Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  ***************************************************************************/
34 #ifndef QGISPLUGIN_H
35 #define QGISPLUGIN_H
36 
37 
38 #include <QString>
39 
40 class QgisInterface;
41 
42 //#include "qgisplugingui.h"
43 
49 {
50  public:
51 
53  //virtual QgisPluginGui *gui()=0;
55  /* enum ELEMENTS {
56  MENU,
57  MENU_ITEM,
58  TOOLBAR,
59  TOOLBAR_BUTTON,
60  };
61 
62  @todo XXX this may be a hint that there should be subclasses
63  */
65  {
66  UI = 1, /* user interface plug-in */
67  MAPLAYER, /* map layer plug-in */
68  RENDERER, /*a plugin for a new renderer class*/
69  VECTOR_OVERLAY /*an overlay plugin. Added in version 1.1*/
70  };
71 
72 
73  QgisPlugin( QString const & name = "",
74  QString const & description = "",
75  QString const & version = "",
76  PLUGINTYPE const & type = MAPLAYER )
77  : mName( name ),
79  mVersion( version ),
80  mType( type )
81  {}
82 
83  virtual ~QgisPlugin()
84  {}
85 
87  QString const & name() const
88  {
89  return mName;
90  }
91 
92  QString & name()
93  {
94  return mName;
95  }
96 
98  QString const & version() const
99  {
100  return mVersion;
101  }
102 
104  QString & version()
105  {
106  return mVersion;
107  }
108 
110  QString const & description() const
111  {
112  return mDescription;
113  }
114 
116  QString & description()
117  {
118  return mDescription;
119  }
120 
122  QgisPlugin::PLUGINTYPE const & type() const
123  {
124  return mType;
125  }
126 
127 
130  {
131  return mType;
132  }
133 
135  virtual void initGui() = 0;
136 
138  virtual void unload() = 0;
139 
140  private:
141 
143  QString mName;
144 
146  QString mDescription;
147 
149  QString mVersion;
150 
152 
157 
158 }; // class QgisPlugin
159 
160 
161 // Typedefs used by qgis main app
162 
165 
167 typedef void unload_t( QgisPlugin * );
168 
170 typedef QString name_t();
171 
173 typedef QString description_t();
174 
176 typedef int type_t();
177 
179 typedef QString version_t();
180 
182 typedef QString icon_t();
183 
184 
185 #endif //qgisplugin_h