00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef CLISTVIEW_H
00023 #define CLISTVIEW_H
00024
00025 #include <gtkmm/menu.h>
00026 #include <gtkmm/treestore.h>
00027 #include <gtkmm/treeview.h>
00028
00029 #include "case.h"
00030
00037 class CListView: public Gtk::TreeView {
00038 public:
00040 CListView();
00041
00047 static Glib::RefPtr<Gtk::TextBuffer> create_buffer();
00048
00050 void clear();
00051
00055 void append_toplevel_text(const Glib::ustring &text);
00056
00063 void append_child_text(const Glib::ustring &parent, const Glib::ustring &id,
00064 const Glib::ustring &text, const Glib::RefPtr<Gtk::TextBuffer> &buffer);
00065
00069 void delete_toplevel_text(const Glib::ustring &text);
00070
00075 void select_block(const Glib::ustring &block, Gtk::TreeRow *row);
00076
00080 BufferMap get_buffers() const { return m_Buffers; }
00081
00086 std::map<Glib::ustring, Glib::ustring> get_buffer_descriptions();
00087
00089 sigc::signal<void, Glib::ustring, Glib::RefPtr<Gtk::TextBuffer> >
00090 signal_display_buffer() const { return m_DisplayBufferSignal; }
00091
00093 sigc::signal<void, Glib::ustring, bool, CListView*> signal_add_text_block() const { return m_AddBlockSignal; }
00094
00096 sigc::signal<void, Gtk::TreeModel::iterator> signal_select() const { return m_SelectSignal; }
00097
00098 private:
00100 sigc::signal<void, Glib::ustring, Glib::RefPtr<Gtk::TextBuffer> > m_DisplayBufferSignal;
00101
00103 sigc::signal<void, Gtk::TreeModel::iterator> m_SelectSignal;
00104
00106 sigc::signal<void, Glib::ustring, bool, CListView*> m_AddBlockSignal;
00107
00108
00109 void on_selection_changed();
00110
00111
00112 void on_add_text_block();
00113
00114
00115 void on_delete_text_block();
00116
00117
00118 void on_edit_description();
00119
00120
00121 void on_follow_goto();
00122
00123
00124 virtual bool on_button_press_event(GdkEventButton *e);
00125
00126
00127 Gtk::Menu m_ContextMenu;
00128
00129
00130 Glib::RefPtr<Gtk::TreeStore> m_Model;
00131
00132
00133
00134 class ColumnRec: public Gtk::TreeModel::ColumnRecord {
00135 public:
00136
00137 ColumnRec() {
00138 add(m_Column);
00139 }
00140
00141
00142 Gtk::TreeModelColumn<Glib::ustring> m_Column;
00143 };
00144
00145
00146 ColumnRec m_ColumnRec;
00147
00149 BufferMap m_Buffers;
00150 };
00151
00152 #endif