1 /*************************************************************************** 2 qgsgrassundocommand.h 3 ------------------- 4 begin : November, 2015 5 copyright : (C) 2015 by Radim Blazek 6 email : radim.blazek@gmail.com 7 ***************************************************************************/ 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 #ifndef QGSGRASSUNDOCOMMAND_H 17 #define QGSGRASSUNDOCOMMAND_H 18 19 #include "qgis_grass_lib.h" 20 21 class QgsGrassProvider; 22 23 class GRASS_LIB_EXPORT QgsGrassUndoCommand 24 { 25 public: 26 virtual ~QgsGrassUndoCommand() = default; undo()27 virtual void undo() {} 28 }; 29 30 // This class is used to store information that a new cat was attached to a line 31 // when attribute was changed. 32 class GRASS_LIB_EXPORT QgsGrassUndoCommandChangeAttribute : public QgsGrassUndoCommand 33 { 34 public: 35 QgsGrassUndoCommandChangeAttribute( QgsGrassProvider *provider, int fid, int lid, int field, int cat, bool deleteCat, bool deleteRecord ); 36 void undo() override; 37 private: 38 QgsGrassProvider *mProvider = nullptr; 39 int mFid; 40 int mLid; 41 int mField; 42 int mCat; 43 bool mDeleteCat; 44 bool mDeleteRecord; 45 }; 46 47 #endif // QGSGRASSUNDOCOMMAND_H 48