// Borland C++ Builder
// Copyright (c) 1995, 2005 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Fibdataset.pas' rev: 10.00

#ifndef FibdatasetHPP
#define FibdatasetHPP

#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 <Sysutils.hpp>	// Pascal unit
#include <Ibase.hpp>	// Pascal unit
#include <Ib_intf.hpp>	// Pascal unit
#include <Ib_externals.hpp>	// Pascal unit
#include <Fib.hpp>	// Pascal unit
#include <Pfibprops.hpp>	// Pascal unit
#include <Pfibfieldsdescr.hpp>	// Pascal unit
#include <Db.hpp>	// Pascal unit
#include <Fibcachemanage.hpp>	// Pascal unit
#include <Dbcommon.hpp>	// Pascal unit
#include <Dbconsts.hpp>	// Pascal unit
#include <Dbparsers.hpp>	// Pascal unit
#include <Fibdatabase.hpp>	// Pascal unit
#include <Fibquery.hpp>	// Pascal unit
#include <Fibmiscellaneous.hpp>	// Pascal unit
#include <Sqltxtrtns.hpp>	// Pascal unit
#include <Pfiblists.hpp>	// Pascal unit
#include <Fibclonecomponents.hpp>	// Pascal unit
#include <Pfibinterfaces.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Stdfuncs.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Fmtbcd.hpp>	// Pascal unit
#include <Variants.hpp>	// Pascal unit

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

