Stellarium 0.13.1
StelNoGui.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2009 Fabien Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef _STELNOGUI_HPP_
21 #define _STELNOGUI_HPP_
22 
23 #include "StelGuiBase.hpp"
24 
27 class StelNoGui : public StelGuiBase
28 {
29 public:
30  StelNoGui() {;}
31  ~StelNoGui() {;}
32  virtual void init(QGraphicsWidget* topLevelGraphicsWidget, class StelAppGraphicsWidget* stelAppGraphicsWidget) {;}
33  virtual void updateI18n() {;}
34  virtual void setStelStyle(const QString& section) {;}
35  virtual void setInfoTextFilters(const StelObject::InfoStringGroup& aflags) {dummyInfoTextFilter=aflags;}
36  virtual const StelObject::InfoStringGroup& getInfoTextFilters() const {return dummyInfoTextFilter;}
37  virtual class QProgressBar* addProgressBar();
38  virtual QAction* addGuiActions(const QString& actionName, const QString& text, const QString& shortCut, const QString& helpGroup, bool checkable=true, bool autoRepeat=false) {return NULL;}
39  virtual void forceRefreshGui() {;}
40  virtual void setVisible(bool b) {visible=b;}
41  virtual bool getVisible() const {return visible;}
42  virtual bool isCurrentlyUsed() const {return false;}
43 private:
44  StelObject::InfoStringGroup dummyInfoTextFilter;
45  bool visible;
46 };
47 
49 class StelNoGuiPluginInterface : public QObject, public StelGuiPluginInterface
50 {
51  Q_OBJECT
52  Q_INTERFACES(StelGuiPluginInterface)
53 public:
54  virtual class StelGuiBase* getStelGuiBase() const;
55 };
56 
57 
58 
59 #endif // _STELNOGUI_HPP_
Define the interface to implement when creating a GUI plugin.
Definition: StelGuiBase.hpp:62
virtual bool isCurrentlyUsed() const
Show wether the Gui is currently used.
Definition: StelNoGui.hpp:42
An example GUI plugin with an empty GUI.
Definition: StelNoGui.hpp:49
virtual bool getVisible() const
Get the current visible status of the GUI.
Definition: StelNoGui.hpp:41
Abstract class defining the base interface for all GUIs.
Definition: StelGuiBase.hpp:32
virtual void setInfoTextFilters(const StelObject::InfoStringGroup &aflags)
Get a pointer on the info panel used to display selected object info.
Definition: StelNoGui.hpp:35
Dummy implementation of StelGuiBase to use when no GUI is used.
Definition: StelNoGui.hpp:27
virtual class StelGuiBase * getStelGuiBase() const =0
Get the instance of StelGuiBase implmenting the GUI.
virtual void setStelStyle(const QString &section)
Load color scheme matchin the section name.
Definition: StelNoGui.hpp:34
virtual void setVisible(bool b)
Show whether the GUI is visible.
Definition: StelNoGui.hpp:40