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

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

#ifndef IdiohandlerstreamHPP
#define IdiohandlerstreamHPP

#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 <Idbasecomponent.hpp>	// Pascal unit
#include <Idglobal.hpp>	// Pascal unit
#include <Idiohandler.hpp>	// Pascal unit
#include <Idobjs.hpp>	// Pascal unit
#include <Idstream.hpp>	// Pascal unit
#include <Idsys.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Idcomponent.hpp>	// Pascal unit

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

namespace Idiohandlerstream
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TIdIOHandlerStreamType { stRead, stWrite, stReadWrite };
#pragma option pop

class DELPHICLASS TIdIOHandlerStream;
typedef void __fastcall (__closure *TIdOnGetStreams)(TIdIOHandlerStream* ASender, Classes::TStream* &VReceiveStream, Classes::TStream* &VSendStream);

class PASCALIMPLEMENTATION TIdIOHandlerStream : public Idiohandler::TIdIOHandler 
{
	typedef Idiohandler::TIdIOHandler inherited;
	
protected:
	bool FFreeStreams;
	TIdOnGetStreams FOnGetStreams;
	Classes::TStream* fReceiveStream;
	Classes::TStream* fSendStream;
	TIdIOHandlerStreamType FStreamType;
	Classes::TStream* __fastcall GetReceiveStream(void);
	Classes::TStream* __fastcall GetSendStream(void);
	void __fastcall SetReceiveStream(Classes::TStream* AStream);
	void __fastcall SetSendStream(Classes::TStream* AStream);
	virtual int __fastcall ReadFromSource(bool ARaiseExceptionIfDisconnected = true, int ATimeout = 0xffffffff, bool ARaiseExceptionOnTimeout = true);
	
public:
	virtual void __fastcall CheckForDataOnSource(int ATimeout = 0x0);
	virtual void __fastcall CheckForDisconnect(bool ARaiseExceptionIfDisconnected = true, bool AIgnoreBuffer = false);
	__fastcall virtual TIdIOHandlerStream(Classes::TComponent* AOwner, Classes::TStream* AReceiveStream, Classes::TStream* ASendStream)/* overload */;
	__fastcall TIdIOHandlerStream(Classes::TComponent* AOwner)/* overload */;
	virtual bool __fastcall Connected(void);
	virtual void __fastcall Close(void);
	virtual void __fastcall Open(void);
	virtual bool __fastcall Readable(int AMSec = 0xffffffff);
	virtual void __fastcall WriteDirect(Idglobal::TBytes &aBuffer);
	__property Classes::TStream* ReceiveStream = {read=GetReceiveStream};
	__property Classes::TStream* SendStream = {read=GetSendStream};
	
__published:
	__property bool FreeStreams = {read=FFreeStreams, write=FFreeStreams, nodefault};
	__property TIdIOHandlerStreamType StreamType = {read=FStreamType, write=FStreamType, nodefault};
	__property TIdOnGetStreams OnGetStreams = {read=FOnGetStreams, write=FOnGetStreams};
public:
	#pragma option push -w-inl
	/* TIdIOHandler.Destroy */ inline __fastcall virtual ~TIdIOHandlerStream(void) { }
	#pragma option pop
	
};


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

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

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