bluetoothengine/btui/Ecom/inc/BTUIKeyWatcher.h
branchRCL_3
changeset 56 9386f31cc85b
parent 0 f63038272f30
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  Watcher for PubSub and CenRep keys.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CBTUIKEYWATCHER_H
       
    20 #define CBTUIKEYWATCHER_H
       
    21 
       
    22 #include <e32property.h>
       
    23 #include <centralrepository.h>
       
    24 #include "BTUIActive.h"
       
    25 
       
    26 //  Identification for key and active object to be watched
       
    27 const TInt KBTUIPHYCountWatcher = 0x01;
       
    28 
       
    29 /**
       
    30  *  Class CBTUIKeyWatcher
       
    31  *
       
    32  *  Notify and handle the key values' change.
       
    33  *
       
    34  *  @since S60 v5.0
       
    35  */
       
    36 class CBTUIKeyWatcher : public CBase, public MBTUIActiveObserver
       
    37     {
       
    38 
       
    39 public:
       
    40 
       
    41     /**
       
    42      * Two-phase constructor
       
    43 	 * 
       
    44 	 * @param aCaller The one calls this class.
       
    45 	 * @param aServiceID Identify which key to be listened to. 
       
    46 	 *                   It can be a logical AND value when listening to multiple keys. 
       
    47      */
       
    48     static CBTUIKeyWatcher* NewL( TAny* aCaller, TInt aServiceID);
       
    49 
       
    50     /**
       
    51      * Destructor
       
    52      */
       
    53     virtual ~CBTUIKeyWatcher();
       
    54 
       
    55     /**
       
    56      * From MBTUIActiveObserver.
       
    57      * Notification that a key value has changed.
       
    58      *
       
    59      * @since S60 v5.0
       
    60      * @param aActive Active object for the key which value changed.
       
    61      * @param aId Identification for key, defined in this file.
       
    62      * @param aStatus Request status
       
    63      */
       
    64     void RequestCompletedL( CBTUIActive* aActive, TInt aId, TInt aStatus );
       
    65 
       
    66     /**
       
    67      * From MBTUIActiveObserver.
       
    68      * Notification that a key value has changed.
       
    69      *
       
    70      * @since S60 v5.0
       
    71      * @param aActive Active object for the key which value changed.
       
    72      * @param aId Identification for key, defined in this file.
       
    73      * @param aError Error occured in Active Object's RunL().
       
    74      */
       
    75     void HandleError( CBTUIActive* aActive, TInt aId, TInt aError );
       
    76 
       
    77 private:
       
    78 
       
    79     /**
       
    80      * C++ default constructor
       
    81      * @param aCaller The one calls this class.
       
    82      */
       
    83     CBTUIKeyWatcher( TAny* aCaller );
       
    84 
       
    85     /**
       
    86      * Symbian 2nd-phase constructor
       
    87      * @param aServiceID Identify which key to be listened to. It can 
       
    88 	 *        be a logical AND value when listening to multiple keys. 
       
    89      */
       
    90     void ConstructL( TInt aServiceID );
       
    91 
       
    92 private: // data
       
    93    	
       
    94    	/**
       
    95      * Property containing count of physical BT connections.
       
    96      * When physical connections exists, specific BT UI indicator is shown.
       
    97      */
       
    98     RProperty iPHYCountKey;
       
    99           
       
   100     /**
       
   101      * Active object for listening to above keys' change.
       
   102      * Own.
       
   103      */    
       
   104     CBTUIActive* iPHYCountWatcher;
       
   105     
       
   106     /**
       
   107      * Our caller view.
       
   108      * Not own.
       
   109      */
       
   110     TAny* iCaller; 
       
   111    
       
   112     };
       
   113 
       
   114 #endif // CBTUIKEYWATCHER_H