idlefw/inc/framework/aiecomobserver.h
branchRCL_3
changeset 8 d0529222e3f0
equal deleted inserted replaced
4:1a2a00e78665 8:d0529222e3f0
       
     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:  CAiEcomObserver class implementation.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AIECOMOBSERVER_H
       
    20 #define AIECOMOBSERVER_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>	
       
    24 #include <e32std.h>		
       
    25 #include <ecom/ecom.h>
       
    26 
       
    27 // User includes
       
    28 
       
    29 
       
    30 // Class declaration
       
    31 /**
       
    32  * 
       
    33  * Active Idle ECom observer
       
    34  *
       
    35  * @ingroup group_aifw
       
    36  * @lib aifw.lib 
       
    37  * @since S60 5.2 
       
    38  */
       
    39 class MAiEcomObserver
       
    40     {
       
    41 public:
       
    42     
       
    43     /**    
       
    44     * This is called when the IdleFw detects a change in ECom
       
    45     * plugin registrations (adding, removing or upgrading ECOM-plugins).
       
    46     * 
       
    47     * @since S60 5.2   
       
    48     */
       
    49     virtual void NotifyEcomRegistryChanged() = 0;    
       
    50     };
       
    51 
       
    52 
       
    53 // Class declaration
       
    54 /**
       
    55  * 
       
    56  * Active Idle ECom observer
       
    57  * 
       
    58  * @ingroup group_aifw
       
    59  * @lib aifw.lib 
       
    60  * @since S60 5.2 
       
    61  */
       
    62 NONSHARABLE_CLASS( CAiEcomObserver ) : public CActive
       
    63     {
       
    64 public:
       
    65     // constructors and destructor
       
    66     
       
    67     // Two-phased constructor.
       
    68     static CAiEcomObserver* NewL();
       
    69 
       
    70     // Two-phased constructor.
       
    71     static CAiEcomObserver* NewLC();
       
    72 
       
    73     // Cancel and destroy
       
    74     ~CAiEcomObserver();
       
    75 
       
    76 public: 
       
    77     // New functions
       
    78 
       
    79     /**
       
    80      * Adds a new observer for plugin notifications.
       
    81      * @param aObserver Observer pointer.
       
    82      */
       
    83     void AddObserverL( MAiEcomObserver* aObserver );
       
    84 
       
    85 private:
       
    86     // new functions
       
    87 
       
    88     // Start observing ecom notification
       
    89     void StartObserving();
       
    90 
       
    91     // Notifies observers
       
    92     void NotifyObservers();
       
    93 
       
    94 private:
       
    95     // constructors
       
    96     
       
    97     /**
       
    98      * C++ default constructor
       
    99      */
       
   100     CAiEcomObserver();
       
   101     
       
   102     /**
       
   103      * 2nd phase constructor
       
   104      */
       
   105     void ConstructL();
       
   106 
       
   107 private: 
       
   108     // from CActive
       
   109 
       
   110     /**
       
   111      * @see CActive
       
   112      */
       
   113     void RunL();
       
   114 
       
   115     /**
       
   116      * @see CActive
       
   117      */
       
   118     void DoCancel();
       
   119     
       
   120 private:
       
   121     // data
       
   122 
       
   123     /** ECom session handle (must be closed, not deleted), Own */
       
   124     REComSession iEComSession;
       
   125 
       
   126     /** Own: Array of Observers - pointer not owned */
       
   127     RPointerArray< MAiEcomObserver > iObservers;
       
   128     
       
   129 private:
       
   130     // friend classes
       
   131     
       
   132 #ifdef _AIFW_UNIT_TEST
       
   133     friend class UT_AiEcomObserver;
       
   134 #endif
       
   135     };
       
   136 
       
   137 #endif // AIECOMOBSERVER_H
       
   138 
       
   139 // End of file