phonebookengines/VirtualPhonebook/VPbkSimStoreImpl/inc/CBtSapNotification.h
branchRCL_3
changeset 63 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2002-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:  An active object that completes when bluetooth SIM access
       
    15 *                profile status changes
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef VPBKSIMSTOREIMPL_CBTSAPNOTIFICATION_H
       
    21 #define VPBKSIMSTOREIMPL_CBTSAPNOTIFICATION_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <e32property.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CVPbkSimStateInformation;
       
    29 
       
    30 namespace VPbkSimStoreImpl {
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class MBtSapObserver;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  An active object that completes when BT SAP status changes
       
    39 *
       
    40 */
       
    41 NONSHARABLE_CLASS(CBtSapNotification) : public CActive
       
    42     {
       
    43     public:  // Constructors and destructor
       
    44         
       
    45         /**
       
    46         * Two-phased constructor.
       
    47         *
       
    48         * @param aStore the store to listen to.
       
    49         * @return a new instance of this class
       
    50         */
       
    51         static CBtSapNotification* NewL( 
       
    52             CVPbkSimStateInformation& aSimStateInfo );
       
    53         
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         virtual ~CBtSapNotification();
       
    58 
       
    59     public: // New functions
       
    60         
       
    61         /**
       
    62         * Activates this notification.
       
    63         */
       
    64         void ActivateL();
       
    65         
       
    66         /**
       
    67         * Adds observer for the notification
       
    68         * @param aObserver the observer to add
       
    69         */
       
    70         void AddObserverL( MBtSapObserver& aObserver );
       
    71        
       
    72         /**
       
    73         * Removes the observer
       
    74         * @param aObserver the observer to remove
       
    75         */
       
    76         void RemoveObserver( MBtSapObserver& aObserver );
       
    77     
       
    78     private:    // New functions
       
    79         CBtSapNotification( CVPbkSimStateInformation& aSimStateInfo );
       
    80         void ConstructL();
       
    81         void DoActivate();
       
    82        
       
    83     private:  // Functions from base classes
       
    84         
       
    85         /**
       
    86         * From CActive
       
    87         */
       
    88         void RunL();
       
    89 
       
    90         /**
       
    91         * From CActive
       
    92         */
       
    93         void DoCancel();
       
    94         
       
    95         /**
       
    96         * From CActive
       
    97         */
       
    98         TInt RunError( TInt aError );
       
    99 
       
   100     private:    // Data
       
   101         /// Ref: the SIM state information
       
   102         CVPbkSimStateInformation& iSimStateInfo;
       
   103         /// Ref: An array of observers
       
   104         RPointerArray<MBtSapObserver> iObservers;
       
   105         /// The P&S property for BT SAP notification
       
   106         RProperty iBtSapProperty;
       
   107         /// Own: idle for deactivation event
       
   108         CIdle* iDeactivationIdle;
       
   109         /// Own: the current state of the BT SAP
       
   110         TBool iActive;
       
   111     };
       
   112 } // namespace VPbkSimStoreImpl
       
   113 #endif      // VPBKSIMSTOREIMPL_CBTSAPNOTIFICATION_H
       
   114             
       
   115 // End of File