dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
ioutputpane.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #ifndef IOUTPUTPANE_H
29 #define IOUTPUTPANE_H
30 
31 #include "core_global.h"
32 
33 #include <QtCore/QObject>
34 #include <QtCore/QList>
35 #include <QtCore/QString>
36 
37 QT_BEGIN_NAMESPACE
38 class QWidget;
39 QT_END_NAMESPACE
40 
41 namespace Core {
42 
43 class CORE_EXPORT IOutputPane : public QObject
44 {
45  Q_OBJECT
46 public:
47  IOutputPane(QObject *parent = nullptr)
48  : QObject(parent)
49  {
50  }
51  virtual ~IOutputPane() {}
52 
53  virtual QWidget *outputWidget(QWidget *parent) = 0;
54  virtual QList<QWidget *> toolBarWidgets() const = 0;
55  virtual QString name() const = 0;
56 
57  // -1 don't show in statusBar
58  // 100...0 show at front...end
59  virtual int priorityInStatusBar() const = 0;
60 
61  virtual void clearContents() = 0;
62  virtual void visibilityChanged(bool visible) = 0;
63 
64  // This function is called to give the outputwindow focus
65  virtual void setFocus() = 0;
66  // Wheter the outputpane has focus
67  virtual bool hasFocus() = 0;
68  // Wheter the outputpane can be focused at the moment.
69  // (E.g. the search result window doesn't want to be focussed if the are no results.)
70  virtual bool canFocus() = 0;
71 
72  virtual bool canNavigate() = 0;
73  virtual bool canNext() = 0;
74  virtual bool canPrevious() = 0;
75  virtual void goToNext() = 0;
76  virtual void goToPrev() = 0;
77 public slots:
78  void popup() { popup(true); }
79  void popup(bool withFocus) { emit showPage(withFocus); }
80 
81  void hide() { emit hidePage(); }
82 
83  void toggle() { toggle(true); }
84 
85  void toggle(bool withFocusIfShown) { emit togglePage(withFocusIfShown); }
86 
87  void navigateStateChanged() { emit navigateStateUpdate(); }
88 
89 signals:
90  void showPage(bool withFocus);
91  void hidePage();
92  void togglePage(bool withFocusIfShown);
93  void navigateStateUpdate();
94 };
95 
96 } // namespace Core
97 
98 #endif // IOUTPUTPANE_H
void popup(bool withFocus)
Definition: ioutputpane.h:79
void toggle(bool withFocusIfShown)
Definition: ioutputpane.h:85
IOutputPane(QObject *parent=nullptr)
Definition: ioutputpane.h:47
virtual ~IOutputPane()
Definition: ioutputpane.h:51
void navigateStateChanged()
Definition: ioutputpane.h:87
Definition: icore.h:39