QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
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 <QMap>
23#include "qgis_sip.h"
24#include <QDomNode>
25
26#include "qgis_core.h"
27
28class QgsPluginLayer;
29
34class CORE_EXPORT QgsPluginLayerType
35{
36 public:
37
38 QgsPluginLayerType( const QString &name );
39 virtual ~QgsPluginLayerType() = default;
40
41 QString name() const;
42
44 virtual QgsPluginLayer *createLayer() SIP_FACTORY;
45
49 virtual QgsPluginLayer *createLayer( const QString &uri ) SIP_FACTORY;
50
52 virtual bool showLayerProperties( QgsPluginLayer *layer );
53
54 protected:
55 QString mName;
56};
57
58//=============================================================================
59
67class CORE_EXPORT QgsPluginLayerRegistry
68{
69 public:
70
76
81
85 QStringList pluginLayerTypes();
86
88 bool addPluginLayerType( QgsPluginLayerType *pluginLayerType SIP_TRANSFER );
89
91 bool removePluginLayerType( const QString &typeName );
92
94 QgsPluginLayerType *pluginLayerType( const QString &typeName );
95
100 QgsPluginLayer *createLayer( const QString &typeName, const QString &uri = QString() ) SIP_FACTORY;
101
102 private:
103#ifdef SIP_RUN
105#endif
106
107 typedef QMap<QString, QgsPluginLayerType *> PluginLayerTypes;
108
109 PluginLayerTypes mPluginLayerTypes;
110};
111
112#endif // QGSPLUGINLAYERREGSITRY_H
A registry of plugin layers types.
QgsPluginLayerRegistry()=default
Constructor for QgsPluginLayerRegistry.
QgsPluginLayerRegistry & operator=(const QgsPluginLayerRegistry &rh)=delete
QgsPluginLayerRegistry cannot be copied.
QgsPluginLayerRegistry(const QgsPluginLayerRegistry &rh)=delete
QgsPluginLayerRegistry cannot be copied.
Class for creating plugin specific layers.
virtual ~QgsPluginLayerType()=default
Base class for plugin layers.
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:76
const QString & typeName