idlefw/inc/framework/aistatemanager.h
branchRCL_3
changeset 14 15e4dd19031c
parent 8 d0529222e3f0
child 15 a0713522ab97
equal deleted inserted replaced
12:502e5d91ad42 14:15e4dd19031c
    20 #define _AISTATEMANAGER_H
    20 #define _AISTATEMANAGER_H
    21 
    21 
    22 // System includes
    22 // System includes
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 #include <babitflags.h>
    24 #include <babitflags.h>
       
    25 #include <AknProgressDialog.h> // for MProgressDialogCallback
    25 
    26 
    26 // User includes
    27 // User includes
    27 #include <aifwdefs.h>
    28 #include <aifwdefs.h>
    28 #include "aistateobserver.h"
    29 #include "aistateobserver.h"
    29 
    30 
    30 // Forward declarations
    31 // Forward declarations
    31 class CAiPluginFactory;
    32 class CAiPluginFactory;
       
    33 class CAiCpsCommandBuffer;
    32 class CHsContentPublisher;
    34 class CHsContentPublisher;
    33 class THsPublisherInfo;
    35 class THsPublisherInfo;
       
    36 class CAknWaitDialog;
    34 
    37 
    35 /**
    38 /**
    36  * State Manager
    39  * State Manager
    37  * 
    40  * 
    38  * @ingroup group_aifw
    41  * @ingroup group_aifw
    39  * @lib aifw.lib
    42  * @lib aifw.lib
    40  * @since S60 5.0
    43  * @since S60 5.0
    41  */
    44  */
    42 NONSHARABLE_CLASS( CAiStateManager ) : public CBase,
    45 NONSHARABLE_CLASS( CAiStateManager ) : public CBase,
    43     public MAiStateObserver
    46     public MAiStateObserver,
       
    47     public MProgressDialogCallback
    44     {
    48     {
    45 private:
    49 private:
    46     // Data types
    50     // Data types
    47     enum TState
    51     enum TState
    48         {
    52         {
   111         TAiFwDestroyReason aReason );
   115         TAiFwDestroyReason aReason );
   112 
   116 
   113     /**
   117     /**
   114      * @see MAiStateObserver
   118      * @see MAiStateObserver
   115      */        
   119      */        
   116     void NotifyUpdatePlugins();
   120     void NotifyReloadPlugins();
   117     
   121     
       
   122 
   118     /**
   123     /**
   119      * @see MAiStateObserver
   124      * @see MAiStateObserver
   120      */            
   125      */            
   121     TBool OnlineStateInUse() const;
   126     void NotifyReleasePlugins( const RArray<TUid>& aUidList );
   122             
   127 
   123 private:
   128 private:
   124     // new functions
   129     // new functions
   125         
   130         
   126     /**
   131     /**
   127      * Evaluates next state 
   132      * Evaluates next state 
   185      * Destroys all plugins from plugin factory
   190      * Destroys all plugins from plugin factory
   186      * 
   191      * 
   187      * @since S60 5.2
   192      * @since S60 5.2
   188      */
   193      */
   189     void DestroyPlugins();
   194     void DestroyPlugins();
   190                            
   195               
       
   196     /**
       
   197      * Starts wait dialog with progress bar.
       
   198      */
       
   199     void StartWaitDialogL();
       
   200 
       
   201     /**
       
   202      * Stops wait dialog with progress bar.
       
   203      */
       
   204     void StopWaitDialogL();
       
   205 
       
   206     /**
       
   207      * Callback method from MProgressDialogCallback interface.
       
   208      * Gets called when a dialog is dismissed.
       
   209      * @param aButtonId Id of the pushed button.
       
   210      */
       
   211     void DialogDismissedL( TInt aButtonId );
       
   212                           
       
   213     /**
       
   214      * Flushes cps command buffer
       
   215      * 
       
   216      * @since S60 5.2
       
   217      */
       
   218     void FlushCommandBuffer();
       
   219     
   191 private:
   220 private:
   192     // data
   221     // data
   193     
   222     
   194     /** Plugin Factory, Not owned */
   223     /** Plugin Factory, Not owned */
   195     CAiPluginFactory& iFactory;
   224     CAiPluginFactory& iFactory;
       
   225     /** CPS Command buffer, Owned */
       
   226     CAiCpsCommandBuffer* iCommandBuffer;
   196     /** Current state */
   227     /** Current state */
   197     TState iCurrentState;    
   228     TState iCurrentState;    
   198     /** Flags */
   229     /** Flags */
   199     TBitFlags32 iFlags;
   230     TBitFlags32 iFlags;
   200     /** Halted flag */
   231     /** Halted flag */
   201     TBool iHalt;
   232     TBool iHalt;
   202     
   233     /**
       
   234      * Own.
       
   235      * Pointer to wait dialog.
       
   236      */ 
       
   237     CAknWaitDialog* iWaitDialog;
       
   238    
       
   239     /** List of plugins which should be reloaded */
       
   240     RArray<THsPublisherInfo> iReloadPlugins;
       
   241 
   203 private:
   242 private:
   204     // friend classes
   243     // friend classes
   205     
   244     
   206 #ifdef _AIFW_UNIT_TEST
   245 #ifdef _AIFW_UNIT_TEST
   207     friend class UT_AiStateManager;
   246     friend class UT_AiStateManager;