// Borland C++ Builder
// Copyright (c) 1995, 1998 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'PtblRV.pas' rev: 3.00

#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 <SysInit.hpp>
#include <System.hpp>

//-- user supplied -----------------------------------------------------------

namespace Ptblrv
{
//-- type declarations -------------------------------------------------------
class 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 DELPHICLASS TRVPageInfo;
class 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 DELPHICLASS TPrintableRV;
class 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 InterLeftMarginPix;
	int InterRightMarginPix;
	Richview::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 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 PASCALIMPLEMENTATION TRVPrint : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	bool FPreviewCorrection;
	TRVPrintingEvent FOnFormatting;
	TRVPrintingEvent FOnPrinting;
	TRVPrintComponentEvent FOnPrintComponent;
	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);
	
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);
	__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 PACKAGE HDC __fastcall GetPrinterDC(void);
extern PACKAGE void __fastcall Register(void);

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