camerauis/cameraxui/cxengine/inc/cxestatemachine.h
changeset 48 42ba2d16bf40
parent 19 d9aefe59d544
equal deleted inserted replaced
37:64817133cd1d 48:42ba2d16bf40
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 */
    16 */
       
    17 
    17 #ifndef CXESTATEMACHINE_H
    18 #ifndef CXESTATEMACHINE_H
    18 #define CXESTATEMACHINE_H
    19 #define CXESTATEMACHINE_H
    19 
    20 
    20 #include "cxestatemachinebase.h"
    21 #include "cxestatemachinebase.h"
    21 
    22 
    38     * add all the defined states and call setInitialState().
    39     * add all the defined states and call setInitialState().
    39     *
    40     *
    40     * @sa addState setInitialState
    41     * @sa addState setInitialState
    41     * @param stateMachineName  Name for this state machine (used for debug prints)
    42     * @param stateMachineName  Name for this state machine (used for debug prints)
    42     */
    43     */
    43     CxeStateMachine(const char* stateMachineName);
    44     CxeStateMachine(const char *stateMachineName);
    44     virtual ~CxeStateMachine();
    45     virtual ~CxeStateMachine();
    45 
    46 
    46 protected:
    47 protected:
    47     /**
    48     /**
    48      * Add a new state to the machine. Takes ownership of state. This function will
    49      * Add a new state to the machine. Takes ownership of state. This function will
    60      * transition is invalid, this function will panic.
    61      * transition is invalid, this function will panic.
    61      *
    62      *
    62      * @param stateId State ID of the new state
    63      * @param stateId State ID of the new state
    63      * @param error   Optional error code to be associated with the transition
    64      * @param error   Optional error code to be associated with the transition
    64      */
    65      */
    65     bool setState(int stateId, int error = 0);
    66     bool setState(int stateId, CxeError::Id error = CxeError::None);
    66 
    67 
    67     /**
    68     /**
    68      * Set the initial state of the state machine. Can be called only once.
    69      * Set the initial state of the state machine. Can be called only once.
    69      * This method will panic, if initial state to be set is unknown, or initial
    70      * This method will panic, if initial state to be set is unknown, or initial
    70      * state has already been set.
    71      * state has already been set.
    85 private:
    86 private:
    86 
    87 
    87 };
    88 };
    88 
    89 
    89 #endif // CXESTATEMACHINE_H
    90 #endif // CXESTATEMACHINE_H
    90 
       
    91