#include <qgsdataprovider.h>
Signals | |
void | fullExtentCalculated () |
This is emitted whenever the worker thread has fully calculated the PostGIS extents for this layer, and its event has been received by this provider. | |
void | dataChanged () |
This is emitted whenever an asynchronous operation has finished and the data should be redrawn. | |
Public Member Functions | |
QgsDataProvider (QString const &uri="") | |
virtual | ~QgsDataProvider () |
We need this so the subclass destructors get called. | |
virtual QgsCoordinateReferenceSystem | crs ()=0 |
virtual void | setDataSourceUri (QString const &uri) |
Set the data source specification. | |
virtual QString | dataSourceUri () const |
Get the data source specification. | |
virtual QgsRectangle | extent ()=0 |
Get the extent of the layer. | |
virtual bool | isValid ()=0 |
Returns true if this is a valid layer. | |
virtual void | updateExtents () |
Update the extents of the layer. | |
virtual bool | setSubsetString (QString subset) |
Set the subset string used to create a subset of features in the layer. | |
virtual bool | supportsSubsetString () |
provider supports setting of subset strings | |
virtual QString | subsetString () |
Returns the subset definition string (typically sql) currently in use by the layer and used by the provider to limit the feature set. | |
virtual QStringList | subLayers () const |
Sub-layers handled by this provider, in order from bottom to top. | |
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 |
return the number of layers for the current data source | |
virtual void | setLayerOrder (QStringList layers) |
Reorder the list of layer names to be rendered by this provider (in order from bottom to top). | |
virtual void | setSubLayerVisibility (QString name, bool vis) |
Set the visibility of the given sublayer name. | |
virtual QString | name () const =0 |
return a provider name | |
virtual QString | description () const =0 |
return description | |
virtual QString | fileVectorFilters () const |
return vector file filter string | |
virtual QString | fileRasterFilters () const |
return raster file filter string | |
virtual void | reloadData () |
Reloads the data from the the source. | |
Private Attributes | |
QString | mDataSourceURI |
Universal Resource Identifier for source data. |
This object needs to inherit from QObject to enable event processing in the Postgres/PostGIS provider (QgsPostgresProvider). It is called *here* so that this vtable and the vtable for QgsPostgresProvider don't get misaligned - the QgsVectorLayer class factory (which refers to generic QgsVectorDataProvider's) depends on it.
Definition at line 42 of file qgsdataprovider.h.
QgsDataProvider::QgsDataProvider | ( | QString const & | uri = "" |
) | [inline] |
Definition at line 48 of file qgsdataprovider.h.
virtual QgsDataProvider::~QgsDataProvider | ( | ) | [inline, virtual] |
We need this so the subclass destructors get called.
Definition at line 55 of file qgsdataprovider.h.
virtual QgsCoordinateReferenceSystem QgsDataProvider::crs | ( | ) | [pure virtual] |
Get the QgsCoordinateReferenceSystem for this layer
Referenced by QgsVectorLayer::setCoordinateSystem(), and QgsRasterLayer::setDataProvider().
virtual void QgsDataProvider::setDataSourceUri | ( | QString const & | uri | ) | [inline, virtual] |
Set the data source specification.
This may be a path or database connection string
uri | source specification |
Definition at line 71 of file qgsdataprovider.h.
virtual QString QgsDataProvider::dataSourceUri | ( | ) | const [inline, virtual] |
Get the data source specification.
This may be a path or database connection string
Definition at line 81 of file qgsdataprovider.h.
Referenced by QgsVectorLayer::setDataProvider(), and QgsVectorLayer::setSubsetString().
virtual QgsRectangle QgsDataProvider::extent | ( | ) | [pure virtual] |
Get the extent of the layer.
Referenced by QgsRasterLayer::setDataProvider(), QgsVectorLayer::setDataProvider(), and QgsVectorLayer::updateExtents().
virtual bool QgsDataProvider::isValid | ( | ) | [pure virtual] |
Returns true if this is a valid layer.
It is up to individual providers to determine what constitutes a valid layer
Referenced by QgsProviderRegistry::getProvider(), QgsRasterLayer::setDataProvider(), and QgsVectorLayer::setDataProvider().
virtual void QgsDataProvider::updateExtents | ( | ) | [inline, virtual] |
Update the extents of the layer.
Not implemented by default
Definition at line 104 of file qgsdataprovider.h.
Referenced by QgsVectorLayer::commitChanges().
virtual bool QgsDataProvider::setSubsetString | ( | QString | subset | ) | [inline, virtual] |
Set the subset string used to create a subset of features in the layer.
This may be a sql where clause or any other string that can be used by the data provider to create a subset. Must be implemented in the dataprovider.
Definition at line 116 of file qgsdataprovider.h.
Referenced by QgsVectorLayer::setSubsetString().
virtual bool QgsDataProvider::supportsSubsetString | ( | ) | [inline, virtual] |
provider supports setting of subset strings
Definition at line 128 of file qgsdataprovider.h.
virtual QString QgsDataProvider::subsetString | ( | ) | [inline, virtual] |
Returns the subset definition string (typically sql) currently in use by the layer and used by the provider to limit the feature set.
Must be overridden in the dataprovider, otherwise returns a null QString.
Definition at line 136 of file qgsdataprovider.h.
Referenced by QgsVectorLayer::subsetString().
virtual QStringList QgsDataProvider::subLayers | ( | ) | const [inline, virtual] |
Sub-layers handled by this provider, in order from bottom to top.
Sub-layers are used when the provider's source can combine layers it knows about in some way before it hands them off to the provider.
Definition at line 148 of file qgsdataprovider.h.
Referenced by QgsRasterLayer::subLayers().
virtual QStringList QgsDataProvider::subLayerStyles | ( | ) | const [inline, virtual] |
Sub-layer styles for each sub-layer handled by this provider, in order from bottom to top.
Sub-layer styles are used to abstract the way the provider's source can symbolise layers in some way at the server, before it serves them to the provider.
Definition at line 161 of file qgsdataprovider.h.
Referenced by QgsRasterLayer::writeSymbology().
virtual uint QgsDataProvider::subLayerCount | ( | ) | const [inline, virtual] |
return the number of layers for the current data source
Definition at line 170 of file qgsdataprovider.h.
virtual void QgsDataProvider::setLayerOrder | ( | QStringList | layers | ) | [inline, virtual] |
Reorder the list of layer names to be rendered by this provider (in order from bottom to top).
Definition at line 181 of file qgsdataprovider.h.
Referenced by QgsRasterLayer::setLayerOrder().
virtual void QgsDataProvider::setSubLayerVisibility | ( | QString | name, | |
bool | vis | |||
) | [inline, virtual] |
Set the visibility of the given sublayer name.
Definition at line 195 of file qgsdataprovider.h.
Referenced by QgsRasterLayer::setSubLayerVisibility().
virtual QString QgsDataProvider::name | ( | ) | const [pure virtual] |
return a provider name
Essentially just returns the provider key. Should be used to build file dialogs so that providers can be shown with their supported types. Thus if more than one provider supports a given format, the user is able to select a specific provider to open that file.
Referenced by QgsComposerMap::containsWMSLayer(), and QgsProviderRegistry::getProvider().
virtual QString QgsDataProvider::description | ( | ) | const [pure virtual] |
return description
Return a terse string describing what the provider is.
Referenced by QgsRasterLayer::metadata().
virtual QString QgsDataProvider::fileVectorFilters | ( | ) | const [inline, virtual] |
return vector file filter string
Returns a string suitable for a QFileDialog of vector file formats supported by the data provider. Naturally this will be an empty string for those data providers that do not deal with plain files, such as databases and servers.
Definition at line 248 of file qgsdataprovider.h.
virtual QString QgsDataProvider::fileRasterFilters | ( | ) | const [inline, virtual] |
return raster file filter string
Returns a string suitable for a QFileDialog of raster file formats supported by the data provider. Naturally this will be an empty string for those data providers that do not deal with plain files, such as databases and servers.
Definition at line 265 of file qgsdataprovider.h.
virtual void QgsDataProvider::reloadData | ( | ) | [inline, virtual] |
Reloads the data from the the source.
Needs to be implemented by providers with data caches to synchronize with changes in the data source
Definition at line 272 of file qgsdataprovider.h.
Referenced by QgsRasterLayer::reload(), and QgsVectorLayer::reload().
void QgsDataProvider::fullExtentCalculated | ( | ) | [signal] |
This is emitted whenever the worker thread has fully calculated the PostGIS extents for this layer, and its event has been received by this provider.
void QgsDataProvider::dataChanged | ( | ) | [signal] |
This is emitted whenever an asynchronous operation has finished and the data should be redrawn.
QString QgsDataProvider::mDataSourceURI [private] |
Universal Resource Identifier for source data.
This could be a file, database, or server address.
Definition at line 296 of file qgsdataprovider.h.