Stellarium 0.14.3
CompassMarks.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 COMPASSMARKS_HPP_
20 #define COMPASSMARKS_HPP_
21 
22 #include "VecMath.hpp"
23 #include "StelModule.hpp"
24 #include "StelFader.hpp"
25 #include <QFont>
26 
27 class StelButton;
28 
38 class CompassMarks : public StelModule
44 {
45  Q_OBJECT
46  Q_PROPERTY(bool marksVisible READ getCompassMarks WRITE setCompassMarks NOTIFY compassMarksChanged)
47 public:
48  CompassMarks();
49  virtual ~CompassMarks();
50 
52  // Methods defined in the StelModule class
53  virtual void init();
54  virtual void update(double deltaTime);
55  virtual void draw(StelCore* core);
56  virtual double getCallOrder(StelModuleActionName actionName) const;
57 
58  bool getCompassMarks() const {return markFader;}
59 
60 public slots:
61  void setCompassMarks(bool b);
62 
68  void loadConfiguration();
74  void saveConfiguration();
75  void restoreDefaultConfiguration();
76 
77 signals:
78  void compassMarksChanged(bool);
79 private slots:
80  void cardinalPointsChanged(bool b);
81 
82 private:
83  QSettings* conf;
85  bool displayedAtStartup;
87  QFont font;
88  Vec3f markColor;
89  LinearFader markFader;
90  StelButton* toolbarButton;
91  bool cardinalPointsState;
92 };
93 
94 
95 #include <QObject>
96 #include "StelPluginInterface.hpp"
97 
100 {
101  Q_OBJECT
102  Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
103  Q_INTERFACES(StelPluginInterface)
104 public:
105  virtual StelModule* getStelModule() const;
106  virtual StelPluginInfo getPluginInfo() const;
107 
108 };
109 
110 #endif /*COMPASSMARKS_HPP_*/
void loadConfiguration()
Load the plug-in's settings from the configuration file.
void saveConfiguration()
Save the plug-in's settings to the configuration file.
virtual StelPluginInfo getPluginInfo() const =0
virtual class StelModule * getStelModule() const =0
Main class of the Compass Marks plug-in.
This class is used by Qt to manage a plug-in interface.