Stellarium 0.12.0
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · Renderer · File Structure

StelModule.hpp

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., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, 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 
00049 class StelModule : public QObject
00050 {
00051     // Do not add Q_OBJECT here!!
00052     // This make this class compiled by the Qt moc compiler and for some unknown reasons makes it impossible to dynamically
00053     // load plugins on windows.
00054 public:
00055     StelModule() {;}
00056 
00057     virtual ~StelModule() {;}
00058 
00061     virtual void init() = 0;
00062 
00065     virtual void deinit() {;}
00066 
00070     virtual void draw(StelCore* core, class StelRenderer* renderer) 
00071     {
00072         Q_UNUSED(core);
00073         Q_UNUSED(renderer);
00074     }
00075 
00080     virtual bool drawPartial(StelCore* core, class StelRenderer* renderer);
00081 
00084     virtual void update(double deltaTime) = 0;
00085 
00087     virtual QString getModuleVersion() const;
00088 
00090     virtual QString getAuthorName() const {return "Stellarium's Team";}
00091 
00093     virtual QString getAuthorEmail() const {return "http://www.stellarium.org";}
00094 
00097     virtual void handleMouseClicks(class QMouseEvent*) {;}
00098 
00101     virtual void handleMouseWheel(class QWheelEvent*) {;}
00102 
00105     virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b) {Q_UNUSED(x); Q_UNUSED(y); Q_UNUSED(b); return false;}
00106 
00110     virtual void handleKeys(class QKeyEvent* e) {Q_UNUSED(e);}
00111 
00113     enum StelModuleSelectAction
00114     {
00115         AddToSelection,     
00116         ReplaceSelection,   
00117         RemoveFromSelection 
00118     };
00119 
00121     enum StelModuleActionName
00122     {
00123         ActionDraw,              
00124         ActionUpdate,            
00125         ActionHandleMouseClicks, 
00126         ActionHandleMouseMoves,  
00127         ActionHandleKeys         
00128     };
00129 
00135     virtual double getCallOrder(StelModuleActionName actionName) const {Q_UNUSED(actionName); return 0;}
00136 
00141     virtual bool configureGui(bool show=true) {Q_UNUSED(show); return false;}
00142 };
00143 
00144 #endif // _STELMODULE_HPP_
Generated on Thu Jan 31 14:05:40 2013 for Stellarium by  doxygen 1.6.3