Horizon
Loading...
Searching...
No Matches
core_frame.hpp
1#pragma once
2#include "frame/frame.hpp"
3#include "core.hpp"
4#include "nlohmann/json.hpp"
5#include "document/idocument_frame.hpp"
6
7namespace horizon {
8class CoreFrame : public Core, public IDocumentFrame {
9public:
10 CoreFrame(const std::string &frame_filename, IPool &pool);
11 bool has_object_type(ObjectType ty) const override;
12
13 Frame &get_frame() override;
14 const Frame &get_canvas_data() const;
15 class LayerProvider &get_layer_provider() override;
16
17 std::pair<Coordi, Coordi> get_bbox() override;
18
19 const std::string &get_filename() const override;
20
21 ObjectType get_object_type() const override
22 {
23 return ObjectType::FRAME;
24 }
25
26 const FileVersion &get_version() const override
27 {
28 return frame.version;
29 }
30
31 void set_temp_mode();
32 void set_filename(const std::string &filename);
33
34 bool get_property_meta(ObjectType type, const UUID &uu, ObjectProperty::ID property,
35 class PropertyMeta &meta) override;
36
37private:
38 std::map<UUID, Polygon> *get_polygon_map() override;
39 std::map<UUID, Junction> *get_junction_map() override;
40 std::map<UUID, Text> *get_text_map() override;
41 std::map<UUID, Line> *get_line_map() override;
42 std::map<UUID, Arc> *get_arc_map() override;
43
44 Frame frame;
45
46 std::string m_frame_filename;
47
48 void rebuild_internal(bool from_undo, const std::string &comment) override;
49 std::unique_ptr<HistoryManager::HistoryItem> make_history_item(const std::string &comment) override;
50 void history_load(const HistoryManager::HistoryItem &it) override;
51 void save(const std::string &suffix) override;
52 void delete_autosave() override;
53};
54} // namespace horizon
Definition core_frame.hpp:8
Where Tools and and documents meet.
Definition core.hpp:42
Definition file_version.hpp:9
Definition frame.hpp:18
Definition history_manager.hpp:10
Definition idocument_frame.hpp:5
Definition ipool.hpp:15
Definition layer_provider.hpp:8
Definition core_properties.hpp:104
This class encapsulates a UUID and allows it to be uses as a value type.
Definition uuid.hpp:16
Tiny metaprogramming library.
Definition meta.hpp:116