1
#ifndef __GRID_VIEW_MODEL_H__
2
#define __GRID_VIEW_MODEL_H__
5
#include "linux_utilities/listmodel_wrapper.h"
6
#include "grt/tree_model.h"
12
class GridViewModel : public ListModelWrapper
15
typedef Glib::RefPtr<GridViewModel> Ref;
16
static Ref create(bec::GridModel::Ref model, GridView *view, const std::string &name);
19
virtual bool handle_popup_event(GdkEvent* event);
20
int refresh(bool reset_columns);
21
int column_index(Gtk::TreeViewColumn* col);
22
void row_numbers_visible(bool value) { _row_numbers_visible= value; }
23
bool row_numbers_visible() { return _row_numbers_visible; }
24
void set_ellipsize(const int column, const bool on);
26
sigc::slot<void, const int, Glib::ValueBase*> before_render;
29
GridViewModel(bec::GridModel::Ref model, GridView *view, const std::string &name);
30
virtual void get_value_vfunc(const iterator& iter, int column, Glib::ValueBase& value) const;
33
bec::GridModel::Ref _model;
35
std::map<Gtk::TreeViewColumn*, int> _col_index_map;
36
bool _row_numbers_visible;
38
template <typename ValueTypeTraits>
39
Gtk::TreeViewColumn * add_column(int index, const std::string &name, Editable editable, Gtk::TreeModelColumnBase *color_column);
41
void get_cell_value(const iterator& iter, int column, GType type, Glib::ValueBase& value);
42
void set_cell_value(const iterator& itier, int column, GType type, const Glib::ValueBase& value);
46
#endif // __GRID_VIEW_MODEL_H__