// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'AHMTScheduler.pas' rev: 4.00

#ifndef AHMTSchedulerHPP
#define AHMTSchedulerHPP

#pragma delphiheader begin
#pragma option push -w-
#include <AHMSystemConst.hpp>	// Pascal unit
#include <AHMSystemClass.hpp>	// Pascal unit
#include <Dialogs.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

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

namespace Ahmtscheduler
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TAHMTriggerDaysGroup { Mon, Tue, Wed, Thu, Fri, Sat, Sun };
#pragma option pop

typedef Set<TAHMTriggerDaysGroup, Mon, Sun>  TAHMTriggerDays;

typedef void __fastcall (__closure *TAHMOnTrigger)(System::TObject* Sender, const AnsiString ScheduleID
	, bool &Active);

class DELPHICLASS TAHMScheduledTimerThread;
class DELPHICLASS TAHMScheduledTimer;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TAHMScheduledTimer : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	bool FEnabled;
	Word FInterval;
	Classes::TNotifyEvent FOnTimer;
	TAHMScheduledTimerThread* FTimerThread;
	Classes::TThreadPriority FThreadPriority;
	void __fastcall SetEnabled(const bool Value);
	void __fastcall SetInterval(const Word Value);
	void __fastcall SetThreadPriority(const Classes::TThreadPriority Value);
	
protected:
	void __fastcall UpdateTimer(void);
	DYNAMIC void __fastcall Timer(void);
	
public:
	__fastcall virtual TAHMScheduledTimer(void);
	__fastcall virtual ~TAHMScheduledTimer(void);
	
__published:
	__property bool Enabled = {read=FEnabled, write=SetEnabled, nodefault};
	__property Word Interval = {read=FInterval, write=SetInterval, default=200};
	__property Classes::TNotifyEvent OnTimer = {read=FOnTimer, write=FOnTimer};
	__property Classes::TThreadPriority Priority = {read=FThreadPriority, write=SetThreadPriority, nodefault
		};
};

#pragma pack(pop)

#pragma pack(push, 4)
class PASCALIMPLEMENTATION TAHMScheduledTimerThread : public Classes::TThread 
{
	typedef Classes::TThread inherited;
	
public:
	TAHMScheduledTimer* OwnerTimer;
	virtual void __fastcall Execute(void);
	void __fastcall DoTimer(void);
public:
	#pragma option push -w-inl
	/* TThread.Create */ inline __fastcall TAHMScheduledTimerThread(bool CreateSuspended) : Classes::TThread(
		CreateSuspended) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TThread.Destroy */ inline __fastcall virtual ~TAHMScheduledTimerThread(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

class DELPHICLASS TAHMScheduledTime;
class DELPHICLASS TAHMScheduler;
class DELPHICLASS TAHMSchedules;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TAHMSchedules : public Classes::TCollection 
{
	typedef Classes::TCollection inherited;
	
private:
	TAHMScheduler* FAHMScheduler;
	TAHMScheduledTime* __fastcall GetAHMScheduledTime(int Index);
	void __fastcall SetAHMScheduledTime(int Index, TAHMScheduledTime* Value);
	
protected:
	DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
	
public:
	__fastcall TAHMSchedules(TAHMScheduler* AOwner);
	HIDESBASE TAHMScheduledTime* __fastcall Add(void);
	bool __fastcall Delete(int Index);
	__property TAHMScheduler* Owner = {read=FAHMScheduler};
	__property TAHMScheduledTime* Items[int Index] = {read=GetAHMScheduledTime, write=SetAHMScheduledTime
		/*, default*/};
public:
	#pragma option push -w-inl
	/* TCollection.Destroy */ inline __fastcall virtual ~TAHMSchedules(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

#pragma pack(push, 4)
class PASCALIMPLEMENTATION TAHMScheduler : public Ahmsystemclass::TAHMSystemsComponent 
{
	typedef Ahmsystemclass::TAHMSystemsComponent inherited;
	
private:
	TAHMSchedules* FAHMSchedules;
	bool FEnabled;
	TAHMOnTrigger FBeforeAnyTrigger;
	TAHMOnTrigger FAfterAnyTrigger;
	void __fastcall SetAHMSchedules(TAHMSchedules* Value);
	
public:
	__fastcall virtual TAHMScheduler(Classes::TComponent* AOwner);
	__fastcall virtual ~TAHMScheduler(void);
	
__published:
	__property About ;
	__property TAHMSchedules* Schedules = {read=FAHMSchedules, write=SetAHMSchedules};
	__property bool Enabled = {read=FEnabled, write=FEnabled, default=1};
	__property TAHMOnTrigger BeforeAnyTrigger = {read=FBeforeAnyTrigger, write=FBeforeAnyTrigger};
	__property TAHMOnTrigger AfterAnyTrigger = {read=FAfterAnyTrigger, write=FAfterAnyTrigger};
};

#pragma pack(pop)

#pragma pack(push, 4)
class PASCALIMPLEMENTATION TAHMScheduledTime : public Classes::TCollectionItem 
{
	typedef Classes::TCollectionItem inherited;
	
private:
	TAHMScheduler* FAHMScheduler;
	bool FHasTriggered;
	TAHMScheduledTimer* FCurrentTimer;
	bool FActive;
	AnsiString FTriggerDate;
	AnsiString FTriggerTime;
	TAHMOnTrigger FOnTrigger;
	AnsiString FScheduleID;
	TAHMTriggerDays FAHMTriggerDays;
	void __fastcall SetActive(const bool Value);
	void __fastcall SetTriggerDate(const AnsiString Value);
	void __fastcall SetTriggerTime(const AnsiString Value);
	void __fastcall TimerActive(System::TObject* Sender);
	void __fastcall SetAHMTriggerdays(const TAHMTriggerDays Value);
	
protected:
	virtual AnsiString __fastcall GetDisplayName(void);
	
public:
	__fastcall virtual TAHMScheduledTime(Classes::TCollection* Collection);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	__fastcall virtual ~TAHMScheduledTime(void);
	__property TAHMScheduler* Owner = {read=FAHMScheduler};
	__property AnsiString DisplayName = {read=GetDisplayName};
	
__published:
	__property AnsiString TriggerDate = {read=FTriggerDate, write=SetTriggerDate};
	__property AnsiString TriggerTime = {read=FTriggerTime, write=SetTriggerTime};
	__property TAHMTriggerDays AllowDays = {read=FAHMTriggerDays, write=SetAHMTriggerdays, default=127}
		;
	__property AnsiString ScheduleID = {read=FScheduleID, write=FScheduleID};
	__property bool Active = {read=FActive, write=SetActive, default=0};
	__property TAHMOnTrigger OnTrigger = {read=FOnTrigger, write=FOnTrigger};
};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
extern PACKAGE TTime __fastcall AHMAddToTime(TTime CTime, int Hours, int Minutes, int Seconds);
extern PACKAGE System::TDateTime __fastcall AHMAddToDateTime(System::TDateTime CDateTime, int Day, int 
	Hours, int Minutes, int Seconds);

}	/* namespace Ahmtscheduler */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Ahmtscheduler;
#endif
#pragma option pop	// -w-

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