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