~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to src/qgspluginregistry.h

  • Committer: Bazaar Package Importer
  • Author(s): William Grant
  • Date: 2007-05-06 13:42:32 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070506134232-pyli6t388w5asd8x
Tags: 0.8.0-3ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules, debian/qgis.install, debian/qgis.dirs debian/qgis.desktop:
    Add and install .desktop.
* debian/qgis.desktop: Remove Applications category; it's not real.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                          qgspluginregistry.h    
3
 
           Singleton class for keeping track of installed plugins.
4
 
                             -------------------
5
 
    begin                : Mon Jan 26 2004
6
 
    copyright            : (C) 2004 by Gary E.Sherman
7
 
    email                : sherman at mrcc.com
8
 
 ***************************************************************************/
9
 
 
10
 
/***************************************************************************
11
 
 *                                                                         *
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.                                   *
16
 
 *                                                                         *
17
 
 ***************************************************************************/
18
 
 /* $Id: qgspluginregistry.h,v 1.1 2004/02/07 04:07:49 gsherman Exp $ */
19
 
 
20
 
#ifndef QGSPLUGINREGISTRY_H
21
 
#define QGSPLUGINREGISTRY_H
22
 
#include <map>
23
 
#include "qgspluginmetadata.h"
24
 
class QgsPluginMetadata;
25
 
class QgisPlugin;
26
 
class QString;
27
 
/**
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
31
 
*/
32
 
class QgsPluginRegistry
33
 
{
34
 
public:
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);
47
 
protected:
48
 
//! protected constructor
49
 
 QgsPluginRegistry();
50
 
private:
51
 
 static QgsPluginRegistry* _instance;
52
 
 std::map<QString,QgsPluginMetadata*> plugins;
53
 
};
54
 
#endif //QgsPluginRegistry_H
55