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

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

#ifndef Xlscellareas5HPP
#define Xlscellareas5HPP

#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.Math.hpp>	// Pascal unit
#include <XLSUtils5.hpp>	// Pascal unit
#include <Xc12Utils5.hpp>	// Pascal unit
#include <Xc12Common5.hpp>	// Pascal unit

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

namespace Xlscellareas5
{
//-- type declarations -------------------------------------------------------
enum DECLSPEC_DENUM TCellEdge : unsigned char { ceLeft, ceTop, ceRight, ceBottom };

typedef System::Set<TCellEdge, TCellEdge::ceLeft, TCellEdge::ceBottom> TCellEdges;

class DELPHICLASS TCellRef;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TCellRef : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	System::UnicodeString __fastcall GetAsString(void);
	void __fastcall SetAsString(const System::UnicodeString Value);
	
protected:
	int FCol;
	int FRow;
	
public:
	void __fastcall Clear(void);
	__property int Col = {read=FCol, write=FCol, nodefault};
	__property int Row = {read=FRow, write=FRow, nodefault};
	__property System::UnicodeString AsString = {read=GetAsString, write=SetAsString};
public:
	/* TObject.Create */ inline __fastcall TCellRef(void) : System::TObject() { }
	/* TObject.Destroy */ inline __fastcall virtual ~TCellRef(void) { }
	
};

#pragma pack(pop)

class DELPHICLASS TCellRefs;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TCellRefs : public System::Contnrs::TObjectList
{
	typedef System::Contnrs::TObjectList inherited;
	
private:
	TCellRef* __fastcall GetItems(const int Index);
	
public:
	HIDESBASE void __fastcall Add(const System::UnicodeString ARef);
	__property TCellRef* Items[const int Index] = {read=GetItems};
public:
	/* TObjectList.Create */ inline __fastcall TCellRefs(void)/* overload */ : System::Contnrs::TObjectList() { }
	/* TObjectList.Create */ inline __fastcall TCellRefs(bool AOwnsObjects)/* overload */ : System::Contnrs::TObjectList(AOwnsObjects) { }
	
public:
	/* TList.Destroy */ inline __fastcall virtual ~TCellRefs(void) { }
	
};

#pragma pack(pop)

class DELPHICLASS TCellArea;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TCellArea : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	Xc12utils5::TXLSCellArea __fastcall GetAsRecArea(void);
	void __fastcall SetAsRecArea(const Xc12utils5::TXLSCellArea &Value);
	System::UnicodeString __fastcall GetAsStringAbs(void);
	
protected:
	int FTag;
	System::TObject* FObject;
	TCellEdges __fastcall GetEdges(const int Col, const int Row);
	System::UnicodeString __fastcall GetAsString(void);
	virtual int __fastcall GetCol1(void) = 0 ;
	virtual int __fastcall GetRow1(void) = 0 ;
	virtual int __fastcall GetCol2(void) = 0 ;
	virtual int __fastcall GetRow2(void) = 0 ;
	virtual void __fastcall SetCol1(const int AValue) = 0 ;
	virtual void __fastcall SetRow1(const int AValue) = 0 ;
	virtual void __fastcall SetCol2(const int AValue) = 0 ;
	virtual void __fastcall SetRow2(const int AValue) = 0 ;
	bool __fastcall FullInside(const int Col, const int Row);
	
public:
	void __fastcall Normalize(void);
	void __fastcall Assign(TCellArea* Source);
	void __fastcall SetSize(const int C, const int R)/* overload */;
	void __fastcall SetSize(const int C1, const int R1, const int C2, const int R2)/* overload */;
	bool __fastcall InArea(const int C1, const int R1, const int C2, const int R2);
	bool __fastcall CornerInArea(const int C1, const int R1, const int C2, const int R2)/* overload */;
	bool __fastcall CornerInArea(TCellArea* AArea)/* overload */;
	int __fastcall CellCount(void);
	int __fastcall Width(void);
	int __fastcall Height(void);
	bool __fastcall IsColumn(void);
	bool __fastcall IsRow(void);
	__property Xc12utils5::TXLSCellArea AsRecArea = {read=GetAsRecArea, write=SetAsRecArea};
	__property TCellEdges Edges[const int Col][const int Row] = {read=GetEdges};
	bool __fastcall CellInArea(const int Col, const int Row);
	bool __fastcall Equal(const int C1, const int R1, const int C2, const int R2);
	__property int Col1 = {read=GetCol1, write=SetCol1, nodefault};
	__property int Row1 = {read=GetRow1, write=SetRow1, nodefault};
	__property int Col2 = {read=GetCol2, write=SetCol2, nodefault};
	__property int Row2 = {read=GetRow2, write=SetRow2, nodefault};
	__property System::UnicodeString AsString = {read=GetAsString};
	__property System::UnicodeString AsStringAbs = {read=GetAsStringAbs};
	__property int Tag = {read=FTag, write=FTag, nodefault};
	__property System::TObject* Obj = {read=FObject, write=FObject};
