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

// (DO NOT EDIT: machine generated header) 'ahmtscheduler.pas' rev: 6.00

#ifndef ahmtschedulerHPP
#define ahmtschedulerHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <SysConst.hpp>	// Pascal unit
#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 TAHMScheduledTime;
class DELPHICLASS TAHMScheduler;
class DELPHICLASS TAHMSchedules;
class PASCALIMPLEMENTATION TAHMSchedules : public Ahmsystemclass::TAHMCollection 
{
	typedef Ahmsystemclass::TAHMCollection inherited;
	
public:
	TAHMScheduledTime* operator[](int Index) { return Items[Index]; }
	
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);
	HIDESBASE bool __fastcall Delete(int Index);
	__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
	
};


class PASCALIMPLEMENTATION TAHMScheduler : public Ahmsystemclass::TAHMSystemComponent 
{
	typedef Ahmsystemclass::TAHMSystemComponent 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};
};


class PASCALIMPLEMENTATION TAHMScheduledTime : public Classes::TCollectionItem 
{
	typedef Classes::TCollectionItem inherited;
	
private:
	int fInterval;
	bool FHasTriggered;
	TAHMScheduledTimerThread* FTimerThread;
	bool FActive;
	AnsiString FTriggerDate;
	AnsiString FTriggerTime;
	TAHMOnTrigger FOnTrigger;
	AnsiString FScheduleID;
	TAHMTriggerDays FAHMTriggerDays;
	TAHMScheduler* FAHMScheduler;
	void __fastcall SetActive(const bool Value);
	void __fastcall SetTriggerDate(const AnsiString Value);
	void __fastcall SetTriggerTime(const AnsiString Value);
	Classes::TThreadPriority __fastcall GetPriority(void);
	void __fastcall SetPriority(const Classes::TThreadPriority Value);
	
protected:
	void __fastcall Activate(void);
	virtual AnsiString __fastcall GetDisplayName();
	
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=FAHMTriggerDays, default=127};
	__property AnsiString ScheduleID = {read=FScheduleID, write=FScheduleID};
	__property Classes::TThreadPriority Priority = {read=GetPriority, write=SetPriority, default=3};
	__property bool Active = {read=FActive, write=SetActive, default=0};
	__property TAHMOnTrigger OnTrigger = {read=FOnTrigger, write=FOnTrigger};
};


class PASCALIMPLEMENTATION TAHMScheduledTimerThread : public Classes::TThread 
{
	typedef Classes::TThread inherited;
	
public:
	TAHMScheduledTime* OwnerTimer;
	virtual void __fastcall Execute(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
	
};


//-- 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 */
using namespace Ahmtscheduler;
#pragma option pop	// -w-
#pragma option pop	// -Vx

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