Logo Search packages:      
Sourcecode: packagesearch version File versions

NPlugin::PluginManager Class Reference

#include <pluginmanager.h>

Inheritance diagram for NPlugin::PluginManager:

NPlugin::PluginInformer NPlugin::IPluginInformer

List of all members.

Detailed Description

The PluginManager can be used to load and manage plugins.

It informs the IPluginUser instances which have registered via the addPluginUser function about loading and unloading of plugins.

The settings for all plugins will be loaded on loadSettings and stored in the PluginManager. If a plugin is loaded, the plugin manager will search for the settings of this plugin and call its loadSettings function.
The settings of the manager and the plugins can be stored via the saveSettings function, where the settings for all active plugins and the plugins which are disabled will be stored. If a plugin is no longer available (i.e. neither disabled nor active) its settings will not be saved even if they were loaded before.

Benjamin Mesing

Definition at line 69 of file pluginmanager.h.

Public Member Functions

virtual void addPluginUser (IPluginUser *pUser)
 Adds a plugin user. Plugin users will be informed about loading and unloading of plugins.
vector< PluginContainer * > getLoadedPlugins () const
virtual void informAddPlugin (Plugin *pPlugin)
virtual void informRemovePlugin (Plugin *pPlugin)
void loadPlugins ()
 This loads all available plugins excluding the disabled ones.
void loadSettings (const NXml::XmlData &inData, const QDomElement source)
 Loads the settings for the plugins from inData.
 PluginManager (vector< string > directories, IProvider *pProvider, IPluginUser *pUser)
NUtil::IProgressObserverprogressObserver ()
 Returns the observer where to report progress to.
virtual void removePluginUser (IPluginUser *pUser)
void saveSettings (NXml::XmlData &outData, QDomElement parent)
 Save the settings from this plugin container into the given XML tree.
void showControlDialog (QWidget *pParent)
 This shows a dialog which can be used to control the plugins.
void showSettingsDialog (QWidget *pParent)

Protected Member Functions

vector< PluginDatagetAvailablePlugins ()
PluginContainer * loadPlugin (const string &directory, const string &libraryName)
 This loads the plugin and informs the plugin users about the loading.
void unloadPlugin (PluginContainer *pPlugin)
 This unloads the plugin and informs the plugin users about the unloading.

Private Types

typedef map< PluginContainer
*, PluginData

Private Slots

void onPluginToggled (PluginListItem *pSrc, bool state)

Private Member Functions

bool checkDlError ()
 This check if an error occured in a dl* function and if so prints the error message to stderr.
bool removeFromDisabled (const PluginData &pd)
 This removes the given plugin with the given from the disabled plugin list.

Private Attributes

vector< string > _directories
 The directories the plugin manager searches for plugins.
list< PluginData_disabledPlugins
PluginToDataMap _loadedPlugins
 This holds the plugins currently loaded.
PluginControl * _pControlDialog
 This holds a pointer to the control dialog.
map< string, const QDomElement > _pluginSettings
 This holds the settings for all available plugins.
QListView * _pPluginListView
 This holds a pointer to the dialog displaying the status of the plugin loading process.
 The provider which provides informations for the plugins.
const QString _settingsVersion
 The version of the settings tree used by this class.


class PluginListItem


struct  PluginData
 This holds information about the plugin. More...
struct  PluginEquals
 Function object to find plugins which are equal. More...
struct  PluginInformationEquals
 Function object to find plugins with equal information. More...

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

Generated by  Doxygen 1.6.0   Back to index