StelModule.hpp   StelModule.hpp 
skipping to change at line 29 skipping to change at line 29
#ifndef _STELMODULE_HPP_ #ifndef _STELMODULE_HPP_
#define _STELMODULE_HPP_ #define _STELMODULE_HPP_
#include <QString> #include <QString>
#include <QObject> #include <QObject>
// Predeclaration // Predeclaration
class StelCore; class StelCore;
class QSettings; class QSettings;
class StelStyle;
//! This is the common base class for all the main components of stellarium . //! This is the common base class for all the main components of stellarium .
//! Standard StelModules are the one displaying the stars, the constellatio ns, the planets etc.. //! Standard StelModules are the one displaying the stars, the constellatio ns, the planets etc..
//! Every new module derived class should implement the methods defined in StelModule.hpp. //! Every new module derived class should implement the methods defined in StelModule.hpp.
//! Once a module is registered into the StelModuleMgr, it is automatically managed by the program. //! Once a module is registered into the StelModuleMgr, it is automatically managed by the program.
//! It can be called using the GETSTELMODULE macro, passing as argument its name, which is also the QObject name //! It can be called using the GETSTELMODULE macro, passing as argument its name, which is also the QObject name
//! Because StelModules are very generic components, it is also possible to load them dynamically, //! Because StelModules are very generic components, it is also possible to load them dynamically,
//! thus enabling creation of external plug-ins for stellarium. //! thus enabling creation of external plug-ins for stellarium.
//! @sa StelObjectModule for StelModule managing collections of StelObject. //! @sa StelObjectModule for StelModule managing collections of StelObject.
//! @sa @ref plugins for documentation on how to develop external plugins. //! @sa @ref plugins for documentation on how to develop external plugins.
skipping to change at line 60 skipping to change at line 59
//! Initialize itself. //! Initialize itself.
//! If the initialization takes significant time, the progress shoul d be displayed on the loading bar. //! If the initialization takes significant time, the progress shoul d be displayed on the loading bar.
virtual void init() = 0; virtual void init() = 0;
//! Called before the module will be delete, and before the openGL c ontext is suppressed. //! Called before the module will be delete, and before the openGL c ontext is suppressed.
//! Deinitialize all openGL texture in this method. //! Deinitialize all openGL texture in this method.
virtual void deinit() {;} virtual void deinit() {;}
//! Execute all the drawing functions for this module. //! Execute all the drawing functions for this module.
//! @param core the core to use for the drawing //! @param core the core to use for the drawing
virtual void draw(StelCore* core) {}; virtual void draw(StelCore* core) {Q_UNUSED(core);}
//! Iterate through the drawing sequence. //! Iterate through the drawing sequence.
//! This allow us to split the slow drawing operation into small par ts, //! This allow us to split the slow drawing operation into small par ts,
//! we can then decide to pause the painting for this frame and used the cached image instead. //! we can then decide to pause the painting for this frame and used the cached image instead.
//! @return true if we should continue drawing (by calling the metho d again) //! @return true if we should continue drawing (by calling the metho d again)
virtual bool drawPartial(StelCore* core); virtual bool drawPartial(StelCore* core);
//! Update the module with respect to the time. //! Update the module with respect to the time.
//! @param deltaTime the time increment in second since last call. //! @param deltaTime the time increment in second since last call.
virtual void update(double deltaTime) = 0; virtual void update(double deltaTime) = 0;
//! Update i18n strings from english names according to current glob al sky and application language. //! Update i18n strings from english names according to current glob al sky and application language.
//! This method also reload the proper fonts depending on the langua ge. //! This method also reload the proper fonts depending on the langua ge.
//! The translation shall be done using the StelTranslator provided by the StelApp singleton instance. //! The translation shall be done using the StelTranslator provided by the StelApp singleton instance.
virtual void updateI18n() {;} virtual void updateI18n() {;}
//! Update sky culture, i.e. load data if necessary and translate th em to current sky language if needed. //! Update sky culture, i.e. load data if necessary and translate th em to current sky language if needed.
//! @param skyCultureDir the name of the directory containing the sk y culture to use. //! @param skyCultureDir the name of the directory containing the sk y culture to use.
virtual void updateSkyCulture(const QString& skyCultureDir) {;} virtual void updateSkyCulture(const QString& skyCultureDir) {Q_UNUSE D(skyCultureDir);}
//! Get the version of the module, default is stellarium main versio n //! Get the version of the module, default is stellarium main versio n
virtual QString getModuleVersion() const; virtual QString getModuleVersion() const;
//! Get the name of the module author //! Get the name of the module author
virtual QString getAuthorName() const {return "Stellarium's Team";} virtual QString getAuthorName() const {return "Stellarium's Team";}
//! Get the email adress of the module author //! Get the email adress of the module author
virtual QString getAuthorEmail() const {return "http://www.stellariu m.org";} virtual QString getAuthorEmail() const {return "http://www.stellariu m.org";}
//! Handle mouse clicks. Please note that most of the interactions w ill be done through the GUI module. //! Handle mouse clicks. Please note that most of the interactions w ill be done through the GUI module.
//! @return set the event as accepted if it was intercepted //! @return set the event as accepted if it was intercepted
virtual void handleMouseClicks(class QMouseEvent* e) {;} virtual void handleMouseClicks(class QMouseEvent*) {;}
//! Handle mouse wheel. Please note that most of the interactions wi ll be done through the GUI module. //! Handle mouse wheel. Please note that most of the interactions wi ll be done through the GUI module.
//! @return set the event as accepted if it was intercepted //! @return set the event as accepted if it was intercepted
virtual void handleMouseWheel(class QWheelEvent* e) {;} virtual void handleMouseWheel(class QWheelEvent*) {;}
//! Handle mouse moves. Please note that most of the interactions wi ll be done through the GUI module. //! Handle mouse moves. Please note that most of the interactions wi ll be done through the GUI module.
//! @return true if the event was intercepted //! @return true if the event was intercepted
virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b) {ret urn false;} virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b) {Q_U NUSED(x); Q_UNUSED(y); Q_UNUSED(b); return false;}
//! Handle key events. Please note that most of the interactions wil l be done through the GUI module. //! Handle key events. Please note that most of the interactions wil l be done through the GUI module.
//! @param e the Key event //! @param e the Key event
//! @return set the event as accepted if it was intercepted //! @return set the event as accepted if it was intercepted
virtual void handleKeys(class QKeyEvent* e) {;} virtual void handleKeys(class QKeyEvent* e) {Q_UNUSED(e);}
//! Enum used when selecting objects to define whether to add to, re place, or remove from the existing selection list. //! Enum used when selecting objects to define whether to add to, re place, or remove from the existing selection list.
enum StelModuleSelectAction enum StelModuleSelectAction
{ {
AddToSelection, //!< Add the StelObject to the current l ist of selected ones. AddToSelection, //!< Add the StelObject to the current l ist of selected ones.
ReplaceSelection, //!< Set the StelObject as the new l ist of selected ones. ReplaceSelection, //!< Set the StelObject as the new l ist of selected ones.
RemoveFromSelection //!< Subtract the StelObject from the cu rrent list of selected ones. RemoveFromSelection //!< Subtract the StelObject from the cu rrent list of selected ones.
}; };
//! Indicate that the user requested selection of StelObjects. //! Indicate that the user requested selection of StelObjects.
//! The StelModule should then manage by themself how they handle th e event //! The StelModule should then manage by themself how they handle th e event
//! @param action define if the user requested that the objects are added to the selection or just replace it //! @param action define if the user requested that the objects are added to the selection or just replace it
virtual void selectedObjectChangeCallBack(StelModuleSelectAction act ion=ReplaceSelection) {;} virtual void selectedObjectChangeCallBack(StelModuleSelectAction act ion=ReplaceSelection) {Q_UNUSED(action);}
//! Load the given color style //! Load the given color style
//! @param style the style object containing all necessary informati //! @param section the name of the config section containing all nec
on on how to style widgets and text essary information on how to style widgets and text
virtual void setStelStyle(const StelStyle& style) {;} virtual void setStelStyle(const QString& section) {Q_UNUSED(section)
;}
//! Define the possible action for which an order is defined //! Define the possible action for which an order is defined
enum StelModuleActionName enum StelModuleActionName
{ {
ActionDraw, //!< Action associated to the draw( ) method ActionDraw, //!< Action associated to the draw( ) method
ActionUpdate, //!< Action associated to the updat e() method ActionUpdate, //!< Action associated to the updat e() method
ActionHandleMouseClicks, //!< Action associated to the handl eMouseClicks() method ActionHandleMouseClicks, //!< Action associated to the handl eMouseClicks() method
ActionHandleMouseMoves, //!< Action associated to the handl eMouseMoves() method ActionHandleMouseMoves, //!< Action associated to the handl eMouseMoves() method
ActionHandleKeys //!< Action associated to the handl eKeys() method ActionHandleKeys //!< Action associated to the handl eKeys() method
}; };
//! Return the value defining the order of call for the given action //! Return the value defining the order of call for the given action
//! For example if stars.callOrder[ActionDraw] == 10 and constellati on.callOrder[ActionDraw] == 11, //! For example if stars.callOrder[ActionDraw] == 10 and constellati on.callOrder[ActionDraw] == 11,
//! the stars module will be drawn before the constellations //! the stars module will be drawn before the constellations
//! @param actionName the name of the action for which we want the c all order //! @param actionName the name of the action for which we want the c all order
//! @return the value defining the order. The closer to 0 the earlie r the module's action will be called //! @return the value defining the order. The closer to 0 the earlie r the module's action will be called
virtual double getCallOrder(StelModuleActionName actionName) const { return 0;} virtual double getCallOrder(StelModuleActionName actionName) const { Q_UNUSED(actionName); return 0;}
//! Detect or show the configuration GUI elements for the module. T his is to be used with //! Detect or show the configuration GUI elements for the module. T his is to be used with
//! plugins to display a configuration dialog from the plugin list w indow. //! plugins to display a configuration dialog from the plugin list w indow.
//! @param show if true, make the configuration GUI visible. If fal se, hide the config GUI if there is one. //! @param show if true, make the configuration GUI visible. If fal se, hide the config GUI if there is one.
//! @return true if the module has a configuration GUI, else false. //! @return true if the module has a configuration GUI, else false.
virtual bool configureGui(bool show=true) {return false;} virtual bool configureGui(bool show=true) {Q_UNUSED(show); return fa lse;}
}; };
#endif // _STELMODULE_HPP_ #endif // _STELMODULE_HPP_
 End of changes. 11 change blocks. 
13 lines changed or deleted 13 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/