QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
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
74
78 const QgsPolygon &geographicExtent() const;
79
83 void setGeographicExtent( const QgsPolygon &geographicExtent );
84
88 Qgis::GeometryType geometryType() const;
89
93 void setGeometryType( Qgis::GeometryType geometryType );
94
98 const QString &authid() const;
99
103 void setAuthid( const QString &authid );
104
108 const QString &uri() const;
109
113 void setUri( const QString &Uri );
114
118 const QString &dataProviderName() const;
119
123 void setDataProviderName( const QString &dataProviderName );
124
128 Qgis::LayerType layerType() const;
129
133 void setLayerType( Qgis::LayerType layerType );
134
138 const QString &standardUri() const;
139
143 void setStandardUri( const QString &standardUri );
144
145
146 private:
147
149 QgsPolygon mGeographicExtent;
151 Qgis::GeometryType mGeometryType;
153 QString mAuthid;
155 QString mUri;
157 QString mDataProviderName;
159 Qgis::LayerType mLayerType;
161 QString mStandardUri;
162};
163
165
166
177{
178
179 public:
180
184 QList<QgsLayerMetadataProviderResult> metadata() const;
185
189 void addMetadata( const QgsLayerMetadataProviderResult &metadata );
190
194 QStringList errors() const;
195
199 void addError( const QString &error );
200
201 private:
202
204 QList<QgsLayerMetadataProviderResult> mMetadata;
206 QStringList mErrors;
207};
208
210
211
218{
219
220 public:
221
223
228 virtual QString id() const = 0;
229
238 virtual QgsLayerMetadataSearchResults search( const QgsMetadataSearchContext &searchContext, const QString &searchString = QString(), const QgsRectangle &geographicExtent = QgsRectangle(), QgsFeedback *feedback = nullptr ) const = 0;
239
240};
241
242#endif // QGSABSTRACTLAYERMETADATAPROVIDER_H
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition qgis.h:255
LayerType
Types of layers that can be added to a map.
Definition qgis.h:114
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:45
Result record of layer metadata provider search.
QgsLayerMetadataProviderResult()=default
Default constructor.
Container of result records from a layer metadata search.
A structured metadata store for a map layer.
Polygon geometry type.
Definition qgspolygon.h:34
A rectangle specified with double values.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
QgsCoordinateTransformContext transformContext
Coordinate transform context.