idlefw/inc/framework/aistateprovider.h
branchRCL_3
changeset 114 a5a39a295112
equal deleted inserted replaced
113:0efa10d348c0 114:a5a39a295112
       
     1 /*
       
     2 * Copyright (c) 2008 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:  State Provider
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _AISTATEPROVIDER_H
       
    20 #define _AISTATEPROVIDER_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 #include <coemain.h>
       
    25 #include <hwrmlight.h>
       
    26 #include <AknsSrvClient.h>
       
    27 
       
    28 // User includes
       
    29 #include <aifwstatehandler.h>
       
    30 #include "aiecomobserver.h"
       
    31 
       
    32 // Forward declarations
       
    33 class MAiPSPropertyObserver;
       
    34 class MAiStateObserver;
       
    35 class TAiFwPublisherInfo;
       
    36 
       
    37 // Class declaration
       
    38 
       
    39 /**
       
    40  * State Provider
       
    41  * 
       
    42  * @ingroup group_aifw
       
    43  * @lib aifw.lib
       
    44  * @since S60 5.2
       
    45  */
       
    46 NONSHARABLE_CLASS( CAiStateProvider ) : public CBase,
       
    47     public MCoeMessageMonitorObserver,
       
    48     public MHWRMLightObserver,
       
    49     public MAknsSkinChangeObserver,
       
    50     public MAiEcomObserver,
       
    51     public MAiFwStateHandler
       
    52     {
       
    53 public:    
       
    54     // Constructors and destructor
       
    55     
       
    56     /**
       
    57      * Two-phased constructor.
       
    58      */
       
    59     static CAiStateProvider* NewL( MAiStateObserver& aObserver ); 
       
    60         
       
    61     /**
       
    62      * Two-phased constructor. Leaving on stack
       
    63      */
       
    64     static CAiStateProvider* NewLC( MAiStateObserver& aObserver );         
       
    65 
       
    66     /**
       
    67      * Destructor
       
    68      */
       
    69     ~CAiStateProvider();
       
    70 
       
    71 private:
       
    72     // private constructors
       
    73 
       
    74     /**
       
    75      * 2nd phase constructor
       
    76      */
       
    77     void ConstructL();
       
    78     
       
    79     /**
       
    80      * C++ default constructor
       
    81      */
       
    82     CAiStateProvider( MAiStateObserver& aObserver );         
       
    83      
       
    84 public:
       
    85     // new methods
       
    86     
       
    87     /**
       
    88      * Start state providing
       
    89      * 
       
    90      * @since S60 5.2
       
    91      * @param aCoeEnv Control environment
       
    92      */
       
    93     void StartL( CCoeEnv& aCoeEnv );
       
    94     
       
    95     /**
       
    96      * Stop state providing
       
    97      * 
       
    98      * @since S60 5.2
       
    99      */
       
   100     void Stop();
       
   101     
       
   102 private:
       
   103     // from MCoeMessageMonitorObserver
       
   104     
       
   105     /**
       
   106      * @see MCoeMessageMonitorObserver
       
   107      */
       
   108     void MonitorWsMessage( const TWsEvent& aEvent );
       
   109     
       
   110 private:
       
   111     // from MHWRMLightObserver
       
   112     
       
   113     /**
       
   114      * @see MHWRMLightObserver
       
   115      */
       
   116     void LightStatusChanged( TInt aTarget, 
       
   117         CHWRMLight::TLightStatus aStatus );
       
   118     
       
   119 private:
       
   120     // from MAknsSkinChangeObserver
       
   121     
       
   122     /**
       
   123      * @see MAknsSkinChangeObserver
       
   124      */
       
   125     void SkinContentChanged();
       
   126 
       
   127     /**
       
   128      * @see MAknsSkinChangeObserver
       
   129      */    
       
   130     void SkinConfigurationChanged(
       
   131         const TAknsSkinStatusConfigurationChangeReason aReason );
       
   132     
       
   133     /**
       
   134      * @see MAknsSkinChangeObserver
       
   135      */    
       
   136     void SkinPackageChanged(
       
   137         const TAknsSkinStatusPackageChangeReason aReason );
       
   138     
       
   139 private:
       
   140     // from MAiEcomObserver
       
   141     
       
   142     /**
       
   143      * @see MAiEcomObserver
       
   144      */
       
   145     void NotifyEcomRegistryChanged();
       
   146     
       
   147 private:
       
   148     // from MAiFwStateHandler
       
   149 
       
   150     /**
       
   151      * @see MAiFwStateHandler
       
   152      */
       
   153     void LoadPlugin( const TAiFwPublisherInfo& aInfo );         
       
   154     
       
   155     /**
       
   156      * @see MAiFwStateHandler
       
   157      */
       
   158     void DestroyPlugin( const TAiFwPublisherInfo& aInfo );        
       
   159     
       
   160     /**
       
   161      * @see MAiFwStateHandler
       
   162      */
       
   163     void ChangePluginState( TAiFwState aState );
       
   164 
       
   165 private:
       
   166     // new functions
       
   167     
       
   168     static TInt BackupRestoreEvent( TAny* aAny );
       
   169 
       
   170     static TInt SwiUidListEvent( TAny* aAny );
       
   171 
       
   172 private:
       
   173     // data
       
   174 
       
   175     /** ECom observer, owned */
       
   176     CAiEcomObserver* iEcomObserver;        
       
   177     /** State observer, Not owned */
       
   178     MAiStateObserver& iObserver;        
       
   179     /** Control environment, Not owned */
       
   180     CCoeEnv* iCoeEnv;
       
   181     /** Light status observer, Owned */
       
   182     CHWRMLight* iLightObserver;
       
   183     /** Skin server session, Owned */
       
   184     RAknsSrvSession iSkinSrv;
       
   185     /** Backup Restore observer, Owned */
       
   186     MAiPSPropertyObserver* iBackupRestoreObserver;
       
   187     /** Flag to indicate whether state providing is started */
       
   188     TBool iStarted;
       
   189     /** SWI UID list observer, owned */
       
   190     MAiPSPropertyObserver* iSwiUidListObserver;
       
   191 
       
   192 private:
       
   193     // friend classes
       
   194     
       
   195 #ifdef _AIFW_UNIT_TEST
       
   196     friend class UT_AiStateProvider;
       
   197 #endif    
       
   198     };
       
   199 
       
   200 #endif // _AISTATEPROVIDER_H
       
   201 
       
   202 // End of file
       
   203