//---------------------------------------------------------------------------

#ifndef mainH
#define mainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "wclBluetooth.hpp"
#include "wclConnections.hpp"
#include "wclObex.hpp"
#include <ComCtrls.hpp>
#include <Dialogs.hpp>
//---------------------------------------------------------------------------
class TfmMain : public TForm
{
__published:	// IDE-managed Components
        TLabel *laNewDirName;
        TLabel *laDesc;
        TButton *btDiscover;
        TButton *btConnect;
        TButton *btDisconnect;
        TListView *lvDevices;
        TButton *btOpenSession;
        TButton *btCloseSession;
        TButton *btClear;
        TListBox *lbLog;
        TButton *btSelectFile;
        TEdit *edFileName;
        TButton *btSendFile;
        TButton *btAbort;
        TProgressBar *ProgressBar;
        TButton *btMkDir;
        TButton *btDelete;
        TEdit *edNewDirName;
        TButton *btDir;
        TListView *lvFiles;
        TButton *btRoot;
        TwclBluetoothManager *wclBluetoothManager;
        TOpenDialog *OpenDialog;
        TwclRfCommClient *wclRfCommClient;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall btClearClick(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall wclBluetoothManagerAfterOpen(TObject *Sender);
        void __fastcall wclBluetoothManagerAuthenticationCompleted(
          TObject *Sender, const TwclBluetoothRadio *Radio,
          const __int64 Address, const int Error);
        void __fastcall wclBluetoothManagerDiscoveringCompleted(
          TObject *Sender, const TwclBluetoothRadio *Radio,
          const int Error);
        void __fastcall wclBluetoothManagerDiscoveringStarted(
          TObject *Sender, const TwclBluetoothRadio *Radio);
        void __fastcall wclBluetoothManagerNumericComparison(
          TObject *Sender, const TwclBluetoothRadio *Radio,
          const __int64 Address, const DWORD Number, bool& Confirm);
        void __fastcall wclBluetoothManagerPasskeyNotification(
          TObject *Sender, const TwclBluetoothRadio *Radio,
          const __int64 Address, const DWORD Passkey);
        void __fastcall wclBluetoothManagerPasskeyRequest(TObject *Sender,
          const TwclBluetoothRadio *Radio, const __int64 Address,
          DWORD& Passkey);
        void __fastcall wclBluetoothManagerPinRequest(TObject *Sender,
          const TwclBluetoothRadio *Radio, const __int64 Address,
          String& Pin);
        void __fastcall wclBluetoothManagerDeviceFound(TObject *Sender,
          const TwclBluetoothRadio *Radio, const __int64 Address);
        void __fastcall btDiscoverClick(TObject *Sender);
        void __fastcall btDisconnectClick(TObject *Sender);
        void __fastcall wclRfCommClientDisconnect(TObject *Sender,
          const int Reason);
        void __fastcall wclRfCommClientConnect(TObject *Sender,
          const int Error);
        void __fastcall wclRfCommClientDestroyProcessor(TObject *Sender,
          const TwclClientDataConnection *Connection);
        void __fastcall wclRfCommClientCreateProcessor(TObject *Sender,
          const TwclClientDataConnection *Connection);
        void __fastcall btCloseSessionClick(TObject *Sender);
        void __fastcall btOpenSessionClick(TObject *Sender);
        void __fastcall btConnectClick(TObject *Sender);
        void __fastcall btSelectFileClick(TObject *Sender);
        void __fastcall btAbortClick(TObject *Sender);
        void __fastcall btSendFileClick(TObject *Sender);
        void __fastcall btDirClick(TObject *Sender);
        void __fastcall lvFilesDblClick(TObject *Sender);
        void __fastcall btRootClick(TObject *Sender);
        void __fastcall btDeleteClick(TObject *Sender);
        void __fastcall btMkDirClick(TObject *Sender);
private:	// User declarations
        TwclObexFtpClient* FFtp;

        TwclBluetoothRadio* __fastcall GetRadio();

        void __fastcall FtpConnect(TObject* Sender, const int Error,
          const String Description);
        void __fastcall FtpDisconnect(TObject* Sender, const int Error,
		  const String Description);
		#if __BORLANDC__ >= 0x0740
		  void __fastcall FtpPutComplete(TObject* Sender, const int Error,
			const String Description, TStream* const Stream);
		  void __fastcall FtpGetComplete(TObject* Sender, const int Error,
			const String Description, TStream* const Stream);
		#else
		  void __fastcall FtpPutComplete(TObject* Sender, const int Error,
			const String Description, const TStream* Stream);
		  void __fastcall FtpGetComplete(TObject* Sender, const int Error,
			const String Description, const TStream* Stream);
		#endif
		void __fastcall FtpProgress(TObject* Sender, const unsigned Length,
		  const unsigned Position);
        void __fastcall FtpDirComplete(TObject* Sender, const int Error,
          const String Description, const TwclObexFileObjects Dirs);
        void __fastcall FtpChangeDirComplete(TObject* Sender, const int Error,
          const String Description);
        void __fastcall FtpDeleteComplete(TObject* Sender, const int Error,
          const String Description);
        void __fastcall FtpMkDirComplete(TObject* Sender, const int Error,
          const String Description);
public:		// User declarations
        __fastcall TfmMain(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TfmMain *fmMain;
//---------------------------------------------------------------------------
#endif
