Horizon
pool_browser_part.hpp
1 #pragma once
2 #include "pool_browser.hpp"
3 
4 namespace horizon {
5 class PoolBrowserPart : public PoolBrowser {
6 public:
7  PoolBrowserPart(class Pool *p, const UUID &euuid = UUID());
8  void search() override;
9  void set_MPN(const std::string &s);
10  void set_entity_uuid(const UUID &uu);
11  ObjectType get_type() const override
12  {
13  return ObjectType::PART;
14  }
15 
16 protected:
17  Glib::RefPtr<Gtk::ListStore> create_list_store() override;
18  void create_columns() override;
19  void add_sort_controller_columns() override;
20  UUID uuid_from_row(const Gtk::TreeModel::Row &row) override;
21  PoolItemSource pool_item_source_from_row(const Gtk::TreeModel::Row &row) override;
22 
23 private:
24  class ListColumns : public Gtk::TreeModelColumnRecord {
25  public:
26  ListColumns()
27  {
28  Gtk::TreeModelColumnRecord::add(MPN);
29  Gtk::TreeModelColumnRecord::add(manufacturer);
30  Gtk::TreeModelColumnRecord::add(description);
31  Gtk::TreeModelColumnRecord::add(package);
32  Gtk::TreeModelColumnRecord::add(uuid);
33  Gtk::TreeModelColumnRecord::add(tags);
34  Gtk::TreeModelColumnRecord::add(path);
35  Gtk::TreeModelColumnRecord::add(source);
36  }
37  Gtk::TreeModelColumn<Glib::ustring> MPN;
38  Gtk::TreeModelColumn<Glib::ustring> manufacturer;
39  Gtk::TreeModelColumn<Glib::ustring> description;
40  Gtk::TreeModelColumn<Glib::ustring> package;
41  Gtk::TreeModelColumn<Glib::ustring> tags;
42  Gtk::TreeModelColumn<Glib::ustring> path;
43  Gtk::TreeModelColumn<UUID> uuid;
44  Gtk::TreeModelColumn<PoolItemSource> source;
45  };
46  ListColumns list_columns;
47  Gtk::Entry *MPN_entry = nullptr;
48  Gtk::Entry *manufacturer_entry = nullptr;
49  Gtk::Entry *tags_entry = nullptr;
50  UUID entity_uuid;
51 };
52 } // namespace horizon
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: pool_browser_part.hpp:5
Definition: pool_browser.hpp:11
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:19
Definition: block.cpp:9