idlefw/src/framework/aistatesuspended.cpp
branchRCL_3
changeset 9 d0529222e3f0
parent 4 1a2a00e78665
child 10 5ef93ea513cb
child 18 bd874ee5e5e2
equal deleted inserted replaced
4:1a2a00e78665 9:d0529222e3f0
     1 /*
       
     2 * Copyright (c) 2005-2005 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 class for suspended state
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "aistatesuspended.h"
       
    20 #include "aipluginstatemachine.h"
       
    21 #include "debug.h"
       
    22 
       
    23 // ======== MEMBER FUNCTIONS ========
       
    24 
       
    25 // ----------------------------------------------------------------------------
       
    26 // TAiStateSuspended::TAiStateSuspended()
       
    27 // ----------------------------------------------------------------------------
       
    28 //
       
    29 TAiStateSuspended::TAiStateSuspended()
       
    30     {
       
    31     }
       
    32 
       
    33 // ----------------------------------------------------------------------------
       
    34 // TAiStateSuspended::Enter()
       
    35 // ----------------------------------------------------------------------------
       
    36 //
       
    37 void TAiStateSuspended::Enter( MAiPluginStateMachine& aStateMachine,
       
    38     TAiStateChanges aStateChange )
       
    39     {
       
    40     __PRINTS( "XAI: Enter Suspended" );
       
    41     const TAiTransitionReason reason( 
       
    42             aStateMachine.TranslateReason( aStateChange ) );
       
    43 
       
    44     aStateMachine.ChangePluginState( reason, &CAiContentPublisher::Suspend );                                    
       
    45     }
       
    46     
       
    47 // ----------------------------------------------------------------------------
       
    48 // TAiStateSuspended::HandleEvent()
       
    49 // ----------------------------------------------------------------------------
       
    50 //
       
    51 TBool TAiStateSuspended::HandleEvent( MAiPluginStateMachine& aStateMachine,
       
    52     TAiStateChanges aStateChange )
       
    53     {
       
    54     __PRINTS( "XAI: Suspended handle event" );
       
    55     switch( aStateChange )
       
    56         {
       
    57         case ESMAIIdleForeground:
       
    58         case ESMAIBacklightOn:
       
    59         case ESMAILocaleChanged:
       
    60         case ESMAITimeChanged:
       
    61         case ESMAIMidnightCrossover:
       
    62         case ESMAIRelayoutScreen:
       
    63         case ESMAIGeneralThemeChanged:
       
    64         case ESMAIInCall: // fallthrough
       
    65             {
       
    66             aStateMachine.SwitchToState( EAiAlive, aStateChange );
       
    67             return ETrue;
       
    68             }
       
    69         case ESMAIKeylockEnabled:
       
    70         case ESMAIKeylockDisabled:
       
    71             {
       
    72             Enter( aStateMachine, aStateChange );
       
    73             return ETrue;
       
    74             }
       
    75         default:
       
    76             {
       
    77             return EFalse;
       
    78             }
       
    79         }
       
    80     }
       
    81 
       
    82 // ----------------------------------------------------------------------------
       
    83 // TAiStateSuspended::Exit()
       
    84 // ----------------------------------------------------------------------------
       
    85 //
       
    86 void TAiStateSuspended::Exit( MAiPluginStateMachine& /*aStateMachine*/,
       
    87     TAiStateChanges /*aStateChange*/ )
       
    88     {
       
    89     __PRINTS( "XAI: Exit Suspended" );
       
    90     }
       
    91