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

// (DO NOT EDIT: machine generated header) 'SMADT.pas' rev: 23.00 (Win32)

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

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

namespace Smadt
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TADTFieldType : unsigned char { 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 System::StaticArray<System::UnicodeString, 23> Smadt__1;

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


typedef System::StaticArray<TADTField, 4096> TADTFields;

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


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


class DELPHICLASS TADT;
class PASCALIMPLEMENTATION TADT : public Smcells::TSpreadSheetFile
{
	typedef Smcells::TSpreadSheetFile inherited;
	
private:
	System::Classes::TStream* BLOBStream;
	System::UnicodeString FPassword;
	Smcells::TSMIOnPasswordEvent FOnPassword;
	
protected:
	System::Classes::TStream* FCurrentStream;
	int FNextDeletedRecNo;
	int __fastcall GetFirstDeleted(void);
	int __fastcall GetMarkedAsDeleted(void);
	int __fastcall GetNextAutoInc(void);
	virtual void __fastcall ReadBLOBValue(unsigned StartPos, unsigned ASize, System::UnicodeString &s);
	
public:
	TADTHeader DBHeader;
	TADTBLOBHeader BlobHeader;
	TADTFields Fields;
	__fastcall virtual TADT(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TADT(void);
	virtual void __fastcall LoadFromStream(System::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(System::Classes::TStrings* lst, const System::UnicodeString strFieldList);
	virtual bool __fastcall IsEncrypted(void);
	bool __fastcall IsPasswordValid(void);
	System::UnicodeString __fastcall GetStrFieldType(System::Word AType);
	__property int FirstDeleted = {read=GetFirstDeleted, nodefault};
	__property int MarkedAsDeleted = {read=GetMarkedAsDeleted, nodefault};
	__property int NextAutoInc = {read=GetNextAutoInc, nodefault};
	
__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 */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_SMADT)
using namespace Smadt;
#endif
#pragma pack(pop)
#pragma option pop

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