3 #include "pool/symbol.hpp"
7 #include "document/idocument_symbol.hpp"
10 class CoreSymbol :
public Core,
public IDocumentSymbol {
12 CoreSymbol(
const std::string &filename, IPool &pool);
13 bool has_object_type(ObjectType ty)
const override;
14 Symbol &get_symbol()
override;
16 Junction *get_junction(
const UUID &uu)
override;
17 Line *get_line(
const UUID &uu)
override;
18 SymbolPin &get_symbol_pin(
const UUID &uu)
override;
19 Arc *get_arc(
const UUID &uu)
override;
21 Junction *insert_junction(
const UUID &uu)
override;
22 void delete_junction(
const UUID &uu)
override;
23 Line *insert_line(
const UUID &uu)
override;
24 void delete_line(
const UUID &uu)
override;
25 Arc *insert_arc(
const UUID &uu)
override;
26 void delete_arc(
const UUID &uu)
override;
28 SymbolPin &insert_symbol_pin(
const UUID &uu)
override;
29 void delete_symbol_pin(
const UUID &uu)
override;
31 class LayerProvider &get_layer_provider()
override;
33 std::vector<Line *> get_lines()
override;
34 std::vector<Arc *> get_arcs()
override;
36 void rebuild(
bool from_undo =
false)
override;
38 bool set_property(ObjectType type,
const UUID &uu, ObjectProperty::ID property,
40 bool get_property(ObjectType type,
const UUID &uu, ObjectProperty::ID property,
42 bool get_property_meta(ObjectType type,
const UUID &uu, ObjectProperty::ID property,
45 std::string get_display_name(ObjectType type,
const UUID &uu)
override;
47 const Symbol *get_canvas_data();
48 std::pair<Coordi, Coordi> get_bbox()
override;
50 void reload_pool()
override;
54 const std::string &get_filename()
const override;
56 ObjectType get_object_type()
const override
58 return ObjectType::SYMBOL;
61 class Rules *get_rules()
override;
70 std::map<UUID, Text> *get_text_map()
override;
71 std::map<UUID, Polygon> *get_polygon_map()
override;
74 std::string m_filename;
79 class HistoryItem :
public Core::HistoryItem {
81 HistoryItem(
const Symbol &s) : sym(s)
86 void history_push()
override;
87 void history_load(
unsigned int i)
override;
88 void save(
const std::string &suffix)
override;
89 void delete_autosave()
override;