// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'UXlsRangeRecords.pas' rev: 5.00

#ifndef UXlsRangeRecordsHPP
#define UXlsRangeRecordsHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Math.hpp>	// Pascal unit
#include <UFlxMessages.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <XlsMessages.hpp>	// Pascal unit
#include <UXlsOtherRecords.hpp>	// Pascal unit
#include <UXlsBaseRecordLists.hpp>	// Pascal unit
#include <UXlsBaseRecords.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

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

namespace Uxlsrangerecords
{
//-- type declarations -------------------------------------------------------
#pragma pack(push, 1)
struct TExcelRange
{
	Word R1;
	Word R2;
	Word C1;
	Word C2;
} ;
#pragma pack(pop)

typedef TExcelRange *PExcelRange;

class DELPHICLASS TRangeValuesList;
class PASCALIMPLEMENTATION TRangeValuesList : public Classes::TList 
{
	typedef Classes::TList inherited;
	
private:
	Word FOtherDataLen;
	void __fastcall CopyIntersectRange(const PExcelRange R, const PExcelRange Rx, const int NewFirstRow
		, const int NewLastRow, const int DestRow, const int aCount, Word &MinR1, Word &MaxR2);
	int __fastcall NextInRange(const Uflxmessages::TXlsCellRange &Range, const int k);
	
protected:
	virtual void __fastcall Notify(void * Ptr, Classes::TListNotification Action);
	
public:
	__fastcall TRangeValuesList(const Word aOtherDataLen);
	void __fastcall Load(const Uxlsbaserecords::TBaseRecord* aRecord, const int aPos);
	void __fastcall SaveToStreamC(const Classes::TStream* DataStream);
	__int64 __fastcall TotalSizeC(void);
	int __fastcall FirstRecordSizeC(void);
	void __fastcall SaveToStreamR(const Classes::TStream* DataStream, const int Line);
	void __fastcall SaveRangeToStreamR(const Classes::TStream* DataStream, const int Line, const int aCount
		, const Uflxmessages::TXlsCellRange &Range);
	__int64 __fastcall TotalSizeR(const int aCount);
	int __fastcall RepeatCountR(const int aCount);
	int __fastcall RecordSizeR(const int Line, const int aCount);
	int __fastcall CountRangeRecords(const Uflxmessages::TXlsCellRange &Range);
	void __fastcall CopyFrom(const TRangeValuesList* RVL);
	void __fastcall ArrangeInsertRowsAndCols(const int aRowPos, const int aRowCount, const int aColPos, 
		const int aColCount);
	void __fastcall CopyRowsInclusive(const int FirstRow, const int LastRow, const int DestRow, const int 
		aCount, Word &MinR1, Word &MaxR2, const bool UseCols);
	void __fastcall CopyRowsExclusive(const int FirstRow, const int LastRow, const int DestRow, const int 
		aCount, const bool UseCols);
	void __fastcall DeleteRows(const int aRow, const int aCount, const bool Allow1Cell, const bool UseCols
		);
	void __fastcall PreAddNewRange(int &R1, int &C1, int &R2, int &C2);
	void __fastcall AddNewRange(const int FirstRow, const int FirstCol, const int LastRow, const int LastCol
		);
public:
	#pragma option push -w-inl
	/* TList.Destroy */ inline __fastcall virtual ~TRangeValuesList(void) { }
	#pragma option pop
	
};


class DELPHICLASS TRangeEntry;
class PASCALIMPLEMENTATION TRangeEntry : public System::TObject 
{
	typedef System::TObject inherited;
	
protected:
	TRangeValuesList* RangeValuesList;
	virtual TRangeEntry* __fastcall DoCopyTo(void);
	
public:
	__fastcall virtual TRangeEntry(void);
	__fastcall virtual ~TRangeEntry(void);
	TRangeEntry* __fastcall CopyTo(void);
	virtual void __fastcall LoadFromStream(const Classes::TStream* DataStream, const Uxlsotherrecords::TRangeRecord* 
		First) = 0 ;
	virtual void __fastcall SaveToStream(const Classes::TStream* DataStream) = 0 ;
	virtual void __fastcall SaveRangeToStream(const Classes::TStream* DataStream, const Uflxmessages::TXlsCellRange 
		&CellRange) = 0 ;
	virtual __int64 __fastcall TotalSize(void) = 0 ;
	virtual __int64 __fastcall TotalRangeSize(const Uflxmessages::TXlsCellRange &CellRange) = 0 ;
	virtual void __fastcall ArrangeInsertRowsAndCols(const int aRowPos, const int aRowCount, const int 
		aColPos, const int aColCount, const Xlsmessages::TSheetInfo &SheetInfo);
	virtual void __fastcall InsertAndCopyRowsOrCols(const int FirstRow, const int LastRow, const int DestRow
		, const int aCount, const Xlsmessages::TSheetInfo &SheetInfo, const bool UseCols);
	virtual void __fastcall DeleteRowsOrCols(const Word aRow, const Word aCount, const Xlsmessages::TSheetInfo 
		&SheetInfo, const bool UseCols);
};


class DELPHICLASS TMergedCells;
class PASCALIMPLEMENTATION TMergedCells : public TRangeEntry 
{
	typedef TRangeEntry inherited;
	
public:
	__fastcall virtual TMergedCells(void);
	void __fastcall Clear(void);
	virtual void __fastcall LoadFromStream(const Classes::TStream* DataStream, const Uxlsotherrecords::TRangeRecord* 
		First);
	virtual void __fastcall SaveToStream(const Classes::TStream* DataStream);
	virtual void __fastcall SaveRangeToStream(const Classes::TStream* DataStream, const Uflxmessages::TXlsCellRange 
		&CellRange);
	virtual __int64 __fastcall TotalSize(void);
	virtual __int64 __fastcall TotalRangeSize(const Uflxmessages::TXlsCellRange &CellRange);
	virtual void __fastcall InsertAndCopyRowsOrCols(const int FirstRow, const int LastRow, const int DestRow
		, const int aCount, const Xlsmessages::TSheetInfo &SheetInfo, const bool UseCols);
	virtual void __fastcall DeleteRowsOrCols(const Word aRow, const Word aCount, const Xlsmessages::TSheetInfo 
		&SheetInfo, const bool UseCols);
	bool __fastcall CheckCell(const int aRow, const int aCol, Uflxmessages::TXlsCellRange &CellBounds);
		
	int __fastcall MergedCount(void);
	Uflxmessages::TXlsCellRange __fastcall MergedCell(const int i);
	void __fastcall PreMerge(int &R1, int &C1, int &R2, int &C2);
	void __fastcall MergeCells(const int FirstRow, const int FirstCol, const int LastRow, const int LastCol
		);
	void __fastcall UnMergeCells(const int FirstRow, const int FirstCol, const int LastRow, const int LastCol
		);
public:
	#pragma option push -w-inl
	/* TRangeEntry.Destroy */ inline __fastcall virtual ~TMergedCells(void) { }
	#pragma option pop
	
};


typedef TMetaClass*ClassOfTRangeEntry;

//-- var, const, procedure ---------------------------------------------------

}	/* namespace Uxlsrangerecords */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Uxlsrangerecords;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

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