QGIS API Documentation  2.99.0-Master (8ec3eaf)
qgsvectorlayertools.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayertools.h
3  --------------------------------------
4  Date : 29.5.2013
5  Copyright : (C) 2013 Matthias Kuhn
6  Email : matthias at opengis dot ch
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSVECTORLAYERTOOLS_H
17 #define QGSVECTORLAYERTOOLS_H
18 
19 #include <QObject>
20 
21 #include "qgsfeature.h"
22 #include "qgsgeometry.h"
23 
24 class QgsFeatureRequest;
25 class QgsVectorLayer;
26 
36 class CORE_EXPORT QgsVectorLayerTools : public QObject
37 {
38  Q_OBJECT
39 
40  public:
42 
43  virtual ~QgsVectorLayerTools();
44 
56  virtual bool addFeature( QgsVectorLayer* layer, const QgsAttributeMap& defaultValues = QgsAttributeMap(), const QgsGeometry& defaultGeometry = QgsGeometry(), QgsFeature* feature = nullptr ) const = 0;
57 
69  virtual bool startEditing( QgsVectorLayer* layer ) const = 0;
70 
81  virtual bool stopEditing( QgsVectorLayer* layer, bool allowCancel = true ) const = 0;
82 
91  virtual bool saveEdits( QgsVectorLayer* layer ) const = 0;
92 
105  virtual bool copyMoveFeatures( QgsVectorLayer* layer, QgsFeatureRequest &request, double dx = 0, double dy = 0, QString *errorMsg = nullptr ) const;
106 
107 };
108 
109 #endif // QGSVECTORLAYERTOOLS_H
Methods in this class are used to handle basic operations on vector layers.
QMap< int, QVariant > QgsAttributeMap
Definition: qgsfeature.h:44
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:78
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:135
This class wraps a request for features to a vector layer (or directly its vector data provider)...
Represents a vector layer which manages a vector based data sets.