OpenStructure
build-2.9.0-doc
stage
include
ost
gui
python_shell
transition_guard.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 TRANSITION_GUARD_HH
21
#define TRANSITION_GUARD_HH
22
23
#include "
python_shell_fw.hh
"
24
#include "
python_interpreter.hh
"
25
#include <QObject>
26
27
namespace
ost
{
namespace
gui {
28
29
30
//fw decl
31
class
ShellHistory;
32
class
PythonShellWidget;
33
34
35
class
TransitionGuard
:
public
QObject
36
{
37
Q_OBJECT
38
39
public
:
40
TransitionGuard
();
41
virtual
bool
check
();
42
};
43
44
45
46
class
HistoryGuard
:
public
TransitionGuard
47
{
48
public
:
49
HistoryGuard
(
ShellHistory
* history,
BlockEditMode
mode);
50
virtual
bool
check
();
51
protected
:
52
ShellHistory
*
history_
;
53
BlockEditMode
mode_
;
54
};
55
56
class
EditPositionGuard
:
public
TransitionGuard
57
{
58
public
:
59
enum
FLAGS
{
60
ALWAYSTRUE
=0,
61
SMALLER
=1,
62
EQUAL
=2,
63
BIGGER
=4,
64
ANCHORSMALLER
=8,
65
ANCHOREQUAL
=16,
66
ANCHORBIGGER
=32
67
};
68
EditPositionGuard
(
PythonShellWidget
* shell,
int
flags1,
int
flags2=
ALWAYSTRUE
);
69
virtual
bool
check
();
70
protected
:
71
virtual
bool
check_flag
(
int
flag);
72
PythonShellWidget
*
shell_
;
73
int
flags1_
;
74
int
flags2_
;
75
};
76
77
class
BlockStatusGuard
:
public
TransitionGuard
78
{
79
public
:
80
BlockStatusGuard
(
PythonShellWidget
* shell,
int
status);
81
virtual
bool
check
();
82
protected
:
83
PythonShellWidget
*
shell_
;
84
int
status_
;
85
};
86
87
88
89
}}
//ns
90
91
92
#endif
// TRANSITION_GUARD_HH
ost::gui::BlockStatusGuard
Definition:
transition_guard.hh:78
ost::gui::BlockStatusGuard::shell_
PythonShellWidget * shell_
Definition:
transition_guard.hh:83
ost::gui::BlockStatusGuard::status_
int status_
Definition:
transition_guard.hh:84
ost::gui::BlockStatusGuard::BlockStatusGuard
BlockStatusGuard(PythonShellWidget *shell, int status)
ost::gui::BlockStatusGuard::check
virtual bool check()
ost::gui::EditPositionGuard
Definition:
transition_guard.hh:57
ost::gui::EditPositionGuard::shell_
PythonShellWidget * shell_
Definition:
transition_guard.hh:72
ost::gui::EditPositionGuard::EditPositionGuard
EditPositionGuard(PythonShellWidget *shell, int flags1, int flags2=ALWAYSTRUE)
ost::gui::EditPositionGuard::flags1_
int flags1_
Definition:
transition_guard.hh:73
ost::gui::EditPositionGuard::check_flag
virtual bool check_flag(int flag)
ost::gui::EditPositionGuard::check
virtual bool check()
ost::gui::EditPositionGuard::flags2_
int flags2_
Definition:
transition_guard.hh:74
ost::gui::EditPositionGuard::FLAGS
FLAGS
Definition:
transition_guard.hh:59
ost::gui::EditPositionGuard::ANCHORBIGGER
@ ANCHORBIGGER
Definition:
transition_guard.hh:66
ost::gui::EditPositionGuard::ANCHOREQUAL
@ ANCHOREQUAL
Definition:
transition_guard.hh:65
ost::gui::EditPositionGuard::EQUAL
@ EQUAL
Definition:
transition_guard.hh:62
ost::gui::EditPositionGuard::SMALLER
@ SMALLER
Definition:
transition_guard.hh:61
ost::gui::EditPositionGuard::ALWAYSTRUE
@ ALWAYSTRUE
Definition:
transition_guard.hh:60
ost::gui::EditPositionGuard::ANCHORSMALLER
@ ANCHORSMALLER
Definition:
transition_guard.hh:64
ost::gui::EditPositionGuard::BIGGER
@ BIGGER
Definition:
transition_guard.hh:63
ost::gui::HistoryGuard
Definition:
transition_guard.hh:47
ost::gui::HistoryGuard::history_
ShellHistory * history_
Definition:
transition_guard.hh:52
ost::gui::HistoryGuard::HistoryGuard
HistoryGuard(ShellHistory *history, BlockEditMode mode)
ost::gui::HistoryGuard::mode_
BlockEditMode mode_
Definition:
transition_guard.hh:53
ost::gui::HistoryGuard::check
virtual bool check()
ost::gui::PythonShellWidget
Definition:
python_shell_widget.hh:47
ost::gui::ShellHistory
Definition:
shell_history.hh:33
ost::gui::TransitionGuard
Definition:
transition_guard.hh:36
ost::gui::TransitionGuard::check
virtual bool check()
ost::gui::TransitionGuard::TransitionGuard
TransitionGuard()
ost::gui::BlockEditMode
BlockEditMode
Definition:
python_shell_fw.hh:31
ost
Definition:
base.dox:1
python_interpreter.hh
python_shell_fw.hh
Generated by
1.9.1