#if !defined(__alffprev_h) // Sentry, use file only if it's not already included.
#define __alffprev_h
/*  Project Tec3270

	 SUBSYSTEM:    Tec3270.exe (Tec3270 application)
	 FILE:         alffprev.h
	 AUTHOR:       Alcindo Ferreira Filho

	 OVERVIEW:

    ALFFLayoutWindow and ALFFPreviewWindow Classes Definition,
    the Tec3270 printing preview function specific classes.

    COPYRIGHT:    © 1998-2007
                  Alcindo Ferreira Filho
                  <alcindo@inttec.com.br>

    LICENSE:      Tec3270_License (docs/Tec3270_License.txt)
*/

#include <owl\owlpch.h>
#include "alffprtn.h"
#include "alff3270.h"
#include "alffntsc.h"
#include "tec3270.rh"

//{{TLayoutWindow = ALFFLayoutWindow}}
class ALFFLayoutWindow : public TLayoutWindow
{
 public:
	 ALFFLayoutWindow (TWindow* parent, const char far *title = 0,
							 TModule* module = 0);
	 ~ALFFLayoutWindow();
    char far* GetClassName() {return "ALFFLayoutWindow";}
    void SetPreviewWindow(TWindow* prevW);
	 void ShowScrollBar(int bar, bool show = true);

 protected:
	 bool     hBar;
	 bool     vBar;
	 TWindow* previewWindow;
	 void     EvKeyDown(UINT key,UINT,UINT);
 DECLARE_RESPONSE_TABLE(ALFFLayoutWindow);
};

//{{TDecoratedFrame = ALFFPreviewWindow}}
class ALFFPreviewWindow : public TDecoratedFrame
{
 public:
	 ALFFPreviewWindow (TWindow *parentWindow,
								  ALFFPrinter *printer,
								  TWindow* currWindow,
								  ALFFPrtData* prtDta,
								  const char far* title,
								  ALFFLayoutWindow* client);
	 ~ALFFPreviewWindow ();
    char far* GetClassName() {return "ALFFPreviewWindow";}
	 void PPR_Previous ();
	 void PPR_Next ();
	 TWindow*        CurrWindow;
	 TWindow*        ZoomWindow;
	 TControlBar*    PreviewSpeedBar;
	 TPreviewPage*   Page1;
	 TPreviewPage*   Page2;
	 ALFFPrinter*    Printer;
	 TPrintDC*       PrnDC;
	 TSize*          PrintExtent;
	 ALFFPrintOut*   Printout;
	 ALFFPrtData*    prtData;
    ALFFMsgs*       pMsgs;
	 int             PageNumber;
 private:
	 ALFFLayoutWindow* Client;
	 bool zoom;
	 void SpeedBarState ();
	 void PPR_PreviousEnable (TCommandEnabler &tce);
	 void PPR_NextEnable (TCommandEnabler &tce);
	 void PPR_OneUp ();
	 void PPR_OneUpEnable (TCommandEnabler &tce);
	 void PPR_TwoUpEnable (TCommandEnabler &tce);
	 void PPR_TwoUp ();
	 void PPR_Done ();
	 void PPR_Zoom ();
	 void CmPrintEnable (TCommandEnabler &tce);
	 void CmPrint ();

//{{ALFFPreviewWindowVIRTUAL_BEGIN}}
 protected:
	 virtual void SetupWindow ();
//{{ALFFPreviewWindowVIRTUAL_END}}

//{{ALFFPreviewWindowRSP_TBL_BEGIN}}
 protected:
//{{ALFFPreviewWindowRSP_TBL_END}}
 DECLARE_RESPONSE_TABLE(ALFFPreviewWindow);
};    //{{ALFFPreviewWindow}}

#endif      // __apxprev_h sentry.
