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

// (DO NOT EDIT: machine generated header) 'Srvprint.pas' rev: 21.00

#ifndef SrvprintHPP
#define SrvprintHPP

#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 <Sysutils.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Extctrls.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Printers.hpp>	// Pascal unit
#include <Srvprtinfo.hpp>	// Pascal unit
#include <Sclrview.hpp>	// Pascal unit
#include <Rvstyle.hpp>	// Pascal unit
#include <Richview.hpp>	// Pascal unit

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

namespace Srvprint
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TSRVPrintingEvent)(Sclrview::TSRichViewEdit* Sender, int PageCompleted, int FrameCompleted, Richview::TRVPrintingStep Step);

#pragma option push -b-
enum TSRVPrintMode { srvpAuto, srvpStretchToFit, srvpStretchIfLarger, srvpTiles, srvpPoster, srvpGrid };
#pragma option pop

class DELPHICLASS TSRVPrint;
class PASCALIMPLEMENTATION TSRVPrint : public Classes::TComponent
{
	typedef Classes::TComponent inherited;
	
private:
	bool FAutoUpdate;
	Sclrview::TSRVPageFormat FPageFormat;
	bool FScaleImage;
	bool FCenter;
	Sclrview::TSRichViewEdit* FSRichViewEdit;
	Classes::TNotifyEvent FRVEPageCountChanged;
	bool FClipMargins;
	bool FMirrorMargins;
	bool FUsePhysicalOffsets;
	bool FIntegerCount;
	Classes::TNotifyEvent FSRVUpdateData;
	Classes::TNotifyEvent FRVEChange;
	TSRVPrintingEvent FOnSendingToPrinter;
	Printers::TPrinterOrientation FOrientation;
	int FFrameWidthPix;
	int FFrameHeightPix;
	System::Extended FFrameCountX;
	System::Extended FFrameCountY;
	System::Extended FPageWidthPix;
	System::Extended FPageHeightPix;
	int FPageW;
	int FPageH;
	System::Extended FOffXPix;
	System::Extended FOffYPix;
	System::Extended FTotalFrameWPix;
	System::Extended FTotalFrameHPix;
	System::Extended FRealWidth;
	System::Extended FRealHeight;
	TSRVPrintMode FPrintMode;
	int FPageColCount;
	int FPageRowCount;
	
protected:
	int countLock;
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
	void __fastcall RestoreEvent(Sclrview::TSRichViewEdit* Value);
	void __fastcall SetPageFormat(Sclrview::TSRVPageFormat Value);
	void __fastcall SetAutoUpdate(bool Value);
	void __fastcall SetSRichViewEdit(Sclrview::TSRichViewEdit* Value);
	void __fastcall SetScaleImage(const bool Value);
	void __fastcall SetCenter(const bool Value);
	void __fastcall SetClipMargins(const bool Value);
	void __fastcall SetMirrorMargins(const bool Value);
	void __fastcall SetUsePhysicalOffsets(const bool Value);
	void __fastcall SetIntegerCount(const bool Value);
	void __fastcall SetOrientation(const Printers::TPrinterOrientation Value);
	void __fastcall SetPrintMode(const TSRVPrintMode Value);
	void __fastcall SetFrameCountX(const System::Extended Value);
	void __fastcall SetFrameCountY(const System::Extended Value);
	void __fastcall SetPageWidthPix(const System::Extended Value);
	void __fastcall SetPageHeightPix(const System::Extended Value);
	void __fastcall SetPageColCount(const int Value);
	void __fastcall SetPageRowCount(const int Value);
	void __fastcall RVEPageCountChanged(System::TObject* Sender);
	void __fastcall RVEChange(System::TObject* Sender);
	virtual void __fastcall Loaded(void);
	void __fastcall calculatePictureSize(void);
	Types::TPoint __fastcall getPaperSizePortrait(void);
	void __fastcall PM_Auto(void);
	void __fastcall PM_StretchToFit(void);
	void __fastcall PM_StretchIfLarger(void);
	void __fastcall PM_Tiles(void);
	void __fastcall PM_Poster(void);
	void __fastcall PM_Grid(void);
	void __fastcall AutoCalculateByPageFormat(Sclrview::TSRVPageFormat PageFormat);
	void __fastcall AutoCalculateFrameCount(System::Extended PageWidthPix, System::Extended PageHeightPix);
	void __fastcall AutoCalculatePage(System::Extended FrameCountX, System::Extended FrameCountY);
	void __fastcall RoundFrameCount(void);
	void __fastcall RoundPageSize(void);
	void __fastcall calculateRealSize(void);
	void __fastcall calculateData(System::Extended PageWidthPix, System::Extended PageHeightPix, int FrameWidthPix, int FrameHeightPix, System::Extended FrameCountX, System::Extended FrameCountY);
	bool __fastcall DrawFrame(int PageNo, int IndexFrame, Graphics::TCanvas* Canvas);
	void __fastcall UpdatePage(void);
	
public:
	Srvprtinfo::TSRVPrtInfo* SRVPrtInfo;
	__fastcall virtual TSRVPrint(Classes::TComponent* AOwner);
	__fastcall virtual ~TSRVPrint(void);
	void __fastcall calculateSize(void);
	void __fastcall Update(void);
	Sclrview::TSRVPageFormat __fastcall PaperCodeToPageFormat(int PaperSizeCode);
	void __fastcall BeginUpdate(void);
	void __fastcall EndUpdate(void);
	bool __fastcall PrintFrame(int PageNo, int FrameIndex);
	void __fastcall PrintFramesEx(int PageNo);
	void __fastcall PrintFrames(System::UnicodeString Title, int PageNo);
	void __fastcall Print(System::UnicodeString Title, int Copies, bool Collate);
	void __fastcall PrintPages(int firstPgNo, int lastPgNo, System::UnicodeString Title, int Copies, bool Collate);
	bool __fastcall CheckMargin(int &NewLeft, int &NewTop, int &NewRight, int &NewBottom, int ALeft, int ATop, int ARight, int ABottom);
	Printers::TPrinterOrientation __fastcall OptimalOrientation(void);
	__property System::Extended OffXPix = {read=FOffXPix};
	__property System::Extended OffYPix = {read=FOffYPix};
	__property System::Extended TotalFrameWPix = {read=FTotalFrameWPix};
	__property System::Extended TotalFrameHPix = {read=FTotalFrameHPix};
	__property System::Extended RealWidth = {read=FRealWidth};
	__property System::Extended RealHeight = {read=FRealHeight};
	
__published:
	__property bool AutoUpdate = {read=FAutoUpdate, write=SetAutoUpdate, default=0};
	__property Sclrview::TSRichViewEdit* SRichViewEdit = {read=FSRichViewEdit, write=SetSRichViewEdit};
	__property bool ScaleImage = {read=FScaleImage, write=SetScaleImage, default=0};
	__property bool Center = {read=FCenter, write=SetCenter, default=1};
	__property Printers::TPrinterOrientation Orientation = {read=FOrientation, write=SetOrientation, default=0};
	__property TSRVPrintMode PrintMode = {read=FPrintMode, write=SetPrintMode, default=4};
	__property int PageColCount = {read=FPageColCount, write=SetPageColCount, default=1};
	__property int PageRowCount = {read=FPageRowCount, write=SetPageRowCount, default=1};
	__property bool ClipMargins = {read=FClipMargins, write=SetClipMargins, default=1};
	__property bool MirrorMargins = {read=FMirrorMargins, write=SetMirrorMargins, default=0};
	__property bool UsePhysicalOffsets = {read=FUsePhysicalOffsets, write=SetUsePhysicalOffsets, default=1};
	__property int FrameWidthPix = {read=FFrameWidthPix, default=1};
	__property int FrameHeightPix = {read=FFrameHeightPix, default=1};
	__property System::Extended FrameCountX = {read=FFrameCountX, write=SetFrameCountX};
	__property System::Extended FrameCountY = {read=FFrameCountY, write=SetFrameCountY};
	__property bool IntegerCount = {read=FIntegerCount, write=SetIntegerCount, default=0};
	__property System::Extended PageWidthPix = {read=FPageWidthPix, write=SetPageWidthPix};
	__property System::Extended PageHeightPix = {read=FPageHeightPix, write=SetPageHeightPix};
	__property Sclrview::TSRVPageFormat PageFormat = {read=FPageFormat, write=SetPageFormat, default=7};
	__property Classes::TNotifyEvent OnUpdateData = {read=FSRVUpdateData, write=FSRVUpdateData};
	__property TSRVPrintingEvent OnSendingToPrinter = {read=FOnSendingToPrinter, write=FOnSendingToPrinter};
};


//-- var, const, procedure ---------------------------------------------------
#define Eps  (1.000000E-03)

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

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