Ardour  9.0-pre0-582-g084a23a80d
treemodel.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREEMODEL_H
4 #define _GTKMM_TREEMODEL_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: treemodel.hg,v 1.25 2006/05/10 20:59:28 murrayc Exp $ */
11 
12 /* Copyright (C) 1998-2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29 #include <glibmm/interface.h>
30 #include <glibmm/arrayhandle.h>
31 #include <gtkmm/treeiter.h>
32 
33 
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkTreeModel GtkTreeModel;
36 typedef struct _GtkTreeModelClass GtkTreeModelClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
38 
39 
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 namespace Gtk
42 { class TreeModel_Class; } // namespace Gtk
43 #endif // DOXYGEN_SHOULD_SKIP_THIS
44 
45 namespace Gtk
46 {
47 
48 class TreeModelSort;
49 class TreePath;
50 class TreeRowReference;
51 
52 
68 {
70  TREE_MODEL_LIST_ONLY = 1 << 1
71 };
72 
75  { return static_cast<TreeModelFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
76 
79  { return static_cast<TreeModelFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
80 
83  { return static_cast<TreeModelFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
84 
87  { return static_cast<TreeModelFlags>(~static_cast<unsigned>(flags)); }
88 
91  { return (lhs = static_cast<TreeModelFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
92 
95  { return (lhs = static_cast<TreeModelFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
96 
99  { return (lhs = static_cast<TreeModelFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
100 
101 } // namespace Gtk
102 
103 
104 #ifndef DOXYGEN_SHOULD_SKIP_THIS
105 namespace Glib
106 {
107 
108 template <>
109 class Value<Gtk::TreeModelFlags> : public Glib::Value_Flags<Gtk::TreeModelFlags>
110 {
111 public:
112  static GType value_type() G_GNUC_CONST;
113 };
114 
115 } // namespace Glib
116 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
117 
118 
119 namespace Gtk
120 {
121 
122 
123 //TODO: Remove any mention of null arguments from the method documentation, by adding overrides in gtk_docs_override.xml.
167 class TreeModel : public Glib::Interface
168 {
169 
170 #ifndef DOXYGEN_SHOULD_SKIP_THIS
171 
172 public:
173  typedef TreeModel CppObjectType;
174  typedef TreeModel_Class CppClassType;
175  typedef GtkTreeModel BaseObjectType;
176  typedef GtkTreeModelIface BaseClassType;
177 
178 private:
179  friend class TreeModel_Class;
180  static CppClassType treemodel_class_;
181 
182  // noncopyable
183  TreeModel(const TreeModel&);
184  TreeModel& operator=(const TreeModel&);
185 
186 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
187 protected:
192 
193 #ifndef DOXYGEN_SHOULD_SKIP_THIS
200  explicit TreeModel(const Glib::Interface_Class& interface_class);
201 
202 public:
203  // This is public so that C++ wrapper instances can be
204  // created for C instances of unwrapped types.
205  // For instance, if an unexpected C type implements the C interface.
206  explicit TreeModel(GtkTreeModel* castitem);
207 
208 protected:
209 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
210 
211 public:
212  virtual ~TreeModel();
213 
214  static void add_interface(GType gtype_implementer);
215 
218  static GType get_type() G_GNUC_CONST;
219 
220 #ifndef DOXYGEN_SHOULD_SKIP_THIS
221  static GType get_base_type() G_GNUC_CONST;
222 #endif
223 
225  GtkTreeModel* gobj() { return reinterpret_cast<GtkTreeModel*>(gobject_); }
226 
228  const GtkTreeModel* gobj() const { return reinterpret_cast<GtkTreeModel*>(gobject_); }
229 
230 private:
231 
232 
233 public:
235 
241 
242  typedef TreeRow Row;
243  typedef TreePath Path;
245 
246 
247  //These are part of GtkTreeModelFilter or GtkTreeModelSort, not GtkTreeModel:
248  //gtkmmproc error: gtk_tree_model_filter_sort_new_with_model : ignored method defs lookup failed
249 
255  iterator get_iter(const Path& path);
256  //TODO: Add const_iterator get_iter(const Path& path) const;
257  //Implement a const_iterator?
258 
264  iterator get_iter(const Glib::ustring& path_string);
265  //TODO: Implement a const_iterator? const_iterator get_iter(const Glib::ustring& path_string) const;
266 
269 
270  //TODO: Return a real TreeNodeChildren (a container of const_iterators), when we have a real const_iterator.
273 
274 
280  typedef sigc::slot<bool, const TreeModel::iterator&> SlotForeachIter;
281 
287  void foreach_iter(const SlotForeachIter& slot);
288 
294  typedef sigc::slot<bool, const TreeModel::Path&> SlotForeachPath;
295 
301  void foreach_path(const SlotForeachPath& slot);
302 
308  typedef sigc::slot<bool, const TreeModel::Path&, const TreeModel::iterator&> SlotForeachPathAndIter;
309 
315  void foreach(const SlotForeachPathAndIter& slot);
316 
317 
325 
330  int get_n_columns() const;
331 
337  GType get_column_type(int index) const;
338  //TODO: A C++-type version of get_column_type()?
339 
340 
346  TreeModel::Path get_path(const iterator& iter) const;
347 
348 
354  void row_changed(const Path& path, const iterator& iter);
355 
361  void row_inserted(const Path& path, const iterator& iter);
362 
369  void row_has_child_toggled(const Path& path, const iterator& iter);
370 
378  void row_deleted(const Path& path);
379 
388  void rows_reordered(const Path& path, const iterator& iter, const Glib::ArrayHandle<int>& new_order);
389 
397  void rows_reordered(const Path& path, const Glib::ArrayHandle<int>& new_order);
398 
399 
411  void rows_reordered(const Path& path, const iterator& iter, int* new_order);
412 
413 
421  Glib::ustring get_string(const iterator& iter) const;
422 
423 
430  Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > signal_row_changed();
431 
432 
439  Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > signal_row_inserted();
440 
441 
448  Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > signal_row_has_child_toggled();
449 
450 
457  Glib::SignalProxy1< void,const TreeModel::Path& > signal_row_deleted();
458 
459 
466  Glib::SignalProxy3< void,const TreeModel::Path&,const TreeModel::iterator&,int* > signal_rows_reordered();
467 
468 
469 protected:
471 
472  virtual int get_n_columns_vfunc() const;
473 
474  virtual GType get_column_type_vfunc(int index) const;
475 
476 
477  //These are only for deriving new TreeModels, which isn't very common or easy:
478 
487  virtual bool iter_next_vfunc(const iterator& iter, iterator& iter_next) const;
488 
496  virtual bool get_iter_vfunc(const Path& path, iterator& iter) const;
497 
506  virtual bool iter_children_vfunc(const iterator& parent, iterator& iter) const;
507 
517  virtual bool iter_parent_vfunc(const iterator& child, iterator& iter) const;
518 
530  virtual bool iter_nth_child_vfunc(const iterator& parent, int n, iterator& iter) const;
531 
542  virtual bool iter_nth_root_child_vfunc(int n, iterator& iter) const;
543 
544 
551  virtual bool iter_has_child_vfunc(const iterator& iter) const;
552 
553 
561  virtual int iter_n_children_vfunc(const iterator& iter) const;
562 
569  virtual int iter_n_root_children_vfunc() const;
570 
587  virtual void ref_node_vfunc(const iterator& iter) const;
588 
589 
600  virtual void unref_node_vfunc(const iterator& iter) const;
601 
602 
611  virtual TreeModel::Path get_path_vfunc(const iterator& iter) const;
612 
613 
621  virtual void get_value_vfunc(const iterator& iter, int column, Glib::ValueBase& value) const;
622 
623 
624  //We don't put an deprecation ifdef around this because it would break ABI.
637  virtual bool iter_is_valid(const iterator& iter) const;
638 
639  //Called by TreeRow, which is a friend class:
640  //The comment about set_row_changed() in the documentation is based on my reading of the source of
641  //gtk_list_store_set_value() and gtk_tree_store_set_value().
647  virtual void set_value_impl(const iterator& row, int column, const Glib::ValueBase& value);
648 
649  //This might not need to be virtual, but it's not a big deal. murrayc.
650  virtual void get_value_impl(const iterator& row, int column, Glib::ValueBase& value) const;
651 
652  friend class Gtk::TreeModelSort;
653  friend class Gtk::TreeRow;
654  friend class Gtk::TreeIter;
655 
656 
657 public:
658 
659 public:
660  //C++ methods used to invoke GTK+ virtual functions:
661 
662 protected:
663  //GTK+ Virtual Functions (override these to change behaviour):
664 
665  //Default Signal Handlers::
667  virtual void on_row_changed(const TreeModel::Path& path, const TreeModel::iterator& iter);
669  virtual void on_row_inserted(const TreeModel::Path& path, const TreeModel::iterator& iter);
671  virtual void on_row_has_child_toggled(const TreeModel::Path& path, const TreeModel::iterator& iter);
673  virtual void on_row_deleted(const TreeModel::Path& path);
675  virtual void on_rows_reordered(const TreeModel::Path& path, const TreeModel::iterator& iter, int* new_order);
676 
677 
678 };
679 
680 } // namespace Gtk
681 
682 
683 namespace Glib
684 {
693  Glib::RefPtr<Gtk::TreeModel> wrap(GtkTreeModel* object, bool take_copy = false);
694 
695 } // namespace Glib
696 
697 
698 #endif /* _GTKMM_TREEMODEL_H */
699 
int get_n_columns() const
TreePath Path
Definition: treemodel.h:243
Glib::ustring get_string(const iterator &iter) const
virtual bool iter_parent_vfunc(const iterator &child, iterator &iter) const
virtual ~TreeModel()
Children children() const
This returns an STL-like container API, for iterating over the rows.
GtkTreeModel * gobj()
Provides access to the underlying C GObject.
Definition: treemodel.h:225
GType get_column_type(int index) const
virtual void on_row_inserted(const TreeModel::Path &path, const TreeModel::iterator &iter)
This is a default handler for the signal signal_row_inserted().
virtual void on_row_changed(const TreeModel::Path &path, const TreeModel::iterator &iter)
This is a default handler for the signal signal_row_changed().
sigc::slot< bool, const TreeModel::Path & > SlotForeachPath
Definition: treemodel.h:294
virtual void set_value_impl(const iterator &row, int column, const Glib::ValueBase &value)
virtual bool iter_next_vfunc(const iterator &iter, iterator &iter_next) const
TreeRow Row
Definition: treemodel.h:242
static GType get_type() G_GNUC_CONST
TreeModelFlags get_flags() const
Children::reverse_iterator reverse_iterator
Definition: treemodel.h:238
void row_inserted(const Path &path, const iterator &iter)
virtual bool iter_nth_root_child_vfunc(int n, iterator &iter) const
virtual GType get_column_type_vfunc(int index) const
virtual TreeModel::Path get_path_vfunc(const iterator &iter) const
virtual void on_row_deleted(const TreeModel::Path &path)
This is a default handler for the signal signal_row_deleted().
virtual int iter_n_children_vfunc(const iterator &iter) const
Glib::RefPtr< Gtk::TreeModel > wrap(GtkTreeModel *object, bool take_copy=false)
Children::const_reverse_iterator const_reverse_iterator
Definition: treemodel.h:240
TreeRowReference RowReference
Definition: treemodel.h:244
TreeModelColumnRecord ColumnRecord
Definition: treemodel.h:234
virtual TreeModelFlags get_flags_vfunc() const
Children children()
This returns an STL-like container API, for iterating over the rows.
virtual void get_value_impl(const iterator &row, int column, Glib::ValueBase &value) const
Glib::SignalProxy2< void, const TreeModel::Path &, const TreeModel::iterator & > signal_row_changed()
Children::iterator iterator
Definition: treemodel.h:237
virtual int get_n_columns_vfunc() const
virtual int iter_n_root_children_vfunc() const
iterator get_iter(const Glib::ustring &path_string)
void rows_reordered(const Path &path, const iterator &iter, const Glib::ArrayHandle< int > &new_order)
sigc::slot< bool, const TreeModel::Path &, const TreeModel::iterator & > SlotForeachPathAndIter
Definition: treemodel.h:308
void row_has_child_toggled(const Path &path, const iterator &iter)
virtual bool get_iter_vfunc(const Path &path, iterator &iter) const
virtual bool iter_is_valid(const iterator &iter) const
void row_changed(const Path &path, const iterator &iter)
void rows_reordered(const Path &path, const iterator &iter, int *new_order)
Glib::SignalProxy2< void, const TreeModel::Path &, const TreeModel::iterator & > signal_row_has_child_toggled()
virtual void unref_node_vfunc(const iterator &iter) const
sigc::slot< bool, const TreeModel::iterator & > SlotForeachIter
Definition: treemodel.h:280
Glib::SignalProxy1< void, const TreeModel::Path & > signal_row_deleted()
Glib::SignalProxy2< void, const TreeModel::Path &, const TreeModel::iterator & > signal_row_inserted()
const GtkTreeModel * gobj() const
Provides access to the underlying C GObject.
Definition: treemodel.h:228
virtual bool iter_nth_child_vfunc(const iterator &parent, int n, iterator &iter) const
virtual void get_value_vfunc(const iterator &iter, int column, Glib::ValueBase &value) const
Glib::SignalProxy3< void, const TreeModel::Path &, const TreeModel::iterator &, int * > signal_rows_reordered()
Children::const_iterator const_iterator
Definition: treemodel.h:239
void foreach_path(const SlotForeachPath &slot)
void foreach_iter(const SlotForeachIter &slot)
void rows_reordered(const Path &path, const Glib::ArrayHandle< int > &new_order)
virtual bool iter_has_child_vfunc(const iterator &iter) const
virtual void ref_node_vfunc(const iterator &iter) const
virtual void on_row_has_child_toggled(const TreeModel::Path &path, const TreeModel::iterator &iter)
This is a default handler for the signal signal_row_has_child_toggled().
virtual void on_rows_reordered(const TreeModel::Path &path, const TreeModel::iterator &iter, int *new_order)
This is a default handler for the signal signal_rows_reordered().
TreeNodeChildren Children
Definition: treemodel.h:236
virtual bool iter_children_vfunc(const iterator &parent, iterator &iter) const
void row_deleted(const Path &path)
iterator get_iter(const Path &path)
static void add_interface(GType gtype_implementer)
TreeModel::Path get_path(const iterator &iter) const
std::reverse_iterator< iterator > reverse_iterator
Definition: treeiter.h:359
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: treeiter.h:368
CellRendererState & operator|=(CellRendererState &lhs, CellRendererState rhs)
Definition: cellrenderer.h:86
CellRendererState operator&(CellRendererState lhs, CellRendererState rhs)
Definition: cellrenderer.h:74
CellRendererState operator^(CellRendererState lhs, CellRendererState rhs)
Definition: cellrenderer.h:78
CellRendererState operator~(CellRendererState flags)
Definition: cellrenderer.h:82
CellRendererState & operator&=(CellRendererState &lhs, CellRendererState rhs)
Definition: cellrenderer.h:90
TreeModelFlags
Definition: treemodel.h:68
CellRendererState operator|(CellRendererState lhs, CellRendererState rhs)
Definition: cellrenderer.h:70
CellRendererState & operator^=(CellRendererState &lhs, CellRendererState rhs)
Definition: cellrenderer.h:94
@ TREE_MODEL_LIST_ONLY
Definition: treemodel.h:70
@ TREE_MODEL_ITERS_PERSIST
Definition: treemodel.h:69
struct _GtkTreeModel GtkTreeModel
Definition: gtktreemodel.h:46
Definition: ardour_ui.h:188
Definition: lobject.h:100