bluetoothengine/btnotif/btnotifsrv/inc/btnotifpairnotifier.h
changeset 40 997690c3397a
parent 33 837dcc42fd6a
child 57 5ebadcda06cb
equal deleted inserted replaced
37:91746b151f97 40:997690c3397a
    18 #ifndef BTNOTIFPAIRNOTIFIER_H
    18 #ifndef BTNOTIFPAIRNOTIFIER_H
    19 #define BTNOTIFPAIRNOTIFIER_H
    19 #define BTNOTIFPAIRNOTIFIER_H
    20 
    20 
    21 #include <e32base.h>
    21 #include <e32base.h>
    22 #include <btmanclient.h>
    22 #include <btmanclient.h>
       
    23 #include <hb/hbcore/hbsymbianvariant.h>
    23 #include "bluetoothdevicedialogs.h"
    24 #include "bluetoothdevicedialogs.h"
    24 #include "btnotificationresult.h"
    25 #include "btnotificationresult.h"
    25 #include "bluetoothtrace.h"
    26 #include "bluetoothtrace.h"
    26 
    27 
    27 class CBTNotifPairingManager;
    28 class CBTNotifSecurityManager;
    28 class CBTNotifConnectionTracker;
    29 class CBTNotifConnectionTracker;
    29 class CBluetoothNotification;
    30 class CBluetoothNotification;
    30 
    31 
    31 /**
    32 /**
    32  *  Helper class for performing user prompt for pairing and authorization.
    33  *  Helper class for performing user prompt for pairing.
    33  *  
    34  *  
    34  *  The design of this class is focussed on structure and maintainability first.
    35  *  The design of this class is focussed on structure and maintainability first.
    35  *  Duplicate (state) information is kept to a minimum. And memory usage comes
    36  *  Duplicate (state) information is kept to a minimum. And memory usage comes
    36  *  before processing. Pairing is an infrequent operation, and this class is
    37  *  before processing. Pairing is an infrequent operation, and this class is
    37  *  only instantiated when there is pairing-related processing, so extreme
    38  *  only instantiated when there is pairing-related processing, so extreme
    38  *  focus on memory or processing efficiency would have relatively little effect.
    39  *  focus on memory or processing efficiency would have relatively little effect.
    39  *  
    40  *  
    40  *  Auth represents Authenticate and Authorize
       
    41  *  
       
    42  *  @since Symbian^4
    41  *  @since Symbian^4
    43  */
    42  */
    44 NONSHARABLE_CLASS( CBTNotifPairNotifier ) : public CBase,
    43 NONSHARABLE_CLASS( CBTNotifPairNotifier ) : public CBase,
    45                                             public MBTNotificationResult
    44                                             public MBTNotificationResult
    46     {
    45     {
    51      * Two-phased constructor.
    50      * Two-phased constructor.
    52      * @param aConnection Pointer to the parent.
    51      * @param aConnection Pointer to the parent.
    53      * @param aDevice Pointer to information of the remote device.
    52      * @param aDevice Pointer to information of the remote device.
    54      * aParam The owner of this object
    53      * aParam The owner of this object
    55      */
    54      */
    56     static CBTNotifPairNotifier* NewL( CBTNotifPairingManager& aParent );
    55     static CBTNotifPairNotifier* NewL( CBTNotifSecurityManager& aParent );
    57 
    56 
    58     /**
    57     /**
    59     * Destructor.
    58     * Destructor.
    60     */
    59     */
    61     virtual ~CBTNotifPairNotifier();
    60     virtual ~CBTNotifPairNotifier();
   116 private:
   115 private:
   117 
   116 
   118     /**
   117     /**
   119      * C++ default constructor.
   118      * C++ default constructor.
   120      */
   119      */
   121     CBTNotifPairNotifier( CBTNotifPairingManager& aParent );
   120     CBTNotifPairNotifier( CBTNotifSecurityManager& aParent );
   122 
   121 
   123     /**
   122     /**
   124      * Symbian 2nd-phase constructor.
   123      * Symbian 2nd-phase constructor.
   125      */
   124      */
   126     void ConstructL();
   125     void ConstructL();
   152      * @since Symbian^4
   151      * @since Symbian^4
   153      * @param aError The result of the notification.
   152      * @param aError The result of the notification.
   154      * @param aResult The user response; ETrue if the user accepted the query,
   153      * @param aResult The user response; ETrue if the user accepted the query,
   155      *                otherwise EFalse.
   154      *                otherwise EFalse.
   156      */
   155      */
   157     void CompleteAcceptPairingQueryL( TInt aError, TBool aResult );
   156     void CompleteAcceptPairingQueryL( TInt aError);
   158     
   157     
   159     /**
   158     /**
   160      * Parse the parameters of a request for pairing.
   159      * Parse the parameters of a request for pairing.
   161      * This function also returns values to use for dialog config, and sets
   160      * This function also returns values to use for dialog config, and sets
   162      * the operation state member variable (iOperation).
   161      * the operation state member variable (iOperation).
   229      * @param aData The returned data. The actual format 
   228      * @param aData The returned data. The actual format 
   230      *              is dependent on the actual notifier.
   229      *              is dependent on the actual notifier.
   231      */
   230      */
   232     void NotificationClosedL( TInt aError, const TDesC8& aData );
   231     void NotificationClosedL( TInt aError, const TDesC8& aData );
   233     
   232     
   234     /**
       
   235      * Ask the user if he/she wants to block future connection requests.
       
   236      *
       
   237      * @since Symbian^4
       
   238      */    
       
   239     void LaunchBlockingQueryL();
       
   240 
       
   241 private: // data
   233 private: // data
   242 
   234 
   243     enum TNotifierState
   235     enum TNotifierState
   244         {
   236         {
   245         EIncomingPairingAcceptconfirm,
   237         EIncomingPairingAcceptconfirm,
   246         EPairingInputConfirm,
   238         EPairingInputConfirm,
   247         };
   239         };
   248     
   240     
   249     CBTNotifPairingManager& iParent;
   241     CBTNotifSecurityManager& iParent;
   250     
   242     
   251     /**
   243     /**
   252      * The client request.
   244      * The client request.
   253      */
   245      */
   254     RMessage2 iNotifierMessage;
   246     RMessage2 iNotifierMessage;
   288     // Contains the device name provided in params
   280     // Contains the device name provided in params
   289     TBTDeviceName iCurrentDeviceName;
   281     TBTDeviceName iCurrentDeviceName;
   290     
   282     
   291     TNotifierState iState;
   283     TNotifierState iState;
   292     
   284     
       
   285     // Defines if the check box in the dialog is checked or not.
       
   286     TBool   iCheckBoxState;
       
   287     
       
   288     TBool   iAcceptPairingResult;
       
   289     
   293     BTUNITTESTHOOK
   290     BTUNITTESTHOOK
   294 
   291 
   295     };
   292     };
   296 
   293 
   297 #endif // BTNOTIFPAIRNOTIFIER_H
   294 #endif // BTNOTIFPAIRNOTIFIER_H