OpenStructure
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
stage
include
ost
gui
python_shell
transition.hh
Go to the documentation of this file.
1
#ifndef PYTHON_SHELL_TRANSITION_HH
2
#define PYTHON_SHELL_TRANSITION_HH
3
4
#include <utility>
5
#include <
ost/gui/python_shell/python_interpreter.hh
>
6
7
#include <QObject>
8
#include <QEvent>
9
#include "
transition_guard.hh
"
10
//fw decl
11
class
QKeyEvent;
12
class
QMouseEvent;
13
14
namespace
ost {
namespace
gui {
15
16
//fw decl
17
class
State;
18
class
PythonShellWidget;
19
class
ShellHistory;
20
21
class
TransitionBase
:
public
QObject{
22
Q_OBJECT
23
public
:
24
TransitionBase
(
State
* target,
TransitionGuard
* guard=
new
TransitionGuard
());
25
signals:
26
void
triggered
();
27
protected
:
28
void
trigger_
();
29
bool
is_active_
();
30
State
*
target_
;
31
TransitionGuard
*
guard_
;
32
};
33
34
class
AutomaticTransition
:
public
TransitionBase
{
35
Q_OBJECT
36
public
:
37
AutomaticTransition
(
State
* target,
TransitionGuard
* guard=
new
TransitionGuard
());
38
bool
checkTransition
();
39
};
40
41
class
SignalTransition
:
public
TransitionBase
{
42
Q_OBJECT
43
public
:
44
SignalTransition
(QObject * sender,
const
char
* signal,
State
* target,
TransitionGuard
* guard=
new
TransitionGuard
());
45
protected
slots:
46
void
onSignal
();
47
};
48
49
class
KeyEventTransition
:
public
TransitionBase
{
50
Q_OBJECT
51
public
:
52
KeyEventTransition
(
int
key,Qt::KeyboardModifiers modifiers,
State
* target,
bool
swallow_event=
true
,
TransitionGuard
* guard=
new
TransitionGuard
());
53
virtual
std::pair<bool,bool>
checkEvent
(QKeyEvent* event);
54
protected
:
55
int
key_
;
56
Qt::KeyboardModifiers
modifiers_
;
57
bool
swallow_
;
58
};
59
60
class
MouseEventTransition
:
public
TransitionBase
{
61
Q_OBJECT
62
public
:
63
MouseEventTransition
(
QEvent::Type
type,Qt::MouseButton button,Qt::KeyboardModifiers modifiers,
State
* target,
bool
swallow_event=
true
,
TransitionGuard
* guard=
new
TransitionGuard
());
64
virtual
std::pair<bool,bool>
checkEvent
(QMouseEvent* event);
65
protected
:
66
QEvent::Type
type_
;
67
Qt::MouseButton
button_
;
68
Qt::KeyboardModifiers
modifiers_
;
69
bool
swallow_
;
70
};
71
72
73
74
75
}}
//ns
76
#endif // PYTHON_SHELL_TRANSITION_HH
Generated on Mon Nov 11 2013 09:56:11 for OpenStructure by
1.8.1.1