bluetoothengine/headsetsimulator/core/inc/hsclientobservers.h
branchheadsetsimulator
changeset 60 90dbfc0435e3
equal deleted inserted replaced
59:02103bf20ee5 60:90dbfc0435e3
       
     1 /*
       
     2  * Component Name: Headset Simulator
       
     3  * Author: Comarch S.A.
       
     4  * Version: 1.0
       
     5  * Copyright (c) 2010 Comarch S.A.
       
     6  *  
       
     7  * This Software is submitted by Comarch S.A. to Symbian Foundation Limited on 
       
     8  * the basis of the Member Contribution Agreement entered between Comarch S.A. 
       
     9  * and Symbian Foundation Limited on 5th June 2009 (“Agreement”) and may be 
       
    10  * used only in accordance with the terms and conditions of the Agreement. 
       
    11  * Any other usage, duplication or redistribution of this Software is not 
       
    12  * allowed without written permission of Comarch S.A.
       
    13  * 
       
    14  */
       
    15 
       
    16 #ifndef HSCLIENTOBSERVERS_H
       
    17 #define HSCLIENTOBSERVERS_H
       
    18 
       
    19 class CHsClient;
       
    20 class CBluetoothSocket;
       
    21 class TBTDevAddr;
       
    22 
       
    23 /**
       
    24  * @brief Observer to notify about new AG client connection and disconnection.
       
    25  */
       
    26 class MHsClientObserver
       
    27 {
       
    28 public:
       
    29     /**
       
    30      * Informs about disconnection from AG.
       
    31      * 
       
    32      * @param aClient AG client
       
    33      * @param aErr KErrNone if successful, otherwise one of the system-wide 
       
    34      *        error codes
       
    35      */
       
    36     virtual void HandleClientDisconnect( CHsClient *aClient, TInt aErr ) = 0;
       
    37 
       
    38     /**
       
    39      * Informs about connection with AG.
       
    40      * 
       
    41      * @param aClient AG client
       
    42      * @param aErr KErrNone if successful, otherwise one of the system-wide 
       
    43      *        error codes
       
    44      */
       
    45     virtual void HandleNewClientL( CHsClient *aClient, TInt aErr ) = 0;
       
    46 };
       
    47 
       
    48 /**
       
    49  * @brief Observer to notify about AG client states.
       
    50  */
       
    51 class MHsClientStateNotifier
       
    52 {
       
    53 public:
       
    54 
       
    55     /**
       
    56      * Informs about connection with AG.
       
    57      * 
       
    58      * @param aErr KErrNone if successful, otherwise one of the system-wide 
       
    59      *        error codes
       
    60      */
       
    61     virtual void HandleClientConnectL( TInt aErr ) = 0;
       
    62 
       
    63     /**
       
    64      * Informs about disconnection from AG.
       
    65      * 
       
    66      * @param aErr KErrNone if successful, otherwise one of the system-wide 
       
    67      *        error codes
       
    68      */
       
    69     virtual void HandleClientDisconnectL( TInt aErr ) = 0;
       
    70 
       
    71     /**
       
    72      * Informs about status of received data from AG.
       
    73      * 
       
    74      * @param aData received data
       
    75      * @param aErr KErrNone if successful, otherwise one of the system-wide 
       
    76      *        error codes
       
    77      */
       
    78     virtual void HandleClientReceiveCompleteL( const TDesC8 &aData,
       
    79             TInt aErr ) = 0;
       
    80 
       
    81     /**
       
    82      * Informs about status of sent data from AG.
       
    83      * 
       
    84      * @param aErr KErrNone if successful, otherwise one of the system-wide 
       
    85      *        error codes
       
    86      */
       
    87     virtual void HandleClientSendCompleteL( TInt aErr ) = 0;
       
    88 
       
    89     /**
       
    90      * Informs about problem with AG.
       
    91      * 
       
    92      * @param aErr system-wide error codes
       
    93      */
       
    94     virtual void HandleClientOtherProblemL( TInt aErr ) = 0;
       
    95 };
       
    96 
       
    97 /**
       
    98  * @brief Observer to notify about new AG client.
       
    99  */
       
   100 class MHsAcceptNewClientObserver
       
   101 {
       
   102 public:
       
   103     /**
       
   104      * Informs about connection with AG.
       
   105      * 
       
   106      * @param aClient socket which AG is connected, if NULL see aErr code
       
   107      * @param aErr KErrNone if successful, otherwise one of the system-wide 
       
   108      *        error codes
       
   109      */
       
   110     virtual void HandleNewClientL( CBluetoothSocket *aClient, TInt aErr ) = 0;
       
   111 };
       
   112 
       
   113 /**
       
   114  * @brief Observes remote control clients
       
   115  */
       
   116 class MRemoteControllerConnectionObserver
       
   117 {
       
   118 
       
   119 public:
       
   120     /**
       
   121      * Handles remote control client connection
       
   122      * 
       
   123      * @param aErr error value 
       
   124      */
       
   125     virtual void HandleRemoteControllerConnected( TInt aErr ) = 0;
       
   126 
       
   127     /**
       
   128      * Handles remote control client disconnection
       
   129      * 
       
   130      * @param aErr error value 
       
   131      */
       
   132     virtual void HandleRemoteControllerDisconnected( TInt aErr ) = 0;
       
   133 
       
   134 };
       
   135 
       
   136 /**
       
   137  * @brief Observer to notify about status of searching service and port on 
       
   138  *        device.
       
   139  */
       
   140 class MHsBTManagerObserver
       
   141 {
       
   142 public:
       
   143     /** 
       
   144      * Called when port on desired device found 
       
   145      * 
       
   146      * @param aDevName bluetooth name of found device
       
   147      * @param aDevAddr bluetooth address of found device
       
   148      * @param aPort found port number
       
   149      */
       
   150     virtual void HandleDesiredDeviceFound( const TDesC &aDevName,
       
   151             const TBTDevAddr &aDevAddr, const TInt aPort ) = 0;
       
   152 
       
   153     /** 
       
   154      * Called when desired device not found 
       
   155      *
       
   156      * @param aErr error code 
       
   157      */
       
   158     virtual void HandleDesiredDeviceNotFound( TInt aErr ) = 0;
       
   159 
       
   160     /** 
       
   161      * Called when sdp query error happened 
       
   162      *
       
   163      * @param aErr error code 
       
   164      */
       
   165     virtual void HandleSdpQueryError( TInt aErr ) = 0;
       
   166 
       
   167     /** 
       
   168      * Called when service on device not found 
       
   169      *
       
   170      * @param aErr error code 
       
   171      */
       
   172     virtual void HandleServiceNotFound( TInt aErr ) = 0;
       
   173 
       
   174     /** 
       
   175      * Called when port number on device not found 
       
   176      *
       
   177      * @param aErr error code 
       
   178      */
       
   179     virtual void HandlePortNotFound( TInt aErr ) = 0;
       
   180 
       
   181 };
       
   182 
       
   183 #endif /* HSCLIENTOBSERVERS_H */