2002-10-14 15:43:42 +00:00
|
|
|
/*! \mainpage Quantum GIS - Plugin API
|
|
|
|
*
|
|
|
|
* \section about About QGis Plugins
|
|
|
|
* Plugins provide additional functionality to QGis. Plugins must
|
|
|
|
* implement several required methods in order to be registered with
|
|
|
|
* QGis. These methods include:
|
|
|
|
* <ul>name
|
|
|
|
* <li>version
|
|
|
|
* <li>description
|
|
|
|
* <li>guiElements
|
|
|
|
* </ul>
|
|
|
|
*
|
|
|
|
* All QGis plugins must inherit from the abstract base class QgisPlugin. A
|
|
|
|
* This list will grow as the API is expanded.
|
|
|
|
*
|
|
|
|
* In addition, a plugin must implement the classFactory and unload
|
|
|
|
* functions. Note that these functions must be declared as extern "C" in
|
|
|
|
* order to be resolved properly and prevent C++ name mangling.
|
|
|
|
*/
|
|
|
|
#include <qstring.h>
|
2002-10-13 21:35:17 +00:00
|
|
|
#ifndef qgisplugin_h
|
|
|
|
#define qgisplugin_h
|
|
|
|
#include <qstring.h>
|
|
|
|
|
2002-10-14 15:43:42 +00:00
|
|
|
/*! \class QgisPlugin
|
|
|
|
* \brief Abstract base class from which all plugins must inherit
|
|
|
|
*
|
|
|
|
*/
|
2002-10-13 21:35:17 +00:00
|
|
|
class QgisPlugin{
|
|
|
|
public:
|
2002-10-14 15:43:42 +00:00
|
|
|
//! Get the name of the plugin
|
|
|
|
virtual QString name() = 0;
|
|
|
|
//! Version of the plugin
|
|
|
|
virtual QString version() =0;
|
|
|
|
//! A brief description of the plugin
|
|
|
|
virtual QString description() = 0;
|
|
|
|
|
|
|
|
//! Element types that can be added to the interface
|
|
|
|
enum ELEMENTS {
|
|
|
|
MENU,
|
|
|
|
MENU_ITEM,
|
|
|
|
TOOLBAR,
|
|
|
|
TOOLBAR_BUTTON,
|
|
|
|
};
|
2002-10-13 21:35:17 +00:00
|
|
|
};
|
2002-10-14 15:43:42 +00:00
|
|
|
|
|
|
|
// Typedefs
|
|
|
|
|
|
|
|
//! Typedef for function that returns a generic pointer to a plugin object
|
2002-10-13 21:35:17 +00:00
|
|
|
typedef QgisPlugin* create_t();
|
2002-10-14 15:43:42 +00:00
|
|
|
//! Typedef for the function to unload a plugin and free its resources
|
2002-10-13 21:35:17 +00:00
|
|
|
typedef void unload_t(QgisPlugin *);
|
2002-10-14 15:43:42 +00:00
|
|
|
//! Element type corresponding to one of the values in the ELEMENTS enum
|
2002-10-14 16:03:46 +00:00
|
|
|
//typedef int QGIS_GUI_TYPE;
|
2002-10-14 15:43:42 +00:00
|
|
|
|
2002-10-13 21:35:17 +00:00
|
|
|
#endif //qgisplugin_h
|