Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

core/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., 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            
00068     virtual void updateSkyCulture() {;} 
00069     
00071     virtual QString getModuleVersion() const;
00072     
00074     virtual QString getAuthorName() const {return "Stellarium's Team";}
00075     
00077     virtual QString getAuthorEmail() const {return "http://www.stellarium.org";}
00078 
00081     virtual void handleMouseClicks(class QMouseEvent* event) {return;}
00082     
00085     virtual void handleMouseWheel(class QWheelEvent* event) {return;}
00086     
00089     virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b) {return false;}
00090     
00094     virtual void handleKeys(class QKeyEvent* event) {return;}
00095 
00097     enum StelModuleSelectAction
00098     {
00099         AddToSelection,     
00100         ReplaceSelection,   
00101         RemoveFromSelection 
00102     };
00103     
00107     virtual void selectedObjectChangeCallBack(StelModuleSelectAction action=ReplaceSelection) {;}
00108     
00111     virtual void setStelStyle(const StelStyle& style) {;}
00112     
00114     virtual void glWindowHasBeenResized(int w, int h) {;}
00115     
00117     enum StelModuleActionName
00118     {
00119         ActionDraw,              
00120         ActionUpdate,            
00121         ActionHandleMouseClicks, 
00122         ActionHandleMouseMoves,  
00123         ActionHandleKeys         
00124     };
00125     
00131     virtual double getCallOrder(StelModuleActionName actionName) const {return 0;}
00132 };
00133 
00134 #endif // _STELMODULE_HPP_

Generated on Mon Feb 2 17:23:47 2009 for Stellarium by  doxygen 1.5.5