QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
qgsabstractlayermetadataprovider.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayermetadataprovider.h - QgsLayerMetadataProvider
3
4 ---------------------
5 begin : 17.8.2022
6 copyright : (C) 2022 by Alessandro Pasotti
7 email : elpaso at itopen dot it
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSABSTRACTLAYERMETADATAPROVIDER_H
17#define QGSABSTRACTLAYERMETADATAPROVIDER_H
18
19#include <QObject>
20
21#include "qgis_core.h"
22#include "qgis.h"
23
24#include "qgslayermetadata.h"
25#include "qgsrectangle.h"
26#include "qgspolygon.h"
28
29
30class QgsFeedback;
31
42
60{
61
62 public:
63
69
71
75 const QgsPolygon &geographicExtent() const;
76
80 void setGeographicExtent( const QgsPolygon &geographicExtent );
81
85 Qgis::GeometryType geometryType() const;
86
90 void setGeometryType( Qgis::GeometryType geometryType );
91
95 const QString &authid() const;
96
100 void setAuthid( const QString &authid );
101
105 const QString &uri() const;
106
110 void setUri( const QString &Uri );
111
115 const QString &dataProviderName() const;
116
120 void setDataProviderName( const QString &dataProviderName );
121
125 Qgis::LayerType layerType() const;
126
130 void setLayerType( Qgis::LayerType layerType );
131
135 const QString &standardUri() const;
136
140 void setStandardUri( const QString &standardUri );
141
142
143 private:
144
146 QgsPolygon mGeographicExtent;
148 Qgis::GeometryType mGeometryType;
150 QString mAuthid;
152 QString mUri;
154 QString mDataProviderName;
156 Qgis::LayerType mLayerType;
158 QString mStandardUri;
159};
160
162
163
174{
175
176 public:
177
181 QList<QgsLayerMetadataProviderResult> metadata() const;
182
186 void addMetadata( const QgsLayerMetadataProviderResult &metadata );
187
191 QStringList errors() const;
192
196 void addError( const QString &error );
197
198 private:
199
201 QList<QgsLayerMetadataProviderResult> mMetadata;
203 QStringList mErrors;
204};
205
207
208
215{
216
217 public:
218
220
225 virtual QString id() const = 0;
226
235 virtual QgsLayerMetadataSearchResults search( const QgsMetadataSearchContext &searchContext, const QString &searchString = QString(), const QgsRectangle &geographicExtent = QgsRectangle(), QgsFeedback *feedback = nullptr ) const = 0;
236
237};
238
239#endif // QGSABSTRACTLAYERMETADATAPROVIDER_H
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition qgis.h:337
LayerType
Types of layers that can be added to a map.
Definition qgis.h:169
Layer metadata provider backend interface.
virtual ~QgsAbstractLayerMetadataProvider()=default
virtual QString id() const =0
Returns the id of the layer metadata provider implementation, usually the name of the data provider b...
virtual QgsLayerMetadataSearchResults search(const QgsMetadataSearchContext &searchContext, const QString &searchString=QString(), const QgsRectangle &geographicExtent=QgsRectangle(), QgsFeedback *feedback=nullptr) const =0
Searches for metadata optionally filtering by search string and geographic extent.
Contains information about the context in which a coordinate transform is executed.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
Result record of layer metadata provider search.
Container of result records from a layer metadata search.
A structured metadata store for a map layer.
Polygon geometry type.
Definition qgspolygon.h:33
A rectangle specified with double values.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
QgsCoordinateTransformContext transformContext
Coordinate transform context.