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

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

#ifndef SockhttpHPP
#define SockhttpHPP

#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 <Httpapp.hpp>	// Pascal unit
#include <Webreq.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Sockrequestinterpreter.hpp>	// Pascal unit

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

namespace Sockhttp
{
//-- type declarations -------------------------------------------------------
__interface ISockWebRequestAccess;
typedef System::DelphiInterface<ISockWebRequestAccess> _di_ISockWebRequestAccess;
__interface  INTERFACE_UUID("{E72A0846-8C34-11D3-AAF7-A0AC2E78CD57}") ISockWebRequestAccess  : public IInterface 
{
	
public:
	virtual AnsiString __fastcall GetFieldByName(const AnsiString Name) = 0 ;
	virtual int __fastcall ReadClient(AnsiString &Buffer, int Count) = 0 ;
	virtual AnsiString __fastcall TranslateURI(const AnsiString Value) = 0 ;
	virtual int __fastcall WriteClient(const AnsiString Buffer) = 0 ;
	virtual AnsiString __fastcall GetStringVariable(int Index) = 0 ;
	virtual bool __fastcall WriteHeaders(int StatusCode, AnsiString StatusText, AnsiString Headers) = 0 ;
	virtual bool __fastcall UsingStub(void) = 0 ;
	virtual int __fastcall ReadString(AnsiString &Buffer, int Count) = 0 ;
};

class DELPHICLASS TSockWebRequest;
class PASCALIMPLEMENTATION TSockWebRequest : public Httpapp::TWebRequest 
{
	typedef Httpapp::TWebRequest inherited;
	
private:
	_di_ISockWebRequestAccess FIntf;
	bool __fastcall UsingStub(void);
	
protected:
	virtual AnsiString __fastcall GetStringVariable(int Index);
	virtual System::TDateTime __fastcall GetDateVariable(int Index);
	virtual int __fastcall GetIntegerVariable(int Index);
	virtual AnsiString __fastcall GetInternalPathInfo();
	
public:
	__fastcall TSockWebRequest(_di_ISockWebRequestAccess AIntf);
	virtual AnsiString __fastcall GetFieldByName(const AnsiString Name);
	virtual int __fastcall ReadClient(void *Buffer, int Count);
	virtual AnsiString __fastcall ReadString(int Count);
	virtual AnsiString __fastcall TranslateURI(const AnsiString URI);
	virtual int __fastcall WriteClient(void *Buffer, int Count);
	virtual bool __fastcall WriteString(const AnsiString AString);
	virtual bool __fastcall WriteHeaders(int StatusCode, const AnsiString StatusString, const AnsiString Headers);
public:
	#pragma option push -w-inl
	/* TWebRequest.Destroy */ inline __fastcall virtual ~TSockWebRequest(void) { }
	#pragma option pop
	
};


typedef AnsiString SockHTTP__3[12];

class DELPHICLASS TSockWebResponse;
class PASCALIMPLEMENTATION TSockWebResponse : public Httpapp::TWebResponse 
{
	typedef Httpapp::TWebResponse inherited;
	
private:
	int FStatusCode;
	AnsiString FStringVariables[12];
	int FIntegerVariables[1];
	System::TDateTime FDateVariables[3];
	AnsiString FContent;
	bool FSent;
	
protected:
	virtual AnsiString __fastcall GetContent();
	virtual System::TDateTime __fastcall GetDateVariable(int Index);
	virtual int __fastcall GetIntegerVariable(int Index);
	virtual AnsiString __fastcall GetLogMessage();
	virtual int __fastcall GetStatusCode(void);
	virtual AnsiString __fastcall GetStringVariable(int Index);
	virtual void __fastcall SetContent(const AnsiString Value);
	virtual void __fastcall SetDateVariable(int Index, const System::TDateTime Value);
	virtual void __fastcall SetIntegerVariable(int Index, int Value);
	virtual void __fastcall SetLogMessage(const AnsiString Value);
	virtual void __fastcall SetStatusCode(int Value);
	virtual void __fastcall SetStringVariable(int Index, const AnsiString Value);
	
public:
	__fastcall TSockWebResponse(Httpapp::TWebRequest* HTTPRequest);
	virtual void __fastcall SendResponse(void);
	virtual void __fastcall SendRedirect(const AnsiString URI);
	virtual void __fastcall SendStream(Classes::TStream* AStream);
	virtual bool __fastcall Sent(void);
public:
	#pragma option push -w-inl
	/* TWebResponse.Destroy */ inline __fastcall virtual ~TSockWebResponse(void) { }
	#pragma option pop
	
};


class DELPHICLASS TSockWebRequestHandler;
class PASCALIMPLEMENTATION TSockWebRequestHandler : public Webreq::TWebRequestHandler 
{
	typedef Webreq::TWebRequestHandler inherited;
	
private:
	TSockWebRequest* __fastcall NewRequest(_di_ISockWebRequestAccess AIntf);
	TSockWebResponse* __fastcall NewResponse(TSockWebRequest* SockWebRequest);
	void __fastcall HandleServerException(Sysutils::Exception* E, _di_ISockWebRequestAccess AIntf);
	HIDESBASE void __fastcall HandleException(System::TObject* Sender);
	
public:
	__fastcall virtual TSockWebRequestHandler(Classes::TComponent* AOwner);
	__fastcall virtual ~TSockWebRequestHandler(void);
	void __fastcall Run(_di_ISockWebRequestAccess AIntf);
};


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

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

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