// CodeGear C++Builder
// Copyright (c) 1995, 2007 by CodeGear
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Ptblrv.pas' rev: 11.00

#ifndef PtblrvHPP
#define PtblrvHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Dialogs.hpp>	// Pascal unit
#include <Rvscroll.hpp>	// Pascal unit
#include <Richview.hpp>	// Pascal unit
#include <Rvitem.hpp>	// Pascal unit
#include <Rvstyle.hpp>	// Pascal unit
#include <Printers.hpp>	// Pascal unit
#include <Commdlg.hpp>	// Pascal unit
#include <Dlines.hpp>	// Pascal unit
#include <Rvfuncs.hpp>	// Pascal unit
#include <Crvdata.hpp>	// Pascal unit
#include <Crvfdata.hpp>	// Pascal unit
#include <Rvrvdata.hpp>	// Pascal unit
#include <Ptrvdata.hpp>	// Pascal unit
#include <Rvnote.hpp>	// Pascal unit
#include <Rvdocparams.hpp>	// Pascal unit
#include <Rvclasses.hpp>	// Pascal unit

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

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

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

class DELPHICLASS TRVPrint;
typedef void __fastcall (__closure *TRVPagePrepaintEvent)(TRVPrint* Sender, int PageNo, Graphics::TCanvas* Canvas, bool Preview, const Types::TRect &PageRect, const Types::TRect &PrintAreaRect);

#pragma option push -b-
enum TRVFixMarginsMode { rvfmmAutoCorrect, rvfmmIgnore };
#pragma option pop

class DELPHICLASS TRVEndnotePage;
class PASCALIMPLEMENTATION TRVEndnotePage : public System::TObject 
{
	typedef System::TObject inherited;
	
public:
	int Index;
	int Page;
public:
	#pragma option push -w-inl
	/* TObject.Create */ inline __fastcall TRVEndnotePage(void) : System::TObject() { }
	#pragma option pop
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TRVEndnotePage(void) { }
	#pragma option pop
	
};


