AvogadroLibs  1.90.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | List of all members
PluginManager Class Reference

This class takes care of finding and loading Avogadro plugins. More...

#include <avogadro/qtplugins/pluginmanager.h>

Inheritance diagram for PluginManager:

Public Member Functions

QStringList & pluginDirList ()
 
void load ()
 
void load (const QString &dir)
 
template<typename T >
QList< T * > pluginFactories () const
 
template<typename T >
T * pluginFactory (const QString &id) const
 

Static Public Member Functions

static PluginManagerinstance ()
 

Detailed Description

Author
Marcus D. Hanwell

This class will find and load Avogadro plugins. Once loaded you can use an instance of this class to query and construct plugin instances. By default plugins are loaded from QApplication::applicationDirPath()../<libdir>/avogadro/plugins but this can be changed, or more paths can be added.

The load methods can be called multiple times, and will load any new plugins while ignoring plugins that have already been loaded.

Member Function Documentation

static PluginManager* instance ( )
static

Get the singleton instance of the plugin manager. This instance should not be deleted.

QStringList& pluginDirList ( )

Get a reference to the plugin directory path list. Modifying this before calling load will allow you to add, remove or append to the search paths.

void load ( )

Load all plugins available in the specified plugin directories.

QList< T * > pluginFactories ( ) const

Let the user request plugins with a certain type, this must use the Qt mechanisms as qobject_cast is used in conjunction with interfaces.

* factory = pluginManager->pluginFactories<Avogadro::QtGui::ScenePluginFactory>();
*
T * pluginFactory ( const QString &  id) const

Let the user request a plugin by name, this must use the Qt mechanisms as qobject_cast is used in conjunction with interfaces.

factory = pluginManager->
pluginFactories<Avogadro::QtGui::ScenePluginFactory>("name");
*
Parameters
nameThe identifier of the plugin factory.
Returns
The plugin factory if the plugin was found, NULL otherwise.

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