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

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

#ifndef DscontainerHPP
#define DscontainerHPP

#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 <Db.hpp>	// Pascal unit
#include <Pfibdatainfo.hpp>	// Pascal unit

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

namespace Dscontainer
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TKindDataSetEvent { deBeforeOpen, deAfterOpen, deBeforeClose, deAfterClose, deBeforeInsert, deAfterInsert, deBeforeEdit, deAfterEdit, deBeforePost, deAfterPost, deBeforeCancel, deAfterCancel, deBeforeDelete, deAfterDelete, deBeforeScroll, deAfterScroll, deOnNewRecord, deOnCalcFields, deBeforeRefresh, deAfterRefresh };
#pragma option pop

#pragma option push -b-
enum TKindDataSetError { deOnEditError, deOnPostError, deOnDeleteError };
#pragma option pop

typedef void __fastcall (__closure *TOnApplyDefaultValue)(Db::TDataSet* DataSet, Db::TField* Field, bool &Applied);

typedef void __fastcall (__closure *TOnApplyFieldRepository)(Db::TDataSet* DataSet, Db::TField* Field, Pfibdatainfo::TpFIBFieldInfo* FieldInfo);

typedef void __fastcall (__closure *TOnDataSetEvent)(Db::TDataSet* DataSet, TKindDataSetEvent Event);

typedef void __fastcall (__closure *TOnDataSetError)(Db::TDataSet* DataSet, TKindDataSetError Event, Db::EDatabaseError* E, Db::TDataAction &Action);

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

class DELPHICLASS TDataSetsContainer;
class PASCALIMPLEMENTATION TDataSetsContainer : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	bool FActive;
	TDataSetsContainer* FMasterContainer;
	TOnDataSetEvent FOnDataSetEvent;
	TOnApplyDefaultValue FOnApplyDefaultValue;
	TOnApplyFieldRepository FOnApplyFieldRepository;
	TOnDataSetError FOnDataSetError;
	TOnCompareFieldValues FOnCompareFieldValues;
	Classes::TList* vDataSetsList;
	bool FIsGlobalContainer;
	void __fastcall SetMasterContainer(TDataSetsContainer* Value);
	void __fastcall CheckCircularMaster(TDataSetsContainer* Value);
	void __fastcall SetIsGlobalContainer(const bool Value);
	
protected:
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
	
public:
	__fastcall virtual TDataSetsContainer(Classes::TComponent* AOwner);
	__fastcall virtual ~TDataSetsContainer(void);
	void __fastcall AddDataSet(Db::TDataSet* Value);
	void __fastcall RemoveDataSet(Db::TDataSet* Value);
	void __fastcall DataSetEvent(Db::TDataSet* DataSet, TKindDataSetEvent Event);
	void __fastcall DoOnApplyDefaultValue(Db::TDataSet* DataSet, Db::TField* Field, bool &Applied);
	void __fastcall DoOnApplyFieldRepository(Db::TDataSet* DataSet, Db::TField* Field, Pfibdatainfo::TpFIBFieldInfo* FieldInfo);
	void __fastcall DataSetError(Db::TDataSet* DataSet, TKindDataSetError Event, Db::EDatabaseError* E, Db::TDataAction &Action);
	bool __fastcall DataSetCompareFieldValues(Db::TDataSet* DataSet, Db::TField* Field, const Variant &S1, const Variant &S2, int &Res);
	int __fastcall DataSetCount(void);
	Db::TDataSet* __fastcall DataSet(int Index);
	
__published:
	__property bool Active = {read=FActive, write=FActive, default=1};
	__property TOnDataSetEvent OnDataSetEvent = {read=FOnDataSetEvent, write=FOnDataSetEvent};
	__property TOnDataSetError OnDataSetError = {read=FOnDataSetError, write=FOnDataSetError};
	__property TOnApplyDefaultValue OnApplyDefaultValue = {read=FOnApplyDefaultValue, write=FOnApplyDefaultValue};
	__property TOnApplyFieldRepository OnApplyFieldRepository = {read=FOnApplyFieldRepository, write=FOnApplyFieldRepository};
	__property TDataSetsContainer* MasterContainer = {read=FMasterContainer, write=SetMasterContainer};
	__property TOnCompareFieldValues OnCompareFieldValues = {read=FOnCompareFieldValues, write=FOnCompareFieldValues};
	__property bool IsGlobalContainer = {read=FIsGlobalContainer, write=SetIsGlobalContainer, default=0};
};


//-- var, const, procedure ---------------------------------------------------
extern PACKAGE TDataSetsContainer* __fastcall GlobalContainer(void);

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

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