// CodeGear C++Builder
// Copyright (c) 1995, 2014 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'XBookPrint2.pas' rev: 28.00 (Windows)

#ifndef Xbookprint2HPP
#define Xbookprint2HPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.Classes.hpp>	// Pascal unit
#include <System.SysUtils.hpp>	// Pascal unit
#include <Winapi.Windows.hpp>	// Pascal unit
#include <Vcl.Controls.hpp>	// Pascal unit
#include <System.Math.hpp>	// Pascal unit
#include <Vcl.Printers.hpp>	// Pascal unit
#include <Vcl.Graphics.hpp>	// Pascal unit
#include <XBookTypes2.hpp>	// Pascal unit
#include <XBook_System_2.hpp>	// Pascal unit
#include <XLSBook2.hpp>	// Pascal unit
#include <XBookPaintGDI2.hpp>	// Pascal unit
#include <XBookSkin2.hpp>	// Pascal unit
#include <XBookSheet2.hpp>	// Pascal unit
#include <XBookWindows2.hpp>	// Pascal unit
#include <XBookPaintLayers2.hpp>	// Pascal unit
#include <Xc12Utils5.hpp>	// Pascal unit
#include <Xc12DataStyleSheet5.hpp>	// Pascal unit
#include <XLSUtils5.hpp>	// Pascal unit
#include <XLSMMU5.hpp>	// Pascal unit
#include <XLSCellMMU5.hpp>	// Pascal unit
#include <XLSNames5.hpp>	// Pascal unit
#include <XLSCellAreas5.hpp>	// Pascal unit
#include <XLSSheetData5.hpp>	// Pascal unit
#include <XLSReadWriteII5.hpp>	// Pascal unit

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

namespace Xbookprint2
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TXLSBookPrinter;
class PASCALIMPLEMENTATION TXLSBookPrinter : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	void __fastcall SetXSS(Xlsbook2::TXLSSpreadSheet* const Value);
	Xbookpaintgdi2::TAXWGDI* __fastcall GetGDI(void);
	Vcl::Graphics::TMetafile* __fastcall GetMetafile(void);
	
protected:
	Xlsbook2::TXLSSpreadSheet* FXSS;
	HDC FPrinterDC;
	Xbookpaintlayers2::TXPaintLayers* FLayers;
	Xbookskin2::TXLSBookSkin* FSkin;
	double FVertAdj;
	int FStdFontWidth;
	int FDevicePPIX;
	int FDevicePPIY;
	int FPPIY;
	double FPaperWidth;
	double FPaperHeight;
	double FPrintWidth;
	double FPrintHeight;
	double FPrintXMarg;
	double FPrintYMarg;
	Xlscellareas5::TCellAreas* FPages;
	int FMinCol;
	int FMaxCol;
	int FMinRow;
	int FMaxRow;
	void __fastcall CalcStdFontWidth(void);
	bool __fastcall AreaIsEmpty(const int C1, const int R1, const int C2, const int R2);
	void __fastcall GetPrinter(void);
	int __fastcall MapX(const int APixelWidth, const double ACmX);
	int __fastcall MapY(const int APixelHeight, const double ACmY);
	
public:
	__fastcall TXLSBookPrinter(void);
	__fastcall virtual ~TXLSBookPrinter(void);
	bool __fastcall Prepare(void);
	int __fastcall CalcPageCount(void);
	double __fastcall ColWidthCm(const int ACol);
	double __fastcall RowHeightCm(const int ARow);
	double __fastcall HdrColHeightCm(void);
	double __fastcall HdrRowWidthCm(void);
	bool __fastcall GetNextColBreak(double &AWidth, int &ACol);
	bool __fastcall GetNextRowBreak(double &AHeight, int &ARow);
	void __fastcall Paginate(const int APage);
	void __fastcall PaintPreviewPage(Vcl::Graphics::TCanvas* ACanvas, const int AXOffs, const int AYOffs, const int AX, const int AY, const int AWidth, const int AHeight);
	void __fastcall PrintPixelsPerInch(/* out */ int &APPIX, /* out */ int &APPIY);
	__property Xlsbook2::TXLSSpreadSheet* XSS = {read=FXSS, write=SetXSS};
	__property Xbookskin2::TXLSBookSkin* Skin = {read=FSkin};
	__property Xbookpaintgdi2::TAXWGDI* GDI = {read=GetGDI};
	__property Vcl::Graphics::TMetafile* Metafile = {read=GetMetafile};
	__property double VertAdjustment = {read=FVertAdj, write=FVertAdj};
	__property double PaperWidth = {read=FPaperWidth};
	__property double PaperHeight = {read=FPaperHeight};
	__property double PrintWidth = {read=FPrintWidth};
	__property double PrintHeight = {read=FPrintHeight};
	__property double PrintXMarg = {read=FPrintXMarg};
	__property double PrintYMarg = {read=FPrintYMarg};
	__property int MinCol = {read=FMinCol, nodefault};
	__property int MaxCol = {read=FMaxCol, nodefault};
	__property int MinRow = {read=FMinRow, nodefault};
	__property int MaxRow = {read=FMaxRow, nodefault};
	__property Xlscellareas5::TCellAreas* Pages = {read=FPages};
};


