QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
16 #ifndef QQGSDATAPROVIDER_H
17 #define QQGSDATAPROVIDER_H
19 #include "qgis_core.h"
23 #include <QStringList>
46 if ( qobject_cast<QgsVectorDataProvider *>( sipCpp ) )
48 sipType = sipType_QgsVectorDataProvider;
50 else if ( qobject_cast<QgsRasterDataProvider *>( sipCpp ) )
52 sipType = sipType_QgsRasterDataProvider;
54 else if ( qobject_cast<QgsMeshDataProvider *>( sipCpp ) )
56 sipType = sipType_QgsMeshDataProvider;
75 NoDataCapabilities = 0,
81 Q_DECLARE_FLAGS( DataCapabilities, DataCapability )
120 FlagTrustDataSource = 1 << 0,
122 Q_DECLARE_FLAGS( ReadFlags, ReadFlag )
131 QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
147 mDataSourceURI = uri;
161 if ( expandAuthConfig && mDataSourceURI.contains( QLatin1String(
"authcfg" ) ) )
164 return uri.
uri( expandAuthConfig );
168 return mDataSourceURI;
189 mDataSourceURI = uri.
uri(
true );
231 virtual
bool isValid() const = 0;
237 virtual
void updateExtents()
253 Q_UNUSED( updateFeatureCount )
285 return QStringList();
297 return QStringList();
318 if ( layers.count() < 1 )
332 if ( name.isEmpty() || !vis )
355 virtual QString
name()
const = 0;
410 virtual void reloadData();
413 virtual QDateTime
timestamp()
const {
return mTimestamp; }
480 void setProviderProperty( ProviderProperty property,
const QVariant &value );
488 void setProviderProperty(
int property,
const QVariant &value );
496 QVariant providerProperty( ProviderProperty property,
const QVariant &defaultValue = QVariant() )
const;
504 QVariant providerProperty(
int property,
const QVariant &defaultValue )
const;
516 virtual void setListening(
bool isListening );
528 double lastRenderingTimeMs = -1;
531 double maxRenderingTimeMs = MAXIMUM_LAYER_PREVIEW_TIME_MS;
596 static QString sublayerSeparator();
606 void fullExtentCalculated();
629 void notify( const QString &msg );
637 QDateTime mTimestamp;
649 QgsDataProvider::ReadFlags mReadFlags = QgsDataProvider::ReadFlags();
657 QString mDataSourceURI;
661 QMap< int, QVariant > mProviderProperties;
666 mutable QMutex mOptionsMutex;
672 virtual void reloadProviderData() {}
Class for storing the component parts of a RDBMS data source URI (e.g.
virtual QStringList subLayerStyles() const
Sub-layer styles for each sub-layer handled by this provider, in order from bottom to top.
virtual uint subLayerCount() const
Returns the number of layers for the current data source.
Contains information about the context in which a coordinate transform is executed.
virtual bool supportsSubsetString() const
Returns true if the provider supports setting of subset strings.
Setting options for creating vector data providers.
Abstract base class for spatial data provider implementations.
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.
virtual void invalidateConnections(const QString &connection)
Invalidate connections corresponding to specified name.
virtual QgsError error() const
Gets current status error.
QgsError is container for error messages (report).
virtual QString dataSourceUri(bool expandAuthConfig=false) const
Gets the data source specification.
void append(const QString &message, const QString &tag)
Append new error message.
ProviderProperty
Properties are used to pass custom configuration options into data providers.
A rectangle specified with double values.
virtual QString description() const =0
Returns description.
virtual QDateTime timestamp() const
Time stamp of data source in the moment when data/metadata were loaded by provider.
Base class for handling properties relating to a data provider's temporal capabilities.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
@ EvaluateDefaultValues
Evaluate default values on provider side when calling QgsVectorDataProvider::defaultValue( int index ...
void setUri(const QgsDataSourceUri &uri)
Set the data source specification.
virtual bool writeLayerMetadata(const QgsLayerMetadata &metadata)
Writes layer metadata to the underlying provider source.
virtual bool enterUpdateMode()
Enter update mode.
Stores settings related to the context in which a preview job runs.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
void setError(const QgsError &error)
Sets error message.
QgsErrorMessage represents single error message.
This class represents a coordinate reference system (CRS).
virtual QDateTime dataTimestamp() const
Current time stamp of data source.
virtual QString fileVectorFilters() const
Returns vector file filter string.
virtual void setDataSourceUri(const QString &uri)
Set the data source specification.
QgsCoordinateTransformContext transformContext
Coordinate transform context.
QString uri(bool expandAuthConfig=true) const
Returns the complete URI as a string.
QgsDataSourceUri uri() const
Gets the data source specification.
virtual bool leaveUpdateMode()
Leave update mode.
virtual QString subsetString() const
Returns the subset definition string (typically sql) currently in use by the layer and used by the pr...
virtual QString name() const =0
Returns a provider name.
virtual QgsLayerMetadata layerMetadata() const
Returns layer metadata collected from the provider's source.
virtual QString dataComment() const
Returns a short comment for the data that this provider is providing access to (e....
ReadFlag
Flags which control dataprovider construction.
DataCapability
Used in browser model to understand which items for which providers should be populated.
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 QString fileRasterFilters() const
Returns raster file filter string.
virtual QStringList subLayers() const
Sub-layers handled by this provider, in order from bottom to top.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate system for the data source.