namespace Fibdataset
{
//-- type declarations -------------------------------------------------------
typedef Fibmiscellaneous::TFIBBlobStream* TBlobDataArray[1];

typedef TBlobDataArray *PBlobDataArray;

struct TFieldData
{
	
public:
	bool fdIsNull;
} ;

typedef TFieldData *PFieldData;

#pragma option push -b-
enum TCachedUpdateStatus { cusUnmodified, cusModified, cusInserted, cusDeleted, cusUninserted, cusDeletedApplied };
#pragma option pop

#pragma pack(push,1)
struct TRecordData
{
	
public:
	int rdRecordNumber;
	Db::TBookmarkFlag rdBookmarkFlag;
	Byte rdFlags;
	TFieldData rdFields[1];
} ;
#pragma pack(pop)

typedef TRecordData *PRecordData;

#pragma pack(push,1)
struct TSavedRecordData
{
	
public:
	Byte rdFlags;
	TFieldData rdFields[1];
} ;
#pragma pack(pop)

typedef TSavedRecordData *PSavedRecordData;

class DELPHICLASS TFIBStringField;
class PASCALIMPLEMENTATION TFIBStringField : public Db::TStringField 
{
	typedef Db::TStringField inherited;
	
private:
	bool vInSetAsString;
	bool FEmptyStrToNull;
	bool FDefaultValueEmptyString;
	int FValueLength;
	int FSqlSubType;
	char *FReservedBuffer;
	AnsiString __fastcall GetAsDB_KEY();
	
protected:
	#pragma option push -w-inl
	/* virtual class method */ virtual void __fastcall CheckTypeSize(int Value) { CheckTypeSize(__classid(TFIBStringField), Value); }
	#pragma option pop
	/*         class method */ static void __fastcall CheckTypeSize(TMetaClass* vmt, int Value);
	virtual void __fastcall SetDataSet(Db::TDataSet* ADataSet);
	HIDESBASE bool __fastcall GetValue(AnsiString &Value);
	virtual AnsiString __fastcall GetAsString();
	virtual Variant __fastcall GetAsVariant();
	virtual void __fastcall SetAsString(const AnsiString Value);
	virtual void __fastcall SetSize(int Value);
	
public:
	__fastcall virtual TFIBStringField(Classes::TComponent* AOwner);
	__fastcall virtual ~TFIBStringField(void);
	bool __fastcall IsDBKey(void);
	int __fastcall SqlSubType(void);
	AnsiString __fastcall CharacterSet();
	virtual void __fastcall Clear(void);
	__property bool DefaultValueEmptyString = {read=FDefaultValueEmptyString, write=FDefaultValueEmptyString, nodefault};
	
__published:
	__property bool EmptyStrToNull = {read=FEmptyStrToNull, write=FEmptyStrToNull, nodefault};
};


class DELPHICLASS TFIBWideStringField;
class PASCALIMPLEMENTATION TFIBWideStringField : public Db::TWideStringField 
{
	typedef Db::TWideStringField inherited;
	
protected:
	virtual int __fastcall GetDataSize(void);
	
public:
	virtual void __fastcall Clear(void);
	AnsiString __fastcall CharacterSet();
	Byte __fastcall CollateNumber(void);
public:
	#pragma option push -w-inl
	/* TWideStringField.Create */ inline __fastcall virtual TFIBWideStringField(Classes::TComponent* AOwner) : Db::TWideStringField(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBWideStringField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBLargeIntField;
class PASCALIMPLEMENTATION TFIBLargeIntField : public Db::TLargeintField 
{
	typedef Db::TLargeintField inherited;
	
private:
	__int64 __fastcall GetOldAsInt64(void);
	
protected:
	virtual void __fastcall SetVarValue(const Variant &Value);
	
public:
	__property __int64 OldValue = {read=GetOldAsInt64};
public:
	#pragma option push -w-inl
	/* TLargeintField.Create */ inline __fastcall virtual TFIBLargeIntField(Classes::TComponent* AOwner) : Db::TLargeintField(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBLargeIntField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBIntegerField;
class PASCALIMPLEMENTATION TFIBIntegerField : public Db::TIntegerField 
{
	typedef Db::TIntegerField inherited;
	
protected:
	virtual bool __fastcall GetAsBoolean(void);
	virtual void __fastcall SetAsBoolean(bool Value);
	
public:
	virtual void __fastcall Clear(void);
	__fastcall virtual TFIBIntegerField(Classes::TComponent* AOwner);
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBIntegerField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBDateField;
class PASCALIMPLEMENTATION TFIBDateField : public Db::TDateField 
{
	typedef Db::TDateField inherited;
	
public:
	#pragma option push -w-inl
	/* TDateField.Create */ inline __fastcall virtual TFIBDateField(Classes::TComponent* AOwner) : Db::TDateField(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBDateField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBTimeField;
class PASCALIMPLEMENTATION TFIBTimeField : public Db::TTimeField 
{
	typedef Db::TTimeField inherited;
	
public:
	#pragma option push -w-inl
	/* TTimeField.Create */ inline __fastcall virtual TFIBTimeField(Classes::TComponent* AOwner) : Db::TTimeField(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBTimeField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBDateTimeField;
class PASCALIMPLEMENTATION TFIBDateTimeField : public Db::TDateTimeField 
{
	typedef Db::TDateTimeField inherited;
	
public:
	#pragma option push -w-inl
	/* TDateTimeField.Create */ inline __fastcall virtual TFIBDateTimeField(Classes::TComponent* AOwner) : Db::TDateTimeField(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBDateTimeField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBBlobField;
class PASCALIMPLEMENTATION TFIBBlobField : public Db::TBlobField 
{
	typedef Db::TBlobField inherited;
	
private:
	short FSubType;
	bool FIsClientCalcField;
	
protected:
	virtual Variant __fastcall GetAsVariant();
	Ibase::TGDS_QUAD __fastcall GetBlobId();
	virtual bool __fastcall GetIsNull(void);
	
public:
	__property short SubType = {read=FSubType, nodefault};
	__property Ibase::TGDS_QUAD Blob_ID = {read=GetBlobId};
	
__published:
	__property bool IsClientField = {read=FIsClientCalcField, write=FIsClientCalcField, default=0};
public:
	#pragma option push -w-inl
	/* TBlobField.Create */ inline __fastcall virtual TFIBBlobField(Classes::TComponent* AOwner) : Db::TBlobField(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBBlobField(void) { }
	#pragma option pop
	
};


__interface IWideStringField;
typedef System::DelphiInterface<IWideStringField> _di_IWideStringField;
__interface  INTERFACE_UUID("{679C5F1A-4356-4696-A8F3-9C7C6970A9F6}") IWideStringField  : public IInterface 
{
	
public:
	virtual WideString __fastcall GetAsWideString(void) = 0 ;
	virtual void __fastcall SetAsWideString(const WideString Value) = 0 ;
	virtual WideString __fastcall GetWideDisplayText(void) = 0 ;
	virtual WideString __fastcall GetWideEditText(void) = 0 ;
	virtual void __fastcall SetWideEditText(const WideString Value) = 0 ;
	__property WideString AsWideString = {read=GetAsWideString, write=SetAsWideString};
	__property WideString WideDisplayText = {read=GetWideDisplayText};
	__property WideString WideText = {read=GetWideEditText, write=SetWideEditText};
};

class DELPHICLASS TFIBMemoField;
class PASCALIMPLEMENTATION TFIBMemoField : public Db::TMemoField 
{
	typedef Db::TMemoField inherited;
	
private:
	int FCharSetID;
	WideString __fastcall GetWideDisplayText();
	WideString __fastcall GetWideEditText();
	void __fastcall SetWideEditText(const WideString Value);
	
protected:
	virtual WideString __fastcall GetAsWideString();
	virtual void __fastcall SetAsWideString(const WideString aValue);
	virtual void __fastcall SetAsVariant(const Variant &Value);
	virtual Variant __fastcall GetAsVariant();
	Ibase::TGDS_QUAD __fastcall GetBlobId();
	
public:
	void __fastcall InternalSetCharSet(int aValue);
	__property Ibase::TGDS_QUAD Blob_ID = {read=GetBlobId};
public:
	#pragma option push -w-inl
	/* TMemoField.Create */ inline __fastcall virtual TFIBMemoField(Classes::TComponent* AOwner) : Db::TMemoField(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBMemoField(void) { }
	#pragma option pop
	
private:
	void *__IWideStringField;	/* Fibdataset::IWideStringField */
	
public:
	operator IWideStringField*(void) { return (IWideStringField*)&__IWideStringField; }
	
};


class DELPHICLASS TFIBSmallIntField;
class PASCALIMPLEMENTATION TFIBSmallIntField : public Db::TSmallintField 
{
	typedef Db::TSmallintField inherited;
	
protected:
	virtual bool __fastcall GetAsBoolean(void);
	virtual void __fastcall SetAsBoolean(bool Value);
public:
	#pragma option push -w-inl
	/* TSmallintField.Create */ inline __fastcall virtual TFIBSmallIntField(Classes::TComponent* AOwner) : Db::TSmallintField(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBSmallIntField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBFloatField;
class PASCALIMPLEMENTATION TFIBFloatField : public Db::TFloatField 
{
	typedef Db::TFloatField inherited;
	
private:
	bool FRoundByScale;
	int __fastcall GetScale(void);
	
protected:
	virtual void __fastcall SetAsFloat(double Value);
	virtual void __fastcall GetText(AnsiString &Text, bool DisplayText);
	
public:
	__fastcall virtual TFIBFloatField(Classes::TComponent* AOwner);
	__property int Scale = {read=GetScale, nodefault};
	
__published:
	__property bool RoundByScale = {read=FRoundByScale, write=FRoundByScale, default=1};
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBFloatField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBBCDField;
class PASCALIMPLEMENTATION TFIBBCDField : public Db::TBCDField 
{
	typedef Db::TBCDField inherited;
	
private:
	bool FRoundByScale;
	bool FDataAsComp;
	int __fastcall GetScale(void);
	int __fastcall ServerType(void);
	
protected:
	#pragma option push -w-inl
	/* virtual class method */ virtual void __fastcall CheckTypeSize(int Value) { CheckTypeSize(__classid(TFIBBCDField), Value); }
	#pragma option pop
	/*         class method */ static void __fastcall CheckTypeSize(TMetaClass* vmt, int Value);
	virtual System::Currency __fastcall GetAsCurrency(void);
	virtual AnsiString __fastcall GetAsString();
	virtual Variant __fastcall GetAsVariant();
	virtual int __fastcall GetDataSize(void);
	virtual void __fastcall GetText(AnsiString &Text, bool DisplayText);
	HIDESBASE bool __fastcall GetValue(System::Currency &Value);
	virtual void __fastcall SetAsString(const AnsiString Value);
	virtual void __fastcall SetAsCurrency(System::Currency Value);
	System::Comp __fastcall GetAsComp(void);
	Extended __fastcall GetAsExtended(void);
	void __fastcall SetAsComp(System::Comp Value);
	void __fastcall SetAsExtended(Extended Value);
	__int64 __fastcall GetAsInt64(void);
	void __fastcall SetAsInt64(const __int64 Value);
	virtual Fmtbcd::TBcd __fastcall GetAsBCD();
	virtual void __fastcall SetAsBCD(const Fmtbcd::TBcd &Value);
	virtual void __fastcall SetVarValue(const Variant &Value);
	__int64 __fastcall GetInternalData(bool &ValueIsNull);
	__int64 __fastcall GetInternalOldData(bool &OldIsNull);
	HIDESBASE bool __fastcall GetData(void * Buffer);
	
public:
	__fastcall virtual TFIBBCDField(Classes::TComponent* AOwner);
	void __fastcall AddExtended(const Extended Value);
	void __fastcall SubtractExtended(const Extended Value);
	void __fastcall MultiplyExtended(const Extended Value);
	void __fastcall DivideExtended(const Extended Value);
	void __fastcall AddBCD(const Fmtbcd::TBcd &Value);
	void __fastcall SubtractBCD(const Fmtbcd::TBcd &Value);
	void __fastcall MultiplyBCD(const Fmtbcd::TBcd &Value);
	void __fastcall DivideBCD(const Fmtbcd::TBcd &Value);
	__property __int64 AsInt64 = {read=GetAsInt64, write=SetAsInt64};
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	bool __fastcall FieldModified(void);
	__property Fmtbcd::TBcd AsBcd = {read=GetAsBCD, write=SetAsBCD};
	__property int Scale = {read=GetScale, nodefault};
	__property System::Comp AsComp = {read=GetAsComp, write=SetAsComp};
	__property Extended AsExtended = {read=GetAsExtended, write=SetAsExtended};
	__property Variant Value = {read=GetAsVariant, write=SetVarValue};
	
__published:
	__property Size  = {default=8};
	__property bool RoundByScale = {read=FRoundByScale, write=FRoundByScale, nodefault};
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBBCDField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBGuidField;
class PASCALIMPLEMENTATION TFIBGuidField : public Db::TGuidField 
{
	typedef Db::TGuidField inherited;
	
protected:
	#pragma option push -w-inl
	/* virtual class method */ virtual void __fastcall CheckTypeSize(int Value) { CheckTypeSize(__classid(TFIBGuidField), Value); }
	#pragma option pop
	/*         class method */ static void __fastcall CheckTypeSize(TMetaClass* vmt, int Value);
	virtual int __fastcall GetDataSize(void);
	virtual AnsiString __fastcall GetAsString();
	virtual void __fastcall SetAsString(const AnsiString Value);
	HIDESBASE GUID __fastcall GetAsGuid();
	HIDESBASE void __fastcall SetAsGuid(const GUID &Value);
	virtual Variant __fastcall GetAsVariant();
	virtual void __fastcall SetAsVariant(const Variant &Value);
	
public:
	__fastcall virtual TFIBGuidField(Classes::TComponent* AOwner);
	__property GUID AsGuid = {read=GetAsGuid, write=SetAsGuid};
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBGuidField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBBooleanField;
class PASCALIMPLEMENTATION TFIBBooleanField : public Db::TBooleanField 
{
	typedef Db::TBooleanField inherited;
	
private:
	AnsiString FStringFalse;
	AnsiString FStringTrue;
	
protected:
	bool __fastcall StoreStrFalse(void);
	bool __fastcall StoreStrTrue(void);
	virtual int __fastcall GetAsInteger(void);
	virtual void __fastcall SetAsString(const AnsiString Value);
	virtual void __fastcall SetAsInteger(int Value);
	virtual void __fastcall SetAsBoolean(bool Value);
	virtual int __fastcall GetDataSize(void);
	virtual AnsiString __fastcall GetAsString();
	virtual bool __fastcall GetAsBoolean(void);
	virtual Variant __fastcall GetAsVariant();
	
public:
	__fastcall virtual TFIBBooleanField(Classes::TComponent* AOwner);
	
__published:
	__property AnsiString StringFalse = {read=FStringFalse, write=FStringFalse, stored=StoreStrFalse};
	__property AnsiString StringTrue = {read=FStringTrue, write=FStringTrue, stored=StoreStrTrue};
public:
	#pragma option push -w-inl
	/* TField.Destroy */ inline __fastcall virtual ~TFIBBooleanField(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBArrayField;
class PASCALIMPLEMENTATION TFIBArrayField : public Db::TBytesField 
{
	typedef Db::TBytesField inherited;
	
private:
	char *FOldValueBuffer;
	Fibquery::TFIBXSQLVAR* __fastcall GetFIBXSQLVAR(void);
	
protected:
	virtual void __fastcall GetText(AnsiString &Text, bool DisplayText);
	int __fastcall GetDimCount(void);
	Db::TFieldType __fastcall GetElementType(void);
	Ibase::TISC_ARRAY_BOUND __fastcall GetDimension(int Index);
	int __fastcall GetArraySize(void);
	void __fastcall SaveOldBuffer(void);
	void __fastcall RestoreOldBuffer(void);
	Ibase::TGDS_QUAD __fastcall GetArrayId();
	virtual Variant __fastcall GetAsVariant();
	virtual void __fastcall SetAsVariant(const Variant &Value);
	
public:
	__fastcall virtual TFIBArrayField(Classes::TComponent* AOwner);
	__fastcall virtual ~TFIBArrayField(void);
	__property int DimensionCount = {read=GetDimCount, nodefault};
	__property Db::TFieldType ElementType = {read=GetElementType, nodefault};
	__property Ibase::TISC_ARRAY_BOUND Dimension[int Index] = {read=GetDimension};
	__property int ArraySize = {read=GetArraySize, nodefault};
	__property Ibase::TGDS_QUAD ArrayID = {read=GetArrayId};
};


typedef Set<Db::TUpdateKind, ukModify, ukDelete>  TUpdateKinds;

#pragma option push -b-
enum TFIBUpdateAction { uaFail, uaAbort, uaSkip, uaRetry, uaApply, uaApplied };
#pragma option pop

typedef void __fastcall (__closure *TFIBUpdateErrorEvent)(Db::TDataSet* DataSet, Fib::EFIBError* E, Db::TUpdateKind UpdateKind, TFIBUpdateAction &UpdateAction);

typedef void __fastcall (__closure *TFIBUpdateRecordEvent)(Db::TDataSet* DataSet, Db::TUpdateKind UpdateKind, TFIBUpdateAction &UpdateAction);

typedef void __fastcall (__closure *TFIBAfterUpdateRecordEvent)(Db::TDataSet* DataSet, Db::TUpdateKind UpdateKind, bool &Resume);

typedef Set<TCachedUpdateStatus, cusUnmodified, cusDeletedApplied>  TFIBUpdateRecordTypes;

typedef void __fastcall (__closure *TOnFetchRecord)(Fibquery::TFIBQuery* FromQuery, int RecordNumber, bool &StopFetching);

#pragma option push -b-
enum TpSQLKind { skModify, skInsert, skDelete, skRefresh };
#pragma option pop

#pragma option push -b-
enum TDispositionFieldType { dfNormal, dfRRecNumber };
#pragma option pop

#pragma option push -b-
enum TExtLocateOption { eloCaseInsensitive, eloPartialKey, eloWildCards, eloInSortedDS, eloNearest, eloInFetchedRecords };
#pragma option pop

typedef Set<TExtLocateOption, eloCaseInsensitive, eloInFetchedRecords>  TExtLocateOptions;

#pragma option push -b-
enum TLocateKind { lkStandard, lkNext, lkPrior };
#pragma option pop

struct TSortFieldInfo
{
	
public:
	AnsiString FieldName;
	int InDataSetIndex;
	int InOrderIndex;
	bool Asc;
	bool NullsFirst;
} ;

class DELPHICLASS TFIBDataLink;
class DELPHICLASS TFIBCustomDataSet;
#pragma option push -b-
enum TTransactionKind { tkReadTransaction, tkUpdateTransaction };
#pragma option pop

typedef void __fastcall (__closure *TOnFillClientBlob)(TFIBCustomDataSet* DataSet, TFIBBlobField* Field, Fibmiscellaneous::TFIBBlobStream* Stream);

#pragma option push -b-
enum TDataSetRunStateValue { drsInCacheRefresh, drsInSort, drsInOpenByTimer, drsInFilterProc, drsInGetRecordProc, drsInGotoBookMark, drsInClone, drsInApplyUpdates, drsInRefreshClientFields, drsDontCheckInactive, drsForceCreateCalcFields, drsInRefreshRow, drsInMoveRecord, drsInCacheDelete };
#pragma option pop

typedef Set<TDataSetRunStateValue, drsInCacheRefresh, drsInCacheDelete>  TDataSetRunState;

struct TFilteredCacheInfo
{
	
public:
	int AllRecords;
	int FilteredRecords;
	Pfiblists::TSortedList* NonVisibleRecords;
} ;

class DELPHICLASS TCacheModelOptions;
#pragma option push -b-
enum TCacheModelKind { cmkStandard, cmkLimitedBufferSize };
#pragma option pop

class PASCALIMPLEMENTATION TCacheModelOptions : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	TFIBCustomDataSet* vOwner;
	TCacheModelKind FCacheModelKind;
	int FBufferChunks;
	AnsiString FPlanForDescSQLs;
	void __fastcall SetBufferChunks(int Value);
	void __fastcall SetCacheModelKind(TCacheModelKind Value);
	
public:
	__fastcall TCacheModelOptions(TFIBCustomDataSet* Owner);
	
__published:
	__property TCacheModelKind CacheModelKind = {read=FCacheModelKind, write=SetCacheModelKind, default=0};
	__property int BufferChunks = {read=FBufferChunks, write=SetBufferChunks, default=32};
	__property AnsiString PlanForDescSQLs = {read=FPlanForDescSQLs, write=FPlanForDescSQLs};
public:
	#pragma option push -w-inl
	/* TPersistent.Destroy */ inline __fastcall virtual ~TCacheModelOptions(void) { }
	#pragma option pop
	
};


struct TRecordsPartition;
typedef TRecordsPartition *PRecordsPartition;

typedef int __fastcall (__closure *TCompareFieldValues)(Db::TField* Field, const Variant &S1, const Variant &S2);

#pragma option push -b-
enum TUpdateBlobInfo { ubiCheckIsNull, ubiPost, ubiCancel, ubiClearOldValue };
#pragma option pop

class PASCALIMPLEMENTATION TFIBCustomDataSet : public Db::TWideDataSet 
{
	typedef Db::TWideDataSet inherited;
	
protected:
	Fibdatabase::TFIBBase* FBase;
	int FBlobCacheBufferOffset;
	int FBlobCacheOffset;
	Classes::TList* FBlobStreamList;
	Fibcachemanage::TRecordsCache* FRecordsCache;
	unsigned FBufferChunkSize;
	unsigned FBPos;
	unsigned FOBPos;
	unsigned FBEnd;
	unsigned FOBEnd;
	bool FCachedUpdates;
	int FCalcFieldsOffset;
	int FCurrentRecord;
	int FDeletedRecords;
	TFIBDataLink* FSourceLink;
	bool FOpen;
	bool FPrepared;
	Fibquery::TFIBQuery* FQDelete;
	Fibquery::TFIBQuery* FQInsert;
	Fibquery::TFIBQuery* FQRefresh;
	Fibquery::TFIBQuery* FQSelect;
	Fibquery::TFIBQuery* FQUpdate;
	int FRecordBufferSize;
	int FBlockReadSize;
	int FRecordCount;
	int FAllRecordCount;
	int FRecordSize;
	int vDisableScrollCount;
	Classes::TNotifyEvent FDatabaseDisconnecting;
	Classes::TNotifyEvent FDatabaseDisconnected;
	Classes::TNotifyEvent FDatabaseFree;
	TFIBUpdateErrorEvent FOnUpdateError;
	TFIBUpdateRecordEvent FOnUpdateRecord;
	TFIBAfterUpdateRecordEvent FAfterUpdateRecord;
	Classes::TNotifyEvent FTransactionEnding;
	Classes::TNotifyEvent FTransactionEnded;
	Classes::TNotifyEvent FTransactionFree;
	Classes::TNotifyEvent FBeforeStartTr;
	Classes::TNotifyEvent FAfterStartTr;
	Fibdatabase::TEndTrEvent FBeforeEndTr;
	Fibdatabase::TEndTrEvent FAfterEndTr;
	Classes::TNotifyEvent FBeforeStartUpdTr;
	Classes::TNotifyEvent FAfterStartUpdTr;
	Fibdatabase::TEndTrEvent FBeforeEndUpdTr;
	Fibdatabase::TEndTrEvent FAfterEndUpdTr;
	bool FUpdatesPending;
	TFIBUpdateRecordTypes FUpdateRecordTypes;
	bool FUniDirectional;
	Db::TDataSetErrorEvent FOnGetRecordError;
	Pfibprops::TpFIBDsOptions FOptions;
	Pfibprops::TDetailConditions FDetailConditions;
	int vInspectRecno;
	TDispositionFieldType vTypeDispositionField;
	Stdfuncs::TFIBTimer* vTimerForDetail;
	Stdfuncs::TFIBTimer* vScrollTimer;
	int FDisableCOCount;
	int FDisableCalcFieldsCount;
	Pfibprops::TpPrepareOptions FPrepareOptions;
	bool vSelectSQLTextChanged;
	TTransactionKind FRefreshTransactionKind;
	bool FAutoCommit;
	int FWaitEndMasterInterval;
	Db::TFieldNotifyEvent FOnFieldChange;
	TOnFillClientBlob FOnFillClientBlob;
	Db::TDataSetState vPredState;
	int vrdFieldCount;
	int FStringFieldCount;
	Dbparsers::TExpressionParser* FFilterParser;
	TUpdateKinds FAllowedUpdateKinds;
	TDataSetRunState FRunState;
	bool vCalcFieldsSavedCache;
	bool FIsUnicodeConnect;
	Pfibprops::TFieldOriginRule FFieldOriginRule;
	TFilteredCacheInfo FFilteredCacheInfo;
	Pfibprops::TAutoUpdateOptions* FAutoUpdateOptions;
	bool __fastcall IsDBKeyField(System::TObject* Field);
	void __fastcall CheckDataFields(Classes::TList* FieldList, const AnsiString CallerProc);
	void __fastcall PrepareAdditionalSelects(void);
	bool __fastcall CompareBookMarkAndRecno(void * BookMark, int Rno, bool OnlyFields = false);
	bool __fastcall RefreshAround(Fibquery::TFIBQuery* BaseQuery, int &BaseRecNum, bool IgnoreEmptyBaseQuery = true, bool ReopenBaseQuery = true);
	
private:
	TCacheModelOptions* FCacheModelOptions;
	TRecordsPartition *vPartition;
	Fibquery::TFIBQuery* FQCurrentSelect;
	Fibquery::TFIBQuery* FQSelectPart;
	Fibquery::TFIBQuery* FQSelectDescPart;
	Fibquery::TFIBQuery* FQSelectDesc;
	Fibquery::TFIBQuery* FQBookMark;
	Classes::TStrings* FKeyFieldsForBookMark;
	Variant FSortFields;
	bool __fastcall CanHaveLimitedCache(void);
	void __fastcall SetCacheModelOptions(TCacheModelOptions* aCacheModelOptions);
	int __fastcall GetBufferChunks(void);
	void __fastcall SetBufferChunks(int Value);
	void __fastcall ShiftCurRec(void);
	bool __fastcall StoreUpdTransaction(void);
	void __fastcall SetOnEndScroll(Db::TDataSetNotifyEvent Event);
	bool __fastcall GetDefaultFields(void);
	void __fastcall ClearBlobStreamList(void);
	Fibquery::TFIBQuery* __fastcall CreateInternalQuery(const AnsiString QName);
	AnsiString __fastcall GetGroupByString();
	AnsiString __fastcall GetMainWhereClause();
	void __fastcall SetGroupByString(const AnsiString Value);
	void __fastcall SetMainWhereClause(const AnsiString Value);
	AnsiString __fastcall GetPlanClause();
	void __fastcall SetPlanClause(const AnsiString Value);
	
protected:
	TCompareFieldValues FOnCompareFieldValues;
	virtual int __fastcall CompareFieldValues(Db::TField* Field, const Variant &S1, const Variant &S2);
	
public:
	int __fastcall AnsiCompareString(Db::TField* Field, const Variant &val1, const Variant &val2);
	int __fastcall StdAnsiCompareString(Db::TField* Field, const Variant &S1, const Variant &S2);
	int __fastcall StdCompareValues(const Variant &S1, const Variant &S2);
	
__published:
	__property TCompareFieldValues OnCompareFieldValues = {read=FOnCompareFieldValues, write=FOnCompareFieldValues};
	
protected:
	Pfibprops::TpFIBDsOption FCurOption;
	Pfibprops::TpPrepareOption FCurPrepareOption;
	Pfibprops::TDetailCondition FCurDetailCondition;
	bool FLoadingPrepared;
	void __fastcall ReadOption(Classes::TReader* Reader);
	void __fastcall WriteOption(Classes::TWriter* Writer);
	void __fastcall ReadPrepareOption(Classes::TReader* Reader);
	void __fastcall WritePrepareOption(Classes::TWriter* Writer);
	void __fastcall ReadDetailCondition(Classes::TReader* Reader);
	void __fastcall WriteDetailCondition(Classes::TWriter* Writer);
	void __fastcall ReadOV(Classes::TReader* Reader);
	void __fastcall ReadBufferChunks(Classes::TReader* Reader);
	virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
	Ibase::TXSQLVAR __fastcall GetXSQLVAR(Db::TField* Fld);
	short __fastcall GetFieldScale(Db::TNumericField* Fld);
	Fibdatabase::TFIBTransaction* __fastcall GetUpdateTransaction(void);
	Db::TGetResult __fastcall AdjustCurrentRecord(void * Buffer, Db::TGetMode GetMode);
	virtual bool __fastcall CanEdit(void);
	virtual bool __fastcall CanInsert(void);
	virtual bool __fastcall CanDelete(void);
	virtual void __fastcall CheckFieldCompatibility(Db::TField* Field, Db::TFieldDef* FieldDef);
	virtual void __fastcall CheckInactive(void);
	void __fastcall CheckEditState(void);
	void __fastcall UpdateBlobInfo(void * Buff, TUpdateBlobInfo Operation, bool ClearModified, bool ForceWrite, Db::TField* Field = (Db::TField*)(0x0));
	void __fastcall CopyRecordBuffer(void * Source, void * Dest);
	void __fastcall DoDatabaseDisconnecting(System::TObject* Sender);
	void __fastcall DoDatabaseDisconnected(System::TObject* Sender);
	void __fastcall DoDatabaseFree(System::TObject* Sender);
	virtual void __fastcall DoTransactionEnding(System::TObject* Sender);
	virtual void __fastcall DoTransactionEnded(System::TObject* Sender);
	void __fastcall DoTransactionFree(System::TObject* Sender);
	void __fastcall DoBeforeStartTransaction(System::TObject* Sender);
	void __fastcall DoAfterStartTransaction(System::TObject* Sender);
	void __fastcall DoBeforeEndTransaction(Fibdatabase::TFIBTransaction* EndingTR, Fibdatabase::TTransactionAction Action, bool Force);
	void __fastcall DoAfterEndTransaction(Fibdatabase::TFIBTransaction* EndingTR, Fibdatabase::TTransactionAction Action, bool Force);
	void __fastcall DoBeforeStartUpdateTransaction(System::TObject* Sender);
	void __fastcall DoAfterStartUpdateTransaction(System::TObject* Sender);
	void __fastcall DoBeforeEndUpdateTransaction(Fibdatabase::TFIBTransaction* EndingTR, Fibdatabase::TTransactionAction Action, bool Force);
	virtual void __fastcall DoAfterEndUpdateTransaction(Fibdatabase::TFIBTransaction* EndingTR, Fibdatabase::TTransactionAction Action, bool Force);
	void __fastcall FetchCurrentRecordToBuffer(Fibquery::TFIBQuery* Qry, int RecordNumber, char * Buffer);
	void __fastcall FetchRecordToCache(Fibquery::TFIBQuery* Qry, int RecordNumber);
	void __fastcall InitDataSetSchema(void);
	char * __fastcall GetActiveBuf(void);
	Fibdatabase::TFIBDatabase* __fastcall GetDatabase(void);
	Ibase::PISC_DB_HANDLE __fastcall GetDBHandle(void);
	Classes::TStrings* __fastcall GetDeleteSQL(void);
	Classes::TStrings* __fastcall GetInsertSQL(void);
	Fibquery::TFIBXSQLDA* __fastcall GetParams(void);
	Classes::TStrings* __fastcall GetRefreshSQL(void);
	Classes::TStrings* __fastcall GetSelectSQL(void);
	Fibquery::TFIBSQLTypes __fastcall GetStatementType(void);
	Classes::TStrings* __fastcall GetUpdateSQL(void);
	Fibdatabase::TFIBTransaction* __fastcall GetTransaction(void);
	Ibase::PISC_TR_HANDLE __fastcall GetTRHandle(void);
	virtual void __fastcall InternalDeleteRecord(Fibquery::TFIBQuery* Qry, void * Buff);
	virtual bool __fastcall InternalLocate(const AnsiString KeyFields, Variant * KeyValues, const int KeyValues_Size, TExtLocateOptions Options, bool FromBegin = false, TLocateKind LocateKind = (TLocateKind)(0x0), bool ResyncToCenter = false);
	bool __fastcall InternalLocateForLimCache(const AnsiString KeyFields, Variant const * KeyValues, const int KeyValues_Size, TExtLocateOptions Options, TLocateKind LocateKind = (TLocateKind)(0x0), Fibquery::TFIBQuery* aQLocate = (Fibquery::TFIBQuery*)(0x0));
	bool __fastcall InternalExtLocate(const AnsiString KeyFields, const Variant &KeyValues, TExtLocateOptions Options, TLocateKind LocateKind);
	virtual void __fastcall InternalPostRecord(Fibquery::TFIBQuery* Qry, void * Buff);
	bool __fastcall InternalRefreshRow(Fibquery::TFIBQuery* Qry, void * Buff);
	void __fastcall InternalRevertRecord(int RecordNumber, bool WithUnInserted);
	bool __fastcall IsVisibleStat(char * Buffer);
	virtual bool __fastcall IsVisible(char * Buffer);
	void __fastcall SaveOldBuffer(char * Buffer);
	void __fastcall SetDatabase(Fibdatabase::TFIBDatabase* Value);
	void __fastcall SetDeleteSQL(Classes::TStrings* Value);
	void __fastcall SetInsertSQL(Classes::TStrings* Value);
	void __fastcall SetQueryParams(Fibquery::TFIBQuery* Qry, void * Buffer);
	void __fastcall SetRefreshSQL(Classes::TStrings* Value);
	void __fastcall SetSelectSQL(Classes::TStrings* Value);
	void __fastcall SetUpdateSQL(Classes::TStrings* Value);
	void __fastcall SetTransaction(Fibdatabase::TFIBTransaction* Value);
	virtual void __fastcall SetUpdateTransaction(Fibdatabase::TFIBTransaction* Value);
	void __fastcall SetUpdateRecordTypes(TFIBUpdateRecordTypes Value);
	HIDESBASE void __fastcall SetUniDirectional(bool Value);
	virtual void __fastcall SetPrepareOptions(Pfibprops::TpPrepareOptions Value);
	void __fastcall SetRefreshTransactionKind(const TTransactionKind Value);
	void __fastcall SourceChanged(void);
	void __fastcall SourceDisabled(void);
	Db::TParams* FParams;
	void __fastcall SQLChanging(System::TObject* Sender);
	void __fastcall ReadRecordCache(int RecordNumber, char * Buffer, bool ReadOldBuffer);
	void __fastcall WriteRecordCache(int RecordNumber, char * Buffer);
	char * __fastcall GetNewBuffer(void);
	char * __fastcall GetOldBuffer(int aRecordNo = 0xffffffff);
	void __fastcall CheckUpdateTransaction(void);
	Pfibfieldsdescr::TFIBFieldDescrList* vFieldDescrList;
	Classes::TStringList* FFNFields;
	int vIgnoreLocReno;
	bool vControlsEnabled;
	Db::TDataSetNotifyEvent FOnEnableControls;
	Db::TDataSetNotifyEvent FOnDisableControls;
	Db::TDataSetNotifyEvent FOnEndScroll;
	bool FCachedActive;
	bool vNeedReloadClientBlobs;
	virtual void __fastcall SetActive(bool Value);
	virtual void __fastcall DataEvent(Db::TDataEvent Event, int Info);
	virtual void __fastcall SetStateFieldValue(Db::TDataSetState State, Db::TField* Field, const Variant &Value);
	void __fastcall DoOnDisableControls(Db::TDataSet* DataSet);
	void __fastcall DoOnEnableControls(Db::TDataSet* DataSet);
	virtual char * __fastcall AllocRecordBuffer(void);
	virtual void __fastcall InternalDoBeforeOpen(void);
	virtual void __fastcall DoBeforeOpen(void);
	virtual void __fastcall DoAfterOpen(void);
	virtual void __fastcall DoBeforeClose(void);
	virtual void __fastcall DoAfterClose(void);
	virtual void __fastcall DoBeforeCancel(void);
	virtual void __fastcall DoAfterCancel(void);
	virtual void __fastcall DoBeforeDelete(void);
	virtual void __fastcall DoBeforeEdit(void);
	virtual void __fastcall DoBeforeInsert(void);
	virtual void __fastcall DoBeforeScroll(void);
	virtual void __fastcall DoAfterScroll(void);
	virtual void __fastcall DoBeforePost(void);
	virtual void __fastcall DoAfterInsert(void);
	virtual void __fastcall DoAfterPost(void);
	virtual void __fastcall DoAfterDelete(void);
	void __fastcall DoOnEndScroll(System::TObject* Sender);
	virtual void __fastcall DoOnPostError(Db::TDataSet* DataSet, Db::EDatabaseError* E, Db::TDataAction &Action);
	virtual void __fastcall FreeRecordBuffer(char * &Buffer);
	virtual void __fastcall GetBookmarkData(char * Buffer, void * Data);
	virtual Db::TBookmarkFlag __fastcall GetBookmarkFlag(char * Buffer);
	virtual bool __fastcall GetCanModify(void);
	virtual Db::TDataSource* __fastcall GetDataSource(void);
	virtual TMetaClass* __fastcall GetFieldClass(Db::TFieldType FieldType);
	virtual int __fastcall GetRecNo(void);
	int __fastcall GetRealRecNo(void);
	void __fastcall TryDesignPrepare(void);
	void __fastcall PrepareQuery(TpSQLKind KindQuery);
	void __fastcall PrepareBookMarkSize(void);
	virtual void __fastcall ClearCalcFields(char * Buffer);
	virtual void __fastcall GetCalcFields(char * Buffer);
	virtual Db::TGetResult __fastcall GetRecord(char * Buffer, Db::TGetMode GetMode, bool DoCheck);
	virtual int __fastcall GetRecordCount(void);
	virtual Word __fastcall GetRecordSize(void);
	virtual void __fastcall InternalAddRecord(void * Buffer, bool Append);
	virtual void __fastcall InternalCancel(void);
	virtual void __fastcall InternalClose(void);
	virtual void __fastcall CloseCursor(void);
	virtual void __fastcall InternalDelete(void);
	virtual void __fastcall InternalFirst(void);
	virtual void __fastcall InternalGotoBookmark(void * Bookmark);
	virtual void __fastcall InternalHandleException(void);
	virtual void __fastcall InternalInitFieldDefs(void);
	virtual void __fastcall InternalInitRecord(char * Buffer);
	virtual void __fastcall InternalLast(void);
	virtual void __fastcall InternalOpen(void);
	virtual void __fastcall InternalPost(void);
	virtual void __fastcall DoInternalRefresh(Fibquery::TFIBQuery* Qry, void * Buff, bool ForceFullRefresh);
	virtual void __fastcall InternalRefresh(void);
	virtual void __fastcall InternalSetToRecord(char * Buffer);
	virtual bool __fastcall IsCursorOpen(void);
	virtual void __fastcall SetBookmarkFlag(char * Buffer, Db::TBookmarkFlag Value);
	virtual void __fastcall SetBookmarkData(char * Buffer, void * Data);
	void __fastcall SetCachedUpdates(bool Value);
	void __fastcall SetDataSource(Db::TDataSource* Value);
	void __fastcall SetOptions(Pfibprops::TpFIBDsOptions Value);
	virtual void __fastcall SetFieldData(Db::TField* Field, void * Buffer)/* overload */;
	void __fastcall SetRealRecNo(int Value, bool ToCenter = false);
	virtual void __fastcall SetRecNo(int Value);
	virtual bool __fastcall MasterFieldsChanged(void);
	void __fastcall SetParamsFromMaster(void);
	void __fastcall ForceEndWaitMaster(void);
	virtual void __fastcall SetFiltered(bool Value);
	void __fastcall ExprParserCreate(const AnsiString Text, Db::TFilterOptions Options);
	void __fastcall SetFilterData(const AnsiString Text, Db::TFilterOptions Options);
	virtual void __fastcall SetFilterOptions(Db::TFilterOptions Value);
	virtual void __fastcall SetFilterText(const AnsiString Value);
	bool FIsClientSorting;
	TOnFetchRecord FBeforeFetchRecord;
	TOnFetchRecord FAfterFetchRecord;
	Classes::TStringList* FRelationTables;
	int FCountUpdatesPending;
	Controls::TCursor FSQLScreenCursor;
	Pfibprops::TSQLs* FSQLs;
	void __fastcall SetBeforeFetchRecord(TOnFetchRecord Value);
	bool __fastcall IsValidBuffer(char * FCache);
	void __fastcall PackMemory(char * &FCache);
	bool __fastcall GetAllFetched(void);
	void __fastcall OpenByTimer(System::TObject* Sender);
	void __fastcall DoCloseOpen(System::TObject* Sender);
	bool __fastcall GetWaitEndMasterScroll(void);
	void __fastcall SetWaitEndMasterScroll(bool Value);
	Pfibprops::TDetailConditions __fastcall GetDetailConditions(void);
	void __fastcall SetDetailConditions(Pfibprops::TDetailConditions Value);
	bool __fastcall IsSorted(void);
	void __fastcall DoOnSelectFetch(int RecordNumber, bool &StopFetching);
	void __fastcall PrepareAdditionalInfo(void);
	void __fastcall RefreshMasterDS(void);
	void __fastcall AutoStartUpdateTransaction(void);
	void __fastcall AutoCommitUpdateTransaction(void);
	__property Fibquery::TFIBXSQLDA* Params = {read=GetParams};
	__property bool Prepared = {read=FPrepared, nodefault};
	__property Fibquery::TFIBQuery* QDelete = {read=FQDelete};
	__property Fibquery::TFIBQuery* QInsert = {read=FQInsert};
	__property Fibquery::TFIBQuery* QRefresh = {read=FQRefresh};
	__property Fibquery::TFIBQuery* QSelect = {read=FQSelect};
	__property Fibquery::TFIBQuery* QUpdate = {read=FQUpdate};
	__property Fibquery::TFIBSQLTypes StatementType = {read=GetStatementType, nodefault};
	__property bool UpdatesPending = {read=FUpdatesPending, nodefault};
	__property int BufferChunks = {read=GetBufferChunks, write=SetBufferChunks, nodefault};
	__property bool CachedUpdates = {read=FCachedUpdates, write=SetCachedUpdates, default=0};
	__property Classes::TStrings* DeleteSQL = {read=GetDeleteSQL, write=SetDeleteSQL};
	__property Classes::TStrings* InsertSQL = {read=GetInsertSQL, write=SetInsertSQL};
	__property Classes::TStrings* RefreshSQL = {read=GetRefreshSQL, write=SetRefreshSQL};
	__property Classes::TStrings* SelectSQL = {read=GetSelectSQL, write=SetSelectSQL};
	__property bool UniDirectional = {read=FUniDirectional, write=SetUniDirectional, default=0};
	__property TFIBUpdateRecordTypes UpdateRecordTypes = {read=FUpdateRecordTypes, write=SetUpdateRecordTypes, default=7};
	__property Classes::TStrings* UpdateSQL = {read=GetUpdateSQL, write=SetUpdateSQL};
	__property Classes::TNotifyEvent DatabaseDisconnecting = {read=FDatabaseDisconnecting, write=FDatabaseDisconnecting};
	__property Classes::TNotifyEvent DatabaseDisconnected = {read=FDatabaseDisconnected, write=FDatabaseDisconnected};
	__property Classes::TNotifyEvent DatabaseFree = {read=FDatabaseFree, write=FDatabaseFree};
	__property TFIBUpdateErrorEvent OnUpdateError = {read=FOnUpdateError, write=FOnUpdateError};
	__property TFIBUpdateRecordEvent OnUpdateRecord = {read=FOnUpdateRecord, write=FOnUpdateRecord};
	__property TFIBAfterUpdateRecordEvent AfterUpdateRecord = {read=FAfterUpdateRecord, write=FAfterUpdateRecord};
	__property Classes::TNotifyEvent TransactionEnding = {read=FTransactionEnding, write=FTransactionEnding};
	__property Classes::TNotifyEvent TransactionEnded = {read=FTransactionEnded, write=FTransactionEnded};
	__property Classes::TNotifyEvent TransactionFree = {read=FTransactionFree, write=FTransactionFree};
	__property int DisableCOCount = {read=FDisableCOCount, nodefault};
	__property TCacheModelOptions* CacheModelOptions = {read=FCacheModelOptions, write=SetCacheModelOptions};
	
private:
	Pfibprops::TConditions* __fastcall GetConditions(void);
	void __fastcall SetConditions(Pfibprops::TConditions* Value);
	AnsiString __fastcall GetOrderString();
	void __fastcall SetOrderString(const AnsiString OrderTxt);
	AnsiString __fastcall GetFieldsString();
	void __fastcall SetFieldsString(const AnsiString Value);
	
public:
	Db::TField* __fastcall FN(const AnsiString FieldName);
	Db::TField* __fastcall FBN(const AnsiString FieldName);
	void __fastcall SwapRecords(int Recno1, int Recno2);
	int __fastcall GetCacheSize(void);
	void __fastcall ApplyConditions(bool Reopen = false);
	void __fastcall CancelConditions(void);
	__property AnsiString OrderClause = {read=GetOrderString, write=SetOrderString};
	__property AnsiString FieldsClause = {read=GetFieldsString, write=SetFieldsString};
	__property AnsiString GroupByClause = {read=GetGroupByString, write=SetGroupByString};
	__property AnsiString MainWhereClause = {read=GetMainWhereClause, write=SetMainWhereClause};
	__property AnsiString PlanClause = {read=GetPlanClause, write=SetPlanClause};
	__property Pfibprops::TConditions* Conditions = {read=GetConditions, write=SetConditions};
	__fastcall virtual TFIBCustomDataSet(Classes::TComponent* AOwner);
	__fastcall virtual ~TFIBCustomDataSet(void);
	__property Pfibprops::TAutoUpdateOptions* AutoUpdateOptions = {read=FAutoUpdateOptions, write=FAutoUpdateOptions};
	
private:
	int vLockResync;
	bool __fastcall NeedMoveRecordToOrderPos(void);
	void __fastcall MoveRecordToOrderPos(void);
	void __fastcall CreateDetailTimer(void);
	void __fastcall CreateScrollTimer(void);
	
protected:
	void __fastcall ChangeScreenCursor(int &OldCursor);
	void __fastcall RestoreScreenCursor(const int OldCursor);
	
public:
	__property TDataSetRunState RunState = {read=FRunState, nodefault};
	virtual void __fastcall Resync(Db::TResyncMode Mode);
	virtual bool __fastcall BookmarkValid(void * Bookmark);
	virtual void __fastcall Post(void);
	int __fastcall SetRecordPosInBuffer(int NewPos);
	void __fastcall CloseOpen(const bool DoFetchAll);
	void __fastcall StartTransaction(void);
	void __fastcall BatchInput(Fibquery::TFIBBatchInputStream* InputObject, TpSQLKind SQLKind = (TpSQLKind)(0x1));
	void __fastcall BatchOutput(Fibquery::TFIBBatchOutputStream* OutputObject);
	TCachedUpdateStatus __fastcall CachedUpdateStatus(void);
	virtual void __fastcall CancelUpdates(void);
	void __fastcall CheckDatasetClosed(const AnsiString Reason);
	void __fastcall CheckDatasetOpen(const AnsiString Reason);
	void __fastcall CheckNotUniDirectional(void);
	void __fastcall FetchAll(void);
	virtual void __fastcall Prepare(void);
	void __fastcall UnPrepare(void);
	void __fastcall RecordModified(bool Value);
	void __fastcall RevertRecord(void);
	void __fastcall Undelete(void);
	void __fastcall DisableScrollEvents(void);
	void __fastcall EnableScrollEvents(void);
	void __fastcall DisableCloseOpenEvents(void);
	void __fastcall EnableCloseOpenEvents(void);
	void __fastcall DisableCalcFields(void);
	void __fastcall EnableCalcFields(void);
	Variant __fastcall ArrayFieldValue(Db::TField* Field);
	void __fastcall SetArrayValue(Db::TField* Field, const Variant &Value);
	Variant __fastcall GetElementFromValue(Db::TField* Field, int * Indexes, const int Indexes_Size);
	void __fastcall SetArrayElementValue(Db::TField* Field, const Variant &Value, int * Indexes, const int Indexes_Size);
	AnsiString __fastcall GetRelationTableName(System::TObject* Field);
	AnsiString __fastcall GetRelationFieldName(System::TObject* Field);
	virtual void __fastcall MoveRecord(int OldRecno, int NewRecno);
	void __fastcall DoSortEx(int * Fields, const int Fields_Size, bool * Ordering, const int Ordering_Size)/* overload */;
	void __fastcall DoSortEx(Classes::TStrings* Fields, bool * Ordering, const int Ordering_Size)/* overload */;
	virtual void __fastcall DoSort(System::TVarRec * Fields, const int Fields_Size, bool * Ordering, const int Ordering_Size);
	Db::TField* __fastcall CreateCalcField(TMetaClass* FieldClass, const AnsiString aName, const AnsiString aFieldName, int aSize);
	Db::TField* __fastcall CreateLookUpField(TMetaClass* FieldClass, const AnsiString aName, const AnsiString aFieldName, int aSize, Db::TDataSet* aLookupDataSet, const AnsiString aKeyFields, const AnsiString aLookupKeyFields, const AnsiString aLookupResultField);
	AnsiString __fastcall GetFieldOrigin(Db::TField* Fld);
	Db::TField* __fastcall FieldByOrigin(const AnsiString aOrigin)/* overload */;
	Db::TField* __fastcall FieldByOrigin(const AnsiString TableName, const AnsiString FieldName)/* overload */;
	Db::TField* __fastcall FieldByRelName(const AnsiString FName);
	AnsiString __fastcall ReadySelectText();
	AnsiString __fastcall TableAliasForField(const AnsiString aFieldName);
	AnsiString __fastcall SQLFieldName(const AnsiString aFieldName);
	void __fastcall RestoreMacroDefaultValues(void);
	bool __fastcall IsComputedField(const Variant &Fld);
	AnsiString __fastcall DomainForField(const Variant &Fld);
	bool __fastcall SortInfoIsValid(void);
	bool __fastcall IsSortedField(Db::TField* Field, TSortFieldInfo &FieldSortOrder);
	int __fastcall SortFieldsCount(void);
	TSortFieldInfo __fastcall SortFieldInfo(int OrderIndex);
	AnsiString __fastcall SortedFields();
	__property Variant SortFields = {read=FSortFields};
	__property bool Sorted = {read=IsSorted, nodefault};
	__property Classes::TStringList* RelationTables = {read=FRelationTables};
	__property bool CachedActive = {read=FCachedActive, nodefault};
	virtual int __fastcall CompareBookmarks(void * Bookmark1, void * Bookmark2);
	bool __fastcall BlobModified(Db::TField* Field);
	virtual Classes::TStream* __fastcall CreateBlobStream(Db::TField* Field, Db::TBlobStreamMode Mode);
	bool __fastcall GetRecordFieldInfo(Db::TField* Field, AnsiString &TableName, AnsiString &FieldName, Stdfuncs::TDynArray &RecordKeyValues);
	virtual bool __fastcall GetCurrentRecord(char * Buffer);
	virtual bool __fastcall GetFieldData(Db::TField* Field, void * Buffer)/* overload */;
	virtual void __fastcall DataConvert(Db::TField* Field, void * Source, void * Dest, bool ToNative);
	virtual Variant __fastcall GetStateFieldValue(Db::TDataSetState State, Db::TField* Field);
	Variant __fastcall RecordFieldValue(Db::TField* Field, int RecNumber)/* overload */;
	Variant __fastcall RecordFieldValue(Db::TField* Field, void * aBookmark)/* overload */;
	bool __fastcall ExtLocate(const AnsiString KeyFields, const Variant &KeyValues, TExtLocateOptions Options);
	virtual bool __fastcall Locate(const AnsiString KeyFields, const Variant &KeyValues, Db::TLocateOptions Options);
	bool __fastcall LocatePrior(const AnsiString KeyFields, const Variant &KeyValues, Db::TLocateOptions Options);
	bool __fastcall LocateNext(const AnsiString KeyFields, const Variant &KeyValues, Db::TLocateOptions Options);
	bool __fastcall ExtLocateNext(const AnsiString KeyFields, const Variant &KeyValues, TExtLocateOptions Options);
	bool __fastcall ExtLocatePrior(const AnsiString KeyFields, const Variant &KeyValues, TExtLocateOptions Options);
	void __fastcall RefreshFilters(void);
	virtual Variant __fastcall Lookup(const AnsiString KeyFields, const Variant &KeyValues, const AnsiString ResultFields);
	virtual int __fastcall Translate(char * Src, char * Dest, bool ToOem);
	virtual Db::TUpdateStatus __fastcall UpdateStatus(void);
	virtual bool __fastcall IsSequenced(void);
	__property bool DefaultFields = {read=GetDefaultFields, nodefault};
	void __fastcall CacheDelete(void);
	void __fastcall CacheOpen(void);
	void __fastcall RefreshClientFields(bool ForceCalc = true);
	Db::TField* __fastcall CreateCalcFieldAs(Db::TField* Field);
	void __fastcall CopyFieldsStructure(TFIBCustomDataSet* Source, bool RecreateFields);
	void __fastcall CopyFieldsProperties(TFIBCustomDataSet* Source, TFIBCustomDataSet* Destination);
	void __fastcall AssignProperties(TFIBCustomDataSet* Source);
	void __fastcall OpenAsClone(TFIBCustomDataSet* DataSet);
	void __fastcall Clone(TFIBCustomDataSet* DataSet, bool RecreateFields);
	bool __fastcall CanCloneFromDataSet(TFIBCustomDataSet* DataSet);
	AnsiString __fastcall PrimaryKeyFields(const AnsiString TableName);
	int __fastcall FetchNext(unsigned FetchCount);
	void __fastcall ReopenLocate(const AnsiString LocateFieldNames);
	Variant __fastcall AllFieldValues();
	
protected:
	void __fastcall InternalFullRefresh(bool NeedResync = true, bool ReopenRefreshSQL = true);
	
public:
	void __fastcall FullRefresh(void);
	__property int CacheSize = {read=GetCacheSize, nodefault};
	__property Ibase::PISC_DB_HANDLE DBHandle = {read=GetDBHandle};
	__property Ibase::PISC_TR_HANDLE TRHandle = {read=GetTRHandle};
	__property bool AllFetched = {read=GetAllFetched, nodefault};
	__property int WaitEndMasterInterval = {read=FWaitEndMasterInterval, write=FWaitEndMasterInterval, nodefault};
	__property bool WaitEndMasterScroll = {read=GetWaitEndMasterScroll, write=SetWaitEndMasterScroll, nodefault};
	__property int CountUpdatesPending = {read=FCountUpdatesPending, nodefault};
	int __fastcall ParamCount(void);
	AnsiString __fastcall ParamName(int ParamIndex);
	int __fastcall FieldsCount(void);
	AnsiString __fastcall FieldName(int FieldIndex);
	bool __fastcall FieldExist(const AnsiString FieldName, int &FieldIndex);
	bool __fastcall ParamExist(const AnsiString ParamName, int &ParamIndex);
	Variant __fastcall FieldValue(const AnsiString FieldName, bool Old)/* overload */;
	Variant __fastcall FieldValue(const int FieldIndex, bool Old)/* overload */;
	Variant __fastcall ParamValue(const AnsiString ParamName)/* overload */;
	Variant __fastcall ParamValue(const int ParamIndex)/* overload */;
	void __fastcall SetParamValue(const int ParamIndex, const Variant &aValue);
	bool __fastcall IEof(void);
	void __fastcall INext(void);
	__property Fibdatabase::TFIBTransaction* Transaction = {read=GetTransaction, write=SetTransaction};
	__property Fibdatabase::TFIBDatabase* Database = {read=GetDatabase, write=SetDatabase};
	__property TOnFetchRecord BeforeFetchRecord = {read=FBeforeFetchRecord, write=SetBeforeFetchRecord};
	__property TOnFetchRecord AfterFetchRecord = {read=FAfterFetchRecord, write=FAfterFetchRecord};
	__property Db::TDataSetErrorEvent OnGetRecordError = {read=FOnGetRecordError, write=FOnGetRecordError};
	__property Pfibprops::TpFIBDsOptions Options = {read=FOptions, write=SetOptions, stored=false, nodefault};
	__property Pfibprops::TFieldOriginRule FieldOriginRule = {read=FFieldOriginRule, write=FFieldOriginRule, default=1};
	__property Pfibprops::TDetailConditions DetailConditions = {read=GetDetailConditions, write=SetDetailConditions, stored=false, nodefault};
	__property Fibdatabase::TFIBTransaction* UpdateTransaction = {read=GetUpdateTransaction, write=SetUpdateTransaction, stored=StoreUpdTransaction};
	__property Pfibprops::TpPrepareOptions PrepareOptions = {read=FPrepareOptions, write=SetPrepareOptions, stored=false, nodefault};
	__property bool AutoCommit = {read=FAutoCommit, write=FAutoCommit, default=0};
	__property Db::TFieldNotifyEvent OnFieldChange = {read=FOnFieldChange, write=FOnFieldChange};
	__property Db::TDataSetNotifyEvent OnEnableControls = {read=FOnEnableControls, write=FOnEnableControls};
	__property Db::TDataSetNotifyEvent OnDisableControls = {read=FOnDisableControls, write=FOnDisableControls};
	__property Db::TDataSetNotifyEvent OnEndScroll = {read=FOnEndScroll, write=SetOnEndScroll};
	__property TOnFillClientBlob OnFillClientBlob = {read=FOnFillClientBlob, write=FOnFillClientBlob};
	__property Controls::TCursor SQLScreenCursor = {read=FSQLScreenCursor, write=FSQLScreenCursor, default=0};
	__property Pfibprops::TSQLs* SQLs = {read=FSQLs, write=FSQLs, stored=false};
	__property TTransactionKind RefreshTransactionKind = {read=FRefreshTransactionKind, write=SetRefreshTransactionKind, default=0};
	__property Classes::TNotifyEvent BeforeStartTransaction = {read=FBeforeStartTr, write=FBeforeStartTr};
	__property Classes::TNotifyEvent AfterStartTransaction = {read=FAfterStartTr, write=FAfterStartTr};
	__property Fibdatabase::TEndTrEvent BeforeEndTransaction = {read=FBeforeEndTr, write=FBeforeEndTr};
	__property Fibdatabase::TEndTrEvent AfterEndTransaction = {read=FAfterEndTr, write=FAfterEndTr};
	__property Classes::TNotifyEvent BeforeStartUpdateTransaction = {read=FBeforeStartUpdTr, write=FBeforeStartUpdTr};
	__property Classes::TNotifyEvent AfterStartUpdateTransaction = {read=FAfterStartUpdTr, write=FAfterStartUpdTr};
	__property Fibdatabase::TEndTrEvent BeforeEndUpdateTransaction = {read=FBeforeEndUpdTr, write=FBeforeEndUpdTr};
	__property Fibdatabase::TEndTrEvent AfterEndUpdateTransaction = {read=FAfterEndUpdTr, write=FAfterEndUpdTr};
	__property TUpdateKinds AllowedUpdateKinds = {read=FAllowedUpdateKinds, write=FAllowedUpdateKinds, default=7};
	
/* Hoisted overloads: */
	
protected:
	inline void __fastcall  SetFieldData(Db::TField* Field, void * Buffer, bool NativeFormat){ TDataSet::SetFieldData(Field, Buffer, NativeFormat); }
	
public:
	inline bool __fastcall  GetFieldData(int FieldNo, void * Buffer){ return TDataSet::GetFieldData(FieldNo, Buffer); }
	inline bool __fastcall  GetFieldData(Db::TField* Field, void * Buffer, bool NativeFormat){ return TDataSet::GetFieldData(Field, Buffer, NativeFormat); }
	
private:
	void *__ISQLObject;	/* Pfibinterfaces::ISQLObject */
	
public:
	operator ISQLObject*(void) { return (ISQLObject*)&__ISQLObject; }
	
};


class PASCALIMPLEMENTATION TFIBDataLink : public Db::TDetailDataLink 
{
	typedef Db::TDetailDataLink inherited;
	
protected:
	TFIBCustomDataSet* FDataSet;
	virtual void __fastcall ActiveChanged(void);
	virtual void __fastcall RecordChanged(Db::TField* Field);
	virtual void __fastcall CheckBrowseMode(void);
	virtual void __fastcall DataSetChanged(void);
	virtual Db::TDataSet* __fastcall GetDetailDataSet(void);
	
public:
	__fastcall TFIBDataLink(TFIBCustomDataSet* ADataSet);
	__fastcall virtual ~TFIBDataLink(void);
};


struct TFIBBookmark
{
	
public:
	int bRecordNumber;
	int bActiveRecord;
} ;

typedef TFIBBookmark *PFIBBookMark;

struct TRecordsPartition
{
	
public:
	int BeginPartRecordNo;
	int EndPartRecordNo;
	bool IncludeBof;
	bool IncludeEof;
} ;

class DELPHICLASS TFIBDataSet;
class PASCALIMPLEMENTATION TFIBDataSet : public TFIBCustomDataSet 
{
	typedef TFIBCustomDataSet inherited;
	
private:
	bool __fastcall DoStoreActive(void);
	
public:
	__property Params ;
	__property Prepared ;
	__property QDelete ;
	__property QInsert ;
	__property QRefresh ;
	__property QSelect ;
	__property QUpdate ;
	__property StatementType ;
	__property UpdatesPending ;
	__property Bof ;
	__property Bookmark ;
	__property Designer ;
	__property Eof ;
	__property FieldCount ;
	__property FieldDefs ;
	__property Fields ;
	__property FieldValues ;
	__property Modified ;
	__property RecordCount ;
	__property State ;
	__property BufferChunks ;
	
__published:
	__property CachedUpdates  = {default=0};
	__property UniDirectional  = {default=0};
	__property UpdateRecordTypes  = {default=7};
	__property UpdateSQL ;
	__property DeleteSQL ;
	__property InsertSQL ;
	__property RefreshSQL ;
	__property SelectSQL ;
	__property Filter ;
	__property FilterOptions  = {default=0};
	__property CacheModelOptions ;
	__property DatabaseDisconnecting ;
	__property DatabaseDisconnected ;
	__property DatabaseFree ;
	__property OnUpdateError ;
	__property OnUpdateRecord ;
	__property AfterUpdateRecord ;
	__property TransactionEnding ;
	__property TransactionEnded ;
	__property TransactionFree ;
	__property AutoUpdateOptions ;
	__property Conditions ;
	__property Active  = {stored=DoStoreActive, default=0};
	__property AutoCalcFields  = {default=1};
	__property AfterCancel ;
	__property AfterClose ;
	__property AfterDelete ;
	__property AfterEdit ;
	__property AfterInsert ;
	__property AfterOpen ;
	__property AfterPost ;
	__property AfterScroll ;
	__property BeforeCancel ;
	__property BeforeClose ;
	__property BeforeDelete ;
	__property BeforeEdit ;
	__property BeforeInsert ;
	__property BeforeOpen ;
	__property BeforePost ;
	__property BeforeScroll ;
	__property OnCalcFields ;
	__property OnDeleteError ;
	__property OnEditError ;
	__property OnNewRecord ;
	__property OnPostError ;
	__property BeforeRefresh ;
	__property AfterRefresh ;
	__property AllowedUpdateKinds  = {default=7};
	__property Transaction ;
	__property Database ;
	__property BeforeFetchRecord ;
	__property AfterFetchRecord ;
	__property OnGetRecordError ;
	__property Options ;
	__property DetailConditions ;
	__property UpdateTransaction ;
	__property PrepareOptions ;
	__property FieldOriginRule  = {default=1};
	__property AutoCommit  = {default=0};
	__property OnFieldChange ;
	__property OnEnableControls ;
	__property OnDisableControls ;
	__property OnEndScroll ;
	__property OnFillClientBlob ;
	__property SQLScreenCursor  = {default=0};
	__property SQLs ;
	__property RefreshTransactionKind  = {default=0};
	__property BeforeStartTransaction ;
	__property AfterStartTransaction ;
	__property BeforeEndTransaction ;
	__property AfterEndTransaction ;
	__property BeforeStartUpdateTransaction ;
	__property AfterStartUpdateTransaction ;
	__property BeforeEndUpdateTransaction ;
	__property AfterEndUpdateTransaction ;
	__property DataSource  = {read=GetDataSource, write=SetDataSource};
public:
	#pragma option push -w-inl
	/* TFIBCustomDataSet.Create */ inline __fastcall virtual TFIBDataSet(Classes::TComponent* AOwner) : TFIBCustomDataSet(AOwner) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TFIBCustomDataSet.Destroy */ inline __fastcall virtual ~TFIBDataSet(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFIBDSBlobStream;
class PASCALIMPLEMENTATION TFIBDSBlobStream : public Classes::TStream 
{
	typedef Classes::TStream inherited;
	
protected:
	TBlobDataArray *FBlobDataArray;
	Ibase::TGDS_QUAD FBlobID;
	bool FModified;
	Db::TField* FField;
	Fibmiscellaneous::TFIBBlobStream* FBlobStream;
	
public:
	__fastcall TFIBDSBlobStream(Db::TField* AField, Fibmiscellaneous::TFIBBlobStream* ABlobStream, Db::TBlobStreamMode Mode, const Ibase::TGDS_QUAD &ABlobID, PBlobDataArray aBlobDataArray);
	__fastcall virtual ~TFIBDSBlobStream(void);
	virtual int __fastcall Read(void *Buffer, int Count);
	virtual int __fastcall Seek(int Offset, Word Origin)/* overload */;
	virtual void __fastcall SetSize(int NewSize)/* overload */;
	virtual int __fastcall Write(const void *Buffer, int Count);
	
/* Hoisted overloads: */
	
public:
	inline __int64 __fastcall  Seek(const __int64 Offset, Classes::TSeekOrigin Origin){ return TStream::Seek(Offset, Origin); }
	
protected:
	inline void __fastcall  SetSize(const __int64 NewSize){ TStream::SetSize(NewSize); }
	
};


#pragma option push -b-
enum TFIBFilterType { ftByField, ftCopy };
#pragma option pop

//-- var, const, procedure ---------------------------------------------------
static const Shortint vBufferCacheSize = 0x20;
static const Shortint vMinBufferChunksForLimCache = 0x64;
extern PACKAGE TMetaClass* DefaultFieldClasses[22];
#define SNoAction "No Action"
extern PACKAGE void __fastcall Register(void);
extern PACKAGE bool __fastcall IsDBKeyField(System::TObject* Field);
extern PACKAGE TExtLocateOptions __fastcall LocateOptionsToExtLocateOptions(Db::TLocateOptions LocateOptions);
extern PACKAGE int __fastcall RecordDataLength(int n);
extern PACKAGE void __fastcall FilterOut(TFIBCustomDataSet* FromDS);
extern PACKAGE void __fastcall Sort(TFIBCustomDataSet* DataSet, System::TVarRec * aFields, const int aFields_Size, bool * Ordering, const int Ordering_Size);

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

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