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

// (DO NOT EDIT: machine generated header) 'Srvprint.pas' rev: 11.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 };
#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 FMirror;
	bool FUsePhysicalOffsets;
	bool FIntegerCount;
	Classes::TNotifyEvent FSRVUpdateData;
	Classes::TNotifyEvent FRVEChange;
	TSRVPrintingEvent FOnSendingToPrinter;
	Printers::TPrinterOrientation FOrientation;
	int FFrameWidthPix;
	int FFrameHeightPix;
	Extended FFrameCountX;
	Extended FFrameCountY;
	Extended FPageWidthPix;
	Extended FPageHeightPix;
	int FPageW;
	int FPageH;
	Extended FOffXPix;
	Extended FOffYPix;
	Extended FTotalFrameWPix;
	Extended FTotalFrameHPix;
	Extended FRealWidth;
	Extended FRealHeight;
	TSRVPrintMode FPrintMode;
	
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 SetMirror(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 Extended Value);
	void __fastcall SetFrameCountY(const Extended Value);
	void __fastcall SetPageWidthPix(const Extended Value);
	void __fastcall SetPageHeightPix(const Extended 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 __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 AutoCalculateByPageFormat(Sclrview::TSRVPageFormat PageFormat);
	void __fastcall AutoCalculateFrameCount(Extended PageWidthPix, Extended PageHeightPix);
	void __fastcall AutoCalculatePage(Extended FrameCountX, Extended FrameCountY);
	void __fastcall RoundFrameCount(void);
	void __fastcall RoundPageSize(void);
	void __fastcall calculateRealSize(void);
	void __fastcall calculateData(Extended PageWidthPix, Extended PageHeightPix, int FrameWidthPix, int FrameHeightPix, Extended FrameCountX, 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(AnsiString Title, int PageNo);
	void __fastcall Print(AnsiString Title, int Copies, bool Collate);
	void __fastcall PrintPages(int firstPgNo, int lastPgNo, AnsiString 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 Extended OffXPix = {read=FOffXPix};
	__property Extended OffYPix = {read=FOffYPix};
	__property Extended TotalFrameWPix = {read=FTotalFrameWPix};
	__property Extended TotalFrameHPix = {read=FTotalFrameHPix};
	__property Extended RealWidth = {read=FRealWidth};
	__property 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 bool ClipMargins = {read=FClipMargins, write=SetClipMargins, default=1};
	__property bool Mirror = {read=FMirror, write=SetMirror, 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 Extended FrameCountX = {read=FFrameCountX, write=SetFrameCountX};
	__property Extended FrameCountY = {read=FFrameCountY, write=SetFrameCountY};
	__property bool IntegerCount = {read=FIntegerCount, write=SetIntegerCount, default=0};
	__property Extended PageWidthPix = {read=FPageWidthPix, write=SetPageWidthPix};
	__property 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)
extern PACKAGE void __fastcall Register(void);

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

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