QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgspluginlayerregistry.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgspluginlayerregistry.cpp - class for
3
registering plugin layer creators
4
-------------------
5
begin : Mon Nov 30 2009
6
copyright : (C) 2009 by Mathias Walker, Sourcepole
7
email : mwa at sourcepole.ch
8
***************************************************************************/
9
10
/***************************************************************************
11
* *
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
16
* *
17
***************************************************************************/
18
19
#ifndef QGSPLUGINLAYERREGSITRY_H
20
#define QGSPLUGINLAYERREGSITRY_H
21
22
#include "qgis_core.h"
23
#include "
qgis_sip.h
"
24
25
#include <QDomNode>
26
#include <QMap>
27
28
class
QgsPluginLayer
;
29
34
class
CORE_EXPORT
QgsPluginLayerType
35
{
36
public
:
37
QgsPluginLayerType
(
const
QString &
name
);
38
virtual
~QgsPluginLayerType
() =
default
;
39
40
QString
name
()
const
;
41
43
virtual
QgsPluginLayer
*
createLayer
()
SIP_FACTORY
;
44
48
virtual
QgsPluginLayer
*
createLayer
( const QString &uri )
SIP_FACTORY
;
49
51
virtual
bool
showLayerProperties
(
QgsPluginLayer
*layer );
52
53
protected:
54
QString
mName
;
55
};
56
57
//=============================================================================
58
66
class CORE_EXPORT
QgsPluginLayerRegistry
67
{
68
public
:
69
QgsPluginLayerRegistry
() =
default
;
70
~QgsPluginLayerRegistry
();
71
72
QgsPluginLayerRegistry
(
const
QgsPluginLayerRegistry
&rh ) =
delete
;
73
QgsPluginLayerRegistry
&
operator=
(
const
QgsPluginLayerRegistry
&rh ) =
delete
;
74
78
QStringList
pluginLayerTypes
();
79
81
bool
addPluginLayerType
(
QgsPluginLayerType
*
pluginLayerType
SIP_TRANSFER
);
82
84
bool
removePluginLayerType
(
const
QString &typeName );
85
87
QgsPluginLayerType
*
pluginLayerType
(
const
QString &typeName );
88
93
QgsPluginLayer
*
createLayer
(
const
QString &typeName,
const
QString &uri = QString() )
SIP_FACTORY
;
94
95
private:
96
#ifdef SIP_RUN
97
QgsPluginLayerRegistry
(
const
QgsPluginLayerRegistry
&rh );
98
#endif
99
100
typedef
QMap<QString, QgsPluginLayerType *> PluginLayerTypes;
101
102
PluginLayerTypes mPluginLayerTypes;
103
};
104
105
#endif
// QGSPLUGINLAYERREGSITRY_H
QgsPluginLayerRegistry::addPluginLayerType
bool addPluginLayerType(QgsPluginLayerType *pluginLayerType)
Add plugin layer type (take ownership) and return true on success.
Definition
qgspluginlayerregistry.cpp:77
QgsPluginLayerRegistry::QgsPluginLayerRegistry
QgsPluginLayerRegistry()=default
QgsPluginLayerRegistry::operator=
QgsPluginLayerRegistry & operator=(const QgsPluginLayerRegistry &rh)=delete
QgsPluginLayerRegistry::removePluginLayerType
bool removePluginLayerType(const QString &typeName)
Remove plugin layer type and return true on success.
Definition
qgspluginlayerregistry.cpp:90
QgsPluginLayerRegistry::pluginLayerTypes
QStringList pluginLayerTypes()
List all known layer types.
Definition
qgspluginlayerregistry.cpp:72
QgsPluginLayerRegistry::pluginLayerType
QgsPluginLayerType * pluginLayerType(const QString &typeName)
Returns plugin layer type metadata or nullptr if doesn't exist.
Definition
qgspluginlayerregistry.cpp:115
QgsPluginLayerRegistry::QgsPluginLayerRegistry
QgsPluginLayerRegistry(const QgsPluginLayerRegistry &rh)=delete
QgsPluginLayerRegistry::createLayer
QgsPluginLayer * createLayer(const QString &typeName, const QString &uri=QString())
Returns new layer if corresponding plugin has been found else returns nullptr.
Definition
qgspluginlayerregistry.cpp:121
QgsPluginLayerType
Responsible for creating plugin specific map layers.
Definition
qgspluginlayerregistry.h:35
QgsPluginLayerType::name
QString name() const
Definition
qgspluginlayerregistry.cpp:33
QgsPluginLayerType::showLayerProperties
virtual bool showLayerProperties(QgsPluginLayer *layer)
Show plugin layer properties dialog. Return false if the dialog cannot be shown.
Definition
qgspluginlayerregistry.cpp:49
QgsPluginLayerType::mName
QString mName
Definition
qgspluginlayerregistry.h:54
QgsPluginLayerType::QgsPluginLayerType
QgsPluginLayerType(const QString &name)
Definition
qgspluginlayerregistry.cpp:29
QgsPluginLayerType::createLayer
virtual QgsPluginLayer * createLayer()
Returns new layer of this type. Return nullptr on error.
Definition
qgspluginlayerregistry.cpp:38
QgsPluginLayerType::~QgsPluginLayerType
virtual ~QgsPluginLayerType()=default
QgsPluginLayer
Base class for plugin layers.
Definition
qgspluginlayer.h:38
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:35
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
Generated on
for QGIS API Documentation by
1.17.0