StelModuleMgr.hpp   StelModuleMgr.hpp 
skipping to change at line 28 skipping to change at line 28
*/ */
#ifndef _STELMODULEMGR_HPP_ #ifndef _STELMODULEMGR_HPP_
#define _STELMODULEMGR_HPP_ #define _STELMODULEMGR_HPP_
#include <QObject> #include <QObject>
#include <QMap> #include <QMap>
#include <QList> #include <QList>
#include "StelModule.hpp" #include "StelModule.hpp"
//! Get a module from its QObject name //! @def GETSTELMODULE(m)
//! Return a pointer on a StelModule from its QObject name @a m
#define GETSTELMODULE( m ) StelApp::getInstance().getModuleMgr().getModule( m ) #define GETSTELMODULE( m ) StelApp::getInstance().getModuleMgr().getModule( m )
//! @class StelModuleMgr //! @class StelModuleMgr
//! Manage a collection of StelModules including both core and plugin modul es. //! Manage a collection of StelModules including both core and plugin modul es.
//! //! The order in which some actions like draw or update are called for each module can be retrieved with the getCallOrders() method.
class StelModuleMgr : public QObject class StelModuleMgr : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
StelModuleMgr(); StelModuleMgr();
~StelModuleMgr(); ~StelModuleMgr();
//! Regenerate calling lists if necessary //! Regenerate calling lists if necessary
void update(); void update();
//! Register a new StelModule to the list //! Register a new StelModule to the list
//! The module is later referenced by its QObject name. //! The module is later referenced by its QObject name.
void registerModule(StelModule* m, bool generateCallingLists=false); void registerModule(StelModule* m, bool generateCallingLists=false);
//! Unregister and delete a StelModule. The program will hang if oth er modules depend on the removed one //! Unregister and delete a StelModule. The program will hang if oth er modules depend on the removed one
//! @param moduleID the unique ID of the module, by convention equal to the class name //! @param moduleID the unique ID of the module, by convention equal to the class name
void unloadModule(const QString& moduleID); //! @param alsoDelete if true also delete the StelModule instance, o
therwise it has to be deleted by external code.
void unloadModule(const QString& moduleID, bool alsoDelete=true);
//! Load dynamically a module //! Load dynamically a module
//! @param moduleID the name of the module = name of the dynamic lib rary file without extension //! @param moduleID the name of the module = name of the dynamic lib rary file without extension
//! (e.g "mymodule" for mymodule.so or mymodule.dll) //! (e.g "mymodule" for mymodule.so or mymodule.dll)
//! @return the loaded module or NULL in case of error. The returned Stelmodule still needs to be initialized //! @return the loaded module or NULL in case of error. The returned Stelmodule still needs to be initialized
StelModule* loadPlugin(const QString& moduleID); StelModule* loadPlugin(const QString& moduleID);
//! Unload all plugins //! Unload all plugins
void unloadAllPlugins(); void unloadAllPlugins();
//! Get the corresponding module or NULL if can't find it. //! Get the corresponding module or NULL if can't find it.
//! @param moduleID the QObject name of the module instance, by conv ention it is equal to the class name //! @param moduleID the QObject name of the module instance, by conv ention it is equal to the class name
StelModule* getModule(const QString& moduleName); StelModule* getModule(const QString& moduleID);
//! Get the list of all the currently registered modules //! Get the list of all the currently registered modules
QList<StelModule*> getAllModules() {return modules.values();} QList<StelModule*> getAllModules() {return modules.values();}
//! Generate properly sorted calling lists for each action (e,g, dra w, update) //! Generate properly sorted calling lists for each action (e,g, dra w, update)
//! according to modules orders dependencies //! according to modules orders dependencies
void generateCallingLists(); void generateCallingLists();
//! Get the list of modules in the correct order for calling the giv en action //! Get the list of modules in the correct order for calling the giv en action
const QList<StelModule*>& getCallOrders(StelModule::StelModuleAction Name action) const QList<StelModule*>& getCallOrders(StelModule::StelModuleAction Name action)
skipping to change at line 95 skipping to change at line 97
QString author; QString author;
QString contact; QString contact;
QString description; QString description;
//! If true, the module is automatically loaded at startup //! If true, the module is automatically loaded at startup
bool loadAtStartup; bool loadAtStartup;
}; };
//! Return the list of all the external module found in the modules directories //! Return the list of all the external module found in the modules directories
static QList<PluginDescriptor> getPluginsList(); static QList<PluginDescriptor> getPluginsList();
//! Enum used when selecting objects to define whether to add to, re
place, or remove from the existing selection list.
enum SelectAction
{
AddToSelection,
ReplaceSelection,
RemoveFromSelection
};
private: private:
//! The main module list associating name:pointer //! The main module list associating name:pointer
QMap<QString, StelModule*> modules; QMap<QString, StelModule*> modules;
//! The list of all module in the correct order for each action //! The list of all module in the correct order for each action
QMap<StelModule::StelModuleActionName, QList<StelModule*> > callOrde rs; QMap<StelModule::StelModuleActionName, QList<StelModule*> > callOrde rs;
//! True if modules were removed, and therefore the calling list nee d to be regenerated //! True if modules were removed, and therefore the calling list nee d to be regenerated
bool callingListsToRegenerate; bool callingListsToRegenerate;
}; };
 End of changes. 5 change blocks. 
13 lines changed or deleted 7 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/