Skip to content

Commit 55d665b

Browse files
author
mhugent
committed
added an interface class for renderer plugins and a type QgisPlugin::RENDERER
git-svn-id: http://svn.osgeo.org/qgis/trunk@5310 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent e3433a0 commit 55d665b

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

src/gui/qgisapp.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -3624,7 +3624,8 @@ void QgisApp::loadPlugin(QString name, QString description, QString theFullPathN
36243624

36253625
switch (pType())
36263626
{
3627-
case QgisPlugin::UI:
3627+
case QgisPlugin::RENDERER:
3628+
case QgisPlugin::UI:
36283629
{
36293630
// UI only -- doesn't use mapcanvas
36303631
create_ui *cf = (create_ui *) myLib->resolve("classFactory");

src/plugins/qgisplugin.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class QgisPlugin
5050
typedef enum PLUGINTYPE
5151
{
5252
UI = 1, /* user interface plug-in */
53-
MAPLAYER /* map layer plug-in */
53+
MAPLAYER, /* map layer plug-in */
54+
RENDERER /*a plugin for a new renderer class*/
5455
};
5556

5657

src/plugins/qgsrendererplugin.h

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/***************************************************************************
2+
qgsrendererplugin.h - description
3+
-------------------
4+
begin : April 2006
5+
copyright : (C) 2006 by Marco Hugentobler
6+
email : marco dot hugentobler at karto dot baug dot ethz dot ch
7+
***************************************************************************/
8+
9+
/***************************************************************************
10+
* *
11+
* This program is free software; you can redistribute it and/or modify *
12+
* it under the terms of the GNU General Public License as published by *
13+
* the Free Software Foundation; either version 2 of the License, or *
14+
* (at your option) any later version. *
15+
* *
16+
***************************************************************************/
17+
18+
#ifndef QGSRENDERERPLUGIN_H
19+
#define QGSRENDERERPLUGIN_H
20+
21+
#include "qgisplugin.h"
22+
23+
class QgsRenderer;
24+
class QDialog;
25+
class QString;
26+
27+
/**Interface class for renderer plugins. This kind of plugins is of plugin type QgisPlugin::RENDERER
28+
and is capable to return a pointer to a concrete renderer and a dialog which can be embedded into the
29+
vector layer properties dialog in the main qgis application*/
30+
class QgsRendererPlugin: public QgisPlugin
31+
{
32+
public:
33+
QgsRendererPlugin(const QString& name, const QString& description, const QString& version): QgisPlugin(name, description, version, QgisPlugin::RENDERER) {}
34+
virtual QDialog* rendererDialog() = 0;
35+
virtual QgsRenderer* renderer() = 0;
36+
};
37+
38+
#endif

0 commit comments

Comments
 (0)