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

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

#ifndef PfiberrorhandlerHPP
#define PfiberrorhandlerHPP

#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 <Classes.hpp>	// Pascal unit
#include <Fib.hpp>	// Pascal unit
#include <Fibdatabase.hpp>	// Pascal unit
#include <Pfibdatabase.hpp>	// Pascal unit
#include <Ib_errorcodes.hpp>	// Pascal unit
#include <Ibase.hpp>	// Pascal unit
#include <Ib_intf.hpp>	// Pascal unit
#include <Ib_externals.hpp>	// Pascal unit
#include <Db.hpp>	// Pascal unit
#include <Pfibdatainfo.hpp>	// Pascal unit
#include <Fibquery.hpp>	// Pascal unit

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

namespace Pfiberrorhandler
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TOptionErrorHandler { oeException, oeForeignKey, oeLostConnect, oeCheck, oeUniqueViolation };
#pragma option pop

#pragma option push -b-
enum TKindIBError { keNoError, keException, keForeignKey, keLostConnect, keSecurity, keCheck, keUniqueViolation, keOther };
#pragma option pop

typedef void __fastcall (__closure *TOnFIBErrorEvent)(System::TObject* Sender, Fib::EFIBError* ErrorValue, TKindIBError KindIBError, bool &DoRaise);

typedef Set<TOptionErrorHandler, oeException, oeUniqueViolation>  TOptionsErrorHandler;

class DELPHICLASS TErrorLexems;
class PASCALIMPLEMENTATION TErrorLexems : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	AnsiString FConstraint;
	AnsiString FIndex;
	AnsiString FException;
	AnsiString FAt;
	bool __fastcall StoredConstraintProp(void);
	bool __fastcall StoredIndexProp(void);
	bool __fastcall StoredExceptionProp(void);
	bool __fastcall StoredAtProp(void);
	
public:
	__fastcall TErrorLexems(void);
	
__published:
	__property AnsiString Constraint = {read=FConstraint, write=FConstraint, stored=StoredConstraintProp};
	__property AnsiString Index = {read=FIndex, write=FIndex, stored=StoredIndexProp};
	__property AnsiString Exception = {read=FException, write=FException, stored=StoredExceptionProp};
	__property AnsiString At = {read=FAt, write=FAt, stored=StoredAtProp};
public:
	#pragma option push -w-inl
	/* TPersistent.Destroy */ inline __fastcall virtual ~TErrorLexems(void) { }
	#pragma option pop
	
};


class DELPHICLASS TpFibErrorHandler;
class PASCALIMPLEMENTATION TpFibErrorHandler : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	TKindIBError FLastError;
	TOnFIBErrorEvent FOnFIBErrorEvent;
	TOptionsErrorHandler FOptions;
	int FExceptionNumber;
	AnsiString FConstraintName;
	AnsiString FExceptionName;
	TErrorLexems* FErrorLexems;
	void __fastcall DefaultOnError(System::TObject* Sender, Fib::EFIBError* ErrorValue, bool &DoRaise);
	AnsiString __fastcall GetConstraintName(const AnsiString Msg);
	Fibdatabase::TFIBTransaction* __fastcall GetTr(System::TObject* Sender);
	void __fastcall SetErrorLexems(const TErrorLexems* Value);
	
public:
	__fastcall virtual TpFibErrorHandler(Classes::TComponent* AOwner);
	__fastcall virtual ~TpFibErrorHandler(void);
	DYNAMIC void __fastcall DoOnErrorEvent(System::TObject* Sender, Fib::EFIBError* ErrorValue, bool &DoRaise);
	void __fastcall DoOnLostConnect(Fibdatabase::TFIBDatabase* DataBase, Fib::EFIBError* ErrorValue);
	__property int ExceptionNumber = {read=FExceptionNumber, nodefault};
	__property TKindIBError LastError = {read=FLastError, nodefault};
	__property AnsiString ConstraintName = {read=FConstraintName};
	__property AnsiString ExceptionName = {read=FExceptionName};
	
__published:
	__property TOnFIBErrorEvent OnFIBErrorEvent = {read=FOnFIBErrorEvent, write=FOnFIBErrorEvent};
	__property TOptionsErrorHandler Options = {read=FOptions, write=FOptions, default=5};
	__property TErrorLexems* ErrorLexems = {read=FErrorLexems, write=SetErrorLexems};
};


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

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

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