Horizon
treeview_state_store.hpp
1 #pragma once
2 #include <string>
3 #include <map>
4 #include <sigc++/sigc++.h>
5 
6 namespace Gtk {
7 class TreeView;
8 }
9 
10 
11 namespace horizon {
12 namespace SQLite {
13 class Database;
14 }
15 
16 class TreeViewStateStore : public sigc::trackable {
17 public:
18  TreeViewStateStore(Gtk::TreeView *view, const std::string &prefix);
19  static std::string get_prefix(const std::string &instance, const std::string &widget);
20 
21 private:
22  SQLite::Database &db;
23  const std::string prefix;
24  Gtk::TreeView *view = nullptr;
25  std::string get_key(int column) const;
26  std::map<unsigned int, unsigned int> column_widths;
27  sigc::connection timer_connection;
28  bool save();
29  void realize();
30 };
31 } // namespace horizon
Definition: sqlite.hpp:69
Definition: treeview_state_store.hpp:16