StelModuleMgr.hpp   StelModuleMgr.hpp 
skipping to change at line 59 skipping to change at line 59
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
//! @param alsoDelete if true also delete the StelModule instance, o therwise it has to be deleted by external code. //! @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); 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 Q_NULLPTR in case of error. The ret urned Stelmodule still needs to be initialized
StelModule* loadPlugin(const QString& moduleID); StelModule* loadPlugin(const QString& moduleID);
QObjectList loadExtensions(const QString& moduleID);
//! Unload all plugins //! Unload all plugins
void unloadAllPlugins(); void unloadAllPlugins();
//! Define whether a plugin should be loaded at startup. //! Define whether a plugin should be loaded at startup.
//! @param key the key of the plugin as in the PluginDescriptor clas s. //! @param key the key of the plugin as in the PluginDescriptor clas s.
//! @param b the value to set. //! @param b the value to set.
void setPluginLoadAtStartup(const QString& key, bool b); void setPluginLoadAtStartup(const QString& key, bool b);
//! Get the corresponding module or NULL if can't find it. //! Get the corresponding module or Q_NULLPTR 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.
//! @param noWarning if true, don't display any warning if the modul e is not found. //! @param noWarning if true, don't display any warning if the modul e is not found.
StelModule* getModule(const QString& moduleID, bool noWarning=false) ; 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();}
//! 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
{ {
PluginDescriptor() : loadAtStartup(false), loaded(false), pl uginInterface(NULL) {;} PluginDescriptor() : loadAtStartup(false), loaded(false), pl uginInterface(Q_NULLPTR) {;}
//! The static info for the plugin. //! The static info for the plugin.
StelPluginInfo info; StelPluginInfo info;
//! 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. //! True if the plugin is currently loaded.
bool loaded; bool loaded;
private: private:
friend class StelModuleMgr; friend class StelModuleMgr;
StelPluginInterface* pluginInterface; 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
QList<PluginDescriptor> getPluginsList(); QList<PluginDescriptor> getPluginsList();
//! Returns the list of all currently registered extensions.
//! If using this method, you probably also want to subscribe to
//! the extensionsAdded() signal to handle all possible initializati
on orders.
QObjectList getExtensionList() { return extensions; }
signals:
//! Called whenever new plugin extensions are added
void extensionsAdded(QObjectList newExtensions);
private: private:
//! 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();
//! The main module list associating name:pointer //! The main module list associating name:pointer
QMap<QString, StelModule*> modules; QMap<QString, StelModule*> modules;
//! All currently known extensions
QObjectList extensions;
//! 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; QMap<QString, StelModuleMgr::PluginDescriptor> pluginDescriptorList;
bool pluginDescriptorListLoaded; bool pluginDescriptorListLoaded;
}; };
 End of changes. 6 change blocks. 
3 lines changed or deleted 17 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/