Avogadro  1.1.0
Public Slots | Signals | Public Member Functions | Static Public Member Functions
Avogadro::PluginManager Class Reference
Inheritance diagram for Avogadro::PluginManager:
Inheritance graph
[legend]

List of all members.

Public Slots

void reload ()

Signals

void reloadPlugins ()

Public Member Functions

 PluginManager (QObject *parent=0)
void setPluginPath (const QStringList &path)
void setPluginPath (const QString &path)
void addToPluginPath (const QStringList &path)
void addToPluginPath (const QString &path)
QStringList pluginPath () const
void loadFactories (const QString &dir="")
QList< PluginFactory * > factories (Plugin::Type type)
PluginFactoryfactory (const QString &id, Plugin::Type type)
Extensionextension (const QString &id, QObject *parent=0)
Tooltool (const QString &id, QObject *parent=0)
Colorcolor (const QString &id, QObject *parent=0)
Engineengine (const QString &id, QObject *parent=0)
QList< QStringnames (Plugin::Type type)
QList< QStringidentifiers (Plugin::Type type)
QList< QStringdescriptions (Plugin::Type type)
QList< Extension * > extensions (QObject *parent=0)
QList< Tool * > tools (QObject *parent=0)
QList< Color * > colors (QObject *parent=0)
void writeSettings (QSettings &settings)
QList< QStringtoolScripts ()
QList< QStringengineScripts ()
QList< QStringextensionScripts ()
QList< PluginItem * > pluginItems (Plugin::Type)

Static Public Member Functions

static PluginManagerinstance ()
static void loadPluginList (const QDir &dir, const QStringList &plugins, QSettings &settings)

Member Function Documentation

Add list of directories to the search path.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Add the supplied path to the search path.

Color * Avogadro::PluginManager::color ( const QString id,
QObject parent = 0 
)

Get a new instance of the color with identifier id.

Returns:
0 if there is no color plugin with identifier id

References Avogadro::PluginFactory::createInstance(), factories(), factory(), Avogadro::PluginFactory::identifier(), and loadFactories().

Referenced by colors().

Get a list of all colors (new instances).

References color(), Avogadro::PluginFactory::createInstance(), factories(), factory(), and loadFactories().

Get a list with the plugin descriptions of type type.

References QList::append(), Avogadro::PluginFactory::description(), factories(), factory(), and loadFactories().

Engine * Avogadro::PluginManager::engine ( const QString id,
QObject parent = 0 
)

Get a new instance of the color with identifier id.

Returns:
0 if there is no engine plugin with identifier id

References Avogadro::PluginFactory::createInstance(), factories(), factory(), Avogadro::PluginFactory::identifier(), and loadFactories().

Get a list of all python engine script filenames.

Referenced by loadFactories().

Extension * Avogadro::PluginManager::extension ( const QString id,
QObject parent = 0 
)

Get a new instance of the extension with identifier id.

Returns:
0 if there is no extension plugin with identifier id

References Avogadro::PluginFactory::createInstance(), factories(), factory(), Avogadro::PluginFactory::identifier(), and loadFactories().

Referenced by extensions().

Get a list of all extension (new instances).

References Avogadro::PluginFactory::createInstance(), extension(), factories(), factory(), and loadFactories().

Get a list of all python extension script filenames.

Referenced by loadFactories().

PluginFactory * Avogadro::PluginManager::factory ( const QString id,
Plugin::Type  type 
)

Get a list with the plugin identifiers of type type.

References QList::append(), factories(), factory(), Avogadro::PluginFactory::identifier(), and loadFactories().

Get the singleton instance of the PluginManager. Always use this function when using the PluginManager class. This pointer never has to be deleted.

Referenced by Avogadro::GLWidget::colorMap(), Avogadro::GLWidget::loadDefaultEngines(), loadFactories(), and loadPluginList().

void Avogadro::PluginManager::loadFactories ( const QString dir = "")

Find all plugins by looking through the plugin search path. If it was not set, the next directories are used <bin_location>/../<lib_dir>/avogadro/engines <bin_location>/../<lib_dir>/avogadro/tools <bin_location>/../<lib_dir>/avogadro/extensions <bin_location>/../<lib_dir>/avogadro/colors <bin_location>/../<lib_dir>/avogadro/contrib (external plugins)

You can set AVOGADRO_PLUGINS to designate a path at runtime to search.

Parameters:
dirPath of directory to search for plugins instead of the default paths
See also:
setPluginPath, pluginPath
Todo:
To be removed in libavogadro 2

References QVector::append(), QSettings::beginGroup(), QSettings::endGroup(), engineScripts(), extensionScripts(), factory(), instance(), QString::isEmpty(), QPluginLoader::staticInstances(), toolScripts(), and Avogadro::PluginFactory::type().

Referenced by color(), colors(), descriptions(), engine(), extension(), extensions(), factories(), factory(), identifiers(), names(), tool(), and tools().

void Avogadro::PluginManager::loadPluginList ( const QDir dir,
const QStringList plugins,
QSettings settings 
) [static]

Load plugins with file names listed in plugins from directory dir and enable/disable them using settings

References QDir::absoluteFilePath(), QString::indexOf(), instance(), and QLibrary::isLibrary().

QList< QString > Avogadro::PluginManager::names ( Plugin::Type  type)

Get a list with the plugin names of type type.

References QList::append(), factories(), factory(), loadFactories(), and Avogadro::PluginFactory::name().

Use by the plugin manager settings dialog

Get the search path for plugins.

Set the search path for plugins as list of directories.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Set the search path for plugins.

Tool * Avogadro::PluginManager::tool ( const QString id,
QObject parent = 0 
)

Get a new instance of the tool with identifier id.

Returns:
0 if there is no tool plugin with identifier id

References Avogadro::PluginFactory::createInstance(), factories(), factory(), Avogadro::PluginFactory::identifier(), and loadFactories().

Referenced by tools().

Get a list of all tools (new instances).

References Avogadro::PluginFactory::createInstance(), factories(), factory(), loadFactories(), and tool().

Get a list of all python tool script filenames.

Referenced by loadFactories().


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