idlefw/inc/framework/aipluginstatemachineimpl.h
branchRCL_3
changeset 8 d0529222e3f0
parent 4 1a2a00e78665
child 11 bd874ee5e5e2
equal deleted inserted replaced
4:1a2a00e78665 8:d0529222e3f0
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Plugin state machine implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_AIPLUGINSTATEMACHINEIMPL_H
       
    20 #define C_AIPLUGINSTATEMACHINEIMPL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <aicontentpublisher.h>
       
    24 #include "aipluginstatemachine.h"
       
    25 #include "aistatealive.h"
       
    26 #include "aistatesuspended.h"
       
    27 #include "aistateidle.h"
       
    28 
       
    29 class MAiPluginStateControl;
       
    30 class MAiPluginState;
       
    31 
       
    32 /**
       
    33  * Plugin state machine implementation.
       
    34  * 
       
    35  *  @lib aifw
       
    36  *  @since S60 3.2
       
    37  */
       
    38 NONSHARABLE_CLASS( CAiPluginStateMachine ) : public CBase,
       
    39                                              public MAiPluginStateMachine
       
    40     {
       
    41 public: // Constructor 
       
    42        
       
    43     CAiPluginStateMachine( MAiPluginStateResources& aPluginStateResource,                           
       
    44                            CAiContentPublisher& aPlugin );
       
    45     
       
    46 public: // from MAiPluginStateMachine
       
    47                                   
       
    48     TBool StateVariable( TAiStateVariable aStateVariable );
       
    49     
       
    50     TAiTransitionReason TranslateReason( TAiStateChanges aStateChange );
       
    51     
       
    52     void RestartSuspendTimer();
       
    53     
       
    54     void SwitchToState( TAiState aState, TAiStateChanges aStateChange );
       
    55     
       
    56     CAiContentPublisher& Plugin() const;
       
    57               
       
    58     void ChangePluginState( TAiTransitionReason aReason,                
       
    59                             void (CAiContentPublisher::*aStateChangeMethod)(TAiTransitionReason) );
       
    60                 
       
    61 public: // new methods
       
    62 
       
    63     TBool HandleEvent( TAiStateChanges aStateChange );
       
    64         
       
    65 private: // data
       
    66 
       
    67     /**
       
    68      * Alive master state.
       
    69      */
       
    70     TAiStateAlive iAlive;
       
    71 
       
    72     /**
       
    73      * Suspended state.
       
    74      */
       
    75     TAiStateSuspended iSuspended;
       
    76 
       
    77     /**
       
    78      * Idle master state.
       
    79      */
       
    80     TAiStateIdle iIdle;
       
    81 
       
    82     /**
       
    83      * Pointer to current state.
       
    84      * Not owned.
       
    85      */
       
    86     MAiPluginState* iCurrentState;
       
    87 
       
    88     /**
       
    89      * Pointer to parent state machine.
       
    90      * Not owned.
       
    91      */
       
    92     MAiPluginStateResources& iPluginStateResource;
       
    93     
       
    94     /**
       
    95      * Pointer to managed plugin.
       
    96      * Not owned.
       
    97      */
       
    98     CAiContentPublisher& iPlugin;    
       
    99 
       
   100     /**
       
   101      * Online sub-state     
       
   102      */    
       
   103     TBool iOnline;
       
   104     };
       
   105 
       
   106 #endif // C_AIPLUGINSTATEMACHINEIMPL_H