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

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

#ifndef SmadtHPP
#define SmadtHPP

#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 <Classes.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <Smcells.hpp>	// Pascal unit

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

namespace Smadt
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TADTFieldType { aftUnknow, aftLogical, aftNumeric, aftDate, aftString, aftMemo, aftBinary, aftImage, aftVarChar, aftCompactDate, aftDouble, aftInteger, aftShortInt, aftTime, aftTimeStamp, aftAutoInc, aftRAW, aftCurrency, aftMoney, aftLongLong, aftCIString, aftRowVersion, aftModTime };
#pragma option pop

typedef StaticArray<System::UnicodeString, 23> Smadt__1;

#pragma pack(push,1)
struct TADTField
{
	
public:
	StaticArray<char, 128> FieldName;
	System::Word FieldType;
	unsigned StartPos;
	System::Word Length;
	unsigned Decimals;
	StaticArray<System::Byte, 2> Option;
	StaticArray<System::Byte, 58> Reserved;
};
#pragma pack(pop)


typedef StaticArray<TADTField, 4096> TADTFields;

#pragma pack(push,1)
struct TADTHeader
{
	
public:
	StaticArray<char, 16> Manufacture;
	unsigned x1;
	unsigned x2;
	int NumberOfRecords;
	int NumberOfRecordsHi;
	unsigned HeaderSize;
	unsigned RecordSize;
	StaticArray<System::Byte, 8> FirstDeleted;
	StaticArray<System::Byte, 8> MarkedAsDeleted;
	StaticArray<char, 20> Password;
	unsigned EncryptionVer;
	StaticArray<System::Byte, 8> NextAutoInc;
	StaticArray<System::Byte, 4> Options;
	StaticArray<char, 264> DataDicPath;
	System::Word UnsentToClient;
	System::Word NumberOfFields;
	StaticArray<char, 40> Reserved;
	TADTFields Fields;
};
#pragma pack(pop)


#pragma pack(push,1)
struct TADTBLOBHeader
{
	
public:
	unsigned x1;
	unsigned BlockSize;
};
#pragma pack(pop)


class DELPHICLASS TADT;
class PASCALIMPLEMENTATION TADT : public Smcells::TSpreadSheetFile
{
	typedef Smcells::TSpreadSheetFile inherited;
	
private:
	Classes::TStream* BLOBStream;
	System::UnicodeString FPassword;
	Smcells::TSMIOnPasswordEvent FOnPassword;
	
protected:
	Classes::TStream* FCurrentStream;
	int FNextDeletedRecNo;
	int __fastcall GetFirstDeleted(void);
	int __fastcall GetMarkedAsDeleted(void);
	virtual void __fastcall ReadBLOBValue(unsigned StartPos, unsigned ASize, System::UnicodeString &s);
	
public:
	TADTHeader DBHeader;
	TADTBLOBHeader BlobHeader;
	__fastcall virtual TADT(Classes::TComponent* AOwner);
	__fastcall virtual ~TADT(void);
	virtual void __fastcall LoadFromStream(Classes::TStream* AStream);
	virtual void __fastcall LoadFromFile(const System::WideString FileName);
	virtual void __fastcall BeforeLoad(void);
	virtual void __fastcall AfterLoad(void);
	virtual bool __fastcall LoadRecord(int RecNo);
	virtual int __fastcall FindColumn(const System::UnicodeString AFieldName);
	virtual void __fastcall FillColumnList(Classes::TStrings* lst, const System::UnicodeString strFieldList);
	virtual bool __fastcall IsEncrypted(void);
	bool __fastcall IsPasswordValid(void);
	
__published:
	__property System::UnicodeString Password = {read=FPassword, write=FPassword};
	__property Smcells::TSMIOnPasswordEvent OnPassword = {read=FOnPassword, write=FOnPassword};
};


//-- var, const, procedure ---------------------------------------------------
extern PACKAGE Smadt__1 arrADTFieldTypeStr;
extern PACKAGE Smcells::TSMIOnPasswordEvent RegisteredAdvantagePassword;

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

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