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

#ifndef mainH
#define mainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "wclBluetooth.hpp"
#include "wclObex.hpp"
#include <ComCtrls.hpp>
#include <Dialogs.hpp>
//---------------------------------------------------------------------------
class TfmMain : public TForm
{
__published:	// IDE-managed Components
        TButton *btListen;
        TButton *btClose;
        TListBox *lbLog;
        TButton *btClear;
        TListView *lvClients;
        TButton *btDisconnect;
        TwclBluetoothManager *wclBluetoothManager;
        TwclRfCommServer *wclRfCommServer;
        TSaveDialog *SaveDialog;
        TOpenDialog *OpenDialog;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall btClearClick(TObject *Sender);
        void __fastcall btListenClick(TObject *Sender);
        void __fastcall btCloseClick(TObject *Sender);
        void __fastcall wclRfCommServerListen(TObject *Sender);
        void __fastcall wclRfCommServerClosed(TObject *Sender,
          const int Reason);
        void __fastcall wclRfCommServerDisconnect(TObject *Sender,
          const TwclRfCommServerClientConnection *Client,
          const int Reason);
        void __fastcall wclRfCommServerDestroyProcessor(TObject *Sender,
          const TwclServerClientDataConnection *Connection);
        void __fastcall wclRfCommServerConnect(TObject *Sender,
          const TwclRfCommServerClientConnection *Client, const int Error);
        void __fastcall wclRfCommServerCreateProcessor(TObject *Sender,
          const TwclServerClientDataConnection *Connection);
        void __fastcall btDisconnectClick(TObject *Sender);
        void __fastcall wclRfCommServerGetSdpAttributes(TObject *Sender,
          TwclBluetoothSdpProtocols& Protocols,
          TwclBluetoothSdpProfiles& Profiles,
          TwclBluetoothSdpFormats& Formats, DWORD& Cod);
private:	// User declarations
        String FFileName;

        void __fastcall Trace(String Msg);

        void __fastcall OppClientConnect(TObject* Sender,
          const String Description);
        void __fastcall OppClientDisconnected(TObject* Sender,
          const int Reason, const String Description);
        void __fastcall OppClientPutBegin(TObject* Sender, const String Name,
          const String Description, const String Mime, const unsigned int Length,
		  bool& Accept);
		#if __BORLANDC__ >= 0x0740
		  void __fastcall OppClientPutCompleted(TObject* Sender, const int Error,
			TStream* const Stream, bool& Accept);
		  void __fastcall OppClientGetCompleted(TObject* Sender, int Error,
			TStream* const Stream);
		#else
		  void __fastcall OppClientPutCompleted(TObject* Sender, const int Error,
			const TStream* Stream, bool& Accept);
		  void __fastcall OppClientGetCompleted(TObject* Sender, int Error,
			const TStream* Stream);
		#endif
		void __fastcall OppClientPutProgress(TObject* Sender,
		  const unsigned int Position, const unsigned int Length,
		  bool& Continue);
		void __fastcall OppClientGetRequest(TObject* Sender, String aType,
		  TwclObexServerOperationResult& Result, TStream*& Stream);
		void __fastcall OppClientProgress(TObject* Sender,
          const unsigned int Length, const unsigned int Position);
public:		// User declarations
        __fastcall TfmMain(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TfmMain *fmMain;
//---------------------------------------------------------------------------
#endif
