//----------------------------------------------------------------------------
// PtblRV.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
// From: PtblRV.pas
//----------------------------------------------------------------------------
#ifndef PtblRVHPP
#define PtblRVHPP
//----------------------------------------------------------------------------
#include <DLines.hpp>
#include <CommDlg.hpp>
#include <Printers.hpp>
#include <RVStyle.hpp>
#include <RichView.hpp>
#include <RVScroll.hpp>
#include <Dialogs.hpp>
#include <Forms.hpp>
#include <Controls.hpp>
#include <Graphics.hpp>
#include <Classes.hpp>
#include <SysUtils.hpp>
#include <Messages.hpp>
#include <Windows.hpp>
#include <System.hpp>
namespace Ptblrv
{
//-- type declarations -------------------------------------------------------
class __declspec(delphiclass) TRVPrint;
typedef void __fastcall (__closure *TRVPrintComponentEvent)(TRVPrint* Sender, Controls::TControl* PrintMe
	, Graphics::TBitmap* &ComponentImage);

enum TRVPrintingStep { rvpsStarting, rvpsProceeding, rvpsFinished };

typedef void __fastcall (__closure *TRVPrintingEvent)(Richview::TRichView* Sender, int PageCompleted
	, TRVPrintingStep Step);

class __declspec(delphiclass) TRVPageInfo;
class __declspec(pascalimplementation) TRVPageInfo : public Classes::TCollectionItem
{
	typedef Classes::TCollectionItem inherited;
	
public:
	int StartY;
	int StartLineNo;
	virtual void __fastcall Assign(Classes::TPersistent* Source);
public:
	/* TCollectionItem.Create */ __fastcall virtual TRVPageInfo(Classes::TCollection* Collection) : Classes::
		TCollectionItem(Collection) { }
	/* TCollectionItem.Destroy */ __fastcall virtual ~TRVPageInfo(void) { }
	
};

class __declspec(delphiclass) TPrintableRV;
class __declspec(pascalimplementation) TPrintableRV : public Richview::TRichView
{
	typedef Richview::TRichView inherited;
	
private:
	TRVPrintingEvent FOnFormatting;
	TRVPrintingEvent FOnPrinting;
	Classes::TCollection* pagescoll;
	int FLeftMarginMM;
	int FRightMarginMM;
	int FTopMarginMM;
	int FBottomMarginMM;
	int TmpLM;
	int TmpTM;
	int TmpRM;
	int TmpBM;
	int TmpTMPix;
	int TmpBMPix;
	Rvstyle::TScreenAndDevice PrinterSad;
	TRVPrintComponentEvent FOnPrintComponent;
	
protected:
	TRVPrint* FRVPrint;
	
public:
	__fastcall virtual TPrintableRV(Classes::TComponent* AOwner);
	__fastcall virtual ~TPrintableRV(void);
	int __fastcall FormatPages(void);
	void __fastcall DrawPage(int pgNo, Graphics::TCanvas* Canvas, bool Preview, bool Correction);
	void __fastcall PrintPages(int firstPgNo, int lastPgNo, const System::AnsiString Title, int Copies, 
		bool Collate);
	void __fastcall Print(const System::AnsiString Title, int Copies, bool Collate);
	
__published:
	__property TRVPrintingEvent OnFormatting = {read=FOnFormatting, write=FOnFormatting};
	__property TRVPrintingEvent OnSendingToPrinter = {read=FOnPrinting, write=FOnPrinting};
	__property TRVPrintComponentEvent OnPrintComponent = {read=FOnPrintComponent, write=FOnPrintComponent
		};
public:
	/* TWinControl.CreateParented */ __fastcall TPrintableRV(HWND ParentWindow) : Richview::TRichView(ParentWindow
		) { }
	
};

class __declspec(pascalimplementation) TRVPrint : public Classes::TComponent
{
	typedef Classes::TComponent inherited;
	
private:
	bool FPreviewCorrection;
	TRVPrintingEvent FOnFormatting;
	TRVPrintingEvent FOnPrinting;
	TRVPrintComponentEvent FOnPrintComponent;
	int FTopMarginPix;
	int FBottomMarginPix;
	int __fastcall GetLM(void);
	int __fastcall GetRM(void);
	int __fastcall GetTM(void);
	int __fastcall GetBM(void);
	void __fastcall SetLM(int mm);
	void __fastcall SetRM(int mm);
	void __fastcall SetTM(int mm);
	void __fastcall SetBM(int mm);
	int __fastcall GetPagesCount(void);
	int __fastcall GetPreview100PercentHeight(void);
	int __fastcall GetPreview100PercentWidth(void);
	
protected:
	virtual void __fastcall Loaded(void);
	
public:
	TPrintableRV* rv;
	bool Ready;
	__fastcall virtual TRVPrint(Classes::TComponent* AOwner);
	void __fastcall AssignSource(Richview::TRichView* PrintMe);
	void __fastcall Clear(void);
	int __fastcall FormatPages(Richview::TRVDisplayOptions PrintOptions);
	void __fastcall PrintPages(int firstPgNo, int lastPgNo,  System::AnsiString Title, int Copies, bool 
		Collate);
	void __fastcall Print( System::AnsiString Title, int Copies, bool Collate);
	void __fastcall MakePreview(int pgNo, Graphics::TBitmap* bmp);
	void __fastcall DrawPreview(int pgNo, Graphics::TCanvas* Canvas, const Windows::TRect &PageRect);
	void __fastcall MakeScaledPreview(int pgNo, Graphics::TBitmap* bmp);
	void __fastcall DrawMarginsRect(Graphics::TCanvas* Canvas, const Windows::TRect &PageRect);
	void __fastcall UpdatePaletteInfo(void);
	__property int Preview100PercentWidth = {read=GetPreview100PercentWidth, nodefault};
	__property int Preview100PercentHeight = {read=GetPreview100PercentHeight, nodefault};
	__property int PagesCount = {read=GetPagesCount, nodefault};
	
__published:
	__property int LeftMarginMM = {read=GetLM, write=SetLM, nodefault};
	__property int RightMarginMM = {read=GetRM, write=SetRM, nodefault};
	__property int TopMarginMM = {read=GetTM, write=SetTM, nodefault};
	__property int BottomMarginMM = {read=GetBM, write=SetBM, nodefault};
	__property bool PreviewCorrection = {read=FPreviewCorrection, write=FPreviewCorrection, nodefault};
		
	__property TRVPrintingEvent OnFormatting = {read=FOnFormatting, write=FOnFormatting};
	__property TRVPrintingEvent OnSendingToPrinter = {read=FOnPrinting, write=FOnPrinting};
	__property TRVPrintComponentEvent OnPrintComponent = {read=FOnPrintComponent, write=FOnPrintComponent
		};
public:
	/* TComponent.Destroy */ __fastcall virtual ~TRVPrint(void) { }
	
};

//-- var, const, procedure ---------------------------------------------------
extern HDC __fastcall GetPrinterDC(void);
extern void __fastcall Register(void);

}	/* namespace Ptblrv */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Ptblrv;
#endif
//-- end unit ----------------------------------------------------------------
#endif	// PtblRV
