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

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

#ifndef Xlsrichpainter5HPP
#define Xlsrichpainter5HPP

#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 <System.Contnrs.hpp>	// Pascal unit
#include <System.Types.hpp>	// Pascal unit
#include <System.Math.hpp>	// Pascal unit
#include <Winapi.Windows.hpp>	// Pascal unit
#include <Vcl.Graphics.hpp>	// Pascal unit
#include <Xc12DataStyleSheet5.hpp>	// Pascal unit
#include <XLSUtils5.hpp>	// Pascal unit
#include <XLSTools5.hpp>	// Pascal unit

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

namespace Xlsrichpainter5
{
//-- type declarations -------------------------------------------------------
struct TXBookRichRow;
typedef TXBookRichRow *PXBookRichRow;

struct DECLSPEC_DRECORD TXBookRichRow
{
public:
	int CR1;
	int CR2;
	int CP1;
	int CP2;
	int Width;
	int Height;
	int LineGap;
	int Ascent;
	int Descent;
};


class DELPHICLASS TXBookRichPainter;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TXBookRichPainter : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	typedef System::DynamicArray<TXBookRichRow> _TXBookRichPainter__1;
	
	
protected:
	Vcl::Graphics::TCanvas* FCanvas;
	Xc12datastylesheet5::TXc12XF* FXF;
	Xc12datastylesheet5::TXc12HorizAlignment FHorizAlign;
	Xc12datastylesheet5::TXc12VertAlignment FVertAlign;
	int FTotHeight;
	int FPaintWidth;
	Xlstools5::TXLSFormattedText* FCharRuns;
	_TXBookRichPainter__1 FRows;
	int FRowCount;
	void __fastcall BeginRow(const int ACR, const int ACP);
	void __fastcall UpdateRow(const int ACR, const int ACP, const int AWidth, const int AHeight, const int ALineGap, const int AAscent, const int ADescent);
	void __fastcall EndRow(void);
	void __fastcall Paginate(void);
	int __fastcall CalcX(const int AX1, const int AX2, PXBookRichRow ARow);
	int __fastcall CalcY(const int AY1, const int AY2);
	System::UnicodeString __fastcall DrawCharRun(Xlstools5::TXLSFormattedTextItem* ACR, const int ACP, const int ACharCount, const int AX, const int AY);
	
public:
	__fastcall TXBookRichPainter(Vcl::Graphics::TCanvas* ACanvas);
	__fastcall virtual ~TXBookRichPainter(void);
	void __fastcall DrawText(const int AX1, const int AY1, const int AX2, const int AY2);
	int __fastcall CalcHeight(const int APaintWidth);
	int __fastcall CalcWidth(void);
	void __fastcall AssignText(System::UnicodeString S, Xc12datastylesheet5::TXc12XF* XF, Xc12datastylesheet5::PXc12FontRunArray FR, int FontRunCount);
	__property Xc12datastylesheet5::TXc12HorizAlignment HorizAlign = {read=FHorizAlign, write=FHorizAlign, nodefault};
	__property Xc12datastylesheet5::TXc12VertAlignment VertAlign = {read=FVertAlign, write=FVertAlign, nodefault};
};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
extern DELPHI_PACKAGE void __fastcall RichTextRect(Vcl::Graphics::TCanvas* ACanvas, const int AX1, const int AY1, const int AX2, const int AY2, Xc12datastylesheet5::PXc12FontRunArray AFontRuns, const int AFRCount, const System::UnicodeString AText)/* overload */;
extern DELPHI_PACKAGE void __fastcall RichTextRect(Vcl::Graphics::TCanvas* ACanvas, const double AX1, const double AY1, const double AX2, const double AY2, Xlstools5::TXLSFormattedText* AText, Xc12datastylesheet5::TXc12HorizAlignment AHorizAlign = (Xc12datastylesheet5::TXc12HorizAlignment)(0x1), Xc12datastylesheet5::TXc12VertAlignment AVertAlign = (Xc12datastylesheet5::TXc12VertAlignment)(0x0))/* overload */;
extern DELPHI_PACKAGE void __fastcall RichTextRect(Vcl::Graphics::TCanvas* ACanvas, const System::Types::TRect &ARect, Xc12datastylesheet5::TXc12XF* AXF, Xc12datastylesheet5::PXc12FontRunArray AFontRuns, const int AFRCount, const System::UnicodeString AText)/* overload */;
extern DELPHI_PACKAGE int __fastcall RichTextWidth(Vcl::Graphics::TCanvas* ACanvas, Xc12datastylesheet5::TXc12XF* AXF, Xc12datastylesheet5::PXc12FontRunArray AFontRuns, const int AFRCount, const System::UnicodeString AText);
}	/* namespace Xlsrichpainter5 */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_XLSRICHPAINTER5)
using namespace Xlsrichpainter5;
#endif
#pragma pack(pop)
#pragma option pop

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