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< Qgis::LayerType > supportedLayerTypes()
const;
278 SIP_PYOBJECT supportedLayerTypes() const
SIP_TYPEHINT( List[
Qgis.LayerType] );
282 const QList<
Qgis::LayerType > cppRes = sipCpp->supportedLayerTypes();
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_Qgis_LayerType );
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< Qgis::LayerType > 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;
468 virtual QString suggestGroupNameForUri(
const QString &uri )
const;
481 QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() )
SIP_FACTORY;
489 static
void setBoolParameter( QVariantMap &uri, const QString ¶meter, const QVariant &value );
497 static
bool boolParameter( const QVariantMap &uri, const QString ¶meter,
bool defaultValue = false );
512 QMap<int, int> &oldToNewAttrIdxMap,
513 QString &errorMessage,
514 const QMap<QString, QVariant> *options );
532 virtual bool createDatabase(
const QString &uri, QString &errorMessage
SIP_OUT );
540 const QString &format,
545 double *geoTransform,
547 const QStringList &createOptions = QStringList() )
SIP_FACTORY;
553 virtual
bool createMeshData(
555 const QString &fileName,
556 const QString &driverName,
563 virtual
bool createMeshData(
572 virtual QList<QPair<QString, QString> > pyramidResamplingMethods();
591 virtual QVariantMap decodeUri( const QString &uri ) const;
601 virtual QString encodeUri( const QVariantMap &parts ) const;
614 virtual QString absoluteToRelativeUri( const QString &uri, const
QgsReadWriteContext &context ) const;
627 virtual QString relativeToAbsoluteUri( const QString &uri, const
QgsReadWriteContext &context ) const;
642 virtual
int listStyles( const QString &uri, QStringList &ids, QStringList &names,
643 QStringList &descriptions, QString &errCause );
656 virtual
bool styleExists( const QString &uri, const QString &styleId, QString &errorCause
SIP_OUT );
665 virtual QString getStyleById( const QString &uri, const QString &styleId, QString &errCause );
671 virtual
bool deleteStyleById( const QString &uri, const QString &styleId, QString &errCause );
684 virtual
bool saveStyle( const QString &uri, const QString &qmlStyle, const QString &sldStyle,
685 const QString &styleName, const QString &styleDescription,
686 const QString &uiFileContent,
bool useAsDefault, QString &errCause );
692 virtual QString loadStyle( const QString &uri, QString &errCause );
702 virtual QString loadStoredStyle( const QString &uri, QString &styleName, QString &errCause );
724 virtual
bool createDb( const QString &dbPath, QString &errCause );
774 template <
typename T> QMap<QString, T *>connections(
bool cached =
true );
816 SIP_PYOBJECT __repr__();
818 QString
str = QStringLiteral(
"<QgsProviderMetadata: %1>" ).arg( sipCpp->key() );
819 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
860 template <
class T_prov
ider_conn,
class T_conn> QMap<QString, QgsAbstractProviderConnection *> connectionsProtected(
bool cached =
true )
862 if ( ! cached || mProviderConnections.isEmpty() )
864 qDeleteAll( mProviderConnections );
865 mProviderConnections.clear();
866 const auto connNames { T_conn::connectionList() };
867 for (
const auto &cname : connNames )
869 mProviderConnections.insert( cname,
new T_provider_conn( cname ) );
872 return mProviderConnections;
875 template <
class T_prov
ider_conn>
void deleteConnectionProtected(
const QString &name )
877 T_provider_conn conn( name );
879 mProviderConnections.clear();
880 emit connectionDeleted( name );
884 QMap<QString, QgsAbstractProviderConnection *> mProviderConnections;
896 QString mDescription;
902 CreateDataProviderFunction mCreateFunction =
nullptr;
The Qgis class provides global constants for use throughout the application.
VectorExportResult
Vector layer export result codes.
DataType
Raster data types.
WkbType
The WKB type describes the number of dimensions a geometry has.
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.
The class is used as a container of context for various read/write operations on other objects.
This class allows including a set of layers in a database-side transaction, provided the layer data p...
#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.