public:
	/* TObject.Create */ inline __fastcall TCellArea(void) : System::TObject() { }
	/* TObject.Destroy */ inline __fastcall virtual ~TCellArea(void) { }
	
};

#pragma pack(pop)

class DELPHICLASS TCellAreaImpl;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TCellAreaImpl : public TCellArea
{
	typedef TCellArea inherited;
	
protected:
	int FCol1;
	int FRow1;
	int FCol2;
	int FRow2;
	virtual int __fastcall GetCol1(void);
	virtual int __fastcall GetRow1(void);
	virtual int __fastcall GetCol2(void);
	virtual int __fastcall GetRow2(void);
	virtual void __fastcall SetCol1(const int AValue);
	virtual void __fastcall SetRow1(const int AValue);
	virtual void __fastcall SetCol2(const int AValue);
	virtual void __fastcall SetRow2(const int AValue);
public:
	/* TObject.Create */ inline __fastcall TCellAreaImpl(void) : TCellArea() { }
	/* TObject.Destroy */ inline __fastcall virtual ~TCellAreaImpl(void) { }
	
};

#pragma pack(pop)

class DELPHICLASS TBaseCellAreas;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TBaseCellAreas : public System::Contnrs::TObjectList
{
	typedef System::Contnrs::TObjectList inherited;
	
public:
	TCellArea* operator[](const int Index) { return Items[Index]; }
	
private:
	System::UnicodeString __fastcall GetDelimitedText(void);
	void __fastcall SetDelimitedText(const System::UnicodeString Value);
	TCellArea* __fastcall GetItems(const int Index);
	
protected:
	int FTag;
	System::WideChar FDelimiter;
	bool __fastcall IntersectArea(const Xc12utils5::TXLSCellArea &Source1, const Xc12utils5::TXLSCellArea &Source2, Xc12utils5::TXLSCellArea &Dest);
	int __fastcall Split(const int Index, const Xc12utils5::TXLSCellArea &Area, Xc12utils5::TXLSCellArea *SplitAreas, const int SplitAreas_High);
	virtual TCellArea* __fastcall CreateObject(void);
	
public:
	__fastcall TBaseCellAreas(void);
	HIDESBASE void __fastcall Assign(TBaseCellAreas* Areas);
	HIDESBASE TCellArea* __fastcall Add(void)/* overload */;
	HIDESBASE TCellArea* __fastcall Add(const System::UnicodeString ARef)/* overload */;
	HIDESBASE TCellArea* __fastcall Add(const Xc12utils5::PXLSCellArea AArea)/* overload */;
	HIDESBASE TCellArea* __fastcall Add(const int C, const int R)/* overload */;
	HIDESBASE TCellArea* __fastcall Add(const int C1, const int R1, const int C2, const int R2)/* overload */;
	HIDESBASE void __fastcall Add(const int C1, const int R1, const int C2, const int R2, TBaseCellAreas* AAreas)/* overload */;
	int __fastcall CellCount(void);
	Xc12utils5::TXLSCellArea __fastcall TotExtent(void);
	void __fastcall NormalizeAll(void);
	int __fastcall MaxWidth(void);
	int __fastcall MaxHeight(void);
	bool __fastcall AreaInAreas(TCellArea* AArea)/* overload */;
	bool __fastcall AreaInAreas(const int Col1, const int Row1, const int Col2, const int Row2)/* overload */;
	bool __fastcall FillAndClipHitList(const int Col1, const int Row1, const int Col2, const int Row2, TBaseCellAreas* AList, System::TObject* AObject = (System::TObject*)(0x0));
	bool __fastcall FillHitList(const int Col1, const int Row1, const int Col2, const int Row2, TBaseCellAreas* AList);
	int __fastcall FindArea(const int Col1, const int Row1, const int Col2, const int Row2)/* overload */;
	int __fastcall FindArea(const int Col, const int Row)/* overload */;
	int __fastcall CellInAreas(const int Col, const int Row);
	virtual void __fastcall Copy(const int Col1, const int Row1, const int Col2, const int Row2, const int DeltaCol, const int DeltaRow);
	HIDESBASE virtual void __fastcall Delete(const int Col1, const int Row1, const int Col2, const int Row2) = 0 /* overload */;
	virtual TCellArea* __fastcall Include(const int Col1, const int Row1, const int Col2, const int Row2) = 0 ;
	HIDESBASE virtual void __fastcall Move(const int DeltaCol, const int DeltaRow) = 0 /* overload */;
	HIDESBASE virtual void __fastcall Move(const int Col1, const int Row1, const int Col2, const int Row2, const int DeltaCol, const int DeltaRow) = 0 /* overload */;
	__property TCellArea* Items[const int Index] = {read=GetItems/*, default*/};
	__property System::WideChar Delimiter = {read=FDelimiter, nodefault};
	__property System::UnicodeString DelimitedText = {read=GetDelimitedText, write=SetDelimitedText};
	__property int Tag = {read=FTag, write=FTag, nodefault};
public:
	/* TList.Destroy */ inline __fastcall virtual ~TBaseCellAreas(void) { }
	
};

