accessoryservices/accessoryserver/inc/ChargerContext/ChargingContextStateWFCharger.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2008-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:  Charging Context Controller's "Wait For Charger" state.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CHARGINGCONTEXTSTATEWFCHARGER_H
       
    21 #define C_CHARGINGCONTEXTSTATEWFCHARGER_H
       
    22 
       
    23 
       
    24 #include "FiniteStateMachine.h"
       
    25 #include "AccSrvChargingContextController.h"
       
    26 
       
    27 
       
    28 class CAccSrvChargingContextController;
       
    29 
       
    30 
       
    31 
       
    32 /**
       
    33  * "Wait For Charger" state implementation for Charging Context 
       
    34  * Controller.
       
    35  * State waits until charger is connected before moving to
       
    36  * next state "charging".
       
    37  *
       
    38  *  @code
       
    39  *   ?good_class_usage_example(s)
       
    40  *  @endcode
       
    41  *
       
    42  *  @lib AccServer.exe
       
    43  *  @since S60 5.1
       
    44  */
       
    45 NONSHARABLE_CLASS( CChargingContextStateWFCharger ): public CBase, public MFSMState
       
    46     {
       
    47 
       
    48 
       
    49 public:
       
    50 
       
    51     
       
    52     /**
       
    53      * Two-phased constructor.
       
    54      * @param aFSMBody Body of the Finite State Machine.
       
    55      * @param aChargingContextController Host class object that owns the FSM.
       
    56      */
       
    57     static CChargingContextStateWFCharger* NewL(
       
    58             MFSMBody* aFSMBody, 
       
    59             CAccSrvChargingContextController* aChargingContextController );
       
    60     
       
    61 
       
    62     /**
       
    63     * Destructor.
       
    64     */
       
    65     virtual ~CChargingContextStateWFCharger();
       
    66 
       
    67     
       
    68 // from base class MFSMState
       
    69 
       
    70 
       
    71     /**
       
    72      * From MFSMState.
       
    73      * Function is called when entering the state. State can perform
       
    74      * necessary entry actions if any.
       
    75      *
       
    76      * @since S60 5.1
       
    77      * @param none. 
       
    78      * @return aFSMBody Interface pointer of a FSM body.
       
    79      */
       
    80     virtual void Enter();
       
    81 
       
    82     /**
       
    83      * From MFSMState.
       
    84      * Function is called by FSM Body whenever an event that might have 
       
    85      * impact on the state has been fired. Implementation has to found
       
    86      * out what event has occurred and decide whether it enforces
       
    87      * transition to another state.
       
    88      *
       
    89      * @since S60 5.1
       
    90      * @param none. 
       
    91      * @return none.
       
    92      */
       
    93     virtual void Input();
       
    94 
       
    95     /**
       
    96      * From MFSMState.
       
    97      * Function returns state's identification.
       
    98      *
       
    99      * @since S60 5.1
       
   100      * @param none. 
       
   101      * @return TFSMState State's identification.
       
   102      */
       
   103     virtual TFSMState Id();
       
   104 
       
   105     /**
       
   106      * From MFSMState.
       
   107      * Function returns state's name.
       
   108      *
       
   109      * @since S60 5.1
       
   110      * @param none. 
       
   111      * @return TPtrC Name of the state.
       
   112      */
       
   113     virtual TPtrC Name();
       
   114 
       
   115     
       
   116 protected:
       
   117 
       
   118 
       
   119 private:
       
   120 
       
   121 
       
   122     /**
       
   123      * C++ default constructor.
       
   124      */
       
   125     CChargingContextStateWFCharger();
       
   126 
       
   127     /**
       
   128      * By default Symbian OS constructor is private.
       
   129      * @param aFSMBody Body of the Finite State Machine.
       
   130      * @param aChargingContextController Host class object that owns the FSM.
       
   131      */
       
   132     void ConstructL(
       
   133             MFSMBody* aFSMBody, 
       
   134             CAccSrvChargingContextController* aChargingContextController );
       
   135 
       
   136 private: // data
       
   137 
       
   138     /**
       
   139      * Host class object that owns the FSM.
       
   140      * Not own.
       
   141      */
       
   142     CAccSrvChargingContextController* iChargingContextController;
       
   143 
       
   144     /**
       
   145      * FSM body.
       
   146      * Not own.
       
   147      */
       
   148     MFSMBody* iFSMBody;
       
   149 
       
   150     };
       
   151 
       
   152 #endif // C_CHARGINGCONTEXTSTATEWFCHARGER_H