15#ifndef QGSVECTORDATAPROVIDER_H
16#define QGSVECTORDATAPROVIDER_H
101 virtual QString storageType()
const;
126 virtual bool empty()
const;
137 virtual bool isSqlQuery()
const;
204 virtual QStringList uniqueStringsMatching(
int index,
const QString &substring,
int limit = -1,
231 virtual void enumValues(
int index, QStringList &enumList
SIP_OUT )
const { Q_UNUSED( index ) enumList.clear(); }
250 virtual bool truncate();
258 virtual bool cancelReload();
265 virtual bool addAttributes(
const QList<QgsField> &attributes );
283 virtual bool renameAttributes(
const QgsFieldNameMap &renamedAttributes );
320 virtual QVariant defaultValue(
int fieldIndex )
const;
328 virtual QString defaultValueClause(
int fieldIndex )
const;
352 virtual bool changeGeometryValues(
const QgsGeometryMap &geometry_map );
358 virtual bool createSpatialIndex();
361 virtual bool createAttributeIndex(
int field );
376 QString capabilitiesString()
const;
398 virtual void setEncoding(
const QString &e );
405 QString encoding()
const;
410 int fieldNameIndex(
const QString &fieldName )
const;
415 QMap<QString, int> fieldNameMap()
const;
432 virtual QString geometryColumnName()
const;
444 bool supportedType( const
QgsField &field ) const;
448 NativeType(
const QString &typeDesc,
const QString &
typeName, QMetaType::Type type,
int minLen = 0,
int maxLen = 0,
int minPrec = 0,
int maxPrec = 0, QMetaType::Type subType = QMetaType::Type::UnknownType )
449 : mTypeDesc( typeDesc )
454 , mMinPrec( minPrec )
455 , mMaxPrec( maxPrec )
456 , mSubType( subType )
459 Q_DECL_DEPRECATED
NativeType(
const QString &typeDesc,
const QString &
typeName, QVariant::Type type,
int minLen = 0,
int maxLen = 0,
int minPrec = 0,
int maxPrec = 0, QVariant::Type subType = QVariant::Type::Invalid )
460 : mTypeDesc( typeDesc )
465 , mMinPrec( minPrec )
466 , mMaxPrec( maxPrec )
484 QList< QgsVectorDataProvider::NativeType > nativeTypes()
const;
493 static QStringList availableEncodings();
498 bool hasErrors()
const;
508 QStringList errors()
const;
547 static QVariant convertValue( QMetaType::Type type, const QString &value );
554 Q_DECL_DEPRECATED static QVariant convertValue( QVariant::Type type, const QString &value )
SIP_DEPRECATED;
569 virtual QSet<QgsMapLayerDependency> dependencies()
const;
577 virtual QList<QgsRelation> discoverRelations(
const QgsVectorLayer *target,
const QList<QgsVectorLayer *> &layers )
const;
583 virtual QVariantMap
metadata()
const {
return QVariantMap(); }
598 virtual QString
translateMetadataValue(
const QString &mdKey,
const QVariant &value )
const { Q_UNUSED( mdKey )
return value.toString(); }
628 void raiseError( const QString &msg ) const;
636 void clearMinMaxCache();
641 void fillMinMaxCache() const;
651 void pushError( const QString &msg ) const;
673 QTextCodec *textEncoding()
const;
685 mutable bool mCacheMinMaxDirty =
true;
686 mutable QMap<int, QVariant> mCacheMinValues, mCacheMaxValues;
689 QTextCodec *mEncoding =
nullptr;
695 QList< NativeType > mNativeTypes;
698 mutable QStringList mErrors;
700 std::unique_ptr< QgsVectorDataProviderTemporalCapabilities > mTemporalCapabilities;
701 std::unique_ptr< QgsDataProviderElevationProperties > mElevationProperties;
703 static QStringList sEncodings;
@ EditingCapabilities
Bitmask of all editing capabilities.
QFlags< VectorLayerTypeFlag > VectorLayerTypeFlags
Vector layer type flags.
QFlags< DataProviderReadFlag > DataProviderReadFlags
Flags which control data provider construction.
FeatureAvailability
Possible return value for QgsFeatureSource::hasFeatures() to determine if a source is empty.
QFlags< VectorProviderCapability > VectorProviderCapabilities
Vector data provider capabilities.
Aggregate
Available aggregates to calculate.
QFlags< VectorDataProviderAttributeEditCapability > VectorDataProviderAttributeEditCapabilities
Attribute editing capabilities which may be supported by vector data providers.
WkbType
The WKB type describes the number of dimensions a geometry has.
Base class that can be used for any class that is capable of returning features.
Abstract base class - its implementations define different approaches to the labeling of a vector lay...
A 3-dimensional box composed of x, y, z coordinates.
This class represents a coordinate reference system (CRS).
Base class for handling elevation related properties for a data provider.
Abstract base class for spatial data provider implementations.
virtual QString dataComment() const
Returns a short comment for the data that this provider is providing access to (e....
virtual QgsDataProviderTemporalCapabilities * temporalCapabilities()
Returns the provider's temporal capabilities.
virtual void reloadData()
Reloads the data from the source for providers with data caches to synchronize, changes in the data s...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Wrapper for iterator of features from vector data provider or vector layer.
Abstract base class for all 2D vector feature renderers.
This class wraps a request for features to a vector layer (or directly its vector data provider).
An interface for objects which accept features via addFeature(s) methods.
virtual QString lastError() const
Returns the most recent error encountered by the sink, e.g.
virtual bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())=0
Adds a list of features to the sink.
An interface for objects which provide features via a getFeatures method.
virtual QgsCoordinateReferenceSystem sourceCrs() const =0
Returns the coordinate reference system for features in the source.
virtual Qgis::FeatureAvailability hasFeatures() const
Determines if there are any features available in the source.
virtual QVariant minimumValue(int fieldIndex) const
Returns the minimum value for an attribute column or an invalid variant in case of error.
virtual QVariant maximumValue(int fieldIndex) const
Returns the maximum value for an attribute column or an invalid variant in case of error.
virtual QgsRectangle sourceExtent() const
Returns the extent of all geometries from the source.
virtual QgsBox3D sourceExtent3D() const
Returns the 3D extent of all geometries from the source.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Constraint
Constraints which may be present on a field.
QFlags< Constraint > Constraints
Encapsulate a field in an attribute table or data source.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
A rectangle specified with double values.
This class allows including a set of layers in a database-side transaction, provided the layer data p...
Contains utility functions for working with QVariants and QVariant types.
Implementation of data provider temporal properties for QgsVectorDataProviders.
This is the base class for vector data providers.
virtual void enumValues(int index, QStringList &enumList) const
Returns the possible enum values of an attribute.
QString sourceName() const override
Returns a friendly display name for the source.
virtual QString translateMetadataValue(const QString &mdKey, const QVariant &value) const
Gets the translated metadata value.
long long featureCount() const override=0
Number of features in the layer.
virtual bool doesStrictFeatureTypeCheck() const
Returns true if the provider is strict about the type of inserted features (e.g.
virtual QgsAbstractFeatureSource * featureSource() const =0
Returns feature source object that can be used for querying provider's data.
virtual bool hasMetadata() const
Returns true if the data source has metadata, false otherwise.
QgsFields fields() const override=0
Returns the fields associated with this data provider.
Qgis::WkbType wkbType() const override=0
Returns the geometry type which is returned by this layer.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const override=0
Query the provider for features specified in request.
virtual QString translateMetadataKey(const QString &mdKey) const
Gets the translated metadata key.
virtual QVariantMap metadata() const
Gets metadata, dependent on the provider type, that will be display in the metadata tab of the layer ...
Stores queued vector layer edit operations prior to committing changes to the layer's data provider.
Represents a vector layer which manages a vector based data sets.
QMap< int, QString > QgsFieldNameMap
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
QList< QgsFeature > QgsFeatureList
QSet< QgsFeatureId > QgsFeatureIds
QList< int > QgsAttributeList
QList< int > QgsAttributeList
QSet< int > QgsAttributeIds
QHash< int, QString > QgsAttrPalIndexNameHash
const QgsAttributeList & attributeIndexes
A bundle of parameters controlling aggregate calculation.
Setting options for creating vector data providers.
NativeType(const QString &typeDesc, const QString &typeName, QMetaType::Type type, int minLen=0, int maxLen=0, int minPrec=0, int maxPrec=0, QMetaType::Type subType=QMetaType::Type::UnknownType)
Q_DECL_DEPRECATED NativeType(const QString &typeDesc, const QString &typeName, QVariant::Type type, int minLen=0, int maxLen=0, int minPrec=0, int maxPrec=0, QVariant::Type subType=QVariant::Type::Invalid)