1// Aseprite
2// Copyright (C) 2019 Igara Studio S.A.
3// Copyright (C) 2001-2016 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_ADD_TAG_H_INCLUDED
9#define APP_CMD_ADD_TAG_H_INCLUDED
10#pragma once
11
12#include "app/cmd.h"
13#include "app/cmd/with_tag.h"
14#include "app/cmd/with_sprite.h"
15
16#include <sstream>
17
18namespace app {
19namespace cmd {
20 using namespace doc;
21
22 class AddTag : public Cmd
23 , public WithSprite
24 , public WithTag {
25 public:
26 AddTag(Sprite* sprite, Tag* tag);
27
28 protected:
29 void onExecute() override;
30 void onUndo() override;
31 void onRedo() override;
32 size_t onMemSize() const override {
33 return sizeof(*this) + m_size;
34 }
35
36 private:
37 size_t m_size;
38 std::stringstream m_stream;
39 };
40
41} // namespace cmd
42} // namespace app
43
44#endif
45