bluetoothengine/btnotif/inc/btnpairnotifier.h
branchRCL_3
changeset 23 9386f31cc85b
child 24 269724087bed
equal deleted inserted replaced
22:613943a21004 23:9386f31cc85b
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Declares pair base notifier.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef BTNPAIRNOTIFIER_H_
       
    19 #define BTNPAIRNOTIFIER_H_
       
    20 
       
    21 #include "btnotifier.h" // base class
       
    22 
       
    23 // CLASS DECLARATION
       
    24 /**
       
    25 * This class is used as base class for all pairing purpose notifiers
       
    26 */
       
    27 NONSHARABLE_CLASS(CBTNPairNotifierBase) : public CBTNotifierBase
       
    28     {
       
    29     public: // Constructors and destructor
       
    30 
       
    31         /**
       
    32         * Two-phased constructor.
       
    33         */
       
    34         static CBTNPairNotifierBase* NewL();  // Constructor (public)
       
    35 
       
    36         /**
       
    37         * Destructor.
       
    38         */
       
    39         virtual ~CBTNPairNotifierBase();      // Destructor
       
    40     
       
    41     protected: // From base class
       
    42     
       
    43         /**
       
    44         * From CBTNotifierBase
       
    45         */
       
    46         virtual TNotifierInfo RegisterL();
       
    47         
       
    48         /**
       
    49         * From CBTNotifierBase Used in asynchronous notifier launch to 
       
    50         * store received parameters into members variables and 
       
    51         * make needed initializations.
       
    52         * @param aBuffer A buffer containing received parameters
       
    53         * @param aReturnVal The return value to be passed back.
       
    54         * @param aMessage Should be completed when the notifier is deactivated.
       
    55         * @return None.
       
    56         */
       
    57         virtual void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
       
    58         
       
    59         virtual void UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
       
    60         
       
    61         /**
       
    62         * From CBTNotifierBase Updates a currently active notifier.
       
    63         * @param aBuffer The updated data.
       
    64         * @return A pointer to return value.
       
    65         */
       
    66         virtual TPtrC8 UpdateL(const TDesC8& aBuffer);
       
    67         
       
    68     protected: // New functions
       
    69 
       
    70         void ProcessParamsGetDeviceL( const TBTDevAddr& aAddr, const TBTDeviceName& aName );
       
    71         
       
    72         /**
       
    73          * Check not to allow pairing attempt from banned devices,
       
    74          */
       
    75         TBool CheckBlockedDeviceL();
       
    76         
       
    77         /**
       
    78         * Query user to accept/reject when the pairing request is initiated 
       
    79         * from remote device.   
       
    80         * @param None.
       
    81         * @return ETrue if User accepted.
       
    82         */
       
    83         TBool AuthoriseIncomingPairingL();
       
    84         
       
    85         /**
       
    86          * Generate prompt based on subclass's own needs.
       
    87          * @param aRBuf the descriptor to which the prompt will be loaded.
       
    88          */
       
    89         virtual void GenerateQueryPromptL( RBuf& aRBuf );
       
    90         
       
    91     private:
       
    92         /**
       
    93         * From CBTNotifierBase Called when a notifier is first loaded 
       
    94         * to allow any initial construction that is required.
       
    95         * @param None.
       
    96         * @return A structure containing priority and channel info.
       
    97         */
       
    98         //TNotifierInfo RegisterL();
       
    99         
       
   100     protected:
       
   101         /**
       
   102         * C++ default constructor.
       
   103         */    
       
   104         CBTNPairNotifierBase();
       
   105         
       
   106     protected: // Data
       
   107         TBool                   iLocallyInitiated;    
       
   108     };
       
   109 
       
   110 #endif /* BTNPAIRNOTIFIER_H */
       
   111