File indexing completed on 2024-12-22 04:10:02
0001 /* 0002 * SPDX-FileCopyrightText: 2019 Boudewijn Rempt <boud@valdyas.org> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #ifndef KISNODERENAMECOMMAND_H 0007 #define KISNODERENAMECOMMAND_H 0008 0009 #include "kis_node_command.h" 0010 #include "commands_new/KisAsynchronouslyMergeableCommandInterface.h" 0011 0012 /// The command for setting the node's name 0013 class KRITAIMAGE_EXPORT KisNodeRenameCommand : public KisNodeCommand, public KisAsynchronouslyMergeableCommandInterface 0014 { 0015 public: 0016 KisNodeRenameCommand(KisNodeSP node, 0017 const QString &oldName, 0018 const QString &newName); 0019 0020 void redo() override; 0021 void undo() override; 0022 0023 int id() const override; 0024 bool mergeWith(const KUndo2Command *command) override; 0025 bool canMergeWith(const KUndo2Command *command) const override; 0026 0027 private: 0028 0029 QString m_oldName; 0030 QString m_newName; 0031 }; 0032 0033 #endif // KISNODERENAMECOMMAND_H