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

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

#ifndef IdipwatchHPP
#define IdipwatchHPP

#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 <Idcomponent.hpp>	// Pascal unit
#include <Idthread.hpp>	// Pascal unit

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

namespace Idipwatch
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TIdIPWatchThread;
class PASCALIMPLEMENTATION TIdIPWatchThread : public Idthread::TIdThread 
{
	typedef Idthread::TIdThread inherited;
	
protected:
	int FInterval;
	System::TObject* FSender;
	Classes::TNotifyEvent FTimerEvent;
	virtual void __fastcall Run(void);
	void __fastcall TimerEvent(void);
public:
	#pragma option push -w-inl
	/* TIdThread.Create */ inline __fastcall virtual TIdIPWatchThread(bool ACreateSuspended) : Idthread::TIdThread(ACreateSuspended) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TIdThread.Destroy */ inline __fastcall virtual ~TIdIPWatchThread(void) { }
	#pragma option pop
	
};


class DELPHICLASS TIdIPWatch;
class PASCALIMPLEMENTATION TIdIPWatch : public Idcomponent::TIdComponent 
{
	typedef Idcomponent::TIdComponent inherited;
	
protected:
	bool FActive;
	AnsiString FCurrentIP;
	bool FHistoryEnabled;
	AnsiString FHistoryFilename;
	Classes::TStringList* FIPHistoryList;
	bool FIsOnline;
	bool FLocalIPHuntBusy;
	int FMaxHistoryEntries;
	int FOnLineCount;
	Classes::TNotifyEvent FOnStatusChanged;
	AnsiString FPreviousIP;
	TIdIPWatchThread* FThread;
	unsigned FWatchInterval;
	void __fastcall AddToIPHistoryList(AnsiString Value);
	void __fastcall CheckStatus(System::TObject* Sender);
	void __fastcall SetActive(bool Value);
	void __fastcall SetMaxHistoryEntries(int Value);
	void __fastcall SetWatchInterval(unsigned Value);
	
public:
	__fastcall virtual TIdIPWatch(Classes::TComponent* AOwner);
	__fastcall virtual ~TIdIPWatch(void);
	bool __fastcall ForceCheck(void);
	void __fastcall LoadHistory(void);
	AnsiString __fastcall LocalIP();
	void __fastcall SaveHistory(void);
	__property AnsiString CurrentIP = {read=FCurrentIP};
	__property Classes::TStringList* IPHistoryList = {read=FIPHistoryList};
	__property bool IsOnline = {read=FIsOnline, nodefault};
	__property AnsiString PreviousIP = {read=FPreviousIP};
	
__published:
	__property bool Active = {read=FActive, write=SetActive, nodefault};
	__property bool HistoryEnabled = {read=FHistoryEnabled, write=FHistoryEnabled, default=1};
	__property AnsiString HistoryFilename = {read=FHistoryFilename, write=FHistoryFilename};
	__property int MaxHistoryEntries = {read=FMaxHistoryEntries, write=SetMaxHistoryEntries, default=25};
	__property Classes::TNotifyEvent OnStatusChanged = {read=FOnStatusChanged, write=FOnStatusChanged};
	__property unsigned WatchInterval = {read=FWatchInterval, write=SetWatchInterval, default=1000};
};


//-- var, const, procedure ---------------------------------------------------
static const Shortint IP_WATCH_HIST_MAX = 0x19;
#define IP_WATCH_HIST_FILENAME "iphist.dat"
static const Word IP_WATCH_INTERVAL = 0x3e8;

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

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