2017-05-22 09:01:45 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsvectorlayertools.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-01 16:03:05 +01:00
|
|
|
class QgsVectorLayerTools : QObject
|
2013-10-04 11:22:57 +02:00
|
|
|
{
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Methods in this class are used to handle basic operations on vector layers.
|
|
|
|
With an implementation of this class, parts of the application can ask for
|
|
|
|
an operation to be done and the implementation will then take care of it.
|
2017-05-22 09:01:45 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
Reimplement this class, if you need to have custom checks or GUI elements
|
|
|
|
in your application.
|
2017-05-22 09:01:45 +02:00
|
|
|
%End
|
|
|
|
|
2013-10-04 11:22:57 +02:00
|
|
|
%TypeHeaderCode
|
2017-05-22 09:01:45 +02:00
|
|
|
#include "qgsvectorlayertools.h"
|
2013-10-04 11:22:57 +02:00
|
|
|
%End
|
|
|
|
public:
|
2016-11-01 16:03:05 +01:00
|
|
|
QgsVectorLayerTools();
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool addFeature( QgsVectorLayer *layer, const QgsAttributeMap &defaultValues = QgsAttributeMap(), const QgsGeometry &defaultGeometry = QgsGeometry(), QgsFeature *feature /Out/ = 0 ) const = 0;
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
This method should/will be called, whenever a new feature will be added to the layer
|
2017-05-22 09:01:45 +02:00
|
|
|
|
2018-05-27 16:42:41 +10:00
|
|
|
:param layer: The layer to which the feature should be added
|
|
|
|
:param defaultValues: Default values for the feature to add
|
2017-12-15 10:36:55 -04:00
|
|
|
:param defaultGeometry: A default geometry to add to the feature
|
2018-05-27 16:42:41 +10:00
|
|
|
:param feature: Updated feature after adding will be written back to this
|
2017-05-22 09:01:45 +02:00
|
|
|
|
2018-05-27 17:04:31 +10:00
|
|
|
:return: True in case of success, False if the operation failed/was aborted
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
TODO QGIS 3: remove const qualifier
|
2017-05-22 09:01:45 +02:00
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool startEditing( QgsVectorLayer *layer ) const = 0;
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
This will be called, whenever a vector layer should be switched to edit mode. Check the providers
|
|
|
|
capability to edit in here.
|
|
|
|
If successful layer->startEditing() will be called and true returned.
|
|
|
|
|
2018-05-27 16:42:41 +10:00
|
|
|
:param layer: The layer on which to start an edit session
|
2017-05-22 09:01:45 +02:00
|
|
|
|
2018-05-27 17:04:31 +10:00
|
|
|
:return: True, if the editing session was started
|
2017-05-22 09:01:45 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
TODO QGIS 3: remove const qualifier
|
2017-05-22 09:01:45 +02:00
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool stopEditing( QgsVectorLayer *layer, bool allowCancel = true ) const = 0;
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Will be called, when an editing session is ended and the features should be committed.
|
|
|
|
Appropriate dialogs should be shown like
|
|
|
|
|
2018-05-27 16:42:41 +10:00
|
|
|
:param layer: The layer to commit
|
2017-12-15 10:36:55 -04:00
|
|
|
:param allowCancel: True if a cancel button should be offered
|
|
|
|
|
2018-05-27 17:04:31 +10:00
|
|
|
:return: True if successful
|
2017-05-22 09:01:45 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
TODO QGIS 3: remove const qualifier
|
2017-05-22 09:01:45 +02:00
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool saveEdits( QgsVectorLayer *layer ) const = 0;
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Should be called, when the features should be committed but the editing session is not ended.
|
2017-05-22 09:01:45 +02:00
|
|
|
|
2018-05-27 16:42:41 +10:00
|
|
|
:param layer: The layer to commit
|
2017-05-22 09:01:45 +02:00
|
|
|
|
2018-05-27 17:04:31 +10:00
|
|
|
:return: True if successful
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
TODO QGIS 3: remove const qualifier
|
2017-05-22 09:01:45 +02:00
|
|
|
%End
|
2016-02-14 03:50:23 +01:00
|
|
|
|
2017-05-02 07:21:20 +02:00
|
|
|
virtual bool copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureRequest &request /In,Out/, double dx = 0, double dy = 0, QString *errorMsg /Out/ = 0 ) const;
|
2017-05-22 09:01:45 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Copy and move features with defined translation.
|
|
|
|
|
|
|
|
:param layer: The layer
|
|
|
|
:param request: The request for the features to be moved. It will be assigned to a new feature request with the newly copied features.
|
|
|
|
:param dx: The translation on x
|
|
|
|
:param dy: The translation on y
|
|
|
|
:param errorMsg: If given, it will contain the error message
|
|
|
|
|
|
|
|
:return: True if all features could be copied.
|
2017-05-22 09:01:45 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
TODO QGIS 3: remove const qualifier
|
2017-05-22 09:01:45 +02:00
|
|
|
%End
|
|
|
|
|
2013-10-04 11:22:57 +02:00
|
|
|
};
|
2017-05-22 09:01:45 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsvectorlayertools.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|