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

// (DO NOT EDIT: machine generated header) 'ABSLocalEngine.pas' rev: 35.00 (Windows)

#ifndef AbslocalengineHPP
#define AbslocalengineHPP

#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>
#include <SysInit.hpp>
#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <Winapi.Windows.hpp>
#include <ABSRelationalAlgebra.hpp>
#include <ABSExcept.hpp>
#include <ABSBase.hpp>
#include <ABSBaseEngine.hpp>
#include <ABSMemEngine.hpp>
#include <ABSTempEngine.hpp>
#include <ABSDiskEngine.hpp>
#include <ABSConverts.hpp>
#include <ABSVariant.hpp>
#include <ABSCompression.hpp>
#include <ABSSecurity.hpp>
#include <ABSTypes.hpp>
#include <ABSSQLProcessor.hpp>
#include <ABSExpressions.hpp>
#include <ABSConst.hpp>
#include <ABSMemory.hpp>

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

namespace Abslocalengine
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TABSLocalBLOBStream;
class DELPHICLASS TABSLocalSQLProcessor;
class DELPHICLASS TABSLocalCursor;
class DELPHICLASS TABSLocalSession;
//-- type declarations -------------------------------------------------------
class PASCALIMPLEMENTATION TABSLocalBLOBStream : public Abscompression::TABSStream
{
	typedef Abscompression::TABSStream inherited;
	
private:
	Abstypes::TABSBLOBOpenMode FOpenMode;
	Abscompression::TABSStream* FTemporaryStream;
	Abscompression::TABSStream* FUserBLOBStream;
	int FFieldNo;
	Absbase::TABSCursor* FCursor;
	__int64 FPosition;
	
protected:
	void __fastcall InternalSetSize(const __int64 NewSize);
	virtual void __fastcall SetSize(int NewSize)/* overload */;
	virtual void __fastcall SetSize(const __int64 NewSize)/* overload */;
	
public:
	virtual int __fastcall Read(void *Buffer, int Count)/* overload */;
	virtual int __fastcall Write(const void *Buffer, int Count)/* overload */;
	virtual int __fastcall Seek(int Offset, System::Word Origin)/* overload */;
	virtual __int64 __fastcall Seek(const __int64 Offset, System::Classes::TSeekOrigin Origin)/* overload */;
	__fastcall TABSLocalBLOBStream(Abscompression::TABSStream* TemporaryStream, Absbase::TABSCursor* Cursor, Abstypes::TABSBLOBOpenMode OpenMode, int FieldNo);
	__fastcall virtual ~TABSLocalBLOBStream();
	__property Absbase::TABSCursor* Cursor = {read=FCursor};
	__property int FieldNo = {read=FFieldNo, nodefault};
	__property Abstypes::TABSBLOBOpenMode OpenMode = {read=FOpenMode, write=FOpenMode, nodefault};
	__property Abscompression::TABSStream* TemporaryStream = {read=FTemporaryStream, write=FTemporaryStream};
	__property Abscompression::TABSStream* UserBLOBStream = {read=FUserBLOBStream, write=FUserBLOBStream};
	/* Hoisted overloads: */
	
public:
	inline int __fastcall  Read(System::TArray__1<System::Byte> Buffer, int Offset, int Count){ return System::Classes::TStream::Read(Buffer, Offset, Count); }
	inline int __fastcall  Read(System::TArray__1<System::Byte> &Buffer, int Count){ return System::Classes::TStream::Read(Buffer, Count); }
	inline int __fastcall  Write(const System::TArray__1<System::Byte> Buffer, int Offset, int Count){ return System::Classes::TStream::Write(Buffer, Offset, Count); }
	inline int __fastcall  Write(const System::TArray__1<System::Byte> Buffer, int Count){ return System::Classes::TStream::Write(Buffer, Count); }
	inline __int64 __fastcall  Seek(const __int64 Offset, System::Word Origin){ return System::Classes::TStream::Seek(Offset, Origin); }
	
};


class PASCALIMPLEMENTATION TABSLocalSQLProcessor : public Abssqlprocessor::TABSSQLProcessor
{
	typedef Abssqlprocessor::TABSSQLProcessor inherited;
	
public:
	/* TABSSQLProcessor.Create */ inline __fastcall TABSLocalSQLProcessor(Data::Db::TDataSet* Query) : Abssqlprocessor::TABSSQLProcessor(Query) { }
	/* TABSSQLProcessor.Destroy */ inline __fastcall virtual ~TABSLocalSQLProcessor() { }
	
};


class PASCALIMPLEMENTATION TABSLocalCursor : public Absbase::TABSCursor
{
	typedef Absbase::TABSCursor inherited;
	
private:
	Absbaseengine::TABSTableData* FTableData;
	Absbaseengine::TABSDatabaseData* FDatabaseData;
	
public:
	__fastcall TABSLocalCursor();
	__fastcall virtual ~TABSLocalCursor();
	virtual void __fastcall CreateTable(Absbase::TABSFieldDefs* FieldDefs, Absbase::TABSIndexDefs* IndexDefs, Absbase::TABSConstraintDefs* ConstraintDefs);
	virtual void __fastcall DeleteTable();
	virtual void __fastcall EmptyTable();
	virtual void __fastcall RenameTable(System::UnicodeString NewTableName);
	virtual void __fastcall InternalInitFieldDefs();
	virtual void __fastcall OpenTableByFieldDefs(Absbase::TABSFieldDefs* FieldDefs, Absbase::TABSIndexDefs* IndexDefs, Absbase::TABSConstraintDefs* ConstraintDefs);
	void __fastcall OpenTable(Absbaseengine::TABSTableData* aTableData);
	virtual void __fastcall CloseTable();
	virtual void __fastcall LockTableData();
	virtual void __fastcall UnlockTableData();
	virtual bool __fastcall LockTable(Abstypes::TABSLockType LockType, int TryCount, int Delay, bool AllowXIRWAfterSIRW = true);
	virtual bool __fastcall UnlockTable(Abstypes::TABSLockType LockType, bool IgnoreIfNoLock = false);
	virtual void __fastcall InternalInitRecord(System::PByte RecordBuffer, bool InsertMode);
	virtual void __fastcall RenameField(System::UnicodeString FieldName, System::UnicodeString NewFieldName);
	virtual void __fastcall CopyFieldValue(int SrcFieldNo, bool DirectAccess, int DestFieldNo, Absbase::TABSCursor* DestCursor);
	virtual Absbase::TABSIndexDefs* __fastcall GetIndexDefs();
	virtual void __fastcall AddIndex(Absbase::TABSIndexDef* IndexDef);
	virtual void __fastcall DeleteIndex(System::UnicodeString Name);
	virtual void __fastcall DeleteAllIndexes();
	virtual System::UnicodeString __fastcall FindOrCreateIndex(System::Classes::TStringList* FieldNamesList, System::Classes::TStringList* AscDescList, System::Classes::TStringList* CaseSensitivityList, bool &IsCreated);
	virtual bool __fastcall IndexExists(System::Classes::TStringList* FieldNamesList, System::Classes::TStringList* AscDescList, System::Classes::TStringList* CaseSensitivityList);
	virtual void __fastcall FreeRecordBuffer(System::PByte &Buffer);
	virtual Abstypes::TABSGetRecordResult __fastcall GetRecordBuffer(Abstypes::TABSGetRecordMode GetRecordMode);
	virtual __int64 __fastcall GetRecordCount();
	virtual void __fastcall SetRecNo(__int64 Value);
	virtual __int64 __fastcall GetRecNo();
	virtual int __fastcall CompareRecordsOrder(const Abstypes::TABSPageItemID &RecordID1, const Abstypes::TABSPageItemID &RecordID2);
	virtual void __fastcall InternalFirst();
	virtual void __fastcall InternalLast();
	virtual void __fastcall InternalInsert();
	virtual void __fastcall InternalEdit();
	virtual void __fastcall InternalCancel(bool ToInsert);
	virtual void __fastcall InternalPost(bool ToInsert);
	virtual void __fastcall InternalDelete();
	virtual bool __fastcall IsRecordLocked();
	virtual void __fastcall ApplyDistinct(System::Classes::TStringList* FieldNamesList, System::Classes::TStringList* AscDescList, System::Classes::TStringList* CaseSensitivityList);
	virtual void __fastcall ActivateFilters(System::UnicodeString FilterText, bool CaseInsensitive, bool PartialKey);
	virtual void __fastcall DeactivateFilters();
	virtual bool __fastcall Locate(const System::UnicodeString KeyFields, const System::Variant &KeyValues, bool CaseInsensitive, bool PartialKey);
	virtual bool __fastcall FindKey(Abstypes::TABSSearchCondition SearchCondition);
	virtual bool __fastcall IsAnyRecordMatchCondition(const System::UnicodeString FieldName, const Abstypes::TABSDataOperator Operator, Absvariant::TABSVariant* const Value);
	virtual Abscompression::TABSStream* __fastcall InternalCreateBlobStream(bool ToInsert, bool ToEdit, int FieldNo, Abstypes::TABSBLOBOpenMode OpenMode, bool CanDoGetRecordBuffer);
	virtual void __fastcall InternalCloseBLOB(int FieldNo);
	virtual void __fastcall ClearBLOBStreams(bool WriteOnly = false);
	virtual __int64 __fastcall LastAutoincValue(int FieldNo);
	virtual void __fastcall BeginBatchUpdate();
	virtual void __fastcall EndBatchUpdate();
	virtual void __fastcall CancelBatchUpdate();
	virtual bool __fastcall CheckConstraints(bool ToInsert);
	__property Absbaseengine::TABSTableData* TableData = {read=FTableData};
	__property Absbaseengine::TABSDatabaseData* DatabaseData = {read=FDatabaseData};
};


