devicediagnosticsfw/diagframework/inc/diagenginestatemachineobserver.h
branchRCL_3
changeset 61 b183ec05bd8c
parent 59 13d7c31c74e0
child 62 19bba8228ff0
equal deleted inserted replaced
59:13d7c31c74e0 61:b183ec05bd8c
     1 /*
       
     2 * Copyright (c) 2007 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:  Class declaration for MStateMachineObserver
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DIAGENGINESTATEMACHINEOBSERVER_H
       
    20 #define DIAGENGINESTATEMACHINEOBSERVER_H
       
    21 
       
    22 // system include
       
    23 
       
    24 // user include
       
    25 #include "diagenginestates.h"   // DiagFwInternal::TState
       
    26 #include "diagengineevents.h"   // DiagFwInternal::TEvent
       
    27 
       
    28 namespace DiagFwInternal
       
    29     {
       
    30 // forward declaration
       
    31 class CEventBasic;
       
    32 
       
    33 /**
       
    34  *  Diagnostics Framework Engine State Machine Observer
       
    35  *
       
    36  *  This interface is called by CDiagEngineStateMachine to notify
       
    37  *  its client of state changes and events.
       
    38  *
       
    39  *  @since S60 v5.0
       
    40  */
       
    41 class MStateMachineObserver
       
    42     {
       
    43 public:
       
    44     /**
       
    45     * Notify state machine client that state machine has entered a new state.
       
    46     *
       
    47     * @param aPreviousState     Previous state.
       
    48     * @param aCurrentState      Current state. (new state.)
       
    49     * @param aEventPreview  Event that caused state change. Note that
       
    50     *   this is just a preview.  HandleEventL() will be called with the same
       
    51     *   event later on.
       
    52     */
       
    53     virtual void HandleStateChangedL( TState aPreviousState, 
       
    54                                       TState aCurrentState,
       
    55                                       const CEventBasic& aEventPreview ) = 0;
       
    56 
       
    57     /**
       
    58     * Notify state machine client that a new event is received.
       
    59     *
       
    60     * @param aEvent        New event.
       
    61     */
       
    62     virtual void HandleEventL( CEventBasic& aEvent ) = 0;
       
    63 
       
    64     /**
       
    65     * Notify state machine client that an abnormal error has occured.
       
    66     * Client can handle the error and return appropriate error state.
       
    67     *
       
    68     * @param aCurrentState Current state.
       
    69     * @param aError        Error number.
       
    70     * @return TState       New state to go to.
       
    71     */
       
    72     virtual TState HandleError( TState aCurrentState, TInt aError ) = 0;
       
    73     };
       
    74     } // end of namespace DiagFwInternal
       
    75     
       
    76 #endif // DIAGENGINESTATEMACHINEOBSERVER_H
       
    77 
       
    78 // End of File
       
    79