Stellarium 0.11.1
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure
Classes | Public Member Functions
StelModuleMgr Class Reference

#include <StelModuleMgr.hpp>

List of all members.

Classes

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

Public Member Functions

void update ()
void registerModule (StelModule *m, bool generateCallingLists=false)
void unloadModule (const QString &moduleID, bool alsoDelete=true)
StelModuleloadPlugin (const QString &moduleID)
void unloadAllPlugins ()
void setPluginLoadAtStartup (const QString &key, bool b)
StelModulegetModule (const QString &moduleID, bool noWarning=false)
QList< StelModule * > getAllModules ()
const QList< StelModule * > & getCallOrders (StelModule::StelModuleActionName action)
QList< PluginDescriptorgetPluginsList ()

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.


Member Function Documentation

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

Get the corresponding module or NULL 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.
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 NULL 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::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.