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

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

#ifndef SibeabaseHPP
#define SibeabaseHPP

#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 <Windows.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Syncobjs.hpp>	// Pascal unit
#include <Sibglobals.hpp>	// Pascal unit
#include <Sibapi.hpp>	// Pascal unit
#include <Ibase.hpp>	// Pascal unit
#include <Ib_intf.hpp>	// Pascal unit
#include <Ib_externals.hpp>	// Pascal unit

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

namespace Sibeabase
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TSIBAlertEvent)(System::TObject* Sender, AnsiString EventName, int EventCount);

class DELPHICLASS TSIBEventAlerter;
class PASCALIMPLEMENTATION TSIBEventAlerter : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
protected:
	Ib_intf::_di_IIBClientLibrary FClientLibrary;
	TSIBAlertEvent FOnEventAlert;
	Classes::TStrings* FEvents;
	Classes::TList* FThreads;
	void * *FNativeHandle;
	Classes::TThread* SleeperThread;
	bool ThreadException;
	void __fastcall SetEvents(Classes::TStrings* Value);
	bool __fastcall GetRegistered(void);
	void __fastcall SetRegistered(const bool Value);
	virtual void __fastcall SetNativeHandle(const Sibapi::SIB_PVoid Value);
	virtual Sibapi::SIB_PVoid __fastcall GetNativeHandle(void);
	virtual void __fastcall EventChange(System::TObject* Sender);
	virtual void __fastcall ThreadEnded(System::TObject* Sender);
	
public:
	__fastcall virtual TSIBEventAlerter(Classes::TComponent* Owner);
	__fastcall virtual ~TSIBEventAlerter(void);
	virtual void __fastcall RegisterEvents(void);
	virtual void __fastcall UnRegisterEvents(void);
	__property Sibapi::SIB_PVoid NativeHandle = {read=GetNativeHandle, write=SetNativeHandle};
	__property bool Registered = {read=GetRegistered, write=SetRegistered, nodefault};
	
__published:
	__property Classes::TStrings* Events = {read=FEvents, write=SetEvents};
	__property TSIBAlertEvent OnEventAlert = {read=FOnEventAlert, write=FOnEventAlert};
};


class DELPHICLASS TSIBEventThread;
class PASCALIMPLEMENTATION TSIBEventThread : public Classes::TThread 
{
	typedef Classes::TThread inherited;
	
private:
	Ib_intf::_di_IIBClientLibrary FClientLibrary;
	int WhichEvent;
	char *ErrorBuffer;
	Sibapi::SIB_StatusVector *ErrorVector;
	int StatusVector[20];
	int ResultStatus;
	int EventID;
	void * *DB;
	char *EventBuffer;
	int EventBufferLen;
	char *ResultBuffer;
	Syncobjs::TSimpleEvent* Signal;
	bool EventsReceived;
	bool FirstTime;
	int EventGroup;
	int EventCount;
	TSIBEventAlerter* Parent;
	System::TObject* FExceptObject;
	void *FExceptAddr;
	
protected:
	virtual void __fastcall Execute(void);
	virtual void __fastcall SignalEvent(void);
	virtual void __fastcall SignalTerminate(void);
	virtual void __fastcall RegisterEvents(void);
	virtual void __fastcall UnRegisterEvents(void);
	virtual void __fastcall QueueEvents(void);
	virtual void __fastcall ProcessEvents(void);
	virtual AnsiString __fastcall GetIBErrorString();
	virtual void __fastcall SIBQueEvents(void);
	virtual void __fastcall SIBInterpretError(void);
	virtual void __fastcall SIBEventCounts(void);
	virtual void __fastcall SIBFree(void);
	virtual void __fastcall SIBCancelEvents(void);
	virtual void __fastcall SIBEventBlock(void);
	virtual void __fastcall DoEvent(void);
	virtual void __fastcall DoHandleException(void);
	virtual bool __fastcall HandleException(void);
	virtual void __fastcall UpdateResultBuffer(Word Length, char * Updated);
	
public:
	__fastcall virtual TSIBEventThread(Ib_intf::_di_IIBClientLibrary ClientLibrary, TSIBEventAlerter* Owner, Sibapi::SIB_PVoid DBHandle, int EventGrp, Classes::TNotifyEvent TermEvent);
	__fastcall virtual ~TSIBEventThread(void);
};


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

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

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