Horizon
pool_browser_part.hpp
1 #pragma once
2 #include "pool_browser_stockinfo.hpp"
3 
4 namespace horizon {
6 public:
7  PoolBrowserPart(class IPool &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  void add_copy_name_context_menu_item() override;
16 
17 protected:
18  Glib::RefPtr<Gtk::ListStore> create_list_store() override;
19  void create_columns() override;
20  void add_sort_controller_columns() override;
21  UUID uuid_from_row(const Gtk::TreeModel::Row &row) override;
22  PoolItemSource pool_item_source_from_row(const Gtk::TreeModel::Row &row) override;
23  Gtk::TreeModelColumn<std::shared_ptr<StockInfoRecord>> &get_stock_info_column() override;
24 
25 private:
26  class ListColumns : public Gtk::TreeModelColumnRecord {
27  public:
28  ListColumns()
29  {
30  Gtk::TreeModelColumnRecord::add(MPN);
31  Gtk::TreeModelColumnRecord::add(manufacturer);
32  Gtk::TreeModelColumnRecord::add(description);
33  Gtk::TreeModelColumnRecord::add(package);
34  Gtk::TreeModelColumnRecord::add(uuid);
35  Gtk::TreeModelColumnRecord::add(tags);
36  Gtk::TreeModelColumnRecord::add(path);
37  Gtk::TreeModelColumnRecord::add(source);
38  Gtk::TreeModelColumnRecord::add(stock_info);
39  }
40  Gtk::TreeModelColumn<Glib::ustring> MPN;
41  Gtk::TreeModelColumn<Glib::ustring> manufacturer;
42  Gtk::TreeModelColumn<Glib::ustring> description;
43  Gtk::TreeModelColumn<Glib::ustring> package;
44  Gtk::TreeModelColumn<Glib::ustring> tags;
45  Gtk::TreeModelColumn<Glib::ustring> path;
46  Gtk::TreeModelColumn<UUID> uuid;
47  Gtk::TreeModelColumn<PoolItemSource> source;
48  Gtk::TreeModelColumn<std::shared_ptr<StockInfoRecord>> stock_info;
49  };
50  ListColumns list_columns;
51  Gtk::Entry *MPN_entry = nullptr;
52  Gtk::Entry *manufacturer_entry = nullptr;
53  Gtk::Entry *desc_entry = nullptr;
54  class TagEntry *tag_entry = nullptr;
55  UUID entity_uuid;
56 };
57 } // namespace horizon
Definition: ipool.hpp:12
Definition: pool_browser_part.hpp:5
Definition: pool_browser_stockinfo.hpp:7
Definition: tag_entry.hpp:9
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
std::function< struct zip_source *(struct zip *)> source
Source creation for adding files.
Definition: zip.hpp:122