19 #ifndef QGSPROVIDERMETADATA_H
20 #define QGSPROVIDERMETADATA_H
24 #include <QVariantMap>
32 #include "qgis_core.h"
66 CanWriteFaceDatasets = 1 << 0,
67 CanWriteVertexDatasets = 1 << 1,
68 CanWriteEdgeDatasets = 1 << 2,
69 CanWriteMeshData = 1 << 3,
72 Q_ENUM( MeshDriverCapability )
73 Q_DECLARE_FLAGS( MeshDriverCapabilities, MeshDriverCapability )
74 Q_FLAG( MeshDriverCapabilities )
88 const QString &description,
89 const MeshDriverCapabilities &capabilities,
90 const QString &writeDatasetOnFileSuffix );
95 MeshDriverCapabilities capabilities() const;
100 QString name() const;
105 QString description() const;
110 QString writeDatasetOnFileSuffix() const;
114 QString mDescription;
115 MeshDriverCapabilities mCapabilities;
116 QString mWriteDatasetOnFileSuffix;
151 PriorityForUri = 1 << 0,
152 LayerTypesForUri = 1 << 1,
154 Q_DECLARE_FLAGS( ProviderMetadataCapabilities, ProviderMetadataCapability )
163 FileBasedUris = 1 << 0,
164 SaveLayerMetadata = 1 << 1,
166 Q_DECLARE_FLAGS( ProviderCapabilities, ProviderCapability )
180 QgsProviderMetadata( const QString &key, const QString &description, const QString &library = QString() );
205 QString description() const;
243 virtual
void initProvider();
249 virtual
void cleanupProvider();
271 virtual QString filters( FilterType type );
278 virtual QList<QgsMeshDriverMetadata> meshDriversMetadata();
295 virtual int priorityForUri(
const QString &uri )
const;
307 virtual QList< QgsMapLayerType > validLayerTypesForUri(
const QString &uri )
const;
325 virtual bool uriIsBlocklisted(
const QString &uri )
const;
338 QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() )
SIP_FACTORY;
346 static
void setBoolParameter( QVariantMap &uri, const QString ¶meter, const QVariant &value );
354 static
bool boolParameter( const QVariantMap &uri, const QString ¶meter,
bool defaultValue = false );
369 QMap<int, int> &oldToNewAttrIdxMap,
370 QString &errorMessage,
371 const QMap<QString, QVariant> *options );
380 const QString &format,
385 double *geoTransform,
387 const QStringList &createOptions = QStringList() )
SIP_FACTORY;
393 virtual
bool createMeshData(
396 const QString &driverName,
403 virtual QList<QPair<QString, QString> > pyramidResamplingMethods();
422 virtual QVariantMap decodeUri( const QString &uri ) const;
432 virtual QString encodeUri( const QVariantMap &parts ) const;
447 virtual
int listStyles( const QString &uri, QStringList &ids, QStringList &names,
448 QStringList &descriptions, QString &errCause );
454 virtual QString getStyleById( const QString &uri, QString styleId, QString &errCause );
460 virtual
bool deleteStyleById( const QString &uri, QString styleId, QString &errCause );
466 virtual
bool saveStyle( const QString &uri, const QString &qmlStyle, const QString &sldStyle,
467 const QString &styleName, const QString &styleDescription,
468 const QString &uiFileContent,
bool useAsDefault, QString &errCause );
474 virtual QString loadStyle( const QString &uri, QString &errCause );
496 virtual
bool createDb( const QString &dbPath, QString &errCause );
546 template <
typename T> QMap<QString, T *>connections(
bool cached =
true );
588 SIP_PYOBJECT __repr__();
590 QString
str = QStringLiteral(
"<QgsProviderMetadata: %1>" ).arg( sipCpp->key() );
591 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
632 template <
class T_prov
ider_conn,
class T_conn> QMap<QString, QgsAbstractProviderConnection *> connectionsProtected(
bool cached =
true )
634 if ( ! cached || mProviderConnections.isEmpty() )
636 qDeleteAll( mProviderConnections );
637 mProviderConnections.clear();
638 const auto connNames { T_conn::connectionList() };
639 for (
const auto &cname : connNames )
641 mProviderConnections.insert( cname,
new T_provider_conn( cname ) );
644 return mProviderConnections;
647 template <
class T_prov
ider_conn>
void deleteConnectionProtected(
const QString &name )
649 T_provider_conn conn( name );
651 mProviderConnections.clear();
652 emit connectionDeleted( name );
656 QMap<QString, QgsAbstractProviderConnection *> mProviderConnections;
668 QString mDescription;
674 CreateDataProviderFunction mCreateFunction =
nullptr;
VectorExportResult
Vector layer export result codes.
DataType
Raster data types.
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
The QgsAbstractProviderConnection provides an interface for data provider connections.
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.
Base class for all items in the model.
Abstract base class for spatial data provider implementations.
Container of fields for a vector layer.
Base class for providing data for QgsMeshLayer.
Custom exception class which is raised when an operation is not supported.
Custom exception class for provider connection related exceptions.
Base class for raster data providers.
This class allows including a set of layers in a database-side transaction, provided the layer data p...
Type
The WKB type describes the number of dimensions a geometry has.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
const QgsCoordinateReferenceSystem & crs
Setting options for creating vector data providers.
Mesh - vertices, edges and faces.