Stellarium  0.16.1
List of all members | Classes | Signals | Public Member Functions
StelModuleMgr Class Reference

Manage a collection of StelModules including both core and plugin modules. More...

#include <StelModuleMgr.hpp>

+ Inheritance diagram for StelModuleMgr:
+ Collaboration diagram for StelModuleMgr:

Classes

struct  PluginDescriptor
 Contains the information read from the module.ini file. More...
 

Signals

void extensionsAdded (QObjectList newExtensions)
 Called whenever new plugin extensions are added. More...
 

Public Member Functions

void update ()
 Regenerate calling lists if necessary. More...
 
void registerModule (StelModule *m, bool generateCallingLists=false)
 Register a new StelModule to the list The module is later referenced by its QObject name. More...
 
void unloadModule (const QString &moduleID, bool alsoDelete=true)
 Unregister and delete a StelModule. More...
 
StelModuleloadPlugin (const QString &moduleID)
 Load dynamically a module. More...
 
QObjectList loadExtensions (const QString &moduleID)
 
void unloadAllPlugins ()
 Unload all plugins. More...
 
void setPluginLoadAtStartup (const QString &key, bool b)
 Define whether a plugin should be loaded at startup. More...
 
StelModulegetModule (const QString &moduleID, bool noWarning=false)
 Get the corresponding module or Q_NULLPTR if can't find it. More...
 
QList< StelModule * > getAllModules ()
 Get the list of all the currently registered modules. More...
 
const QList< StelModule * > & getCallOrders (StelModule::StelModuleActionName action)
 Get the list of modules in the correct order for calling the given action. More...
 
QList< PluginDescriptorgetPluginsList ()
 Return the list of all the external module found in the modules directories. More...
 
QObjectList getExtensionList ()
 Returns the list of all currently registered extensions. More...
 

Detailed Description

Manage a collection of StelModules including both core and plugin modules.

The order in which some actions like draw or update are called for each module can be retrieved with the getCallOrders() method.

Definition at line 36 of file StelModuleMgr.hpp.

Member Function Documentation

void StelModuleMgr::extensionsAdded ( QObjectList  newExtensions)
signal

Called whenever new plugin extensions are added.

QList<StelModule*> StelModuleMgr::getAllModules ( )
inline

Get the list of all the currently registered modules.

Definition at line 78 of file StelModuleMgr.hpp.

const QList<StelModule*>& StelModuleMgr::getCallOrders ( StelModule::StelModuleActionName  action)
inline

Get the list of modules in the correct order for calling the given action.

Definition at line 81 of file StelModuleMgr.hpp.

QObjectList StelModuleMgr::getExtensionList ( )
inline

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 initialization orders.

Definition at line 108 of file StelModuleMgr.hpp.

StelModule* StelModuleMgr::getModule ( const QString &  moduleID,
bool  noWarning = false 
)

Get the corresponding module or Q_NULLPTR if can't find it.

Parameters
moduleIDthe QObject name of the module instance, by convention it is equal to the class name.
noWarningif true, don't display any warning if the module is not found.
QList<PluginDescriptor> StelModuleMgr::getPluginsList ( )

Return the list of all the external module found in the modules directories.

StelModule* StelModuleMgr::loadPlugin ( const QString &  moduleID)

Load dynamically a module.

Parameters
moduleIDthe name of the module = name of the dynamic library file without extension (e.g "mymodule" for mymodule.so or mymodule.dll)
Returns
the loaded module or Q_NULLPTR in case of error. The returned Stelmodule still needs to be initialized
void StelModuleMgr::registerModule ( StelModule m,
bool  generateCallingLists = false 
)

Register a new StelModule to the list The module is later referenced by its QObject name.

void StelModuleMgr::setPluginLoadAtStartup ( const QString &  key,
bool  b 
)

Define whether a plugin should be loaded at startup.

Parameters
keythe key of the plugin as in the PluginDescriptor class.
bthe value to set.
void StelModuleMgr::unloadAllPlugins ( )

Unload all plugins.

void StelModuleMgr::unloadModule ( const QString &  moduleID,
bool  alsoDelete = true 
)

Unregister and delete a StelModule.

The program will hang if other modules depend on the removed one

Parameters
moduleIDthe unique ID of the module, by convention equal to the class name
alsoDeleteif true also delete the StelModule instance, otherwise it has to be deleted by external code.
void StelModuleMgr::update ( )

Regenerate calling lists if necessary.


The documentation for this class was generated from the following file: