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

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

#ifndef IdcookiemanagerHPP
#define IdcookiemanagerHPP

#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 <Sysutils.hpp>	// Pascal unit
#include <Idbasecomponent.hpp>	// Pascal unit
#include <Idcookie.hpp>	// Pascal unit
#include <Idglobal.hpp>	// Pascal unit
#include <Iduri.hpp>	// Pascal unit

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

namespace Idcookiemanager
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TOnNewCookieEvent)(System::TObject* ASender, Idcookie::TIdCookieRFC2109* ACookie, bool &VAccept);

typedef void __fastcall (__closure *TOnManagerEvent)(System::TObject* ASender, Idcookie::TIdCookies* ACookieCollection);

typedef void __fastcall (__closure *TOnCreateEvent)(System::TObject* ASender, Idcookie::TIdCookies* ACookieCollection);

typedef void __fastcall (__closure *TOnDestroyEvent)(System::TObject* ASender, Idcookie::TIdCookies* ACookieCollection);

class DELPHICLASS TIdCookieManager;
class PASCALIMPLEMENTATION TIdCookieManager : public Idbasecomponent::TIdBaseComponent 
{
	typedef Idbasecomponent::TIdBaseComponent inherited;
	
protected:
	TOnManagerEvent FOnCreate;
	TOnManagerEvent FOnDestroy;
	TOnNewCookieEvent FOnNewCookie;
	Idcookie::TIdCookies* FCookieCollection;
	void __fastcall DoAdd(Idcookie::TIdCookieRFC2109* ACookie, AnsiString ACookieText, AnsiString AHost);
	virtual void __fastcall DoOnCreate(void);
	virtual void __fastcall DoOnDestroy(void);
	void __fastcall CleanupCookieList(void);
	virtual bool __fastcall DoOnNewCookie(Idcookie::TIdCookieRFC2109* ACookie);
	
public:
	__fastcall virtual TIdCookieManager(Classes::TComponent* AOwner);
	__fastcall virtual ~TIdCookieManager(void);
	void __fastcall AddCookie(AnsiString ACookie, AnsiString AHost);
	void __fastcall AddCookie2(AnsiString ACookie, AnsiString AHost);
	AnsiString __fastcall GenerateCookieList(Iduri::TIdURI* URL, bool SecureConnection = false);
	__property Idcookie::TIdCookies* CookieCollection = {read=FCookieCollection};
	void __fastcall DestroyCookieList(void);
	
__published:
	__property TOnManagerEvent OnCreate = {read=FOnCreate, write=FOnCreate};
	__property TOnManagerEvent OnDestroy = {read=FOnDestroy, write=FOnDestroy};
	__property TOnNewCookieEvent OnNewCookie = {read=FOnNewCookie, write=FOnNewCookie};
};


//-- var, const, procedure ---------------------------------------------------

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

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