// 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 <RVClasses.hpp>	// Pascal unit
#include <RVDocParams.hpp>	// Pascal unit
#include <RVNote.hpp>	// Pascal unit
#include <PtRVData.hpp>	// Pascal unit
#include <RVRVData.hpp>	// Pascal unit
#include <CRVFData.hpp>	// Pascal unit
#include <CRVData.hpp>	// Pascal unit
#include <RVFuncs.hpp>	// Pascal unit
#include <DLines.hpp>	// Pascal unit
#include <CommDlg.hpp>	// Pascal unit
#include <Printers.hpp>	// Pascal unit
#include <RVStyle.hpp>	// Pascal unit
#include <RVItem.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 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 Windows::TRect &PageRect, const Windows::TRect &PrintAreaRect);

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

class DELPHICLASS TRVEndnotePage;
#pragma pack(push, 4)
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
	
};

#pragma pack(pop)

class DELPHICLASS TRVEndnotePageList;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TRVEndnotePageList : public Rvclasses::TRVList 
{
	typedef Rvclasses::TRVList inherited;
	
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
	
};

#pragma pack(pop)

class DELPHICLASS TRVEndnoteList;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TRVEndnoteList : public Rvclasses::TRVList 
{
	typedef Rvclasses::TRVList inherited;
	
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
		*/};
};

#pragma pack(pop)

class DELPHICLASS TRVFootnoteList;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TRVFootnoteList : public Rvclasses::TRVList 
{
	typedef Rvclasses::TRVList inherited;
	
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
	
};

#pragma pack(pop)

class DELPHICLASS TRVFootnoteDrawItem;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TRVFootnoteDrawItem : public Dlines::TRVComplexLineHeightDrawLineInfo 
{
	typedef Dlines::TRVComplexLineHeightDrawLineInfo 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::TRVComplexLineHeightDrawLineInfo(ALeft, ATop
		, AWidth, AHeight, AItemNo, AFromNewLine) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Create */ inline __fastcall TRVFootnoteDrawItem(void) : Dlines::TRVComplexLineHeightDrawLineInfo(
		) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TRVFootnoteDrawItem(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

class DELPHICLASS TCustomPrintableRV;
#pragma pack(push, 4)
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
	
};

#pragma pack(pop)

class DELPHICLASS TPrintableRV;
#pragma pack(push, 4)
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
	
};

#pragma pack(pop)

#pragma pack(push, 4)
class PASCALIMPLEMENTATION TCustomRVPrint : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	bool FPreviewCorrection;
	TRVPrintComponentEvent FOnPrintComponent;
	int FMinPrintedItemNo;
	int FMaxPrintedItemNo;
	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);
	int __fastcall GetFirstPageNo(void);
	int __fastcall GetLastPageNo(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);
	int __fastcall GetPageNo(Crvdata::TCustomRVData* RVData, int ItemNo, int OffsetInItem);
	bool __fastcall IsComplexSoftPageBreak(int PageNo);
	void __fastcall AssignComplexSoftPageBreakToItem(int PageNo, Crvfdata::TCustomRVFormattedData* RVData
		);
	void __fastcall DrawPreview(int pgNo, Graphics::TCanvas* Canvas, const Windows::TRect &PageRect);
	void __fastcall DrawMarginsRect(Graphics::TCanvas* Canvas, const Windows::TRect &PageRect, int PageNo
		);
	bool __fastcall SavePageAsRVF(Classes::TStream* Stream, int PageNo);
	void __fastcall GetMinimalMargins(Windows::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};
	__property int FirstPageNo = {read=GetFirstPageNo, nodefault};
	__property int LastPageNo = {read=GetLastPageNo, 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};
	__property int MinPrintedItemNo = {read=FMinPrintedItemNo, write=FMinPrintedItemNo, default=0};
	__property int MaxPrintedItemNo = {read=FMaxPrintedItemNo, write=FMaxPrintedItemNo, default=-1};
public:
		
	#pragma option push -w-inl
	/* TComponent.Destroy */ inline __fastcall virtual ~TCustomRVPrint(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

#pragma pack(push, 4)
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);
	Windows::TRect __fastcall GetHeaderRect(void);
	Windows::TRect __fastcall GetFooterRect(void);
	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
		};
};

#pragma pack(pop)

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

}	/* namespace Ptblrv */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Ptblrv;
#endif
#pragma option pop	// -w-

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