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

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

#ifndef IdtrivialftpserverHPP
#define IdtrivialftpserverHPP

#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 <Idassignednumbers.hpp>	// Pascal unit
#include <Idtrivialftpbase.hpp>	// Pascal unit
#include <Idsockethandle.hpp>	// Pascal unit
#include <Idudpserver.hpp>	// Pascal unit
#include <Idudpbase.hpp>	// Pascal unit
#include <Idcomponent.hpp>	// Pascal unit

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

namespace Idtrivialftpserver
{
//-- type declarations -------------------------------------------------------
struct TPeerInfo
{
	
public:
	AnsiString PeerIP;
	int PeerPort;
} ;

typedef void __fastcall (__closure *TAccessFileEvent)(System::TObject* Sender, AnsiString &FileName, const TPeerInfo &PeerInfo, bool &GrantAccess, Classes::TStream* &AStream, bool &FreeStreamOnComplete);

typedef void __fastcall (__closure *TTransferCompleteEvent)(System::TObject* Sender, const bool Success, const TPeerInfo &PeerInfo, Classes::TStream* AStream, const bool WriteOperation);

class DELPHICLASS TIdTrivialFTPServer;
class PASCALIMPLEMENTATION TIdTrivialFTPServer : public Idudpserver::TIdUDPServer 
{
	typedef Idudpserver::TIdUDPServer inherited;
	
protected:
	TTransferCompleteEvent FOnTransferComplete;
	TAccessFileEvent FOnReadFile;
	TAccessFileEvent FOnWriteFile;
	Idtrivialftpbase::TIdTFTPMode __fastcall StrToMode(AnsiString mode);
	virtual void __fastcall DoReadFile(AnsiString FileName, const Idtrivialftpbase::TIdTFTPMode Mode, const TPeerInfo &PeerInfo, int RequestedBlockSize = 0x0);
	virtual void __fastcall DoWriteFile(AnsiString FileName, const Idtrivialftpbase::TIdTFTPMode Mode, const TPeerInfo &PeerInfo, int RequestedBlockSize = 0x0);
	virtual void __fastcall DoTransferComplete(const bool Success, const TPeerInfo &PeerInfo, Classes::TStream* SourceStream, const bool WriteOperation);
	virtual void __fastcall DoUDPRead(Classes::TStream* AData, Idsockethandle::TIdSocketHandle* ABinding);
	
public:
	__fastcall virtual TIdTrivialFTPServer(Classes::TComponent* axOwner);
	
__published:
	__property TAccessFileEvent OnReadFile = {read=FOnReadFile, write=FOnReadFile};
	__property TAccessFileEvent OnWriteFile = {read=FOnWriteFile, write=FOnWriteFile};
	__property TTransferCompleteEvent OnTransferComplete = {read=FOnTransferComplete, write=FOnTransferComplete};
public:
	#pragma option push -w-inl
	/* TIdUDPServer.Destroy */ inline __fastcall virtual ~TIdTrivialFTPServer(void) { }
	#pragma option pop
	
};


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

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

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