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

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

#ifndef PtblRVHPP
#define PtblRVHPP

#pragma delphiheader begin
#pragma option push -w-
#include <DLines.hpp>	// Pascal unit
#include <CommDlg.hpp>	// Pascal unit
#include <Printers.hpp>	// Pascal unit
#include <RVStyle.hpp>	// Pascal unit
#include <RichView.hpp>	// Pascal unit
#include <RVScroll.hpp>	// Pascal unit
#include <Dialogs.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

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

namespace Ptblrv
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TRVPrint;
typedef void __fastcall (__closure *TRVPrintComponentEvent)(TRVPrint* Sender, Controls::TControl* PrintMe
	, Graphics::TBitmap* &ComponentImage);

#pragma option push -b-
enum TRVPrintingStep { rvpsStarting, rvpsProceeding, rvpsFinished };
#pragma option pop

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

class DELPHICLASS TRVPageInfo;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TRVPageInfo : public Classes::TCollectionItem 
{
	typedef Classes::TCollectionItem inherited;
	
public:
	int StartY;
	int StartLineNo;
	virtual void __fastcall Assign(Classes::TPersistent* Source);
public:
	#pragma option push -w-inl
	/* TCollectionItem.Create */ inline __fastcall virtual TRVPageInfo(Classes::TCollection* Collection
		) : Classes::TCollectionItem(Collection) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TCollectionItem.Destroy */ inline __fastcall virtual ~TRVPageInfo(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

class DELPHICLASS TPrintableRV;
#pragma pack(push, 4)
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 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 AnsiString Title, int Copies, bool Collate
		);
	void __fastcall Print(const 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:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TPrintableRV(HWND ParentWindow) : Richview::TRichView(
		ParentWindow) { }
	#pragma option pop
	
};

#pragma pack(pop)

#pragma pack(push, 4)
class 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, AnsiString Title, int Copies, bool Collate)
		;
	void __fastcall Print(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:
	#pragma option push -w-inl
	/* TComponent.Destroy */ inline __fastcall virtual ~TRVPrint(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

//-- 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
#pragma option pop	// -w-

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// PtblRV