class DELPHICLASS TXLSPDFData;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TXLSPDFData : public System::TObject
{
	typedef System::TObject inherited;
	
public:
	TXLSBookPrinter* Printer;
	System::Classes::TStream* Stream;
	int Page1;
	int Page2;
	int XMarg;
	int YMarg;
public:
	/* TObject.Create */ inline __fastcall TXLSPDFData(void) : System::TObject() { }
	/* TObject.Destroy */ inline __fastcall virtual ~TXLSPDFData(void) { }
	
};

#pragma pack(pop)

class DELPHICLASS TXLSBookPrint;
class PASCALIMPLEMENTATION TXLSBookPrint : public System::Classes::TComponent
{
	typedef System::Classes::TComponent inherited;
	
private:
	void __fastcall SetXSS(Xlsbook2::TXLSSpreadSheet* const Value);
	
protected:
	TXLSBookPrinter* FPrinter;
	Xlsbook2::TXLSSpreadSheet* FXSS;
	int FFirstPage;
	int FLastPage;
	System::Classes::TNotifyEvent FPrintPDFEvent;
	
public:
	__fastcall virtual TXLSBookPrint(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TXLSBookPrint(void);
	void __fastcall Print(void);
	void __fastcall ExportToPDF(const System::UnicodeString AFilename)/* overload */;
	bool __fastcall ExportToPDF(System::Classes::TStream* AStream)/* overload */;
	__property int FirstPage = {read=FFirstPage, write=FFirstPage, nodefault};
	__property int LastPage = {read=FLastPage, write=FLastPage, nodefault};
	__property Xlsbook2::TXLSSpreadSheet* XSS = {read=FXSS, write=SetXSS};
	__property System::Classes::TNotifyEvent OnPrintPDF = {read=FPrintPDFEvent, write=FPrintPDFEvent};
};


class DELPHICLASS TXLSBookPrintPreview;
class PASCALIMPLEMENTATION TXLSBookPrintPreview : public Vcl::Controls::TCustomControl
{
	typedef Vcl::Controls::TCustomControl inherited;
	
private:
	void __fastcall SetXSS(Xlsbook2::TXLSSpreadSheet* const Value);
	int __fastcall GetPageCount(void);
	void __fastcall SetVertAdjustment(const double Value);
	double __fastcall GetVertAdjustment(void);
	int __fastcall GetCurrPage(void);
	void __fastcall SetCurrPage(const int Value);
	void __fastcall SetShowMargins(const bool Value);
	
protected:
	TXLSBookPrinter* FPrinter;
	Xlsbook2::TXLSSpreadSheet* FXSS;
	unsigned FColorBackground;
	unsigned FColorPaper;
	int FPaperPixMarg;
	int FPaperPixLeft;
	int FPaperPixTop;
	int FPaperPixWidth;
	int FPaperPixHeight;
	Xbooktypes2::TXYRect FPreviewArea;
	int FCurrPage;
	bool FShowMargins;
	void __fastcall CalcPaperPixSz(void);
	int __fastcall MapX(const double ACmX);
	int __fastcall MapY(const double ACmY);
	void __fastcall PaintMargins(void);
	
public:
	__fastcall virtual TXLSBookPrintPreview(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TXLSBookPrintPreview(void);
	virtual void __fastcall Paint(void);
	bool __fastcall Execute(void);
	__property double VerticalAdjustment = {read=GetVertAdjustment, write=SetVertAdjustment};
	__property int PageCount = {read=GetPageCount, nodefault};
	__property int CurrPage = {read=GetCurrPage, write=SetCurrPage, nodefault};
	__property bool ShowMargins = {read=FShowMargins, write=SetShowMargins, nodefault};
	
__published:
	__property Xlsbook2::TXLSSpreadSheet* XSS = {read=FXSS, write=SetXSS};
	__property Align = {default=0};
	__property DoubleBuffered;
public:
	/* TWinControl.CreateParented */ inline __fastcall TXLSBookPrintPreview(HWND ParentWindow) : Vcl::Controls::TCustomControl(ParentWindow) { }
	
};


//-- var, const, procedure ---------------------------------------------------
}	/* namespace Xbookprint2 */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_XBOOKPRINT2)
using namespace Xbookprint2;
#endif
#pragma pack(pop)
#pragma option pop

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