#pragma pack(pop)

class DELPHICLASS TCellAreas;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TCellAreas : public TBaseCellAreas
{
	typedef TBaseCellAreas inherited;
	
protected:
	bool __fastcall CheckAndClip(int &C1, int &R1, int &C2, int &R2);
	bool __fastcall Combine(const int C1, const int R1, const int C2, const int R2);
	
public:
	HIDESBASE TCellArea* __fastcall Last(void);
	virtual void __fastcall Copy(const int Col1, const int Row1, const int Col2, const int Row2, const int DeltaCol, const int DeltaRow);
	virtual void __fastcall Delete(const int Col1, const int Row1, const int Col2, const int Row2)/* overload */;
	virtual TCellArea* __fastcall Include(const int Col1, const int Row1, const int Col2, const int Row2);
	virtual void __fastcall Move(const int DeltaCol, const int DeltaRow)/* overload */;
	virtual void __fastcall Move(const int Col1, const int Row1, const int Col2, const int Row2, const int DeltaCol, const int DeltaRow)/* overload */;
public:
	/* TBaseCellAreas.Create */ inline __fastcall TCellAreas(void) : TBaseCellAreas() { }
	
public:
	/* TList.Destroy */ inline __fastcall virtual ~TCellAreas(void) { }
	
};

#pragma pack(pop)

class DELPHICLASS TSolidCellAreas;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TSolidCellAreas : public TBaseCellAreas
{
	typedef TBaseCellAreas inherited;
	
protected:
	bool FCopyFailed;
	
public:
	virtual void __fastcall Copy(const int Col1, const int Row1, const int Col2, const int Row2, const int DeltaCol, const int DeltaRow);
	virtual void __fastcall Delete(const int Col1, const int Row1, const int Col2, const int Row2)/* overload */;
	virtual TCellArea* __fastcall Include(const int Col1, const int Row1, const int Col2, const int Row2);
	virtual void __fastcall Move(const int DeltaCol, const int DeltaRow)/* overload */;
	virtual void __fastcall Move(const int Col1, const int Row1, const int Col2, const int Row2, const int DeltaCol, const int DeltaRow)/* overload */;
	__property bool CopyFailed = {read=FCopyFailed, nodefault};
public:
	/* TBaseCellAreas.Create */ inline __fastcall TSolidCellAreas(void) : TBaseCellAreas() { }
	
public:
	/* TList.Destroy */ inline __fastcall virtual ~TSolidCellAreas(void) { }
	
};

#pragma pack(pop)

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

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