16 #ifndef QQGSDATAPROVIDER_H 17 #define QQGSDATAPROVIDER_H 19 #include "qgis_core.h" 23 #include <QStringList> 54 if ( qobject_cast<QgsVectorDataProvider *>( sipCpp ) )
56 sipType = sipType_QgsVectorDataProvider;
58 else if ( qobject_cast<QgsRasterDataProvider *>( sipCpp ) )
60 sipType = sipType_QgsRasterDataProvider;
62 else if ( qobject_cast<QgsMeshDataProvider *>( sipCpp ) )
64 sipType = sipType_QgsMeshDataProvider;
78 NoDataCapabilities = 0,
115 : mDataSourceURI( uri )
135 mDataSourceURI = uri;
149 if ( expandAuthConfig && mDataSourceURI.contains( QLatin1String(
"authcfg" ) ) )
152 return uri.
uri( expandAuthConfig );
156 return mDataSourceURI;
167 mDataSourceURI = uri.
uri(
true );
191 virtual bool isValid()
const = 0;
213 Q_UNUSED( updateFeatureCount );
245 return QStringList();
264 return QStringList();
285 if ( layers.count() < 1 )
299 if ( name.isEmpty() || !vis )
322 virtual QString name()
const = 0;
337 virtual QString description()
const = 0;
352 return QLatin1String(
"" );
368 return QLatin1String(
"" );
378 virtual QDateTime
timestamp()
const {
return mTimestamp; }
445 void setProviderProperty(
ProviderProperty property,
const QVariant &value );
453 void setProviderProperty(
int property,
const QVariant &value );
461 QVariant providerProperty(
ProviderProperty property,
const QVariant &defaultValue = QVariant() )
const;
469 QVariant providerProperty(
int property,
const QVariant &defaultValue )
const;
481 virtual void setListening(
bool isListening );
493 double lastRenderingTimeMs = -1;
496 double maxRenderingTimeMs = MAXIMUM_LAYER_PREVIEW_TIME_MS;
541 void fullExtentCalculated();
559 void notify(
const QString &msg );
584 QString mDataSourceURI;
586 QMap< int, QVariant > mProviderProperties;
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.
QgsDataProvider(const QString &uri=QString(), const QgsDataProvider::ProviderOptions &options=QgsDataProvider::ProviderOptions())
Create a new dataprovider with the specified in the uri.
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.
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.
QString uri(bool expandAuthConfig=true) const
Returns complete uri.
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 PostgreSQL/RDBMS datasource URI.
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.