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(), const std::string &instance = "");
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  void set_include_base_parts(bool v);
17 
18 protected:
19  Glib::RefPtr<Gtk::ListStore> create_list_store() override;
20  void create_columns() override;
21  void add_sort_controller_columns() override;
22  UUID uuid_from_row(const Gtk::TreeModel::Row &row) override;
23  PoolItemSource pool_item_source_from_row(const Gtk::TreeModel::Row &row) override;
24  Gtk::TreeModelColumn<std::shared_ptr<StockInfoRecord>> &get_stock_info_column() override;
25 
26 private:
27  class ListColumns : public Gtk::TreeModelColumnRecord {
28  public:
29  ListColumns()
30  {
31  Gtk::TreeModelColumnRecord::add(MPN);
32  Gtk::TreeModelColumnRecord::add(manufacturer);
33  Gtk::TreeModelColumnRecord::add(description);
34  Gtk::TreeModelColumnRecord::add(package);
35  Gtk::TreeModelColumnRecord::add(uuid);
36  Gtk::TreeModelColumnRecord::add(tags);
37  Gtk::TreeModelColumnRecord::add(path);
38  Gtk::TreeModelColumnRecord::add(source);
39  Gtk::TreeModelColumnRecord::add(stock_info);
40  }
41  Gtk::TreeModelColumn<Glib::ustring> MPN;
42  Gtk::TreeModelColumn<Glib::ustring> manufacturer;
43  Gtk::TreeModelColumn<Glib::ustring> description;
44  Gtk::TreeModelColumn<Glib::ustring> package;
45  Gtk::TreeModelColumn<Glib::ustring> tags;
46  Gtk::TreeModelColumn<Glib::ustring> path;
47  Gtk::TreeModelColumn<UUID> uuid;
48  Gtk::TreeModelColumn<PoolItemSource> source;
49  Gtk::TreeModelColumn<std::shared_ptr<StockInfoRecord>> stock_info;
50  };
51  ListColumns list_columns;
52  Gtk::Entry *MPN_entry = nullptr;
53  Gtk::Entry *manufacturer_entry = nullptr;
54  Gtk::Entry *desc_entry = nullptr;
55  class TagEntry *tag_entry = nullptr;
56  Gtk::CheckButton *base_parts_cb = nullptr;
57  UUID entity_uuid;
58 };
59 } // namespace horizon
Definition: ipool.hpp:14
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