16 #ifndef QQGSDATAPROVIDER_H 17 #define QQGSDATAPROVIDER_H 19 #include "qgis_core.h" 23 #include <QStringList> 45 if ( qobject_cast<QgsVectorDataProvider *>( sipCpp ) )
47 sipType = sipType_QgsVectorDataProvider;
49 else if ( qobject_cast<QgsRasterDataProvider *>( sipCpp ) )
51 sipType = sipType_QgsRasterDataProvider;
53 else if ( qobject_cast<QgsMeshDataProvider *>( sipCpp ) )
55 sipType = sipType_QgsMeshDataProvider;
74 NoDataCapabilities = 0,
129 mDataSourceURI = uri;
143 if ( expandAuthConfig && mDataSourceURI.contains( QLatin1String(
"authcfg" ) ) )
146 return uri.
uri( expandAuthConfig );
150 return mDataSourceURI;
161 mDataSourceURI = uri.
uri(
true );
185 virtual bool isValid()
const = 0;
207 Q_UNUSED( updateFeatureCount )
239 return QStringList();
258 return QStringList();
279 if ( layers.count() < 1 )
293 if ( name.isEmpty() || !vis )
316 virtual QString name()
const = 0;
331 virtual QString description()
const = 0;
372 virtual QDateTime
timestamp()
const {
return mTimestamp; }
439 void setProviderProperty(
ProviderProperty property,
const QVariant &value );
447 void setProviderProperty(
int property,
const QVariant &value );
455 QVariant providerProperty(
ProviderProperty property,
const QVariant &defaultValue = QVariant() )
const;
463 QVariant providerProperty(
int property,
const QVariant &defaultValue )
const;
475 virtual void setListening(
bool isListening );
487 double lastRenderingTimeMs = -1;
490 double maxRenderingTimeMs = MAXIMUM_LAYER_PREVIEW_TIME_MS;
557 void fullExtentCalculated();
580 void notify(
const QString &msg );
605 QString mDataSourceURI;
607 QMap< int, QVariant > mProviderProperties;
614 mutable QMutex mOptionsMutex;
virtual void setSubLayerVisibility(const QString &name, bool vis)
Set the visibility of the given sublayer name.
virtual bool setSubsetString(const QString &subset, bool updateFeatureCount=true)
Set the subset string used to create a subset of features in the layer.
A rectangle specified with double values.
virtual QString subsetString() const
Returns the subset definition string (typically sql) currently in use by the layer and used by the pr...
static QString SUBLAYER_SEPARATOR
String sequence used for separating components of sublayers strings.
virtual void updateExtents()
Update the extents of the layer.
virtual QgsError error() const
Gets current status error.
virtual QString fileRasterFilters() const
Returns raster file filter string.
QDateTime mTimestamp
Timestamp of data in the moment when the data were loaded by provider.
virtual QStringList subLayers() const
Sub-layers handled by this provider, in order from bottom to top.
virtual uint subLayerCount() const
Returns the number of layers for the current data source.
Abstract base class for spatial data provider implementations.
const QgsCoordinateReferenceSystem & crs
DataCapability
Used in browser model to understand which items for which providers should be populated.
virtual QgsLayerMetadata layerMetadata() const
Returns layer metadata collected from the provider's source.
virtual QDateTime dataTimestamp() const
Current time stamp of data source.
void setUri(const QgsDataSourceUri &uri)
Set the data source specification.
virtual QString dataSourceUri(bool expandAuthConfig=false) const
Gets the data source specification.
QgsDataSourceUri uri() const
Gets the data source specification.
void appendError(const QgsErrorMessage &message)
Add error message.
virtual void setLayerOrder(const QStringList &layers)
Reorder the list of layer names to be rendered by this provider (in order from bottom to top) ...
virtual bool supportsSubsetString() const
Returns true if the provider supports setting of subset strings.
QgsErrorMessage represents single error message.
virtual void setDataSourceUri(const QString &uri)
Set the data source specification.
void append(const QString &message, const QString &tag)
Append new error message.
Contains information about the context in which a coordinate transform is executed.
QgsCoordinateTransformContext transformContext
QString uri(bool expandAuthConfig=true) const
Returns the complete URI as a string.
Setting options for creating vector data providers.
virtual QDateTime timestamp() const
Time stamp of data source in the moment when data/metadata were loaded by provider.
QgsError is container for error messages (report).
virtual QString fileVectorFilters() const
Returns vector file filter string.
void setError(const QgsError &error)
Sets error message.
virtual void reloadData()
Reloads the data from the source.
This class represents a coordinate reference system (CRS).
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
virtual bool enterUpdateMode()
Enter update mode.
virtual QStringList subLayerStyles() const
Sub-layer styles for each sub-layer handled by this provider, in order from bottom to top...
virtual bool writeLayerMetadata(const QgsLayerMetadata &metadata)
Writes layer metadata to the underlying provider source.
Class for storing the component parts of a RDBMS data source URI (e.g.
virtual void invalidateConnections(const QString &connection)
Invalidate connections corresponding to specified name.
Stores settings related to the context in which a preview job runs.
ProviderProperty
Properties are used to pass custom configuration options into data providers.
Evaluate default values on provider side when calling QgsVectorDataProvider::defaultValue( int index ...
virtual bool leaveUpdateMode()
Leave update mode.