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

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

#ifndef IntrivialftpserverHPP
#define IntrivialftpserverHPP

#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 <Inassignednumbers.hpp>	// Pascal unit
#include <Inglobal.hpp>	// Pascal unit
#include <Intrivialftpbase.hpp>	// Pascal unit
#include <Insockethandle.hpp>	// Pascal unit
#include <Inudpserver.hpp>	// Pascal unit
#include <Inudpbase.hpp>	// Pascal unit
#include <Incomponent.hpp>	// Pascal unit
#include <Inbasecomponent.hpp>	// Pascal unit

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

namespace Intrivialftpserver
{
//-- 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 TInTrivialFTPServer;
class PASCALIMPLEMENTATION TInTrivialFTPServer : public Inudpserver::TInUDPServer 
{
	typedef Inudpserver::TInUDPServer inherited;
	
protected:
	TTransferCompleteEvent FOnTransferComplete;
	TAccessFileEvent FOnReadFile;
	TAccessFileEvent FOnWriteFile;
	Intrivialftpbase::TIdTFTPMode __fastcall StrToMode(AnsiString mode);
	virtual void __fastcall DoReadFile(AnsiString FileName, const Intrivialftpbase::TIdTFTPMode Mode, const TPeerInfo &PeerInfo, int RequestedBlockSize = 0x0);
	virtual void __fastcall DoWriteFile(AnsiString FileName, const Intrivialftpbase::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(Inglobal::TBytes AData, Insockethandle::TInSocketHandle* ABinding);
	virtual void __fastcall InitComponent(void);
	
__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
	/* TInUDPServer.Destroy */ inline __fastcall virtual ~TInTrivialFTPServer(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TInBaseComponent.Create */ inline __fastcall TInTrivialFTPServer(Classes::TComponent* AOwner)/* overload */ : Inudpserver::TInUDPServer(AOwner) { }
	#pragma option pop
	
};


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

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

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