1
/*! \mainpage Quantum GIS - Plugin API
3
* \section about About QGis Plugins
4
* Plugins provide additional functionality to QGis. Plugins must
5
* implement several required methods in order to be registered with
6
* QGis. These methods include:
12
* All QGis plugins must inherit from the abstract base class QgisPlugin. A
13
* This list will grow as the API is expanded.
15
* In addition, a plugin must implement the classFactory and unload
16
* functions. Note that these functions must be declared as extern "C" in
17
* order to be resolved properly and prevent C++ name mangling.
28
//#include "qgisplugingui.h"
31
* \brief Abstract base class from which all plugins must inherit
38
//! Interface to gui element collection object
39
//virtual QgisPluginGui *gui()=0;
40
//! Element types that can be added to the interface
48
@todo XXX this may be a hint that there should be subclasses
50
typedef enum PLUGINTYPE
52
UI = 1, /* user interface plug-in */
53
MAPLAYER, /* map layer plug-in */
54
RENDERER /*a plugin for a new renderer class*/
58
QgisPlugin ( QString const & name = "",
59
QString const & description = "",
60
QString const & version = "",
61
PLUGINTYPE const & type = MAPLAYER )
63
mDescription(description),
71
//! Get the name of the plugin
72
QString const & name() const
82
//! Version of the plugin
83
QString const & version() const
88
//! Version of the plugin
94
//! A brief description of the plugin
95
QString const & description() const
100
//! A brief description of the plugin
101
QString & description()
106
//! Plugin type, either UI or map layer
107
QgisPlugin::PLUGINTYPE const & type() const
113
//! Plugin type, either UI or map layer
114
QgisPlugin::PLUGINTYPE & type()
119
/// function to initialize connection to GUI
120
virtual void initGui() = 0;
122
//! Unload the plugin and cleanup the GUI
123
virtual void unload() = 0;
131
QString mDescription;
136
/// UI or MAPLAYER plug-in
138
@todo Really, might be indicative that this needs to split into
139
maplayer vs. ui plug-in vs. other kind of plug-in
143
}; // class QgisPlugin
146
// Typedefs used by qgis main app
148
//! Typedef for the function that returns a generic pointer to a plugin object
149
typedef QgisPlugin *create_t(QgisApp *, QgisInterface *);
151
//! Typedef for the function to unload a plugin and free its resources
152
typedef void unload_t(QgisPlugin *);
154
//! Typedef for getting the name of the plugin without instantiating it
155
typedef QString name_t();
157
//! Typedef for getting the description without instantiating the plugin
158
typedef QString description_t();
160
//! Typedef for getting the plugin type without instantiating the plugin
161
typedef int type_t();
163
//! Typedef for getting the plugin version without instantiating the plugin
164
typedef QString version_t();
167
#endif //qgisplugin_h