Stellarium 0.15.2
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 
33 // TODO: Update this doc. Is it really dynamically loadable? Or just left-over template documentation from the plugin template?
37 {
38  Q_OBJECT
39 public:
41  virtual ~TextUserInterface();
42 
44  // Methods defined in the StelModule class
45  virtual void init();
46  virtual void update(double) {;}
47  virtual void draw(StelCore* core);
48  virtual double getCallOrder(StelModuleActionName actionName) const;
49  virtual void handleKeys(class QKeyEvent* event);
50 
52  // Methods specific to TextUserInterface
54  void loadConfiguration(void);
55 
56 public slots:
58  void setTuiMenuActive(bool tActive) { tuiActive = tActive;}
60  void setTuiDateTime(bool tDateTime) { tuiDateTime = tDateTime; }
62  void setTuiObjInfo(bool tObjInfo) { tuiObjInfo = tObjInfo; }
64  void setTuiGravityUi(bool tGravityUi) { tuiGravityUi = tGravityUi; }
65 
66 private slots:
67  void setHomePlanet(QString planetName);
68  void setAltitude(int altitude);
69  void setLatitude(double latitude);
70  void setLongitude(double longitude);
71  void setStartupDateMode(QString mode);
72  void setDateFormat(QString format);
73  void setTimeFormat(QString format);
74  void setSkyCulture(QString i18);
75  void setAppLanguage(QString lang);
76  void setSkyLanguage(QString lang);
77  void saveDefaultSettings(void);
78  void shutDown(void);
79 
80 private:
81  DummyDialog dummyDialog;
82  QFont font;
83  bool tuiActive;
84  bool tuiDateTime;
85  bool tuiObjInfo;
86  bool tuiGravityUi;
87  TuiNode* currentNode;
88  Vec3f color;
89 
90  double getLatitude(void);
91  double getLongitude(void);
92 };
93 
94 
95 
96 #include <QObject>
97 #include "StelPluginInterface.hpp"
98 
101 {
102  Q_OBJECT
103  Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
104  Q_INTERFACES(StelPluginInterface)
105 public:
106  virtual StelModule* getStelModule() const;
107  virtual StelPluginInfo getPluginInfo() const;
108 };
109 
110 #endif /*_TEXTUSERINTERFACE_HPP_*/
This is an example of a plug-in which can be dynamically loaded into stellarium.
Define the interface to implement when creating a plugin.
virtual void handleKeys(class QKeyEvent *event)
Handle key events.
void loadConfiguration(void)
Loads the module&#39;s configuration from the config file.
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
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 void init()
Initialize itself.
void setTuiObjInfo(bool tObjInfo)
Show/hide the selected object&#39;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
virtual void update(double)
Update the module with respect to the time.
This class is used by Qt to manage a plug-in interface.
StelModuleActionName
Define the possible action for which an order is defined.
Definition: StelModule.hpp:121
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
virtual double getCallOrder(StelModuleActionName actionName) const
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.
void setTuiMenuActive(bool tActive)
Show/hide the TUI menu.
void setTuiDateTime(bool tDateTime)
Show/hide the TUI date time display.
This is the common base class for all the main components of stellarium.
Definition: StelModule.hpp:49
Contains information about a Stellarium plugin.