19#ifndef QGSPROVIDERREGISTRY_H
20#define QGSPROVIDERREGISTRY_H
107 Q_DECL_DEPRECATED QString library(
const QString &providerKey )
const SIP_DEPRECATED;
110 QString pluginList(
bool asHtml =
false )
const;
115 QDir libraryDirectory()
const;
118 void setLibraryDirectory(
const QDir &path );
148 const QString &dataSource,
150 QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() )
SIP_TRANSFERBACK;
158 Q_DECL_DEPRECATED
int providerCapabilities( const QString &providerKey ) const
SIP_DEPRECATED;
165 SIP_SKIP Qgis::VectorExportResult createEmptyLayer( const QString &providerKey, const QString &uri, const
QgsFields &fields,
Qgis::WkbType wkbType, const
QgsCoordinateReferenceSystem &srs,
bool overwrite, QMap<
int,
int> &oldToNewAttrIdxMap, QString &errorMessage, const QMap<QString, QVariant> *options );
174 const QString &providerKey,
176 const QString &format,
179 int width,
int height,
180 double *geoTransform,
182 const QStringList &createOptions = QStringList() )
SIP_FACTORY;
189 QList<QPair<QString, QString> > pyramidResamplingMethods( const QString &providerKey );
199 QVariantMap decodeUri( const QString &providerKey, const QString &uri );
210 QString encodeUri( const QString &providerKey, const QVariantMap &parts );
223 QString absoluteToRelativeUri( const QString &providerKey, const QString &uri, const
QgsReadWriteContext &context ) const;
236 QString relativeToAbsoluteUri( const QString &providerKey, const QString &uri, const
QgsReadWriteContext &context ) const;
258 int listStyles( const QString &providerKey,
262 QStringList &descriptions,
277 bool styleExists( const QString &providerKey, const QString &uri, const QString &styleId, QString &errorCause
SIP_OUT );
286 QString getStyleById( const QString &providerKey, const QString &uri, const QString &styleId, QString &errCause );
292 bool deleteStyleById( const QString &providerKey, const QString &uri, const QString &styleId, QString &errCause );
299 bool saveStyle( const QString &providerKey, const QString &uri, const QString &qmlStyle, const QString &sldStyle,
300 const QString &styleName, const QString &styleDescription,
301 const QString &uiFileContent,
bool useAsDefault, QString &errCause );
308 QString loadStyle( const QString &providerKey, const QString &uri, QString &errCause );
319 QString loadStoredStyle( const QString &providerKey, const QString &uri, QString &styleName, QString &errCause );
342 bool createDb( const QString &providerKey, const QString &dbPath, QString &errCause );
360 Q_DECL_DEPRECATED QFunctionPointer function( const QString &providerKey, const QString &functionName ) const
SIP_DEPRECATED;
374 QStringList providerList() const;
385 QSet< QString > providersForLayerType(
Qgis::LayerType type ) const;
403 : mMetadata( metadata )
404 , mLayerTypes( layerTypes )
416 QList<Qgis::LayerType>
layerTypes()
const {
return mLayerTypes; }
419 SIP_PYOBJECT __repr__();
421 QString
str = QStringLiteral(
"<QgsProviderRegistry.ProviderCandidateDetails: %1>" ).arg( sipCpp->metadata()->key() );
422 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
429 QList< Qgis::LayerType > mLayerTypes;
449 QList< QgsProviderRegistry::ProviderCandidateDetails > preferredProvidersForUri(
const QString &uri )
const;
472 UnusableUriDetails(
const QString &uri = QString(),
const QString &warning = QString(),
const QList< Qgis::LayerType > &layerTypes = QList< Qgis::LayerType >() )
475 , layerTypes( layerTypes )
500 SIP_PYOBJECT __repr__();
502 QString
str = QStringLiteral(
"<QgsProviderRegistry.UnusableUriDetails: %1>" ).arg( sipCpp->warning );
503 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
593 bool shouldDeferUriForOtherProviders(
const QString &uri,
const QString &providerKey )
const;
608 bool uriIsBlocklisted(
const QString &uri )
const;
621 QList< QgsProviderSublayerDetails > querySublayers(
const QString &uri, Qgis::SublayerQueryFlags flags = Qgis::SublayerQueryFlags(),
QgsFeedback *feedback =
nullptr )
const;
633 QString fileVectorFilters()
const;
647 QString fileRasterFilters()
const;
662 QString fileMeshFilters()
const;
674 QString fileMeshDatasetFilters()
const;
688 QString filePointCloudFilters()
const;
691 QString databaseDrivers()
const;
693 QString directoryDrivers()
const;
695 QString protocolDrivers()
const;
700 Q_DECL_DEPRECATED
void registerGuis( QWidget *widget )
SIP_DEPRECATED;
728 QDir mLibraryDirectory;
739 QString mVectorFileFilters;
744 QString mRasterFileFilters;
749 QString mMeshFileFilters;
754 QString mMeshDatasetFileFilters;
759 QString mPointCloudFileFilters;
767 QString mDatabaseDrivers;
774 QString mDirectoryDrivers;
782 QString mProtocolDrivers;
784 QList< UnusableUriHandlerInterface * > mUnusableUriHandlers;
789 static bool exists();
The Qgis class provides global constants for use throughout the application.
Extends QApplication to provide access to QGIS specific resources such as theme paths,...
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.
Custom exception class which is raised when an operation is not supported.
Contains information pertaining to a candidate provider.
QList< Qgis::LayerType > layerTypes() const
Returns a list of map layer types which are valid options for opening the target using this candidate...
QgsProviderMetadata * metadata() const
Returns the candidate provider metadata.
ProviderCandidateDetails(QgsProviderMetadata *metadata, const QList< Qgis::LayerType > &layerTypes)
Constructor for ProviderCandidateDetails, with the specified provider metadata and valid candidate la...
Contains information about unusable URIs which aren't handled by any registered providers.
QString warning
Contains a short, user-friendly, translated message advising why the URI is not usable.
QString uri
URI which could not be handled.
QString detailedWarning
Contains a longer, user-friendly, translated message advising why the URI is not usable.
UnusableUriDetails(const QString &uri=QString(), const QString &warning=QString(), const QList< Qgis::LayerType > &layerTypes=QList< Qgis::LayerType >())
Constructor for UnusableUriDetails for the given uri, with the specified user-friendly,...
QList< Qgis::LayerType > layerTypes
Contains a list of map layer types which are usually valid options for opening the target URI.
An interface used to handle unusable URIs which aren't handled by any registered providers,...
virtual ~UnusableUriHandlerInterface()=default
virtual UnusableUriDetails details(const QString &uri) const =0
Returns the details for advising the user why the uri is not usable.
virtual bool matchesUri(const QString &uri) const =0
Returns true if the handle is an unusable URI handler for the specified uri.
A registry / canonical manager of data providers.
std::map< QString, QgsProviderMetadata * > Providers
Type for data provider metadata associative container.
WidgetMode
Different ways a source select dialog can be used.
@ Embedded
Used for the data source manager dialog where the widget is embedded as the main content for a partic...
@ None
Basic mode when the widget is used as a standalone dialog.
@ Manager
Used by data items for QgsDataItem::paramWidget().
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...
Represents a vector layer which manages a vector based data sets.
#define SIP_THROW(name,...)
const QgsCoordinateReferenceSystem & crs
Setting options for creating vector data providers.