camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxestatemachine/cxestatemachineunit.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     1 /*
       
     2  * Copyright (c) 2009 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:
       
    15  *
       
    16  */
       
    17 #ifndef CXESTATEMACHINEUNIT_H_
       
    18 #define CXESTATEMACHINEUNIT_H_
       
    19 
       
    20 #include <QObject>
       
    21 #include "cxestatemachinebase.h"
       
    22 
       
    23 // this class is needed to test CxeStateMachine
       
    24 // since CxeStateMachine contains a pure virtual function
       
    25 
       
    26 class CxeStateMachineUnit : public CxeStateMachineBase
       
    27 {
       
    28     friend class UnitTestCxeStateMachine;
       
    29 public:
       
    30 
       
    31     CxeStateMachineUnit(const char *stateMachineName);
       
    32     virtual ~CxeStateMachineUnit();
       
    33 
       
    34     /**
       
    35      * Virtual function derived from CxeStateMachine.
       
    36      * The implementation should emit a stateChanged signal.
       
    37      *
       
    38      * @param newStateId State ID for the new state
       
    39      * @param error      An error code associated with the state transition
       
    40      */
       
    41     virtual void handleStateChanged(int newStateId, CxeError::Id error);
       
    42 
       
    43 protected:
       
    44 
       
    45     int mHandleStateChangedCounter;
       
    46     CxeError::Id mStateChangeErrorId;
       
    47     int mStateChangeStateId;
       
    48 
       
    49 private:
       
    50 
       
    51     // Friend classes
       
    52     friend class UnitTestCxeStateMachine;
       
    53 
       
    54 };
       
    55 
       
    56 #endif /* CXESTATEMACHINEUNIT_H_ */