Engauge Digitizer  2
TutorialStateContext.h
Go to the documentation of this file.
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #ifndef TUTORIAL_STATE_CONTEXT_H
8 #define TUTORIAL_STATE_CONTEXT_H
9 
10 #include <QObject>
11 #include <QVector>
13 
14 class QTimer;
15 class TutorialDlg;
16 
20 class TutorialStateContext : public QObject
21 {
22  Q_OBJECT;
23 
24  public:
27 
30 
33  void requestDelayedStateTransition (TutorialState tutorialState);
34 
39 
42 
43  private slots:
44  void slotTimeout ();
45 
46  private:
47 
48  void completeRequestedStateTransitionIfExists ();
49  void createStates ();
50  void createTimer ();
51 
52  QVector<TutorialStateAbstractBase*> m_states;
53  TutorialState m_currentState;
54  TutorialState m_requestedState; // Same as m_currentState until requestStateTransition is called
55 
56  TutorialDlg &m_tutorialDlg;
57 
58  // Timer for delayed state transitions
59  QTimer *m_timer;
60 };
61 
62 #endif // TUTORIAL_STATE_CONTEXT_H
void requestImmediateStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.
Tutorial using a strategy like a comic strip with decision points deciding which panels appear.
Definition: TutorialDlg.h:19
TutorialStateContext(TutorialDlg &tutorialDlg)
Single constructor.
Context class for tutorial state machine.
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.
~TutorialStateContext()
Destructor deallocates memory.