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

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

#ifndef IdgopherHPP
#define IdgopherHPP

#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 <Idassignednumbers.hpp>	// Pascal unit
#include <Idemailaddress.hpp>	// Pascal unit
#include <Idheaderlist.hpp>	// Pascal unit
#include <Idtcpclient.hpp>	// Pascal unit
#include <Idobjs.hpp>	// Pascal unit
#include <Idbasecomponent.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Idtcpconnection.hpp>	// Pascal unit
#include <Idcomponent.hpp>	// Pascal unit

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

namespace Idgopher
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TIdGopherMenuItem;
class PASCALIMPLEMENTATION TIdGopherMenuItem : public Classes::TCollectionItem 
{
	typedef Classes::TCollectionItem inherited;
	
protected:
	AnsiString FTitle;
	char FItemType;
	AnsiString FSelector;
	AnsiString FServer;
	int FPort;
	bool FGopherPlusItem;
	Idheaderlist::TIdHeaderList* FGopherBlock;
	Classes::TStringList* FViews;
	AnsiString FURL;
	Classes::TStringList* FAbstract;
	Idheaderlist::TIdHeaderList* FAsk;
	Idemailaddress::TIdEMailAddressItem* fAdminEmail;
	AnsiString __fastcall GetLastModified();
	AnsiString __fastcall GetOrganization();
	AnsiString __fastcall GetLocation();
	AnsiString __fastcall GetGeog();
	
public:
	__fastcall virtual TIdGopherMenuItem(Classes::TCollection* ACollection);
	__fastcall virtual ~TIdGopherMenuItem(void);
	virtual void __fastcall DoneSettingInfoBlock(void);
	__property AnsiString Title = {read=FTitle, write=FTitle};
	__property char ItemType = {read=FItemType, write=FItemType, nodefault};
	__property AnsiString Selector = {read=FSelector, write=FSelector};
	__property AnsiString Server = {read=FServer, write=FServer};
	__property int Port = {read=FPort, write=FPort, nodefault};
	__property bool GopherPlusItem = {read=FGopherPlusItem, write=FGopherPlusItem, nodefault};
	__property Idheaderlist::TIdHeaderList* GopherBlock = {read=FGopherBlock};
	__property AnsiString URL = {read=FURL};
	__property Classes::TStringList* Views = {read=FViews};
	__property Classes::TStringList* AAbstract = {read=FAbstract};
	__property AnsiString LastModified = {read=GetLastModified};
	__property Idemailaddress::TIdEMailAddressItem* AdminEMail = {read=fAdminEmail};
	__property AnsiString Organization = {read=GetOrganization};
	__property AnsiString Location = {read=GetLocation};
	__property AnsiString Geog = {read=GetGeog};
	__property Idheaderlist::TIdHeaderList* Ask = {read=FAsk};
};


class DELPHICLASS TIdGopherMenu;
class PASCALIMPLEMENTATION TIdGopherMenu : public Classes::TCollection 
{
	typedef Classes::TCollection inherited;
	
public:
	TIdGopherMenuItem* operator[](int Index) { return Items[Index]; }
	
protected:
	HIDESBASE TIdGopherMenuItem* __fastcall GetItem(int Index);
	HIDESBASE void __fastcall SetItem(int Index, const TIdGopherMenuItem* Value);
	
public:
	__fastcall TIdGopherMenu(void);
	HIDESBASE TIdGopherMenuItem* __fastcall Add(void);
	__property TIdGopherMenuItem* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
public:
	#pragma option push -w-inl
	/* TCollection.Destroy */ inline __fastcall virtual ~TIdGopherMenu(void) { }
	#pragma option pop
	
};


typedef void __fastcall (__closure *TIdGopherMenuEvent)(System::TObject* Sender, TIdGopherMenuItem* MenuItem);

class DELPHICLASS TIdGopher;
class PASCALIMPLEMENTATION TIdGopher : public Idtcpclient::TIdTCPClientCustom 
{
	typedef Idtcpclient::TIdTCPClientCustom inherited;
	
protected:
	TIdGopherMenuEvent FOnMenuItem;
	void __fastcall DoMenu(TIdGopherMenuItem* MenuItem);
	void __fastcall ProcessGopherError(void);
	TIdGopherMenuItem* __fastcall MenuItemFromString(AnsiString stLine, TIdGopherMenu* Menu);
	TIdGopherMenu* __fastcall ProcessDirectory(AnsiString PreviousData = "", const int ExpectedLength = 0x0);
	TIdGopherMenu* __fastcall LoadExtendedDirectory(AnsiString PreviousData = "", const int ExpectedLength = 0x0);
	void __fastcall ProcessFile(Classes::TStream* ADestStream, AnsiString APreviousData = "", const int ExpectedLength = 0x0);
	void __fastcall ProcessTextFile(Classes::TStream* ADestStream, AnsiString APreviousData = "", const int ExpectedLength = 0x0);
	virtual void __fastcall InitComponent(void);
	
public:
	TIdGopherMenu* __fastcall GetMenu(AnsiString ASelector, bool IsGopherPlus = false, AnsiString AView = "");
	TIdGopherMenu* __fastcall Search(AnsiString ASelector, AnsiString AQuery);
	void __fastcall GetFile(AnsiString ASelector, Classes::TStream* ADestStream, bool IsGopherPlus = false, AnsiString AView = "");
	void __fastcall GetTextFile(AnsiString ASelector, Classes::TStream* ADestStream, bool IsGopherPlus = false, AnsiString AView = "");
	TIdGopherMenu* __fastcall GetExtendedMenu(AnsiString ASelector, AnsiString AView = "");
	
__published:
	__property TIdGopherMenuEvent OnMenuItem = {read=FOnMenuItem, write=FOnMenuItem};
	__property Port  = {default=70};
	__property Host ;
public:
	#pragma option push -w-inl
	/* TIdTCPConnection.Destroy */ inline __fastcall virtual ~TIdGopher(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TIdBaseComponent.Create */ inline __fastcall TIdGopher(Classes::TComponent* AOwner)/* overload */ : Idtcpclient::TIdTCPClientCustom(AOwner) { }
	#pragma option pop
	
};


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

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

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