OpenStructure
Loading...
Searching...
No Matches
transition.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// This file is part of the OpenStructure project <www.openstructure.org>
3//
4// Copyright (C) 2008-2020 by the OpenStructure authors
5//
6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License as published by the Free
8// Software Foundation; either version 3.0 of the License, or (at your option)
9// any later version.
10// This library is distributed in the hope that it will be useful, but WITHOUT
11// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13// details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with this library; if not, write to the Free Software Foundation, Inc.,
17// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18//------------------------------------------------------------------------------
19
20#ifndef PYTHON_SHELL_TRANSITION_HH
21#define PYTHON_SHELL_TRANSITION_HH
22
24#include "transition_guard.hh"
25#include <utility>
26
27#include <QObject>
28#include <QEvent>
29//fw decl
30class QKeyEvent;
31class QMouseEvent;
32
33namespace ost { namespace gui {
34
35//fw decl
36class State;
37class PythonShellWidget;
38class ShellHistory;
39
40class TransitionBase: public QObject{
41Q_OBJECT
42public:
44signals:
45 void triggered();
46protected:
47 void trigger_();
48 bool is_active_();
51};
52
54Q_OBJECT
55public:
58};
59
61Q_OBJECT
62public:
63 SignalTransition(QObject * sender,const char * signal, State* target, TransitionGuard* guard=new TransitionGuard());
64protected slots:
65 void onSignal();
66};
67
69Q_OBJECT
70public:
71 KeyEventTransition(int key,Qt::KeyboardModifiers modifiers, State* target, bool swallow_event=true, TransitionGuard* guard=new TransitionGuard());
72 virtual std::pair<bool,bool> checkEvent(QKeyEvent* event);
73protected:
74 int key_;
75 Qt::KeyboardModifiers modifiers_;
77};
78
80Q_OBJECT
81public:
82 MouseEventTransition(QEvent::Type type,Qt::MouseButton button,Qt::KeyboardModifiers modifiers, State* target, bool swallow_event=true, TransitionGuard* guard=new TransitionGuard());
83 virtual std::pair<bool,bool> checkEvent(QMouseEvent* event);
84protected:
85 QEvent::Type type_;
86 Qt::MouseButton button_;
87 Qt::KeyboardModifiers modifiers_;
89};
90
91
92
93
94}}//ns
95#endif // PYTHON_SHELL_TRANSITION_HH
AutomaticTransition(State *target, TransitionGuard *guard=new TransitionGuard())
KeyEventTransition(int key, Qt::KeyboardModifiers modifiers, State *target, bool swallow_event=true, TransitionGuard *guard=new TransitionGuard())
virtual std::pair< bool, bool > checkEvent(QKeyEvent *event)
Qt::KeyboardModifiers modifiers_
Definition transition.hh:75
virtual std::pair< bool, bool > checkEvent(QMouseEvent *event)
Qt::KeyboardModifiers modifiers_
Definition transition.hh:87
MouseEventTransition(QEvent::Type type, Qt::MouseButton button, Qt::KeyboardModifiers modifiers, State *target, bool swallow_event=true, TransitionGuard *guard=new TransitionGuard())
SignalTransition(QObject *sender, const char *signal, State *target, TransitionGuard *guard=new TransitionGuard())
TransitionBase(State *target, TransitionGuard *guard=new TransitionGuard())
TransitionGuard * guard_
Definition transition.hh:50
Definition base.dox:1