class PASCALIMPLEMENTATION TABSLocalSession : public Absbase::TABSBaseSession
{
	typedef Absbase::TABSBaseSession inherited;
	
private:
	Absbaseengine::TABSDatabaseData* FDatabaseData;
	Abssecurity::TABSPassword FPassword;
	int FPageSize;
	int FPageCountInExtent;
	Abssecurity::PABSPassword __fastcall GetPassword();
	bool __fastcall IsAppropriateDatabaseData(Absbaseengine::TABSDatabaseData* DBData);
	Absbaseengine::TABSDatabaseData* __fastcall FindDatabaseData();
	Absbaseengine::TABSDatabaseData* __fastcall CreateDatabaseData();
	Absbaseengine::TABSDatabaseData* __fastcall FindOrCreateDatabaseData();
	
protected:
	virtual bool __fastcall GetConnected();
	virtual void __fastcall SetConnected(bool Value);
	virtual bool __fastcall GetSuppressDBHeaderErrors();
	virtual void __fastcall SetSuppressDBHeaderErrors(bool Value);
	
public:
	virtual void __fastcall CreateDatabase();
	void __fastcall TruncateDatabase();
	int __fastcall GetDBFileConnectionsCount();
	virtual void __fastcall DeleteDatabase();
	virtual void __fastcall RenameDatabase(System::UnicodeString NewDatabaseFileName);
	virtual void __fastcall GetTablesList(System::Classes::TStrings* List);
	virtual bool __fastcall TableExists(System::UnicodeString TableName);
	virtual void __fastcall StartTransaction();
	virtual void __fastcall Commit(bool DoFlushBuffers = true);
	virtual void __fastcall Rollback();
	virtual void __fastcall FlushBuffers();
	__property Absbaseengine::TABSDatabaseData* DatabaseData = {read=FDatabaseData};
	__property Abssecurity::PABSPassword Password = {read=GetPassword};
	__property int PageSize = {read=FPageSize, write=FPageSize, nodefault};
	__property int PageCountInExtent = {read=FPageCountInExtent, write=FPageCountInExtent, nodefault};
public:
	/* TABSBaseSession.Create */ inline __fastcall TABSLocalSession() : Absbase::TABSBaseSession() { }
	/* TABSBaseSession.Destroy */ inline __fastcall virtual ~TABSLocalSession() { }
	
};


//-- var, const, procedure ---------------------------------------------------
extern DELPHI_PACKAGE System::Classes::TThreadList* DBDataList;
extern DELPHI_PACKAGE bool DoUniqueAndPrimaryKeysCheckOnUpdate;
}	/* namespace Abslocalengine */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_ABSLOCALENGINE)
using namespace Abslocalengine;
#endif
#pragma pack(pop)
#pragma option pop

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