1
/***************************************************************************
3
Singleton class for keeping track of installed plugins.
5
begin : Mon Jan 26 2004
6
copyright : (C) 2004 by Gary E.Sherman
7
email : sherman at mrcc.com
8
***************************************************************************/
10
/***************************************************************************
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
17
***************************************************************************/
18
/* $Id: qgspluginregistry.h,v 1.1 2004/02/07 04:07:49 gsherman Exp $ */
20
#ifndef QGSPLUGINREGISTRY_H
21
#define QGSPLUGINREGISTRY_H
23
#include "qgspluginmetadata.h"
24
class QgsPluginMetadata;
28
* \class QgsPluginRegistry
29
* \brief This class tracks plugins that are currently loaded an provides
30
* a means to fetch a pointer to a plugin and unload it
32
class QgsPluginRegistry
35
//! Returns the instance pointer, creating the object on the first call
36
static QgsPluginRegistry* instance();
37
//! Return the full path to the plugins library using the plugin name as a key
38
QString library(QString pluginKey);
39
//! Retrieve the metadata for a plugin by name
40
QgsPluginMetadata * pluginMetadata(QString name);
41
//! Retrieve a pointer to a loaded plugin by name
42
QgisPlugin * plugin(QString name);
43
//! Add a plugin to the map of loaded plugins
44
void addPlugin(QString _library, QString _name, QgisPlugin * _plugin);
45
//! Remove a plugin from the list of loaded plugins
46
void removePlugin(QString name);
48
//! protected constructor
51
static QgsPluginRegistry* _instance;
52
std::map<QString,QgsPluginMetadata*> plugins;
54
#endif //QgsPluginRegistry_H