19 #ifndef QGSPROVIDERMETADATA_H 20 #define QGSPROVIDERMETADATA_H 24 #include <QVariantMap> 32 #include "qgis_core.h" 80 QgsProviderMetadata(
const QString &key,
const QString &description,
const QString &library = QString() );
105 QString description()
const;
123 SIP_SKIP Q_DECL_DEPRECATED CreateDataProviderFunction createFunction() const;
129 virtual
void initProvider();
135 virtual
void cleanupProvider();
176 QMap<int, int> &oldToNewAttrIdxMap,
177 QString &errorMessage,
178 const QMap<QString, QVariant> *options );
187 const QString &format,
192 double *geoTransform,
194 const QStringList &createOptions = QStringList() )
SIP_FACTORY;
200 virtual QList<QPair<QString, QString> > pyramidResamplingMethods();
209 virtual QVariantMap decodeUri(
const QString &uri );
217 virtual QList< QgsDataItemProvider * > dataItemProviders()
const SIP_FACTORY;
224 virtual int listStyles(
const QString &uri, QStringList &ids, QStringList &names,
225 QStringList &descriptions, QString &errCause );
231 virtual QString getStyleById(
const QString &uri, QString styleId, QString &errCause );
237 virtual bool deleteStyleById(
const QString &uri, QString styleId, QString &errCause );
243 virtual bool saveStyle(
const QString &uri,
const QString &qmlStyle,
const QString &sldStyle,
244 const QString &styleName,
const QString &styleDescription,
245 const QString &uiFileContent,
bool useAsDefault, QString &errCause );
251 virtual QString loadStyle(
const QString &uri, QString &errCause );
257 virtual bool createDb(
const QString &dbPath, QString &errCause );
307 template <
typename T> QMap<QString, T *>connections(
bool cached =
true );
355 template <
class T_prov
ider_conn,
class T_conn> QMap<QString, QgsAbstractProviderConnection *> connectionsProtected(
bool cached =
true )
357 if ( ! cached || mProviderConnections.isEmpty() )
359 qDeleteAll( mProviderConnections );
360 mProviderConnections.clear();
361 const auto connNames { T_conn::connectionList() };
362 for (
const auto &cname : connNames )
364 mProviderConnections.insert( cname,
new T_provider_conn( cname ) );
367 return mProviderConnections;
370 template <
class T_prov
ider_conn>
void deleteConnectionProtected(
const QString &name )
372 T_provider_conn conn( name );
374 mProviderConnections.clear();
378 QMap<QString, QgsAbstractProviderConnection *> mProviderConnections;
389 QString mDescription;
395 CreateDataProviderFunction mCreateFunction =
nullptr;
399 #endif //QGSPROVIDERMETADATA_H
DataType
Raster data types.
Container of fields for a vector layer.
Abstract base class for spatial data provider implementations.
const QgsCoordinateReferenceSystem & crs
The QgsAbstractProviderConnection provides an interface for data provider connections.
Type
The WKB type describes the number of dimensions a geometry has.
Base class for all items in the model.
Setting options for creating vector data providers.
This class allows including a set of layers in a database-side transaction, provided the layer data p...
This class represents a coordinate reference system (CRS).
This is the interface for those who want to add custom data items to the browser tree.
Custom exception class for provider connection related exceptions.
Base class for raster data providers.