1// Aseprite
2// Copyright (C) 2022 Igara Studio S.A.
3// Copyright (C) 2001-2017 David Capello
4//
5// This program is distributed under the terms of
6// the End-User License Agreement for Aseprite.
7
8#ifndef APP_RES_PALETTE_RESOURCE_H_INCLUDED
9#define APP_RES_PALETTE_RESOURCE_H_INCLUDED
10#pragma once
11
12#include "app/res/resource.h"
13#include "doc/palette.h"
14
15#include <memory>
16
17namespace doc {
18 class Palette;
19}
20
21namespace app {
22
23 class PaletteResource : public Resource {
24 public:
25 PaletteResource(const std::string& id,
26 const std::string& path,
27 std::unique_ptr<doc::Palette>&& palette)
28 : m_id(id)
29 , m_path(path)
30 , m_palette(std::move(palette)) {
31 }
32 virtual ~PaletteResource() { }
33 virtual const std::string& id() const override { return m_id; }
34 virtual const std::string& path() const override { return m_path; }
35 virtual const doc::Palette* palette() { return m_palette.get(); }
36
37 private:
38 std::string m_id;
39 std::string m_path;
40 std::unique_ptr<doc::Palette> m_palette;
41 };
42
43} // namespace app
44
45#endif
46