/usr/include/qgis/qgsvectorlayertools.h is in libqgis-dev 2.8.6+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | /***************************************************************************
qgsvectorlayertools.h
--------------------------------------
Date : 29.5.2013
Copyright : (C) 2013 Matthias Kuhn
Email : matthias dot kuhn at gmx dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSVECTORLAYERTOOLS_H
#define QGSVECTORLAYERTOOLS_H
#include "qgsfeature.h"
#include "qgsgeometry.h"
class QgsVectorLayer;
/**
* 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.
*
* Reimplement this class, if you need to have custom checks or GUI elements
* in your application.
*
*/
class GUI_EXPORT QgsVectorLayerTools
{
public:
QgsVectorLayerTools()
{}
virtual ~QgsVectorLayerTools()
{}
/**
* This method should/will be called, whenever a new feature will be added to the layer
*
* @param layer The layer to which the feature should be added
* @param defaultValues Default values for the feature to add
* @param defaultGeometry A default geometry to add to the feature
* @return True in case of success, False if the operation failed/was aborted
*/
virtual bool addFeature( QgsVectorLayer* layer, QgsAttributeMap defaultValues = QgsAttributeMap(), const QgsGeometry& defaultGeometry = QgsGeometry() ) const = 0;
/**
* 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.
*
* @param layer The layer on which to start an edit session
*
* @return True, if the editing session was started
*/
virtual bool startEditing( QgsVectorLayer* layer ) const = 0;
/**
* Will be called, when an editing session is ended and the features should be commited.
* Appropriate dialogs should be shown like
*
* @param layer The layer to commit
* @param allowCancel True if a cancel button should be offered
* @return True if successful
*/
virtual bool stopEditing( QgsVectorLayer* layer, bool allowCancel = true ) const = 0;
/**
* Should be called, when the features should be commited but the editing session is not ended.
*
* @param layer The layer to commit
* @return True if successful
*/
virtual bool saveEdits( QgsVectorLayer* layer ) const = 0;
};
#endif // QGSVECTORLAYERTOOLS_H
|