Stellarium 0.12.4
StelModule.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2006 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 _STELMODULE_HPP_
21 #define _STELMODULE_HPP_
22 
23 #include <QString>
24 #include <QObject>
25 
26 // Predeclaration
27 class StelCore;
28 class QSettings;
29 
49 class StelModule : public QObject
50 {
51  // Do not add Q_OBJECT here!!
52  // This make this class compiled by the Qt moc compiler and for some unknown reasons makes it impossible to dynamically
53  // load plugins on windows.
54 public:
55  StelModule() {;}
56 
57  virtual ~StelModule() {;}
58 
61  virtual void init() = 0;
62 
65  virtual void deinit() {;}
66 
70  virtual void draw(StelCore* core, class StelRenderer* renderer)
71  {
72  Q_UNUSED(core);
73  Q_UNUSED(renderer);
74  }
75 
80  virtual bool drawPartial(StelCore* core, class StelRenderer* renderer);
81 
84  virtual void update(double deltaTime) = 0;
85 
87  virtual QString getModuleVersion() const;
88 
90  virtual QString getAuthorName() const {return "Stellarium's Team";}
91 
93  virtual QString getAuthorEmail() const {return "http://www.stellarium.org";}
94 
97  virtual void handleMouseClicks(class QMouseEvent*) {;}
98 
101  virtual void handleMouseWheel(class QWheelEvent*) {;}
102 
105  virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b) {Q_UNUSED(x); Q_UNUSED(y); Q_UNUSED(b); return false;}
106 
110  virtual void handleKeys(class QKeyEvent* e) {Q_UNUSED(e);}
111 
114  {
118  };
119 
122  {
128  };
129 
135  virtual double getCallOrder(StelModuleActionName actionName) const {Q_UNUSED(actionName); return 0;}
136 
141  virtual bool configureGui(bool show=true) {Q_UNUSED(show); return false;}
142 };
143 
144 #endif // _STELMODULE_HPP_