QGIS/python/core/qgsvectorlayerundocommand.sip

196 lines
5.4 KiB
Plaintext
Raw Normal View History

/** \ingroup core
* \class QgsVectorLayerUndoCommand
* \brief Base class for undo commands within a QgsVectorLayerEditBuffer.
*/
2014-01-27 09:22:24 +01:00
class QgsVectorLayerUndoCommand : QUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
/** Constructor for QgsVectorLayerUndoCommand
* @param buffer associated edit buffer
*/
2014-01-27 09:22:24 +01:00
QgsVectorLayerUndoCommand( QgsVectorLayerEditBuffer *buffer /Transfer/ );
//! Returns the layer associated with the undo command
2014-01-27 09:22:24 +01:00
QgsVectorLayer *layer();
QgsGeometryCache *cache();
2014-01-27 09:22:24 +01:00
virtual int id() const;
virtual bool mergeWith( QUndoCommand * );
};
/** \ingroup core
* \class QgsVectorLayerUndoCommandAddFeature
* \brief Undo command for adding a feature to a vector layer.
*/
2014-01-27 09:22:24 +01:00
class QgsVectorLayerUndoCommandAddFeature : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
/** Constructor for QgsVectorLayerUndoCommandAddFeature
* @param buffer associated edit buffer
* @param f feature to add to layer
*/
2014-01-27 09:22:24 +01:00
QgsVectorLayerUndoCommandAddFeature( QgsVectorLayerEditBuffer* buffer /Transfer/, QgsFeature& f );
virtual void undo();
virtual void redo();
};
/** \ingroup core
* \class QgsVectorLayerUndoCommandDeleteFeature
* \brief Undo command for deleting a feature from a vector layer.
*/
2014-01-27 09:22:24 +01:00
class QgsVectorLayerUndoCommandDeleteFeature : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
/** Constructor for QgsVectorLayerUndoCommandDeleteFeature
* @param buffer associated edit buffer
* @param fid feature ID of feature to delete from layer
*/
2014-01-27 09:22:24 +01:00
QgsVectorLayerUndoCommandDeleteFeature( QgsVectorLayerEditBuffer* buffer /Transfer/, QgsFeatureId fid );
virtual void undo();
virtual void redo();
};
/** \ingroup core
* \class QgsVectorLayerUndoCommandChangeGeometry
* \brief Undo command for modifying the geometry of a feature from a vector layer.
*/
2014-01-27 09:22:24 +01:00
class QgsVectorLayerUndoCommandChangeGeometry : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
/** Constructor for QgsVectorLayerUndoCommandChangeGeometry
* @param buffer associated edit buffer
* @param fid feature ID of feature to modify geometry of
* @param newGeom new geometry for feature
*/
QgsVectorLayerUndoCommandChangeGeometry( QgsVectorLayerEditBuffer* buffer /Transfer/, QgsFeatureId fid, QgsGeometry newGeom );
2014-01-27 09:22:24 +01:00
~QgsVectorLayerUndoCommandChangeGeometry();
virtual void undo();
virtual void redo();
virtual int id() const;
virtual bool mergeWith( const QUndoCommand * );
};
/** \ingroup core
* \class QgsVectorLayerUndoCommandChangeAttribute
* \brief Undo command for modifying an attribute of a feature from a vector layer.
*/
2014-01-27 09:22:24 +01:00
class QgsVectorLayerUndoCommandChangeAttribute : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
/** Constructor for QgsVectorLayerUndoCommandChangeAttribute
* @param buffer associated edit buffer
* @param fid feature ID of feature to modify
* @param fieldIndex index of field to modify
* @param newValue new value of attribute
* @param oldValue previous value of attribute
*/
QgsVectorLayerUndoCommandChangeAttribute( QgsVectorLayerEditBuffer* buffer /Transfer/, QgsFeatureId fid, int fieldIndex, const QVariant &newValue, const QVariant &oldValue );
2014-01-27 09:22:24 +01:00
virtual void undo();
virtual void redo();
};
/** \ingroup core
* \class QgsVectorLayerUndoCommandAddAttribute
* \brief Undo command for adding a new attribute to a vector layer.
*/
2014-01-27 22:53:48 +10:00
class QgsVectorLayerUndoCommandAddAttribute : QgsVectorLayerUndoCommand
2014-01-27 09:22:24 +01:00
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
/** Constructor for QgsVectorLayerUndoCommandAddAttribute
* @param buffer associated edit buffer
* @param field definition of new field to add
*/
2014-01-27 09:22:24 +01:00
QgsVectorLayerUndoCommandAddAttribute( QgsVectorLayerEditBuffer* buffer /Transfer/, const QgsField& field );
virtual void undo();
virtual void redo();
};
/** \ingroup core
* \class QgsVectorLayerUndoCommandDeleteAttribute
* \brief Undo command for removing an existing attribute from a vector layer.
*/
2014-01-27 09:22:24 +01:00
class QgsVectorLayerUndoCommandDeleteAttribute : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
/** Constructor for QgsVectorLayerUndoCommandDeleteAttribute
* @param buffer associated edit buffer
* @param fieldIndex index of field to delete
*/
2014-01-27 09:22:24 +01:00
QgsVectorLayerUndoCommandDeleteAttribute( QgsVectorLayerEditBuffer* buffer /Transfer/, int fieldIndex );
virtual void undo();
virtual void redo();
};
/** \ingroup core
* \class QgsVectorLayerUndoCommandRenameAttribute
* \brief Undo command for renaming an existing attribute of a vector layer.
* \note added in QGIS 2.16
*/
class QgsVectorLayerUndoCommandRenameAttribute : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
/** Constructor for QgsVectorLayerUndoCommandRenameAttribute
* @param buffer associated edit buffer
* @param fieldIndex index of field to rename
* @param newName new name for field
*/
QgsVectorLayerUndoCommandRenameAttribute( QgsVectorLayerEditBuffer* buffer /Transfer/, int fieldIndex, const QString& newName );
virtual void undo();
virtual void redo();
};