Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Core::PluginManager Class Reference

Public Member Functions

 PluginManager (QString path="plugins/")
 Creates a new plug-in manager and reads the metadata files of all plug-ins in the specified plug-in folder. More...
 
 ~PluginManager ()
 Unloads all plug-ins. More...
 
QList< PluginInfogetAllLoadedPluginsInfo ()
 Returns a list containing copies of the metadata for all plug-ins which are currently loaded in the system. More...
 
EnvisionPlugingetLoadedPluginInterface (QString pluginId)
 Returns the interface of a loaded plug-in. More...
 
bool isPluginLoaded (QString pluginId)
 Returns true if the specified plugin is loaded. More...
 
void loadAllPlugins (EnvisionManager &envisionManager)
 Loads and initializes all plug-ins found in the plug-ins folder. More...
 
void unloadAllPlugins ()
 Unloads all currently loaded plug-ins. More...
 

Private Member Functions

QString getLibraryFileName (const QString pluginId)
 
PluginInfo readPluginMetaData (const QString fileName)
 
void scanAllPluginsMetaData ()
 
void scanSharedLibraries ()
 

Private Attributes

QMap< QString, QString > _allFoundSharedLibraryFiles
 lower to mixed case maps. More...
 
QMap< QString, PluginInfo * > idToMetaDataMap
 
QMap< QString, QPluginLoader * > idToPluginLoaderMap
 
QList< QPluginLoader * > loadedPlugins
 
QList< PluginInfopluginMetaData
 
QDir pluginsDir
 

Constructor & Destructor Documentation

◆ PluginManager()

Core::PluginManager::PluginManager ( QString  path = "plugins/")

Creates a new plug-in manager and reads the metadata files of all plug-ins in the specified plug-in folder.

◆ ~PluginManager()

Core::PluginManager::~PluginManager ( )

Unloads all plug-ins.

Member Function Documentation

◆ getAllLoadedPluginsInfo()

QList< PluginInfo > Core::PluginManager::getAllLoadedPluginsInfo ( )

Returns a list containing copies of the metadata for all plug-ins which are currently loaded in the system.

◆ getLibraryFileName()

QString Core::PluginManager::getLibraryFileName ( const QString  pluginId)
private

◆ getLoadedPluginInterface()

EnvisionPlugin * Core::PluginManager::getLoadedPluginInterface ( QString  pluginId)

Returns the interface of a loaded plug-in.

This can be used to make calls into the plugin.

◆ isPluginLoaded()

bool Core::PluginManager::isPluginLoaded ( QString  pluginId)

Returns true if the specified plugin is loaded.

◆ loadAllPlugins()

void Core::PluginManager::loadAllPlugins ( EnvisionManager envisionManager)

Loads and initializes all plug-ins found in the plug-ins folder.

Before a plug-in is loaded all its dependencies are loaded first. Each plug-in is given a reference to the EnvisionManager object to communicate to the core.

◆ readPluginMetaData()

PluginInfo Core::PluginManager::readPluginMetaData ( const QString  fileName)
private

◆ scanAllPluginsMetaData()

void Core::PluginManager::scanAllPluginsMetaData ( )
private

◆ scanSharedLibraries()

void Core::PluginManager::scanSharedLibraries ( )
private

◆ unloadAllPlugins()

void Core::PluginManager::unloadAllPlugins ( )

Unloads all currently loaded plug-ins.

Before a plug-in is unloaded it's unload() method will be called giving the plug-in a chance to clean up.

Member Data Documentation

◆ _allFoundSharedLibraryFiles

QMap<QString, QString> Core::PluginManager::_allFoundSharedLibraryFiles
private

lower to mixed case maps.

◆ idToMetaDataMap

QMap<QString, PluginInfo*> Core::PluginManager::idToMetaDataMap
private

◆ idToPluginLoaderMap

QMap<QString, QPluginLoader*> Core::PluginManager::idToPluginLoaderMap
private

◆ loadedPlugins

QList<QPluginLoader*> Core::PluginManager::loadedPlugins
private

◆ pluginMetaData

QList<PluginInfo> Core::PluginManager::pluginMetaData
private

◆ pluginsDir

QDir Core::PluginManager::pluginsDir
private