Horizon
where_used_box.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include "common/common.hpp"
4 #include "util/uuid.hpp"
5 #include "util/pool_goto_provider.hpp"
6 #include "util/item_set.hpp"
7 
8 namespace horizon {
9 class WhereUsedBox : public Gtk::Box, public PoolGotoProvider {
10 public:
11  WhereUsedBox(class IPool &pool);
12 
13  size_t load(ObjectType type, const UUID &uu);
14  void clear();
15  ItemSet get_items() const;
16 
17 private:
18  IPool &pool;
19 
20  class ListColumns : public Gtk::TreeModelColumnRecord {
21  public:
22  ListColumns()
23  {
24  Gtk::TreeModelColumnRecord::add(name);
25  Gtk::TreeModelColumnRecord::add(type);
26  Gtk::TreeModelColumnRecord::add(uuid);
27  }
28  Gtk::TreeModelColumn<Glib::ustring> name;
29  Gtk::TreeModelColumn<ObjectType> type;
30  Gtk::TreeModelColumn<UUID> uuid;
31  };
32  ListColumns list_columns;
33 
34  Gtk::TreeView *view;
35  Glib::RefPtr<Gtk::ListStore> store;
36  void row_activated(const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *column);
37 };
38 } // namespace horizon
Definition: ipool.hpp:14
Definition: pool_goto_provider.hpp:7
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: where_used_box.hpp:9