camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxetestutils/cxedummystatemachine.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 CXEDUMMYSTATEMACHINE_H
       
    18 #define CXEDUMMYSTATEMACHINE_H
       
    19 
       
    20 #include <QObject>
       
    21 #include <QQueue>
       
    22 #include "cxestatemachine.h"
       
    23 #include "cxenamespace.h"
       
    24 
       
    25 class CxeDummyStateMachine : public QObject, public CxeStateMachine
       
    26 {
       
    27     Q_OBJECT
       
    28 
       
    29 public:
       
    30     enum State {
       
    31         A = 0x01,
       
    32         B = 0x02,
       
    33         C = 0x04
       
    34         };
       
    35 
       
    36 public:
       
    37     CxeDummyStateMachine();
       
    38     virtual ~CxeDummyStateMachine();
       
    39 
       
    40     State state() const;
       
    41 
       
    42     void delayedStateChange(State targetState, int ms);
       
    43 
       
    44 signals:
       
    45     void stateChanged(CxeDummyStateMachine::State newState, CxeError::Id error);
       
    46 
       
    47 public slots:
       
    48     void timeout();
       
    49 
       
    50 protected:
       
    51     void handleStateChanged(int newStateId, CxeError::Id error);
       
    52 
       
    53 private:
       
    54     QQueue<State> mTargetStateQueue;
       
    55     int mDelay;
       
    56 };
       
    57 
       
    58 Q_DECLARE_METATYPE(CxeDummyStateMachine::State)
       
    59 
       
    60 #endif // CXEDUMMYSTATEMACHINE_H