idlefw/inc/framework/aistateprovider.h
branchRCL_3
changeset 9 d0529222e3f0
child 18 bd874ee5e5e2
equal deleted inserted replaced
4:1a2a00e78665 9:d0529222e3f0
       
     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 THsPublisherInfo;
       
    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( 
       
    60         MAiStateObserver& aObserver, CCoeEnv& aCoeEnv );
       
    61 
       
    62     /**
       
    63      * Two-phased constructor. Leaving on stack
       
    64      */
       
    65     static CAiStateProvider* NewLC( 
       
    66         MAiStateObserver& aObserver, CCoeEnv& aCoeEnv );
       
    67 
       
    68     /**
       
    69      * Destructor
       
    70      */
       
    71     ~CAiStateProvider();
       
    72 
       
    73 private:
       
    74     // private constructors
       
    75 
       
    76     /**
       
    77      * 2nd phase constructor
       
    78      */
       
    79     void ConstructL();
       
    80     
       
    81     /**
       
    82      * C++ default constructor
       
    83      */
       
    84     CAiStateProvider( 
       
    85         MAiStateObserver& aObserver, CCoeEnv& aCoeEnv );
       
    86         
       
    87 private:
       
    88     // from MCoeMessageMonitorObserver
       
    89     
       
    90     /**
       
    91      * @see MCoeMessageMonitorObserver
       
    92      */
       
    93     void MonitorWsMessage( const TWsEvent& aEvent );
       
    94     
       
    95 private:
       
    96     // from MHWRMLightObserver
       
    97     
       
    98     /**
       
    99      * @see MHWRMLightObserver
       
   100      */
       
   101     void LightStatusChanged( TInt aTarget, 
       
   102         CHWRMLight::TLightStatus aStatus );
       
   103     
       
   104 private:
       
   105     // from MAknsSkinChangeObserver
       
   106     
       
   107     /**
       
   108      * @see MAknsSkinChangeObserver
       
   109      */
       
   110     void SkinContentChanged();
       
   111 
       
   112     /**
       
   113      * @see MAknsSkinChangeObserver
       
   114      */    
       
   115     void SkinConfigurationChanged(
       
   116         const TAknsSkinStatusConfigurationChangeReason aReason );
       
   117     
       
   118     /**
       
   119      * @see MAknsSkinChangeObserver
       
   120      */    
       
   121     void SkinPackageChanged(
       
   122         const TAknsSkinStatusPackageChangeReason aReason );
       
   123     
       
   124 private:
       
   125     // from MAiEcomObserver
       
   126     
       
   127     /**
       
   128      * @see MAiEcomObserver
       
   129      */
       
   130     void NotifyEcomRegistryChanged();
       
   131     
       
   132 private:
       
   133     // from MAiFwStateHandler
       
   134 
       
   135     /**
       
   136      * @see MAiFwStateHandler
       
   137      */
       
   138     TInt LoadPlugin( const THsPublisherInfo& aPublisherInfo, 
       
   139         TAiFwLoadReason aReason );
       
   140     
       
   141     /**
       
   142      * @see MAiFwStateHandler
       
   143      */
       
   144     void DestroyPlugin( const THsPublisherInfo& aPublisherInfo,
       
   145         TAiFwDestroyReason aReason );
       
   146     
       
   147     /**
       
   148      * @see MAiFwStateHandler
       
   149      */
       
   150     void ChangePluginState( TAiFwState aState );
       
   151 
       
   152     /**
       
   153      * @see MAiFwStateHandler
       
   154      */    
       
   155     TBool OnlineStateInUse() const;
       
   156 
       
   157 private:
       
   158     // new functions
       
   159     
       
   160     static TInt BackupRestoreEvent( TAny* aAny );
       
   161     
       
   162 private:
       
   163     // data
       
   164 
       
   165     /** ECom observer, owned */
       
   166     CAiEcomObserver* iEcomObserver;        
       
   167     /** State observer, Not owned */
       
   168     MAiStateObserver& iObserver;        
       
   169     /** Control environment, Not owned */
       
   170     CCoeEnv& iCoeEnv;
       
   171     /** Light status observer, Owned */
       
   172     CHWRMLight* iLightObserver;
       
   173     /** Skin server session, Owned */
       
   174     RAknsSrvSession iSkinSrv;
       
   175     /** Backup Restore observer, Owned */
       
   176     MAiPSPropertyObserver* iBackupRestoreObserver;
       
   177     
       
   178 private:
       
   179     // friend classes
       
   180     
       
   181 #ifdef _AIFW_UNIT_TEST
       
   182     friend class UT_AiStateProvider;
       
   183 #endif    
       
   184     };
       
   185 
       
   186 #endif // _AISTATEPROVIDER_H
       
   187 
       
   188 // End of file
       
   189