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
|
|
|
|
* </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.
|
|
|
|
*/
|
2003-01-25 00:20:20 +00:00
|
|
|
|
2002-10-13 21:35:17 +00:00
|
|
|
#ifndef qgisplugin_h
|
|
|
|
#define qgisplugin_h
|
|
|
|
#include <qstring.h>
|
2003-03-09 15:44:11 +00:00
|
|
|
#include <qwidget.h>
|
|
|
|
#include <qmainwindow.h>
|
2003-03-16 03:52:29 +00:00
|
|
|
#include "../src/qgisapp.h"
|
2003-01-25 00:20:20 +00:00
|
|
|
|
2003-03-09 15:44:11 +00:00
|
|
|
//#include "qgisplugingui.h"
|
2002-10-13 21:35:17 +00:00
|
|
|
|
2002-10-14 15:43:42 +00:00
|
|
|
/*! \class QgisPlugin
|
|
|
|
* \brief Abstract base class from which all plugins must inherit
|
|
|
|
*
|
|
|
|
*/
|
2003-03-09 15:44:11 +00:00
|
|
|
class QgisPlugin {
|
2002-10-13 21:35:17 +00:00
|
|
|
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;
|
2004-01-19 18:17:13 +00:00
|
|
|
//! Plugin type, either UI or map layer
|
|
|
|
virtual int type()=0;
|
|
|
|
virtual void initGui()=0;
|
2004-02-07 04:08:10 +00:00
|
|
|
//! Unload the plugin and cleanup the gui
|
|
|
|
virtual void unload()=0;
|
2002-10-14 16:32:21 +00:00
|
|
|
//! Interface to gui element collection object
|
2003-03-09 15:44:11 +00:00
|
|
|
//virtual QgisPluginGui *gui()=0;
|
2002-10-14 15:43:42 +00:00
|
|
|
//! Element types that can be added to the interface
|
2003-01-25 00:20:20 +00:00
|
|
|
/* enum ELEMENTS {
|
2002-10-14 15:43:42 +00:00
|
|
|
MENU,
|
|
|
|
MENU_ITEM,
|
|
|
|
TOOLBAR,
|
|
|
|
TOOLBAR_BUTTON,
|
|
|
|
};
|
2003-01-25 00:20:20 +00:00
|
|
|
*/
|
2004-01-19 18:17:13 +00:00
|
|
|
enum PLUGINTYPE{
|
|
|
|
UI,
|
|
|
|
MAPLAYER
|
|
|
|
};
|
2003-01-25 00:20:20 +00:00
|
|
|
};
|
2002-10-14 15:43:42 +00:00
|
|
|
|
2003-05-14 02:25:36 +00:00
|
|
|
// Typedefs used by qgis main app
|
2002-10-14 15:43:42 +00:00
|
|
|
|
2003-05-14 02:25:36 +00:00
|
|
|
//! Typedef for the function that returns a generic pointer to a plugin object
|
2003-03-16 03:52:29 +00:00
|
|
|
typedef QgisPlugin* create_t(QgisApp *, QgisInterface *);
|
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 *);
|
2003-05-27 02:22:45 +00:00
|
|
|
//! Typedef for getting the name of the plugin without instantiating it
|
|
|
|
typedef QString name_t();
|
|
|
|
//! Typedef for getting the description without instantiating the plugin
|
|
|
|
typedef QString description_t();
|
2004-01-19 18:17:13 +00:00
|
|
|
//! Typedef for getting the plugin type without instantiating the plugin
|
|
|
|
typedef int type_t();
|
2002-10-13 21:35:17 +00:00
|
|
|
#endif //qgisplugin_h
|