![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure |
00001 /* 00002 * Stellarium 00003 * Copyright (C) 2006 Fabien Chereau 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #ifndef _STELMODULE_HPP_ 00021 #define _STELMODULE_HPP_ 00022 00023 #include <QString> 00024 #include <QObject> 00025 00026 // Predeclaration 00027 class StelCore; 00028 class QSettings; 00029 class StelStyle; 00030 00040 class StelModule : public QObject 00041 { 00042 // Do not add Q_OBJECT here!! 00043 // This make this class compiled by the Qt moc compiler and for some unknown reasons makes it impossible to dynamically 00044 // load plugins on windows. 00045 public: 00046 StelModule() {;} 00047 00048 virtual ~StelModule() {;} 00049 00052 virtual void init() = 0; 00053 00056 virtual void draw(StelCore* core) = 0; 00057 00060 virtual void update(double deltaTime) = 0; 00061 00065 virtual void updateI18n() {;} 00066 00069 virtual void updateSkyCulture(const QString& skyCultureDir) {;} 00070 00072 virtual QString getModuleVersion() const; 00073 00075 virtual QString getAuthorName() const {return "Stellarium's Team";} 00076 00078 virtual QString getAuthorEmail() const {return "http://www.stellarium.org";} 00079 00082 virtual void handleMouseClicks(class QMouseEvent* e) {;} 00083 00086 virtual void handleMouseWheel(class QWheelEvent* e) {;} 00087 00090 virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b) {return false;} 00091 00095 virtual void handleKeys(class QKeyEvent* e) {;} 00096 00098 enum StelModuleSelectAction 00099 { 00100 AddToSelection, 00101 ReplaceSelection, 00102 RemoveFromSelection 00103 }; 00104 00108 virtual void selectedObjectChangeCallBack(StelModuleSelectAction action=ReplaceSelection) {;} 00109 00112 virtual void setStelStyle(const StelStyle& style) {;} 00113 00115 virtual void glWindowHasBeenResized(int w, int h) {;} 00116 00118 enum StelModuleActionName 00119 { 00120 ActionDraw, 00121 ActionUpdate, 00122 ActionHandleMouseClicks, 00123 ActionHandleMouseMoves, 00124 ActionHandleKeys 00125 }; 00126 00132 virtual double getCallOrder(StelModuleActionName actionName) const {return 0;} 00133 }; 00134 00135 #endif // _STELMODULE_HPP_