Stellarium 0.14.3
TextUserInterface.hpp
1 /*
2  * Copyright (C) 2009 Matthew Gates
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17  */
18 
19 #ifndef TEXTUSERINTERFACE_HPP_
20 #define _TEXTUSERINTERFACE_HPP_ 1
21 
22 #include "StelModule.hpp"
23 #include "DummyDialog.hpp"
24 #include "StelCore.hpp"
25 
26 #include <QObject>
27 #include <QString>
28 #include <QFont>
29 
30 class TuiNode;
31 
34 {
35  Q_OBJECT
36 public:
38  virtual ~TextUserInterface();
39 
41  // Methods defined in the StelModule class
42  virtual void init();
43  virtual void update(double) {;}
44  virtual void draw(StelCore* core);
45  virtual double getCallOrder(StelModuleActionName actionName) const;
46  virtual void handleKeys(class QKeyEvent* event);
47 
49  // Methods specific to TextUserInterface
51  void loadConfiguration(void);
52 
53 public slots:
55  void setTuiMenuActive(bool tActive) { tuiActive = tActive;}
57  void setTuiDateTime(bool tDateTime) { tuiDateTime = tDateTime; }
59  void setTuiObjInfo(bool tObjInfo) { tuiObjInfo = tObjInfo; }
61  void setTuiGravityUi(bool tGravityUi) { tuiGravityUi = tGravityUi; }
62 
63 private slots:
64  void setHomePlanet(QString planetName);
65  void setAltitude(int altitude);
66  void setLatitude(double latitude);
67  void setLongitude(double longitude);
68  void setStartupDateMode(QString mode);
69  void setDateFormat(QString format);
70  void setTimeFormat(QString format);
71  void setSkyCulture(QString i18);
72  void setAppLanguage(QString lang);
73  void saveDefaultSettings(void);
74  void shutDown(void);
75  void setBortleScale(int bortle);
76 
77 private:
78  DummyDialog dummyDialog;
79  QFont font;
80  bool tuiActive;
81  bool tuiDateTime;
82  bool tuiObjInfo;
83  bool tuiGravityUi;
84  TuiNode* currentNode;
85  Vec3f color;
86 
87  double getLatitude(void);
88  double getLongitude(void);
89 };
90 
91 
92 
93 #include <QObject>
94 #include "StelPluginInterface.hpp"
95 
98 {
99  Q_OBJECT
100  Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
101  Q_INTERFACES(StelPluginInterface)
102 public:
103  virtual StelModule* getStelModule() const;
104  virtual StelPluginInfo getPluginInfo() const;
105 };
106 
107 #endif /*_TEXTUSERINTERFACE_HPP_*/
This is an example of a plug-in which can be dynamically loaded into stellarium.
void loadConfiguration(void)
Loads the module's configuration from the config file.
void setTuiGravityUi(bool tGravityUi)
Set Gravity text for the TUI text.
The TextUserInterface wants to intercept all key presses including those which are assigned to glocal...
Definition: DummyDialog.hpp:34
virtual StelPluginInfo getPluginInfo() const =0
void setTuiObjInfo(bool tObjInfo)
Show/hide the selected object's short object information.
TuiNode objects are linked together in a network of nodes to form the structure of a menu which may b...
Definition: TuiNode.hpp:42
This class is used by Qt to manage a plug-in interface.
virtual class StelModule * getStelModule() const =0
void setTuiMenuActive(bool tActive)
Show/hide the TUI menu.
void setTuiDateTime(bool tDateTime)
Show/hide the TUI date time display.