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

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

#ifndef IniohandlerstreamHPP
#define IniohandlerstreamHPP

#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 <Inglobal.hpp>	// Pascal unit
#include <Iniohandler.hpp>	// Pascal unit
#include <Instreamvcl.hpp>	// Pascal unit
#include <Incomponent.hpp>	// Pascal unit
#include <Inbasecomponent.hpp>	// Pascal unit

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

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

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

class PASCALIMPLEMENTATION TInIOHandlerStream : public Iniohandler::TInIOHandler 
{
	typedef Iniohandler::TInIOHandler inherited;
	
protected:
	bool FFreeStreams;
	TIdOnGetStreams FOnGetStreams;
	Instreamvcl::TInStreamVCL* FReceiveInStream;
	Instreamvcl::TInStreamVCL* FSendInStream;
	TInIOHandlerStreamType 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 TInIOHandlerStream(Classes::TComponent* AOwner, Classes::TStream* AReceiveStream, Classes::TStream* ASendStream);
	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(Inglobal::TBytes ABuffer);
	__property Classes::TStream* ReceiveStream = {read=GetReceiveStream};
	__property Classes::TStream* SendStream = {read=GetSendStream};
	
__published:
	__property bool FreeStreams = {read=FFreeStreams, write=FFreeStreams, nodefault};
	__property TInIOHandlerStreamType StreamType = {read=FStreamType, write=FStreamType, nodefault};
	__property TIdOnGetStreams OnGetStreams = {read=FOnGetStreams, write=FOnGetStreams};
public:
	#pragma option push -w-inl
	/* TInIOHandler.Destroy */ inline __fastcall virtual ~TInIOHandlerStream(void) { }
	#pragma option pop
	
};


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

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

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