OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
state.hh
Go to the documentation of this file.
1 #ifndef PYTHON_SHELL_STATE_HH
2 #define PYTHON_SHELL_STATE_HH
3 
4 #include <QObject>
5 #include <QList>
6 
7 //fw decl
8 class QKeyEvent;
9 class QMouseEvent;
10 
11 namespace ost { namespace gui {
12 
13 //fw decl
14 class SignalTransition;
15 class MouseEventTransition;
16 class KeyEventTransition;
17 class AutomaticTransition;
18 
19 class State: public QObject{
20 Q_OBJECT
21 public:
22  State();
23  void addTransition(SignalTransition * transition);
24  void addTransition(MouseEventTransition * transition);
25  void addTransition(KeyEventTransition* transition);
26  void addTransition(AutomaticTransition* transition);
27  bool isActive();
28  void setActive();
29  bool checkEvent(QKeyEvent* event);
30  bool checkEvent(QMouseEvent* event);
32  virtual void onEntry();
33  virtual void onExit();
34 signals:
35  void entered();
36  void exited();
37 protected:
38  QList<MouseEventTransition*> mouse_event_transitions_;
39  QList<KeyEventTransition*> key_event_transitions_;
40  QList<AutomaticTransition*> automatic_transitions_;
41 };
42 
43 
44 }}//ns
45 #endif // PYTHON_SHELL_STATE_HH