idlefw/inc/framework/aistatealive.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:  State alive
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef T_AISTATEALIVE_H
       
    20 #define T_AISTATEALIVE_H
       
    21 
       
    22 #include "aipluginstate.h"
       
    23 #include "aipluginstatemachine.h"
       
    24 
       
    25 /**
       
    26  * @ingroup group_aifw
       
    27  * 
       
    28  * Alive active state
       
    29  * 
       
    30  *  @lib aifw
       
    31  *  @since S60 3.2
       
    32  */
       
    33 NONSHARABLE_CLASS( TAiStateAliveActive ) : public MAiPluginState
       
    34     {
       
    35 public: // Constructor
       
    36     
       
    37     TAiStateAliveActive();
       
    38     
       
    39 public: // from MAiPluginState
       
    40     
       
    41     void Enter( MAiPluginStateMachine& aStateMachine,
       
    42                 TAiStateChanges aStateChange );
       
    43     
       
    44     TBool HandleEvent( MAiPluginStateMachine& aStateMachine,
       
    45                       TAiStateChanges aStateChange );
       
    46     
       
    47     void Exit( MAiPluginStateMachine& aStateMachine,
       
    48                TAiStateChanges aStateChange );
       
    49     
       
    50     };
       
    51 
       
    52 /**
       
    53  * Alive inactive state
       
    54  * 
       
    55  *  @lib aifw
       
    56  *  @since S60 3.2
       
    57  */
       
    58 NONSHARABLE_CLASS( TAiStateAliveInactive ) : public MAiPluginState
       
    59     {
       
    60 public: // Constructor    
       
    61     
       
    62     TAiStateAliveInactive();
       
    63     
       
    64 public: // from MAiPluginState
       
    65     
       
    66     void Enter( MAiPluginStateMachine& aStateMachine,
       
    67                 TAiStateChanges aStateChange );
       
    68     
       
    69     TBool HandleEvent( MAiPluginStateMachine& aStateMachine,
       
    70                       TAiStateChanges aStateChange );
       
    71     
       
    72     void Exit( MAiPluginStateMachine& aStateMachine,
       
    73                TAiStateChanges aStateChange );    
       
    74     };
       
    75 
       
    76 /**
       
    77  * Alive incall state
       
    78  * 
       
    79  *  @lib aifw
       
    80  *  @since S60 3.2
       
    81  */
       
    82 NONSHARABLE_CLASS( TAiStateAliveIncall ) : public MAiPluginState
       
    83     {
       
    84 public: // Constructor
       
    85     
       
    86     TAiStateAliveIncall();
       
    87     
       
    88 public: // from MAiPluginState
       
    89     
       
    90     void Enter( MAiPluginStateMachine& aStateMachine,
       
    91                 TAiStateChanges aStateChange );
       
    92     
       
    93     TBool HandleEvent( MAiPluginStateMachine& aStateMachine,
       
    94                       TAiStateChanges aStateChange );
       
    95     
       
    96     void Exit( MAiPluginStateMachine& aStateMachine,
       
    97                TAiStateChanges aStateChange );    
       
    98     };
       
    99 
       
   100 /**
       
   101  * Alive switch state
       
   102  * 
       
   103  *  @lib aifw
       
   104  *  @since S60 3.2
       
   105  */
       
   106 NONSHARABLE_CLASS( TAiStateAlive ) : public MAiPluginState,
       
   107                                      public MAiPluginStateMachine
       
   108     {
       
   109 public: // Constructor
       
   110         
       
   111     TAiStateAlive( MAiPluginStateMachine& aParentStateMachine );
       
   112     
       
   113 public: // from MAiPluginStateMachine
       
   114     
       
   115     TBool StateVariable( TAiStateVariable aStateVariable );
       
   116     
       
   117     TAiTransitionReason TranslateReason( TAiStateChanges aStateChange );
       
   118     
       
   119     void RestartSuspendTimer();
       
   120     
       
   121     void SwitchToState( TAiState aState, TAiStateChanges aStateChange );
       
   122                                   
       
   123     CAiContentPublisher& Plugin() const;
       
   124                  
       
   125     void ChangePluginState( TAiTransitionReason aReason,                
       
   126                             void (CAiContentPublisher::*aStateChangeMethod)(TAiTransitionReason) );
       
   127 
       
   128 public: // from MAiPluginState
       
   129     
       
   130     void Enter( MAiPluginStateMachine& aStateMachine,
       
   131                 TAiStateChanges aStateChange );
       
   132     
       
   133     TBool HandleEvent( MAiPluginStateMachine& aStateMachine,
       
   134                        TAiStateChanges aStateChange );
       
   135     
       
   136     void Exit( MAiPluginStateMachine& aStateMachine,
       
   137                TAiStateChanges aStateChange );
       
   138                
       
   139 private: // data
       
   140 
       
   141     /**
       
   142      * Pointer to current state.
       
   143      * Not owned.
       
   144      */
       
   145     MAiPluginState* iCurrentState;
       
   146 
       
   147     /**
       
   148      * Pointer to parent state machine.
       
   149      * Not owned.
       
   150      */
       
   151     MAiPluginStateMachine* iParentStateMachine;
       
   152 
       
   153     /**
       
   154      * Alive active state.
       
   155      */
       
   156     TAiStateAliveActive iStateAliveActive;
       
   157 
       
   158     /**
       
   159      * Alive incall state.
       
   160      */
       
   161     TAiStateAliveIncall iStateAliveIncall;
       
   162 
       
   163     /**
       
   164      * Alive inactive state.
       
   165      */
       
   166     TAiStateAliveInactive iStateAliveInactive;    
       
   167     };
       
   168 
       
   169 #endif // T_AISTATEALIVE_H