QGIS API Documentation  3.27.0-Master (11ef3e5184)
qgsvectorlayereditbuffergroup.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayereditbuffergroup.h - QgsVectorLayerEditBufferGroup
3 
4  ---------------------
5  begin : 22.12.2021
6  copyright : (C) 2021 by Damiano Lombardi
7  email : [email protected]
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSVECTORLAYEREDITBUFFERGROUP_H
18 #define QGSVECTORLAYEREDITBUFFERGROUP_H
19 
20 #include "qgis_core.h"
21 #include "qgis_sip.h"
22 
23 #include <QObject>
24 #include <QSet>
25 
26 class QgsVectorLayer;
27 
38 class CORE_EXPORT QgsVectorLayerEditBufferGroup : public QObject
39 {
40  Q_OBJECT
41 
42  public:
43 
45  explicit QgsVectorLayerEditBufferGroup( QObject *parent = nullptr );
46 
50  void addLayer( QgsVectorLayer *layer );
51 
55  void clear();
56 
62  QSet<QgsVectorLayer *> layers() const;
63 
69  QSet<QgsVectorLayer *> modifiedLayers() const;
70 
76  bool startEditing();
77 
99  bool commitChanges( QStringList &commitErrors SIP_OUT, bool stopEditing = true );
100 
110  bool rollBack( QStringList &rollbackErrors SIP_OUT, bool stopEditing = true );
111 
115  bool isEditing() const;
116 
117  private:
118 
119  QList<QgsVectorLayer *> orderLayersParentsToChildren( QSet<QgsVectorLayer *> layers );
120  void editingFinished( bool stopEditing );
121 
122  QSet<QgsVectorLayer *> mLayers;
123 
124  bool mIsEditing = false;
125 };
126 
127 #endif // QGSVECTORLAYEREDITBUFFERGROUP_H
The edit buffer group manages a group of edit buffers.
Represents a vector layer which manages a vector based data sets.
#define SIP_OUT
Definition: qgis_sip.h:58