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;
74 NoDataCapabilities = 0,
99 : mDataSourceURI( uri )
117 mDataSourceURI = uri;
131 if ( expandAuthConfig && mDataSourceURI.contains( QLatin1String(
"authcfg" ) ) )
134 return uri.
uri( expandAuthConfig );
138 return mDataSourceURI;
149 mDataSourceURI = uri.
uri(
true );
173 virtual bool isValid()
const = 0;
195 Q_UNUSED( updateFeatureCount );
227 return QStringList();
246 return QStringList();
267 if ( layers.count() < 1 )
281 if ( name.isEmpty() || !vis )
304 virtual QString name()
const = 0;
319 virtual QString description()
const = 0;
334 return QLatin1String(
"" );
350 return QLatin1String(
"" );
360 virtual QDateTime
timestamp()
const {
return mTimestamp; }
427 void setProviderProperty(
ProviderProperty property,
const QVariant &value );
435 void setProviderProperty(
int property,
const QVariant &value );
443 QVariant providerProperty(
ProviderProperty property,
const QVariant &defaultValue = QVariant() )
const;
451 QVariant providerProperty(
int property,
const QVariant &defaultValue )
const;
463 virtual void setListening(
bool isListening );
475 double lastRenderingTimeMs = -1;
478 double maxRenderingTimeMs = MAXIMUM_LAYER_PREVIEW_TIME_MS;
523 void fullExtentCalculated();
541 void notify(
const QString &msg );
566 QString mDataSourceURI;
568 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.
virtual QgsError error() const
Get current status error.
virtual QString fileRasterFilters() const
Return 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
return 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
Get the data source specification.
QgsDataSourceUri uri() const
Get 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
return complete uri
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
Return vector file filter string.
void setError(const QgsError &error)
Set 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.
QgsDataProvider(const QString &uri=QString())
Create a new dataprovider with the specified in the uri.
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.