QGIS API Documentation 3.41.0-Master (57ec4277f5e)
Loading...
Searching...
No Matches
qgisplugin.h
Go to the documentation of this file.
1/***************************************************************************
2 qgisplugin.h
3 --------------------------------------
4 Date : Sun Sep 16 12:12:31 AKDT 2007
5 Copyright : (C) 2007 by Gary E. Sherman
6 Email : sherman at mrcc dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
36#ifndef QGISPLUGIN_H
37#define QGISPLUGIN_H
38
39#define SIP_NO_FILE
40
41
42#include <QString>
43
44class QgisInterface;
45
46//#include "qgisplugingui.h"
47
55{
56 public:
58 //virtual QgisPluginGui *gui()=0;
60#if 0
61 enum Elements
62 {
63 MENU,
64 MENU_ITEM,
65 TOOLBAR,
66 TOOLBAR_BUTTON,
67 };
68
69 \todo XXX this may be a hint that there should be subclasses
70#endif
71
73 {
74 UI = 1,
77 };
78
79
83 QgisPlugin( QString const &name = "", QString const &description = "", QString const &category = "", QString const &version = "", PluginType type = MapLayer )
84 : mName( name )
85 , mDescription( description )
86 , mCategory( category )
87 , mVersion( version )
88 , mType( type )
89 {}
90
91 virtual ~QgisPlugin() = default;
92
94 QString const &name() const
95 {
96 return mName;
97 }
98
99 QString &name()
100 {
101 return mName;
102 }
103
105 QString const &version() const
106 {
107 return mVersion;
108 }
109
111 QString &version()
112 {
113 return mVersion;
114 }
115
117 QString const &description() const
118 {
119 return mDescription;
120 }
121
123 QString &description()
124 {
125 return mDescription;
126 }
127
129 QString const &category() const
130 {
131 return mCategory;
132 }
133
135 QString &category()
136 {
137 return mCategory;
138 }
139
142 {
143 return mType;
144 }
145
146
149 {
150 return mType;
151 }
152
154 virtual void initGui() = 0;
155
157 virtual void unload() = 0;
158
159 private:
161 QString mName;
162
164 QString mDescription;
165
167 QString mCategory;
168
170 QString mVersion;
171
173
178 PluginType mType;
179
180}; // class QgisPlugin
181
182
183// Typedefs used by qgis main app
184
187
189typedef void unload_t( QgisPlugin * );
190
192typedef const QString *name_t();
193
195typedef const QString *description_t();
196
198typedef const QString *category_t();
199
201typedef int type_t();
202
204typedef const QString *version_t();
205
207typedef const QString *icon_t();
208
210typedef const QString *experimental_t();
211
213typedef const QString *create_date_t();
214
216typedef const QString *update_date_t();
217
218#endif // QGISPLUGIN_H
QgisInterface Abstract base class defining interfaces exposed by QgisApp and made available to plugin...
Abstract base class from which all plugins must inherit.
Definition qgisplugin.h:55
QString & name()
Definition qgisplugin.h:99
virtual ~QgisPlugin()=default
QString const & version() const
Version of the plugin.
Definition qgisplugin.h:105
virtual void initGui()=0
function to initialize connection to GUI
PluginType
Interface to gui element collection object.
Definition qgisplugin.h:73
@ Renderer
A plugin for a new renderer class.
Definition qgisplugin.h:76
@ MapLayer
Map layer plug-in.
Definition qgisplugin.h:75
@ UI
User interface plug-in.
Definition qgisplugin.h:74
QString & category()
Plugin category.
Definition qgisplugin.h:135
QgisPlugin::PluginType const & type() const
Plugin type, either UI or map layer.
Definition qgisplugin.h:141
virtual void unload()=0
Unload the plugin and cleanup the GUI.
QgisPlugin::PluginType & type()
Plugin type, either UI or map layer.
Definition qgisplugin.h:148
QString & version()
Version of the plugin.
Definition qgisplugin.h:111
QString & description()
A brief description of the plugin.
Definition qgisplugin.h:123
QString const & category() const
Plugin category.
Definition qgisplugin.h:129
QgisPlugin(QString const &name="", QString const &description="", QString const &category="", QString const &version="", PluginType type=MapLayer)
Constructor for QgisPlugin.
Definition qgisplugin.h:83
QString const & description() const
A brief description of the plugin.
Definition qgisplugin.h:117
QString const & name() const
Gets the name of the plugin.
Definition qgisplugin.h:94
const QString * name_t()
Typedef for getting the name of the plugin without instantiating it.
Definition qgisplugin.h:192
const QString * icon_t()
Typedef for getting the plugin icon file name without instantiating the plugin.
Definition qgisplugin.h:207
QgisPlugin * create_t(QgisInterface *)
Typedef for the function that returns a generic pointer to a plugin object.
Definition qgisplugin.h:186
void unload_t(QgisPlugin *)
Typedef for the function to unload a plugin and free its resources.
Definition qgisplugin.h:189
int type_t()
Typedef for getting the plugin type without instantiating the plugin.
Definition qgisplugin.h:201
const QString * version_t()
Typedef for getting the plugin version without instantiating the plugin.
Definition qgisplugin.h:204
const QString * update_date_t()
Typedef for getting the update date status without instantiating the plugin.
Definition qgisplugin.h:216
const QString * description_t()
Typedef for getting the description without instantiating the plugin.
Definition qgisplugin.h:195
const QString * category_t()
Typedef for getting the category without instantiating the plugin.
Definition qgisplugin.h:198
const QString * experimental_t()
Typedef for getting the experimental status without instantiating the plugin.
Definition qgisplugin.h:210
const QString * create_date_t()
Typedef for getting the create date without instantiating the plugin.
Definition qgisplugin.h:213