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

#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
        TButton *btDiscover;
        TListView *lvDevices;
        TListBox *lbLog;
        TButton *btClear;
        TButton *btConnect;
        TButton *btDisconnect;
        TButton *btOpenSession;
        TButton *btCloseSession;
        TButton *btSelectFile;
        TEdit *edFileName;
        TButton *btSendFile;
        TButton *btAbort;
        TProgressBar *ProgressBar;
        TButton *btGetvCard;
        TButton *btGetCaps;
        TwclBluetoothManager *wclBluetoothManager;
        TwclRfCommClient *wclRfCommClient;
        TOpenDialog *OpenDialog;
        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 btGetvCardClick(TObject *Sender);
        void __fastcall btGetCapsClick(TObject *Sender);
private:	// User declarations
    TwclObexOppClient* FOpp;

    TwclBluetoothRadio* GetRadio();

    void __fastcall OppConnect(TObject* Sender, const int Error,
	  const String Description);
	void __fastcall OppDisconnect(TObject* Sender, const int Error,
	  const String Description);
    #if __BORLANDC__ >= 0x0740
	  void __fastcall OppPutComplete(TObject* Sender, const int Error,
		const String Description, TStream* const Stream);
	  void __fastcall OppGetComplete(TObject* Sender, const int Error,
		const String Description, TStream* const Stream);
	#else
	  void __fastcall OppPutComplete(TObject* Sender, const int Error,
		const String Description, const TStream* Stream);
	  void __fastcall OppGetComplete(TObject* Sender, const int Error,
		const String Description, const TStream* Stream);
	#endif
	void __fastcall OppProgress(TObject* Sender, const unsigned Length,
	  const unsigned Position);
public:		// User declarations
        __fastcall TfmMain(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TfmMain *fmMain;
//---------------------------------------------------------------------------
#endif
