19 #ifndef QGSPROVIDERREGISTRY_H
20 #define QGSPROVIDERREGISTRY_H
29 #include "qgis_core.h"
105 Q_DECL_DEPRECATED QString library(
const QString &providerKey )
const SIP_DEPRECATED;
108 QString pluginList(
bool asHtml =
false )
const;
113 QDir libraryDirectory()
const;
116 void setLibraryDirectory(
const QDir &path );
146 const QString &dataSource,
148 QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() )
SIP_TRANSFERBACK;
156 Q_DECL_DEPRECATED
int providerCapabilities( const QString &providerKey ) const
SIP_DEPRECATED;
163 SIP_SKIP Qgis::VectorExportResult createEmptyLayer( const QString &providerKey, const QString &uri, const
QgsFields &fields,
QgsWkbTypes::Type wkbType, const
QgsCoordinateReferenceSystem &srs,
bool overwrite, QMap<
int,
int> &oldToNewAttrIdxMap, QString &errorMessage, const QMap<QString, QVariant> *options );
172 const QString &providerKey,
174 const QString &format,
177 int width,
int height,
178 double *geoTransform,
180 const QStringList &createOptions = QStringList() )
SIP_FACTORY;
187 QList<QPair<QString, QString> > pyramidResamplingMethods( const QString &providerKey );
197 QVariantMap decodeUri( const QString &providerKey, const QString &uri );
208 QString encodeUri( const QString &providerKey, const QVariantMap &parts );
230 int listStyles( const QString &providerKey,
234 QStringList &descriptions,
242 QString getStyleById( const QString &providerKey, const QString &uri, QString styleId, QString &errCause );
248 bool deleteStyleById( const QString &providerKey, const QString &uri, QString styleId, QString &errCause );
255 bool saveStyle( const QString &providerKey, const QString &uri, const QString &qmlStyle, const QString &sldStyle,
256 const QString &styleName, const QString &styleDescription,
257 const QString &uiFileContent,
bool useAsDefault, QString &errCause );
263 QString loadStyle( const QString &providerKey, const QString &uri, QString &errCause );
286 bool createDb( const QString &providerKey, const QString &dbPath, QString &errCause );
304 Q_DECL_DEPRECATED QFunctionPointer function( const QString &providerKey, const QString &functionName )
SIP_DEPRECATED;
318 QStringList providerList() const;
339 : mMetadata( metadata )
340 , mLayerTypes( layerTypes )
352 QList<QgsMapLayerType>
layerTypes()
const {
return mLayerTypes; }
355 SIP_PYOBJECT __repr__();
357 QString
str = QStringLiteral(
"<QgsProviderRegistry.ProviderCandidateDetails: %1>" ).arg( sipCpp->metadata()->key() );
358 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
365 QList< QgsMapLayerType > mLayerTypes;
385 QList< QgsProviderRegistry::ProviderCandidateDetails > preferredProvidersForUri(
const QString &uri )
const;
408 UnusableUriDetails(
const QString &uri = QString(),
const QString &warning = QString(),
const QList< QgsMapLayerType > &layerTypes = QList< QgsMapLayerType >() )
411 , layerTypes( layerTypes )
436 SIP_PYOBJECT __repr__();
438 QString
str = QStringLiteral(
"<QgsProviderRegistry.UnusableUriDetails: %1>" ).arg( sipCpp->warning );
439 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
529 bool shouldDeferUriForOtherProviders(
const QString &uri,
const QString &providerKey )
const;
544 bool uriIsBlocklisted(
const QString &uri )
const;
556 QString fileVectorFilters()
const;
570 QString fileRasterFilters()
const;
585 QString fileMeshFilters()
const;
597 QString fileMeshDatasetFilters()
const;
611 QString filePointCloudFilters()
const;
614 QString databaseDrivers()
const;
616 QString directoryDrivers()
const;
618 QString protocolDrivers()
const;
623 Q_DECL_DEPRECATED
void registerGuis( QWidget *widget )
SIP_DEPRECATED;
651 QDir mLibraryDirectory;
662 QString mVectorFileFilters;
667 QString mRasterFileFilters;
672 QString mMeshFileFilters;
677 QString mMeshDatasetFileFilters;
682 QString mPointCloudFileFilters;
690 QString mDatabaseDrivers;
697 QString mDirectoryDrivers;
705 QString mProtocolDrivers;
707 QList< UnusableUriHandlerInterface * > mUnusableUriHandlers;
712 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.
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< QgsMapLayerType > layerTypes() const
Returns a list of map layer types which are valid options for opening the target using this candidate...
ProviderCandidateDetails(QgsProviderMetadata *metadata, const QList< QgsMapLayerType > &layerTypes)
Constructor for ProviderCandidateDetails, with the specified provider metadata and valid candidate la...
QgsProviderMetadata * metadata() const
Returns the candidate provider metadata.
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.
UnusableUriDetails(const QString &uri=QString(), const QString &warning=QString(), const QList< QgsMapLayerType > &layerTypes=QList< QgsMapLayerType >())
Constructor for UnusableUriDetails for the given uri, with the specified user-friendly,...
QString uri
URI which could not be handled.
QString detailedWarning
Contains a longer, user-friendly, translated message advising why the URI is not usable.
QList< QgsMapLayerType > 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().
Base class for raster data providers.
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.
Handles storage of information regarding WKB types and their properties.
const QgsCoordinateReferenceSystem & crs
Setting options for creating vector data providers.