StelModuleMgr.hpp   StelModuleMgr.hpp 
skipping to change at line 27 skipping to change at line 27
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#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"
#include "StelPluginInterface.hpp"
//! @def GETSTELMODULE(m) //! @def GETSTELMODULE(m)
//! Return a pointer on a StelModule from its QMetaObject name @a m //! Return a pointer on a StelModule from its QMetaObject name @a m
#define GETSTELMODULE( m ) (( m *)StelApp::getInstance().getModuleMgr().get Module( #m )) #define GETSTELMODULE( m ) (( m *)StelApp::getInstance().getModuleMgr().get Module( #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. //! 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
{ {
skipping to change at line 64 skipping to change at line 65
//! 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();
//! Define whether a plugin should be loaded at startup.
//! @param key the key of the plugin as in the PluginDescriptor clas
s.
void setPluginLoadAtStartup(const QString& key, bool b);
//! 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& moduleID); StelModule* getModule(const QString& moduleID, bool noWarning=false) ;
//! 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)
//! according to modules orders dependencies
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)
{ {
return callOrders[action]; return callOrders[action];
} }
//! Contains the information read from the module.ini file //! Contains the information read from the module.ini file
struct PluginDescriptor struct PluginDescriptor
{ {
//! The name of the directory and of the lib*.so with *=key PluginDescriptor() : loadAtStartup(false), loaded(false) {;}
QString key; //! The static info for the plugin.
QString name; StelPluginInfo info;
QString author;
QString contact;
QString description;
//! If true, the module is automatically loaded at startup //! If true, the module is automatically loaded at startup
bool loadAtStartup; bool loadAtStartup;
//! True if the plugin is currently loaded.
bool loaded;
private:
friend class StelModuleMgr;
StelPluginInterface* pluginInterface;
}; };
//! 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(); QList<PluginDescriptor> getPluginsList();
private: private:
//! Generate properly sorted calling lists for each action (e,g, dra
w, update)
//! according to modules orders dependencies
void generateCallingLists();
//! 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;
QMap<QString, StelModuleMgr::PluginDescriptor> pluginDescriptorList;
bool pluginDescriptorListLoaded;
}; };
#endif // _STELMODULEMGR_HPP_ #endif // _STELMODULEMGR_HPP_
 End of changes. 9 change blocks. 
13 lines changed or deleted 25 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/