1// Aseprite
2// Copyright (C) 2017 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_SLICE_KEY_H_INCLUDED
8#define APP_CMD_SET_SLICE_KEY_H_INCLUDED
9#pragma once
10
11#include "app/cmd.h"
12#include "app/cmd/with_slice.h"
13#include "doc/frame.h"
14#include "doc/slice.h"
15
16namespace app {
17namespace cmd {
18 using namespace doc;
19
20 class SetSliceKey : public Cmd
21 , public WithSlice {
22 public:
23 SetSliceKey(Slice* slice,
24 const doc::frame_t frame,
25 const doc::SliceKey& sliceKey);
26
27 protected:
28 void onExecute() override;
29 void onUndo() override;
30 size_t onMemSize() const override {
31 return sizeof(*this);
32 }
33
34 private:
35 doc::frame_t m_frame;
36 doc::SliceKey m_oldSliceKey;
37 doc::SliceKey m_newSliceKey;
38 };
39
40} // namespace cmd
41} // namespace app
42
43#endif
44