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

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

#ifndef InthreadcomponentHPP
#define InthreadcomponentHPP

#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 <Classes.hpp>	// Pascal unit
#include <Inbasecomponent.hpp>	// Pascal unit
#include <Inexception.hpp>	// Pascal unit
#include <Inglobal.hpp>	// Pascal unit
#include <Inthread.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit

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

namespace Inthreadcomponent
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TInThreadComponent;
typedef void __fastcall (__closure *TInExceptionThreadComponentEvent)(TInThreadComponent* Sender, Sysutils::Exception* AException);

typedef void __fastcall (__closure *TInExceptionThreadComponentEventEx)(TInThreadComponent* Sender, Sysutils::Exception* AException, bool &VHandled);

typedef void __fastcall (__closure *TIdNotifyThreadComponentEvent)(TInThreadComponent* Sender);

class PASCALIMPLEMENTATION TInThreadComponent : public Inbasecomponent::TInBaseComponent 
{
	typedef Inbasecomponent::TInBaseComponent inherited;
	
protected:
	bool FActive;
	bool FLoop;
	Classes::TThreadPriority FPriority;
	Inthread::TInThreadStopMode FStopMode;
	Inthread::TInThread* FThread;
	AnsiString FThreadName;
	TIdNotifyThreadComponentEvent FOnAfterExecute;
	TIdNotifyThreadComponentEvent FOnAfterRun;
	TIdNotifyThreadComponentEvent FOnBeforeExecute;
	TIdNotifyThreadComponentEvent FOnBeforeRun;
	TIdNotifyThreadComponentEvent FOnCleanup;
	TInExceptionThreadComponentEvent FOnException;
	TIdNotifyThreadComponentEvent FOnRun;
	TIdNotifyThreadComponentEvent FOnStopped;
	TIdNotifyThreadComponentEvent FOnTerminate;
	TInExceptionThreadComponentEventEx FOnHandleRunException;
	virtual void __fastcall DoAfterExecute(void);
	virtual void __fastcall DoAfterRun(void);
	virtual void __fastcall DoBeforeExecute(void);
	virtual void __fastcall DoBeforeRun(void);
	virtual void __fastcall DoCleanup(void);
	virtual void __fastcall DoException(Inthread::TInThread* AThread, Sysutils::Exception* AException);
	virtual bool __fastcall DoHandleRunException(Sysutils::Exception* AException);
	virtual void __fastcall DoRun(void);
	virtual void __fastcall DoStopped(Inthread::TInThread* AThread);
	virtual void __fastcall DoTerminate(System::TObject* Sender);
	bool __fastcall GetActive(void);
	System::TObject* __fastcall GetData(void);
	unsigned __fastcall GetHandle(void);
	Classes::TThreadPriority __fastcall GetPriority(void);
	int __fastcall GetReturnValue(void);
	Inthread::TInThreadStopMode __fastcall GetStopMode(void);
	bool __fastcall GetStopped(void);
	bool __fastcall GetSuspended(void);
	AnsiString __fastcall GetTerminatingException();
	TMetaClass* __fastcall GetTerminatingExceptionClass(void);
	bool __fastcall GetTerminated(void);
	virtual void __fastcall InitComponent(void);
	bool __fastcall IsRunning(void);
	virtual void __fastcall Loaded(void);
	virtual void __fastcall SetActive(const bool AValue);
	void __fastcall SetData(const System::TObject* AValue);
	void __fastcall SetLoop(const bool AValue);
	void __fastcall SetThreadName(const AnsiString AValue);
	void __fastcall SetOnTerminate(const TIdNotifyThreadComponentEvent AValue);
	void __fastcall SetPriority(const Classes::TThreadPriority AValue);
	void __fastcall SetReturnValue(const int AValue);
	void __fastcall SetStopMode(const Inthread::TInThreadStopMode AValue);
	
public:
	__fastcall virtual ~TInThreadComponent(void);
	virtual void __fastcall Start(void);
	virtual void __fastcall Stop(void);
	void __fastcall Synchronize(Classes::TThreadMethod AMethod);
	virtual void __fastcall Terminate(void);
	virtual void __fastcall TerminateAndWaitFor(void);
	unsigned __fastcall WaitFor(void);
	__property System::TObject* Data = {read=GetData, write=SetData};
	__property unsigned Handle = {read=GetHandle, nodefault};
	__property int ReturnValue = {read=GetReturnValue, write=SetReturnValue, nodefault};
	__property bool Stopped = {read=GetStopped, nodefault};
	__property bool Suspended = {read=GetSuspended, nodefault};
	__property AnsiString TerminatingException = {read=GetTerminatingException};
	__property TMetaClass* TerminatingExceptionClass = {read=GetTerminatingExceptionClass};
	__property bool Terminated = {read=GetTerminated, nodefault};
	
__published:
	__property bool Active = {read=GetActive, write=SetActive, nodefault};
	__property bool Loop = {read=FLoop, write=SetLoop, nodefault};
	__property Classes::TThreadPriority Priority = {read=GetPriority, write=SetPriority, nodefault};
	__property Inthread::TInThreadStopMode StopMode = {read=GetStopMode, write=SetStopMode, nodefault};
	__property AnsiString ThreadName = {read=FThreadName, write=SetThreadName};
	__property TIdNotifyThreadComponentEvent OnAfterExecute = {read=FOnAfterExecute, write=FOnAfterExecute};
	__property TIdNotifyThreadComponentEvent OnAfterRun = {read=FOnAfterRun, write=FOnAfterRun};
	__property TIdNotifyThreadComponentEvent OnBeforeExecute = {read=FOnBeforeExecute, write=FOnBeforeExecute};
	__property TIdNotifyThreadComponentEvent OnBeforeRun = {read=FOnBeforeRun, write=FOnBeforeRun};
	__property TIdNotifyThreadComponentEvent OnCleanup = {read=FOnCleanup, write=FOnCleanup};
	__property TInExceptionThreadComponentEvent OnException = {read=FOnException, write=FOnException};
	__property TInExceptionThreadComponentEventEx OnHandleRunException = {read=FOnHandleRunException, write=FOnHandleRunException};
	__property TIdNotifyThreadComponentEvent OnRun = {read=FOnRun, write=FOnRun};
	__property TIdNotifyThreadComponentEvent OnStopped = {read=FOnStopped, write=FOnStopped};
	__property TIdNotifyThreadComponentEvent OnTerminate = {read=FOnTerminate, write=SetOnTerminate};
public:
	#pragma option push -w-inl
	/* TInBaseComponent.Create */ inline __fastcall TInThreadComponent(Classes::TComponent* AOwner)/* overload */ : Inbasecomponent::TInBaseComponent(AOwner) { }
	#pragma option pop
	
};


class DELPHICLASS TInThreadEx;
class PASCALIMPLEMENTATION TInThreadEx : public Inthread::TInThread 
{
	typedef Inthread::TInThread inherited;
	
protected:
	TInThreadComponent* FThreadComponent;
	virtual void __fastcall AfterRun(void);
	virtual void __fastcall AfterExecute(void);
	virtual void __fastcall BeforeExecute(void);
	virtual void __fastcall BeforeRun(void);
	virtual void __fastcall Cleanup(void);
	virtual bool __fastcall HandleRunException(Sysutils::Exception* AException);
	virtual void __fastcall Run(void);
	
public:
	__fastcall TInThreadEx(TInThreadComponent* AThreadComponent);
public:
	#pragma option push -w-inl
	/* TInThread.Destroy */ inline __fastcall virtual ~TInThreadEx(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
#define InThreadComponentDefaultPriority (Classes::TThreadPriority)(3)
#define InThreadComponentDefaultStopMode (Inthread::TInThreadStopMode)(0)

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

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