19#ifndef QGSPROVIDERMETADATA_H
20#define QGSPROVIDERMETADATA_H
69 CanWriteFaceDatasets = 1 << 0,
70 CanWriteVertexDatasets = 1 << 1,
71 CanWriteEdgeDatasets = 1 << 2,
72 CanWriteMeshData = 1 << 3,
75 Q_ENUM( MeshDriverCapability )
76 Q_DECLARE_FLAGS( MeshDriverCapabilities, MeshDriverCapability )
77 Q_FLAG( MeshDriverCapabilities )
93 const QString &description,
94 const MeshDriverCapabilities &capabilities,
110 const QString &description,
111 const MeshDriverCapabilities &capabilities,
112 const QString &writeDatasetOnFileSuffix,
113 const QString &writeMeshFrameOnFileSuffix,
114 int maxVerticesPerface );
119 MeshDriverCapabilities capabilities() const;
124 QString name() const;
129 QString description() const;
134 QString writeDatasetOnFileSuffix() const;
141 QString writeMeshFrameOnFileSuffix() const;
148 int maximumVerticesCountPerFace() const;
152 QString mDescription;
153 MeshDriverCapabilities mCapabilities;
154 QString mWriteDatasetOnFileSuffix;
155 QString mWriteMeshFrameOnFileSuffix;
156 int mMaxVerticesPerFace = -1;
191 PriorityForUri = 1 << 0,
192 LayerTypesForUri = 1 << 1,
193 QuerySublayers = 1 << 2,
194 CreateDatabase = 1 << 3,
196 Q_DECLARE_FLAGS( ProviderMetadataCapabilities, ProviderMetadataCapability )
205 FileBasedUris = 1 << 0,
206 SaveLayerMetadata = 1 << 1,
208 Q_DECLARE_FLAGS( ProviderCapabilities, ProviderCapability )
222 QgsProviderMetadata( const QString &key, const QString &description, const QString &library = QString() );
247 QString description() const;
254 virtual QIcon icon() const;
276 virtual QList< QgsMapLayerType > supportedLayerTypes()
const;
284 PyObject *l = PyList_New( cppRes.size() );
290 for (
int i = 0; i < cppRes.size(); ++i )
292 PyObject *eobj = sipConvertFromEnum(
static_cast<int>( cppRes.at( i ) ),
293 sipType_QgsMapLayerType );
300 PyList_SetItem( l, i, eobj );
331 SIP_SKIP Q_DECL_DEPRECATED CreateDataProviderFunction createFunction() const;
337 virtual
void initProvider();
343 virtual
void cleanupProvider();
365 virtual QString filters( FilterType type );
372 virtual QList<QgsMeshDriverMetadata> meshDriversMetadata();
389 virtual int priorityForUri(
const QString &uri )
const;
401 virtual QList< QgsMapLayerType > validLayerTypesForUri(
const QString &uri )
const;
419 virtual bool uriIsBlocklisted(
const QString &uri )
const;
442 virtual QStringList sidecarFilesForUri(
const QString &uri )
const;
458 virtual QList< QgsProviderSublayerDetails > querySublayers(
const QString &uri, Qgis::SublayerQueryFlags flags = Qgis::SublayerQueryFlags(),
QgsFeedback *feedback =
nullptr )
const;
471 QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() )
SIP_FACTORY;
479 static
void setBoolParameter( QVariantMap &uri, const QString ¶meter, const QVariant &value );
487 static
bool boolParameter( const QVariantMap &uri, const QString ¶meter,
bool defaultValue = false );
502 QMap<int, int> &oldToNewAttrIdxMap,
503 QString &errorMessage,
504 const QMap<QString, QVariant> *options );
522 virtual bool createDatabase(
const QString &uri, QString &errorMessage
SIP_OUT );
530 const QString &format,
535 double *geoTransform,
537 const QStringList &createOptions = QStringList() )
SIP_FACTORY;
543 virtual
bool createMeshData(
545 const QString &fileName,
546 const QString &driverName,
553 virtual
bool createMeshData(
562 virtual QList<QPair<QString, QString> > pyramidResamplingMethods();
581 virtual QVariantMap decodeUri( const QString &uri ) const;
591 virtual QString encodeUri( const QVariantMap &parts ) const;
606 virtual
int listStyles( const QString &uri, QStringList &ids, QStringList &names,
607 QStringList &descriptions, QString &errCause );
620 virtual
bool styleExists( const QString &uri, const QString &styleId, QString &errorCause
SIP_OUT );
629 virtual QString getStyleById( const QString &uri, const QString &styleId, QString &errCause );
635 virtual
bool deleteStyleById( const QString &uri, const QString &styleId, QString &errCause );
648 virtual
bool saveStyle( const QString &uri, const QString &qmlStyle, const QString &sldStyle,
649 const QString &styleName, const QString &styleDescription,
650 const QString &uiFileContent,
bool useAsDefault, QString &errCause );
656 virtual QString loadStyle( const QString &uri, QString &errCause );
678 virtual
bool createDb( const QString &dbPath, QString &errCause );
728 template <
typename T> QMap<QString, T *>connections(
bool cached =
true );
770 SIP_PYOBJECT __repr__();
772 QString
str = QStringLiteral(
"<QgsProviderMetadata: %1>" ).arg( sipCpp->key() );
773 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
814 template <
class T_prov
ider_conn,
class T_conn> QMap<QString, QgsAbstractProviderConnection *> connectionsProtected(
bool cached =
true )
816 if ( ! cached || mProviderConnections.isEmpty() )
818 qDeleteAll( mProviderConnections );
819 mProviderConnections.clear();
820 const auto connNames { T_conn::connectionList() };
821 for (
const auto &cname : connNames )
823 mProviderConnections.insert( cname,
new T_provider_conn( cname ) );
826 return mProviderConnections;
829 template <
class T_prov
ider_conn>
void deleteConnectionProtected(
const QString &name )
831 T_provider_conn conn( name );
833 mProviderConnections.clear();
834 emit connectionDeleted( name );
838 QMap<QString, QgsAbstractProviderConnection *> mProviderConnections;
850 QString mDescription;
856 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.
QgsMapLayerType
Types of layers that can be added to a map.
#define SIP_TYPEHINT(type)
#define SIP_THROW(name,...)
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.