| 1 | // Aseprite | 
|---|
| 2 | // Copyright (C) 2019-2022  Igara Studio S.A. | 
|---|
| 3 | // Copyright (C) 2001-2015  David Capello | 
|---|
| 4 | // | 
|---|
| 5 | // This program is distributed under the terms of | 
|---|
| 6 | // the End-User License Agreement for Aseprite. | 
|---|
| 7 |  | 
|---|
| 8 | #ifndef APP_CMD_SET_TAG_NAME_H_INCLUDED | 
|---|
| 9 | #define APP_CMD_SET_TAG_NAME_H_INCLUDED | 
|---|
| 10 | #pragma once | 
|---|
| 11 |  | 
|---|
| 12 | #include "app/cmd.h" | 
|---|
| 13 | #include "app/cmd/with_tag.h" | 
|---|
| 14 |  | 
|---|
| 15 | #include <string> | 
|---|
| 16 |  | 
|---|
| 17 | namespace app { | 
|---|
| 18 | namespace cmd { | 
|---|
| 19 | using namespace doc; | 
|---|
| 20 |  | 
|---|
| 21 | class SetTagName : public Cmd | 
|---|
| 22 | , public WithTag { | 
|---|
| 23 | public: | 
|---|
| 24 | SetTagName(Tag* tag, const std::string& name); | 
|---|
| 25 |  | 
|---|
| 26 | protected: | 
|---|
| 27 | void onExecute() override; | 
|---|
| 28 | void onUndo() override; | 
|---|
| 29 | void onFireNotifications() override; | 
|---|
| 30 | size_t onMemSize() const override { | 
|---|
| 31 | return sizeof(*this); | 
|---|
| 32 | } | 
|---|
| 33 |  | 
|---|
| 34 | private: | 
|---|
| 35 | std::string m_oldName; | 
|---|
| 36 | std::string m_newName; | 
|---|
| 37 | }; | 
|---|
| 38 |  | 
|---|
| 39 | } // namespace cmd | 
|---|
| 40 | } // namespace app | 
|---|
| 41 |  | 
|---|
| 42 | #endif | 
|---|
| 43 |  | 
|---|