File indexing completed on 2024-05-26 04:34:35
0001 /* 0002 * SPDX-FileCopyrightText: 2023 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #ifndef SVGTEXTREMOVECOMMAND_H 0008 #define SVGTEXTREMOVECOMMAND_H 0009 0010 #include <kundo2command.h> 0011 #include "kritatoolsvgtext_export.h" 0012 0013 class KoSvgTextShape; 0014 0015 class KRITATOOLSVGTEXT_EXPORT SvgTextRemoveCommand : public KUndo2Command 0016 { 0017 public: 0018 SvgTextRemoveCommand(KoSvgTextShape *shape, 0019 int endIndex, 0020 int pos, 0021 int anchor, 0022 int length, 0023 KUndo2Command *parent = 0); 0024 ~SvgTextRemoveCommand() override = default; 0025 0026 /// redo the command 0027 void redo() override; 0028 /// revert the actions done in redo 0029 void undo() override; 0030 0031 int id() const override; 0032 bool mergeWith(const KUndo2Command *other) override; 0033 0034 private: 0035 KoSvgTextShape *m_shape; 0036 int m_index; 0037 int m_originalPos; 0038 int m_anchor; 0039 int m_length; 0040 QString m_oldSvg; 0041 QString m_oldDefs; 0042 }; 0043 0044 #endif // SVGTEXTREMOVECOMMAND_H