Horizon
Loading...
Searching...
No Matches
sort_controller.hpp
1#pragma once
2#include <gtkmm.h>
3#include <sigc++/sigc++.h>
4
5namespace horizon {
6class SortController : public sigc::trackable {
7public:
8 enum class Sort { ASC, DESC, NONE };
9
10 SortController(Gtk::TreeView *tv);
11 void add_column(int index, const std::string &name);
12 void set_simple(bool s);
13 std::string get_order_by() const;
14 void set_sort(int index, Sort s);
15
16 typedef sigc::signal<void> type_signal_changed;
17 type_signal_changed signal_changed()
18 {
19 return s_signal_changed;
20 }
21
22private:
23 Gtk::TreeView *treeview;
24 std::map<int, std::pair<std::string, Sort>> columns;
25 void update_treeview();
26 void handle_click(int index);
27 bool is_simple;
28
29 type_signal_changed s_signal_changed;
30};
31} // namespace horizon
Definition sort_controller.hpp:6