class DELPHICLASS TRVEndnotePageList;
class PASCALIMPLEMENTATION TRVEndnotePageList : public Rvclasses::TRVList 
{
	typedef Rvclasses::TRVList inherited;
	
public:
	TRVEndnotePage* operator[](int Index) { return Items[Index]; }
	
private:
	TRVEndnotePage* __fastcall GetItems(int Index);
	void __fastcall SetItems(int Index, const TRVEndnotePage* Value);
	
public:
	__property TRVEndnotePage* Items[int Index] = {read=GetItems, write=SetItems/*, default*/};
public:
	#pragma option push -w-inl
	/* TRVList.Destroy */ inline __fastcall virtual ~TRVEndnotePageList(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Create */ inline __fastcall TRVEndnotePageList(void) : Rvclasses::TRVList() { }
	#pragma option pop
	
};


class DELPHICLASS TRVEndnoteList;
class PASCALIMPLEMENTATION TRVEndnoteList : public Rvclasses::TRVList 
{
	typedef Rvclasses::TRVList inherited;
	
public:
	Ptrvdata::TRVEndnotePtblRVData* operator[](int Index) { return Items[Index]; }
	
private:
	TCustomRVPrint* FOwner;
	TRVEndnotePageList* Pages;
	Ptrvdata::TRVEndnotePtblRVData* __fastcall GetItems(int Index);
	void __fastcall SetItems(int Index, const Ptrvdata::TRVEndnotePtblRVData* Value);
	
public:
	__fastcall TRVEndnoteList(TCustomRVPrint* AOwner);
	__fastcall virtual ~TRVEndnoteList(void);
	void __fastcall DrawPage(int RealPageNo, int PageNo, Graphics::TCanvas* Canvas, bool Preview, bool Correction);
	__property Ptrvdata::TRVEndnotePtblRVData* Items[int Index] = {read=GetItems, write=SetItems/*, default*/};
};


class DELPHICLASS TRVFootnoteList;
class PASCALIMPLEMENTATION TRVFootnoteList : public Rvclasses::TRVList 
{
	typedef Rvclasses::TRVList inherited;
	
public:
	Ptrvdata::TRVFootnotePtblRVData* operator[](int Index) { return Items[Index]; }
	
private:
	TCustomRVPrint* FOwner;
	Ptrvdata::TRVFootnotePtblRVData* __fastcall GetItems(int Index);
	void __fastcall SetItems(int Index, const Ptrvdata::TRVFootnotePtblRVData* Value);
	
public:
	__fastcall TRVFootnoteList(TCustomRVPrint* AOwner);
	void __fastcall SortByFootnotes(void);
	Ptrvdata::TRVFootnotePtblRVData* __fastcall FindByFootnote(Rvnote::TRVFootnoteItemInfo* Footnote);
	__property Ptrvdata::TRVFootnotePtblRVData* Items[int Index] = {read=GetItems, write=SetItems/*, default*/};
public:
	#pragma option push -w-inl
	/* TRVList.Destroy */ inline __fastcall virtual ~TRVFootnoteList(void) { }
	#pragma option pop
	
};


class DELPHICLASS TRVFootnoteDrawItem;
class PASCALIMPLEMENTATION TRVFootnoteDrawItem : public Dlines::TRVDrawLineInfo 
{
	typedef Dlines::TRVDrawLineInfo inherited;
	
public:
	Ptrvdata::TRVFootnotePtblRVData* DocumentRVData;
public:
	#pragma option push -w-inl
	/* TRVDrawLineInfo.CreateEx */ inline __fastcall TRVFootnoteDrawItem(int ALeft, int ATop, int AWidth, int AHeight, int AItemNo, Byte AFromNewLine) : Dlines::TRVDrawLineInfo(ALeft, ATop, AWidth, AHeight, AItemNo, AFromNewLine) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Create */ inline __fastcall TRVFootnoteDrawItem(void) : Dlines::TRVDrawLineInfo() { }
	#pragma option pop
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TRVFootnoteDrawItem(void) { }
	#pragma option pop
	
};


class DELPHICLASS TCustomPrintableRV;
class PASCALIMPLEMENTATION TCustomPrintableRV : public Richview::TCustomRichView 
{
	typedef Richview::TCustomRichView inherited;
	
private:
	TCustomRVPrint* FRVPrint;
	
protected:
	int FNoteSeparatorHeight;
	int FNoteLineWidth;
	TRVEndnoteList* FEndnotes;
	TRVFootnoteList* FFootnotes;
	virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
	
public:
	__fastcall virtual TCustomPrintableRV(Classes::TComponent* AOwner);
	__fastcall virtual ~TCustomPrintableRV(void);
	Ptrvdata::TRVFootnotePtblRVData* __fastcall GetFootnoteRVData(Rvnote::TRVFootnoteItemInfo* Footnote);
	void __fastcall DrawNoteSeparatorAbove(int PageNo, int Y, Graphics::TCanvas* Canvas, bool FullSize);
	void __fastcall CalcFootnotesCoords(Classes::TList* References, int PageNo);
	void __fastcall FreeNotesLists(void);
	DYNAMIC void __fastcall ApplyLayoutInfo(Crvdata::TRVLayoutInfo* Layout);
	virtual bool __fastcall CanUseCustomPPI(void);
	void __fastcall InitFormatPages(void);
	int __fastcall FormatPages(void);
	void __fastcall FinalizeFormatPages(void);
	void __fastcall DrawPage(int PageNo, Graphics::TCanvas* Canvas, bool Preview, bool Correction);
	__property TCustomRVPrint* RVPrint = {read=FRVPrint, write=FRVPrint};
	__property int NoteSeparatorHeight = {read=FNoteSeparatorHeight, nodefault};
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TCustomPrintableRV(HWND ParentWindow) : Richview::TCustomRichView(ParentWindow) { }
	#pragma option pop
	
};


class DELPHICLASS TPrintableRV;
class PASCALIMPLEMENTATION TPrintableRV : public TCustomPrintableRV 
{
	typedef TCustomPrintableRV inherited;
	
private:
	void __fastcall DoOnPrinting(int PageCompleted, Richview::TRVPrintingStep Step);
	
protected:
	virtual TMetaClass* __fastcall GetDataClass(void);
	
public:
	bool FMirrorMargins;
	int FLeftMarginMM;
	int FRightMarginMM;
	int FTopMarginMM;
	int FBottomMarginMM;
	void __fastcall PrintPages(int firstPgNo, int lastPgNo, const AnsiString Title, int Copies, bool Collate);
	void __fastcall Print(const AnsiString Title, int Copies, bool Collate);
	void __fastcall ContinuousPrint(void);
public:
	#pragma option push -w-inl
	/* TCustomPrintableRV.Create */ inline __fastcall virtual TPrintableRV(Classes::TComponent* AOwner) : TCustomPrintableRV(AOwner) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TCustomPrintableRV.Destroy */ inline __fastcall virtual ~TPrintableRV(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TPrintableRV(HWND ParentWindow) : TCustomPrintableRV(ParentWindow) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TCustomRVPrint : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	bool FPreviewCorrection;
	TRVPrintComponentEvent FOnPrintComponent;
	bool __fastcall GetTransparentBackground(void);
	void __fastcall SetTransparentBackground(const bool Value);
	int __fastcall GetPreview100PercentHeight(void);
	int __fastcall GetPreview100PercentWidth(void);
	Rvstyle::TRVColorMode __fastcall GetColorMode(void);
	void __fastcall SetColorMode(const Rvstyle::TRVColorMode Value);
	bool __fastcall GetIsDestinationReady(void);
	
protected:
	virtual void __fastcall Loaded(void);
	DYNAMIC TCustomPrintableRV* __fastcall CreateRichView(void);
	DYNAMIC Richview::TCustomRichView* __fastcall GetSourceRichView(void);
	int __fastcall GetPagesCount(void);
	int __fastcall FormatEndnotes(void);
	void __fastcall PreformatFootnotes(void);
	void __fastcall PostformatFootnotes(void);
	DYNAMIC bool __fastcall IgnoreEndnotes(void);
	
public:
	TCustomPrintableRV* rv;
	bool Ready;
	int StartAt;
	int EndAt;
	int FormattingID;
	__fastcall virtual TCustomRVPrint(Classes::TComponent* AOwner);
	void __fastcall Clear(void);
	void __fastcall UpdatePaletteInfo(void);
	void __fastcall GetFirstItemOnPage(int PageNo, int &ItemNo, int &OffsetInItem);
	void __fastcall GetFirstItemOnPageEx(int PageNo, int &ItemNo, int &OffsetInItem, int &ExtraData);
	bool __fastcall IsComplexSoftPageBreak(int PageNo);
	void __fastcall AssignComplexSoftPageBreakToItem(int PageNo, Crvfdata::TCustomRVFormattedData* RVData);
	void __fastcall DrawPreview(int pgNo, Graphics::TCanvas* Canvas, const Types::TRect &PageRect);
	void __fastcall DrawMarginsRect(Graphics::TCanvas* Canvas, const Types::TRect &PageRect, int PageNo);
	bool __fastcall SavePageAsRVF(Classes::TStream* Stream, int PageNo);
	void __fastcall GetMinimalMargins(Types::TRect &MarginsRect, bool ScreenResolution);
	__property int PagesCount = {read=GetPagesCount, nodefault};
	__property int Preview100PercentWidth = {read=GetPreview100PercentWidth, nodefault};
	__property int Preview100PercentHeight = {read=GetPreview100PercentHeight, nodefault};
	__property bool IsDestinationReady = {read=GetIsDestinationReady, nodefault};
	
__published:
	__property bool PreviewCorrection = {read=FPreviewCorrection, write=FPreviewCorrection, nodefault};
	__property TRVPrintComponentEvent OnPrintComponent = {read=FOnPrintComponent, write=FOnPrintComponent};
	__property bool TransparentBackground = {read=GetTransparentBackground, write=SetTransparentBackground, default=0};
	__property Rvstyle::TRVColorMode ColorMode = {read=GetColorMode, write=SetColorMode, default=1};
public:
	#pragma option push -w-inl
	/* TComponent.Destroy */ inline __fastcall virtual ~TCustomRVPrint(void) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TRVPrint : public TCustomRVPrint 
{
	typedef TCustomRVPrint inherited;
	
private:
	TRVPrintingEvent FOnFormatting;
	TRVPrintingEvent FOnPrinting;
	TRVPagePrepaintEvent FOnPagePrepaint;
	TRVPagePrepaintEvent FOnPagePostPaint;
	bool FClipMargins;
	Richview::TCustomRichView* FPrintMe;
	TRVFixMarginsMode FFixMarginsMode;
	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);
	bool __fastcall GetMirrorMargins(void);
	void __fastcall SetMirrorMargins(const bool Value);
	int __fastcall GetFooterY(void);
	int __fastcall GetHeaderY(void);
	void __fastcall SetFooterY(const int Value);
	void __fastcall SetHeaderY(const int Value);
	
protected:
	DYNAMIC TCustomPrintableRV* __fastcall CreateRichView(void);
	DYNAMIC Richview::TCustomRichView* __fastcall GetSourceRichView(void);
	
public:
	__fastcall virtual TRVPrint(Classes::TComponent* AOwner);
	__fastcall virtual ~TRVPrint(void);
	void __fastcall AssignSource(Richview::TCustomRichView* PrintMe);
	void __fastcall AssignDocParameters(Rvdocparams::TRVDocParameters* DocParameters);
	void __fastcall SetHeader(Crvfdata::TCustomRVFormattedData* RVData);
	void __fastcall SetFooter(Crvfdata::TCustomRVFormattedData* RVData);
	int __fastcall FormatPages(Rvscroll::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 ContinuousPrint(void);
	void __fastcall MakePreview(int pgNo, Graphics::TBitmap* bmp);
	void __fastcall MakeScaledPreview(int pgNo, Graphics::TBitmap* bmp);
	Types::TRect __fastcall GetHeaderRect();
	Types::TRect __fastcall GetFooterRect();
	HIDESBASE void __fastcall Clear(void);
	
__published:
	__property bool ClipMargins = {read=FClipMargins, write=FClipMargins, default=0};
	__property bool MirrorMargins = {read=GetMirrorMargins, write=SetMirrorMargins, default=0};
	__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 int FooterYMM = {read=GetFooterY, write=SetFooterY, default=10};
	__property int HeaderYMM = {read=GetHeaderY, write=SetHeaderY, default=10};
	__property TRVPrintingEvent OnFormatting = {read=FOnFormatting, write=FOnFormatting};
	__property TRVPrintingEvent OnSendingToPrinter = {read=FOnPrinting, write=FOnPrinting};
	__property TRVPagePrepaintEvent OnPagePrepaint = {read=FOnPagePrepaint, write=FOnPagePrepaint};
	__property TRVPagePrepaintEvent OnPagePostpaint = {read=FOnPagePostPaint, write=FOnPagePostPaint};
	__property TRVFixMarginsMode FixMarginsMode = {read=FFixMarginsMode, write=FFixMarginsMode, default=0};
};


//-- var, const, procedure ---------------------------------------------------
extern PACKAGE HDC __fastcall RV_GetPrinterDC(void);

}	/* namespace Ptblrv */
using namespace Ptblrv;
#pragma pack(pop)
#pragma option pop

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