19 #ifndef QGSPROVIDERMETADATA_H
20 #define QGSPROVIDERMETADATA_H
24 #include <QVariantMap>
32 #include "qgis_core.h"
68 CanWriteFaceDatasets = 1 << 0,
69 CanWriteVertexDatasets = 1 << 1,
70 CanWriteEdgeDatasets = 1 << 2,
71 CanWriteMeshData = 1 << 3,
74 Q_ENUM( MeshDriverCapability )
75 Q_DECLARE_FLAGS( MeshDriverCapabilities, MeshDriverCapability )
76 Q_FLAG( MeshDriverCapabilities )
92 const QString &description,
93 const MeshDriverCapabilities &capabilities,
109 const QString &description,
110 const MeshDriverCapabilities &capabilities,
111 const QString &writeDatasetOnFileSuffix,
112 const QString &writeMeshFrameOnFileSuffix,
113 int maxVerticesPerface );
118 MeshDriverCapabilities capabilities() const;
123 QString name() const;
128 QString description() const;
133 QString writeDatasetOnFileSuffix() const;
140 QString writeMeshFrameOnFileSuffix() const;
147 int maximumVerticesCountPerFace() const;
151 QString mDescription;
152 MeshDriverCapabilities mCapabilities;
153 QString mWriteDatasetOnFileSuffix;
154 QString mWriteMeshFrameOnFileSuffix;
155 int mMaxVerticesPerFace = -1;
190 PriorityForUri = 1 << 0,
191 LayerTypesForUri = 1 << 1,
192 QuerySublayers = 1 << 2,
194 Q_DECLARE_FLAGS( ProviderMetadataCapabilities, ProviderMetadataCapability )
203 FileBasedUris = 1 << 0,
204 SaveLayerMetadata = 1 << 1,
206 Q_DECLARE_FLAGS( ProviderCapabilities, ProviderCapability )
220 QgsProviderMetadata( const QString &key, const QString &description, const QString &library = QString() );
245 QString description() const;
283 virtual
void initProvider();
289 virtual
void cleanupProvider();
311 virtual QString filters( FilterType type );
318 virtual QList<QgsMeshDriverMetadata> meshDriversMetadata();
335 virtual int priorityForUri(
const QString &uri )
const;
347 virtual QList< QgsMapLayerType > validLayerTypesForUri(
const QString &uri )
const;
365 virtual bool uriIsBlocklisted(
const QString &uri )
const;
388 virtual QStringList sidecarFilesForUri(
const QString &uri )
const;
404 virtual QList< QgsProviderSublayerDetails > querySublayers(
const QString &uri, Qgis::SublayerQueryFlags flags = Qgis::SublayerQueryFlags(),
QgsFeedback *feedback =
nullptr )
const;
417 QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() )
SIP_FACTORY;
425 static
void setBoolParameter( QVariantMap &uri, const QString ¶meter, const QVariant &value );
433 static
bool boolParameter( const QVariantMap &uri, const QString ¶meter,
bool defaultValue = false );
448 QMap<int, int> &oldToNewAttrIdxMap,
449 QString &errorMessage,
450 const QMap<QString, QVariant> *options );
459 const QString &format,
464 double *geoTransform,
466 const QStringList &createOptions = QStringList() )
SIP_FACTORY;
472 virtual
bool createMeshData(
474 const QString &fileName,
475 const QString &driverName,
482 virtual
bool createMeshData(
491 virtual QList<QPair<QString, QString> > pyramidResamplingMethods();
510 virtual QVariantMap decodeUri( const QString &uri ) const;
520 virtual QString encodeUri( const QVariantMap &parts ) const;
535 virtual
int listStyles( const QString &uri, QStringList &ids, QStringList &names,
536 QStringList &descriptions, QString &errCause );
549 virtual
bool styleExists( const QString &uri, const QString &styleId, QString &errorCause
SIP_OUT );
558 virtual QString getStyleById( const QString &uri, const QString &styleId, QString &errCause );
564 virtual
bool deleteStyleById( const QString &uri, const QString &styleId, QString &errCause );
577 virtual
bool saveStyle( const QString &uri, const QString &qmlStyle, const QString &sldStyle,
578 const QString &styleName, const QString &styleDescription,
579 const QString &uiFileContent,
bool useAsDefault, QString &errCause );
585 virtual QString loadStyle( const QString &uri, QString &errCause );
607 virtual
bool createDb( const QString &dbPath, QString &errCause );
657 template <
typename T> QMap<QString, T *>connections(
bool cached =
true );
699 SIP_PYOBJECT __repr__();
701 QString
str = QStringLiteral(
"<QgsProviderMetadata: %1>" ).arg( sipCpp->key() );
702 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
743 template <
class T_prov
ider_conn,
class T_conn> QMap<QString, QgsAbstractProviderConnection *> connectionsProtected(
bool cached =
true )
745 if ( ! cached || mProviderConnections.isEmpty() )
747 qDeleteAll( mProviderConnections );
748 mProviderConnections.clear();
749 const auto connNames { T_conn::connectionList() };
750 for (
const auto &cname : connNames )
752 mProviderConnections.insert( cname,
new T_provider_conn( cname ) );
755 return mProviderConnections;
758 template <
class T_prov
ider_conn>
void deleteConnectionProtected(
const QString &name )
760 T_provider_conn conn( name );
762 mProviderConnections.clear();
763 emit connectionDeleted( name );
767 QMap<QString, QgsAbstractProviderConnection *> mProviderConnections;
779 QString mDescription;
785 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.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
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.
Contains details about a sub layer available from a dataset.
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.