5 #include "util/uuid.hpp"
6 #include "util/sort_controller.hpp"
7 #include "util/selection_provider.hpp"
8 #include "common/common.hpp"
14 UUID get_selected()
override;
15 bool get_any_selected();
16 void set_show_none(
bool v);
17 void set_show_path(
bool v);
18 void add_context_menu_item(
const std::string &label, sigc::slot1<void, UUID> cb);
19 virtual void add_copy_name_context_menu_item(){};
20 virtual void search() = 0;
22 void clear_search_once();
23 virtual ObjectType get_type()
const
25 return ObjectType::INVALID;
27 void go_to(
const UUID &uu);
30 enum class PoolItemSource { LOCAL, INCLUDED, OVERRIDING };
33 void construct(Gtk::Widget *search_box =
nullptr);
34 class Pool *pool =
nullptr;
36 bool show_none =
false;
37 bool show_path =
false;
38 Gtk::TreeViewColumn *path_column =
nullptr;
41 Gtk::TreeView *treeview =
nullptr;
43 Gtk::TreeViewColumn *append_column(
const std::string &name,
const Gtk::TreeModelColumnBase &column,
44 Pango::EllipsizeMode ellipsize = Pango::ELLIPSIZE_NONE);
45 Gtk::TreeViewColumn *append_column_with_item_source_cr(
const std::string &name,
46 const Gtk::TreeModelColumnBase &column,
47 Pango::EllipsizeMode ellipsize = Pango::ELLIPSIZE_NONE);
49 void install_column_tooltip(Gtk::TreeViewColumn &tvc,
const Gtk::TreeModelColumnBase &col);
51 Gtk::Entry *create_search_entry(
const std::string &label);
52 class TagEntry *create_tag_entry(
const std::string &label);
53 void add_search_widget(
const std::string &label, Gtk::Widget &w);
56 virtual Glib::RefPtr<Gtk::ListStore> create_list_store() = 0;
57 virtual void create_columns() = 0;
58 virtual void add_sort_controller_columns() = 0;
59 virtual UUID uuid_from_row(
const Gtk::TreeModel::Row &row) = 0;
61 Glib::RefPtr<Gtk::ListStore> store;
62 std::unique_ptr<SortController> sort_controller;
64 void row_activated(
const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *column);
65 void selection_changed();
67 void select_uuid(
const UUID &uu);
68 void scroll_to_selection();
70 Gtk::Menu context_menu;
71 std::set<Gtk::Entry *> search_entries;
72 std::set<TagEntry *> tag_entries;
74 PoolItemSource pool_item_source_from_db(
const UUID &uu,
bool overridden);
76 void install_pool_item_source_tooltip();
77 virtual PoolItemSource pool_item_source_from_row(
const Gtk::TreeModel::Row &row);
78 bool searched_once =
false;
80 void set_busy(
bool busy);
81 void prepare_search();
84 Gtk::Box *status_box =
nullptr;
87 Gtk::Grid *grid =
nullptr;
90 Gtk::Box *busy_box =
nullptr;
91 UUID selected_uuid_before_search;
93 Gtk::Label *status_label =
nullptr;