OpenStructure
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:
41  virtual bool check();
42 };
43 
44 
45 
47 {
48 public:
50  virtual bool check();
51 protected:
54 };
55 
57 {
58 public:
59  enum FLAGS{
62  EQUAL=2,
63  BIGGER=4,
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);
73  int flags1_;
74  int flags2_;
75 };
76 
78 {
79 public:
80  BlockStatusGuard(PythonShellWidget* shell, int status);
81  virtual bool check();
82 protected:
84  int status_;
85 };
86 
87 
88 
89 }} //ns
90 
91 
92 #endif // TRANSITION_GUARD_HH
PythonShellWidget * shell_
BlockStatusGuard(PythonShellWidget *shell, int status)
PythonShellWidget * shell_
EditPositionGuard(PythonShellWidget *shell, int flags1, int flags2=ALWAYSTRUE)
virtual bool check_flag(int flag)
HistoryGuard(ShellHistory *history, BlockEditMode mode)
virtual bool check()
Definition: base.dox:1