add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / treeview.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREEVIEW_H
4 #define _GTKMM_TREEVIEW_H
5
6 #include <gtkmmconfig.h>
7
8
9 #include <glibmm.h>
10
11 /* $Id$ */
12
13 /* Copyright(C) 2002 The gtkmm Development Team
14  *
15  * This library is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU Library General Public
17  * License as published by the Free Software Foundation; either
18  * version 2 of the License, or(at your option) any later version.
19  *
20  * This library is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23  * Library General Public License for more details.
24  *
25  * You should have received a copy of the GNU Library General Public
26  * License along with this library; if not, write to the Free
27  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28  */
29
30 // This is for including the config header before any code (such as
31 // the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
32
33
34 #include <glibmm/listhandle.h>
35 #include <gtkmm/container.h>
36 #include <gtkmm/adjustment.h>
37 #include <gdkmm/pixmap.h>
38 #include <gtkmm/treeviewcolumn.h>
39 #include <gtkmm/treeselection.h>
40 #include <gtkmm/treemodelcolumn.h>
41 #include <gtkmm/cellrenderer.h>
42 #include <gtkmm/targetentry.h>
43 #include <gtkmm/entry.h>
44 #include <gtkmm/tooltip.h>
45
46
47 #ifndef DOXYGEN_SHOULD_SKIP_THIS
48 typedef struct _GtkTreeView GtkTreeView;
49 typedef struct _GtkTreeViewClass GtkTreeViewClass;
50 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
51
52
53 namespace Gtk
54 { class TreeView_Class; } // namespace Gtk
55 namespace Gtk
56 {
57
58
59 /** @addtogroup gtkmmEnums Enums and Flags */
60
61 /**
62  * @ingroup gtkmmEnums
63  */
64 enum TreeViewDropPosition
65 {
66   TREE_VIEW_DROP_BEFORE,
67   TREE_VIEW_DROP_AFTER,
68   TREE_VIEW_DROP_INTO_OR_BEFORE,
69   TREE_VIEW_DROP_INTO_OR_AFTER
70 };
71
72 } // namespace Gtk
73
74
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76 namespace Glib
77 {
78
79 template <>
80 class Value<Gtk::TreeViewDropPosition> : public Glib::Value_Enum<Gtk::TreeViewDropPosition>
81 {
82 public:
83   static GType value_type() G_GNUC_CONST;
84 };
85
86 } // namespace Glib
87 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
88
89
90 namespace Gtk
91 {
92
93 /**
94  * @ingroup gtkmmEnums
95  */
96 enum TreeViewGridLines
97 {
98   TREE_VIEW_GRID_LINES_NONE,
99   TREE_VIEW_GRID_LINES_HORIZONTAL,
100   TREE_VIEW_GRID_LINES_VERTICAL,
101   TREE_VIEW_GRID_LINES_BOTH
102 };
103
104 } // namespace Gtk
105
106
107 #ifndef DOXYGEN_SHOULD_SKIP_THIS
108 namespace Glib
109 {
110
111 template <>
112 class Value<Gtk::TreeViewGridLines> : public Glib::Value_Enum<Gtk::TreeViewGridLines>
113 {
114 public:
115   static GType value_type() G_GNUC_CONST;
116 };
117
118 } // namespace Glib
119 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
120
121
122 namespace Gtk
123 {
124
125
126 #ifndef DOXYGEN_SHOULD_SKIP_THIS
127
128 class TreeView;
129
130 namespace TreeView_Private
131 {
132 /* This helper function is not a member of TreeView just for the reason that
133  * there are compilers that have problems compiling it otherwise. E.g. in gcc
134  * 2.95.3 a compiler bug prevents member functions from refering to specialized
135  * member function templates and that's what we do here: In function
136  * _connect_auto_store_editable_signal_handler we build a slot from
137  * TreeView::_auto_store_on_cellrenderer_*_edited. (The latter must be member
138  * functions of TreeView since we connect them to signals and we want the
139  * connections to vanish when the TreeView dies, of course.)
140  */
141   template <class ColumnType> inline
142   void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<ColumnType>& model_column);
143
144   template<class ColumnType> inline
145   void _auto_store_on_cellrenderer_text_edited_string(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
146
147   template <class ColumnType> inline
148   void _auto_store_on_cellrenderer_text_edited_numerical(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model); 
149
150   template <class ColumnType> inline
151   void _auto_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter, int model_column, const Glib::ustring& format);
152 }
153
154 #endif //DOXYGEN_SHOULD_SKIP_THIS
155
156
157 //class TreeViewColumn;
158 class TreeModel;
159
160 /** @defgroup TreeView TreeView Classes
161  * These classes are used with the Gtk::TreeView widget.
162  */
163
164 /** The TreeView widget displays the model (Gtk::TreeModel) data and allows the user to interact with it.
165  * The View can show all of the model's columns, or just some, and it can show them in various ways.
166  * You must provide the TreeModel in the constructor, or with set_model().
167  *
168  * Add View columns with append_column(), append_column_editable(), insert_column(), or insert_column_editable().
169  *
170  * You can manipulate the selection by obtaining the @link Gtk::TreeSelection Gtk::TreeView::Selection@endlink from get_selection().
171  *
172  * @ingroup Widgets
173  * @ingroup Containers
174  * @ingroup TreeView
175  */
176
177 class TreeView : public Container
178 {
179   public:
180 #ifndef DOXYGEN_SHOULD_SKIP_THIS
181   typedef TreeView CppObjectType;
182   typedef TreeView_Class CppClassType;
183   typedef GtkTreeView BaseObjectType;
184   typedef GtkTreeViewClass BaseClassType;
185 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
186
187   virtual ~TreeView();
188
189 #ifndef DOXYGEN_SHOULD_SKIP_THIS
190
191 private:
192   friend class TreeView_Class;
193   static CppClassType treeview_class_;
194
195   // noncopyable
196   TreeView(const TreeView&);
197   TreeView& operator=(const TreeView&);
198
199 protected:
200   explicit TreeView(const Glib::ConstructParams& construct_params);
201   explicit TreeView(GtkTreeView* castitem);
202
203 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
204
205 public:
206 #ifndef DOXYGEN_SHOULD_SKIP_THIS
207   static GType get_type()      G_GNUC_CONST;
208   static GType get_base_type() G_GNUC_CONST;
209 #endif
210
211   ///Provides access to the underlying C GtkObject.
212   GtkTreeView*       gobj()       { return reinterpret_cast<GtkTreeView*>(gobject_); }
213
214   ///Provides access to the underlying C GtkObject.
215   const GtkTreeView* gobj() const { return reinterpret_cast<GtkTreeView*>(gobject_); }
216
217
218 public:
219   //C++ methods used to invoke GTK+ virtual functions:
220 #ifdef GLIBMM_VFUNCS_ENABLED
221 #endif //GLIBMM_VFUNCS_ENABLED
222
223 protected:
224   //GTK+ Virtual Functions (override these to change behaviour):
225 #ifdef GLIBMM_VFUNCS_ENABLED
226 #endif //GLIBMM_VFUNCS_ENABLED
227
228   //Default Signal Handlers::
229 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
230   virtual void on_set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment);
231   virtual void on_row_activated(const TreeModel::Path& path, TreeViewColumn* column);
232   virtual bool on_test_expand_row(const TreeModel::iterator& iter, const TreeModel::Path& path);
233   virtual bool on_test_collapse_row(const TreeModel::iterator& iter, const TreeModel::Path& path);
234   virtual void on_row_expanded(const TreeModel::iterator& iter, const TreeModel::Path& path);
235   virtual void on_row_collapsed(const TreeModel::iterator& iter, const TreeModel::Path& path);
236   virtual void on_cursor_changed();
237   virtual void on_columns_changed();
238 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
239
240
241 private:
242
243   
244 public:
245   /**  A visible column in a Gtk::TreeView widget.
246    */
247   typedef TreeViewColumn Column;
248   
249   /** A selection object for Gtk::TreeView.
250    */
251   typedef TreeSelection Selection;
252   /**
253      Default constructor
254    */
255   TreeView();
256   /**
257      Constructor that binds to a TreeModel
258    */
259   explicit TreeView(const Glib::RefPtr<TreeModel>& model);
260
261   
262   /** Return value: A Gtk::TreeModel, or <tt>0</tt> if none is currently being used.
263    * @return A Gtk::TreeModel, or <tt>0</tt> if none is currently being used.
264    */
265   Glib::RefPtr<TreeModel> get_model();
266   
267   /** Return value: A Gtk::TreeModel, or <tt>0</tt> if none is currently being used.
268    * @return A Gtk::TreeModel, or <tt>0</tt> if none is currently being used.
269    */
270   Glib::RefPtr<const TreeModel> get_model() const;
271   
272   /** Sets the model for a Gtk::TreeView.  If the @a tree_view  already has a model
273    * set, it will remove it before setting the new model.  If @a model  is <tt>0</tt>, 
274    * then it will unset the old model.
275    * @param model The model.
276    */
277   void set_model(const Glib::RefPtr<TreeModel>& model);
278   
279   /** Remove the model from the TreeView.
280    */
281   void unset_model();
282   
283   
284   /** Gets the Gtk::TreeSelection associated with @a tree_view .
285    * @return A Gtk::TreeSelection object.
286    */
287   Glib::RefPtr<TreeSelection> get_selection();
288   
289   /** Gets the Gtk::TreeSelection associated with @a tree_view .
290    * @return A Gtk::TreeSelection object.
291    */
292   Glib::RefPtr<const TreeSelection> get_selection() const;
293   
294   /** Gets the Gtk::Adjustment currently being used for the horizontal aspect.
295    * @return A Gtk::Adjustment object, or <tt>0</tt> if none is currently being
296    * used.
297    */
298   Adjustment* get_hadjustment();
299   
300   /** Gets the Gtk::Adjustment currently being used for the horizontal aspect.
301    * @return A Gtk::Adjustment object, or <tt>0</tt> if none is currently being
302    * used.
303    */
304   const Adjustment* get_hadjustment() const;
305   
306   /** Sets the Gtk::Adjustment for the current horizontal aspect. See also unset_hadjustment().
307    * @param adjustment The Gtk::Adjustment to set.
308    */
309   void set_hadjustment(Adjustment& adjustment);
310   
311   /** This method removes the hadjustment.
312    * @see set_hadjustment().
313    */
314   void unset_hadjustment();
315   
316   
317   /** Gets the Gtk::Adjustment currently being used for the vertical aspect.
318    * @return A Gtk::Adjustment object, or <tt>0</tt> if none is currently being
319    * used.
320    */
321   Adjustment* get_vadjustment();
322   
323   /** Gets the Gtk::Adjustment currently being used for the vertical aspect.
324    * @return A Gtk::Adjustment object, or <tt>0</tt> if none is currently being
325    * used.
326    */
327   const Adjustment* get_vadjustment() const;
328   
329   /** Sets the Gtk::Adjustment for the current vertical aspect. See also unset_vadjustment().
330    * @param adjustment The Gtk::Adjustment to set.
331    */
332   void set_vadjustment(Adjustment& adjustment);
333   
334   /** This method removes the vadjustment.
335    * @see set_vadjustment().
336    */
337   void unset_vadjustment();
338   
339   
340   /** Return value: Whether the headers are visible or not.
341    * @return Whether the headers are visible or not.
342    */
343   bool get_headers_visible() const;
344   
345   /** Sets the visibility state of the headers.
346    * @param headers_visible <tt>true</tt> if the headers are visible.
347    */
348   void set_headers_visible(bool headers_visible);
349   
350   /** Resizes all columns to their optimal width. Only works after the
351    * treeview has been realized.
352    */
353   void columns_autosize();
354   
355   /** Return value: <tt>true</tt> if all header columns are clickable, otherwise <tt>false</tt>
356    * @return <tt>true</tt> if all header columns are clickable, otherwise <tt>false</tt>
357    * 
358    * @newin2p10.
359    */
360   bool get_headers_clickable() const;
361   
362   /** Allow the column title buttons to be clicked.
363    * @param setting <tt>true</tt> if the columns are clickable.
364    */
365   void set_headers_clickable(bool setting = true);
366   
367   /** This function tells GTK+ that the user interface for your
368    * application requires users to read across tree rows and associate
369    * cells with one another. By default, GTK+ will then render the tree
370    * with alternating row colors. Do <em>not</em> use it
371    * just because you prefer the appearance of the ruled tree; that's a
372    * question for the theme. Some themes will draw tree rows in
373    * alternating colors even when rules are turned off, and users who
374    * prefer that appearance all the time can choose those themes. You
375    * should call this function only as a <em>semantic</em>
376    * hint to the theme engine that your tree makes alternating colors
377    * useful from a functional standpoint (since it has lots of columns,
378    * generally).
379    * @param setting <tt>true</tt> if the tree requires reading across rows.
380    */
381   void set_rules_hint(bool setting = true);
382   
383   /** Gets the setting set by set_rules_hint().
384    * @return <tt>true</tt> if rules are useful for the user of this tree.
385    */
386   bool get_rules_hint() const;
387
388   
389   /** Appends @a column  to the list of columns. If @a tree_view  has "fixed_height"
390    * mode enabled, then @a column  must have its "sizing" property set to be
391    * GTK_TREE_VIEW_COLUMN_FIXED.
392    * @param column The Gtk::TreeViewColumn to add.
393    * @return The number of columns in @a tree_view  after appending.
394    */
395   int append_column(TreeViewColumn& column);
396
397   /** Appends a View column with the appropriate CellRenderer for the Model column.
398    *
399    * The CellRenderer can only be created automatically for some basic
400    * column types, such as Glib::ustring, int, double, bool, and Gdk::Pixbuf. 
401    * If the type is not supported then the following warning will be shown:
402    * GLib-GObject-WARNING **: unable to set property `text' of type
403    * `gchararray' from value of type `glibmm__CustomBoxed_t'.
404    *
405    * If the default formatting is not sufficient, or the numeric type is 
406    * not supported, then you could use append_column_numeric(). Or you 
407    * could create the TreeView::Column and/or CellRenderer
408    * manually and use TreeViewColumn::set_cell_data_func() to provide a callback 
409    * that converts the model value into a string representation with .
410    *
411    * @param title The text to be used in the title header of this column.
412    * @param model_column The column in the TreeModel that will be rendered by this View column.
413    * @result The number of columns in the View after appending.
414    */
415   template <class ColumnType> inline
416   int append_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column);
417
418   /** Like append_column(), but only for numeric types, which will be displayed in the specified format.
419    * This convenience template uses TreeView::Column::set_cell_data_func(), so the numeric formatting will 
420    * be deactivated if you specify your own cell_data callback by calling set_cell_data_func() again.
421    *
422    * @param title The text to be used in the title header of this column.
423    * @param model_column The column in the TreeModel that will be rendered by this View column.
424    * @param format A printf-style format, such as "%d", used to create a text representation of the number.
425    * @result The number of columns in the View after appending.
426    */
427   template <class ColumnType> inline
428   int append_column_numeric(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format);
429   
430   //TODO: danielk suggested use of Glib::Value to simplify/improve this.
431   /** Appends a View column with the appropriate CellRenderer for the Model
432    * column.  The compiler will attempt to instantiate appropriate template
433    * code to automatically store user changes in the model.  To intercept the
434    * user's change and implement non-default logic, or if the compiler can't
435    * instantiate appropriate code for your model type, you could use
436    * append_column() and connect a signal handler to the CellRenderer.
437    *
438    * @see append_column_numeric_editable().
439    *
440    * @param title The text to be used in the title header of this column.
441    * @param model_column The column in the TreeModel that will be rendered by this View column.
442    * @result The number of columns in the View after appending.
443    */
444   template <class ColumnType> inline
445   int append_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column);
446
447   /** Like append_column_editable(), but only for numeric types, which will be displayed in the specified format.
448    * This convenience template uses TreeView::Column::set_cell_data_func(), so the numeric formatting will 
449    * be deactivated if you specify your own cell_data callback by calling set_cell_data_func() again.
450    *
451    * Note that the user's input will be interpreted as decimal (base 10), regardless of the @a format.
452    *
453    * @param title The text to be used in the title header of this column.
454    * @param model_column The column in the TreeModel that will be rendered by this View column.
455    * @param format A printf-style format, such as "%d", used to create a text representation of the number.
456    * @result The number of columns in the View after appending.
457    */
458   template <class ColumnType> inline
459   int append_column_numeric_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format);
460
461   
462   /// Creates a View column containing the CellRenderer, and appends it.
463   int append_column(const Glib::ustring& title, CellRenderer& cell);
464
465   
466   /** Removes @a column  from @a tree_view .
467    * @param column The Gtk::TreeViewColumn to remove.
468    * @return The number of columns in @a tree_view  after removing.
469    */
470   int remove_column(TreeViewColumn& column);
471
472   /// Removes all View columns.
473   void remove_all_columns();
474
475   
476   /** This inserts the @a column  into the @a tree_view  at @a position .  If @a position  is
477    * -1, then the column is inserted at the end. If @a tree_view  has
478    * "fixed_height" mode enabled, then @a column  must have its "sizing" property
479    * set to be GTK_TREE_VIEW_COLUMN_FIXED.
480    * @param column The Gtk::TreeViewColumn to be inserted.
481    * @param position The position to insert @a column  in.
482    * @return The number of columns in @a tree_view  after insertion.
483    */
484   int insert_column(TreeViewColumn& column, int position);
485
486   /** Creates a View column containing the CellRenderer, and inserts it.
487    *
488    * @param title The text to be used in the title header of this column.
489    * @param cell The CellRenderer.
490    * @param position The position at which the CellRenderer should be inserted.
491    * @result The number of columns in the View after inserting.
492    */
493   int insert_column(const Glib::ustring& title, CellRenderer& cell, int position);
494
495   
496   /** Inserts a View column with the appropriate CellRenderer for the Model column.
497    *
498    * @param title The text to be used in the title header of this column.
499    * @param model_column The column in the TreeModel that will be rendered by this View column.
500    * @param position The position at which the CellRenderer should be inserted.
501    * @result The number of columns in the View after inserting.
502    */
503   template <class ColumnType> inline
504   int insert_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position);
505
506   /** Inserts a View column with the appropriate CellRenderer for the Model
507    * column.  The compiler will attempt to instantiate appropriate template
508    * code to automatically store user changes in the model.  To intercept the
509    * user's change and implement non-default logic, or if the compiler can't
510    * instantiate appropriate code for your model type, you should use
511    * append_column() and connect a signal handler to the CellRenderer.
512    *
513    * @param title The text to be used in the title header of this column.
514    * @param model_column The column in the TreeModel that will be rendered by this View column.
515    * @param position The position at which the CellRenderer should be inserted.
516    * @result The number of columns in the View after inserting.
517    */
518   template <class ColumnType> inline
519   int insert_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position);
520
521   typedef TreeViewColumn::SlotCellData SlotCellData;
522   
523   /**
524    * Inserts a new column into the TreeView with the given cell
525    * renderer and a SlotCellData to set cell renderer attributes
526    * (normally using data from the model). 
527    *
528    * @param position Position to insert, -1 for append
529    * @param title column title
530    * @param cell cell renderer for column
531    * @param slot function to set attributes of cell renderer
532    * @return number of columns in the TreeView after the insert
533    */
534   int insert_column_with_data_func(int position, const Glib::ustring& title, CellRenderer& cell, const SlotCellData& slot);
535
536   
537   /** Gets the Gtk::TreeViewColumn at the given position in the #tree_view.
538    * @param n The position of the column, counting from 0.
539    * @return The Gtk::TreeViewColumn, or <tt>0</tt> if the position is outside the
540    * range of columns.
541    */
542   TreeViewColumn* get_column(int n);
543   
544   /** Gets the Gtk::TreeViewColumn at the given position in the #tree_view.
545    * @param n The position of the column, counting from 0.
546    * @return The Gtk::TreeViewColumn, or <tt>0</tt> if the position is outside the
547    * range of columns.
548    */
549   const TreeViewColumn* get_column(int n) const;
550
551   //The column index is of the view, not the model, so we do not need TreeViewColumn* get_column(TreeViewColumn& base_column).
552
553   /** Gets the CellRenderer for that column.
554     * You should dynamic_cast<> to the expected derived CellRenderer type.
555     * This assumes that the TreeViewColumn contains only one CellRenderer.
556     *
557     * @param n The position of the view column.
558     * @result The CellRenderer.
559     */
560   CellRenderer* get_column_cell_renderer(int n);
561
562  //TODO: Add TreeViewColumn* get_column_cell_renderer(TreeViewColumn& base_column); and a const one.
563
564
565   /** Gets the CellRenderer for that column.
566     * You should dynamic_cast<> to the expected derived CellRenderer type.
567     * This assumes that the TreeViewColumn contains only one CellRenderer.
568     *
569     * @param n The position of the view column.
570     * @result The CellRenderer.
571     */
572   const CellRenderer* get_column_cell_renderer(int n) const;
573
574   
575   /** Returns a list of all the Gtk::TreeViewColumn s currently in @a tree_view .
576    * @return A list of Gtk::TreeViewColumn s.
577    */
578   Glib::ListHandle<TreeViewColumn*> get_columns();
579   
580   /** Returns a list of all the Gtk::TreeViewColumn s currently in @a tree_view .
581    * @return A list of Gtk::TreeViewColumn s.
582    */
583   Glib::ListHandle<const TreeViewColumn*> get_columns() const;
584   
585   
586   /** Moves @a column  to be after to @a base_column .  See also move_column_to_start().
587    * @param column The Gtk::TreeViewColumn to be moved.
588    * @param base_column The Gtk::TreeViewColumn to be moved relative to.
589    */
590   void move_column_after(TreeViewColumn& column, TreeViewColumn& base_column);
591
592   /** This method moves column to the first position in the view.
593    *
594    * @param column The view column that will be moved
595    */
596   void move_column_to_start(TreeViewColumn& column);
597   
598   
599   /** Sets the column to draw the expander arrow at. It must be in the TreeView.  See also reset_expander_column().
600    * @param column The column to draw the expander arrow at.
601    */
602   void set_expander_column(TreeViewColumn& column);
603   
604   /** This method resets the expander arrow to the default - the first visible column.
605    * @see set_expander_column().  
606    */
607   void reset_expander_column();
608   
609   
610   /** Return value: The expander column.
611    * @return The expander column.
612    */
613   TreeViewColumn* get_expander_column();
614   
615   /** Return value: The expander column.
616    * @return The expander column.
617    */
618   const TreeViewColumn* get_expander_column() const;
619
620   /** For instance,
621    * bool on_column_drop(TreeView*, tree_view, TreeViewColumn* column, TreeViewColumn* prev_column, TreeViewColumn* next_column)
622    *
623    * This function is called on every column pair in turn at the beginning of a column drag to determine where a
624    * drop can take place. The arguments passed to the function are: the tree_view, the view Column being dragged,
625    * and the two view Columns determining the drop spot. If either of the view Column arguments for the drop spot
626    * are 0, then they indicate an edge.
627    */
628   typedef sigc::slot<bool, TreeView*, TreeViewColumn*,  TreeViewColumn*, TreeViewColumn*> SlotColumnDrop;
629
630   /** Sets a callback slot for determining where a column may be dropped when dragged.
631    * This function is called on every column pair in turn at the beginning of a column drag to determine where a
632    * drop can take place. The arguments passed to the function are: the tree_view, the view Column being dragged,
633    * and the two view Columns determining the drop spot. If either of the view Column arguments for the drop spot
634    * are 0, then they indicate an edge.
635    *
636    * See unset_column_drag_function().
637    *
638    * @param slot A callback function to determine which columns are reorderable.
639    */
640   void set_column_drag_function(const SlotColumnDrop& slot);
641   
642
643   /** See set_column_drag_function(). After this method has been called, the TreeView reverts to the default behavior of
644   * allowing all columns to be dropped everywhere.
645   */
646   void unset_column_drag_function();
647    
648   
649   /** Scrolls the tree view such that the top-left corner of the visible
650    * area is @a tree_x , @a tree_y , where @a tree_x  and @a tree_y  are specified
651    * in tree coordinates.  The @a tree_view  must be realized before
652    * this function is called.  If it isn't, you probably want to be
653    * using scroll_to_cell().
654    * 
655    * If either @a tree_x  or @a tree_y  are -1, then that direction isn't scrolled.
656    * @param tree_x X coordinate of new top-left pixel of visible area, or -1.
657    * @param tree_y Y coordinate of new top-left pixel of visible area, or -1.
658    */
659   void scroll_to_point(int tree_x, int tree_y);
660
661   /** Moves the alignments of tree view to the position specified by @a column and @a path.
662    * @a row_align determines where the row is placed, and @a col_align determines where
663    * column is placed. Both are expected to be between 0.0 and 1.0. 0.0 means left/top
664    * alignment, 1.0 means right/bottom alignment, 0.5 means center.
665    *
666    * This function only works if the model is set, and @a path is a valid row on the model.
667    * If the model changes before the tree view is realized, the centered path will be
668    * modified to reflect this change.
669    *
670    * @param path The path of the row to move to.
671    * @param column The Gtk::TreeViewColumn to move horizontally to.
672    * @param row_align The vertical alignment of the row specified by @a path.
673    * @param col_align The horizontal alignment of the column specified by @a column.
674    */
675   void scroll_to_cell(const TreeModel::Path& path, TreeViewColumn& column, float row_align, float col_align);
676   
677
678   /** Moves the alignments of tree view to the position specified by @a column and @a path.
679    * The tree does the minimum amount of work to scroll the cell onto the screen. This means
680    * that the cell will be scrolled to the edge closest to it's current position. If the cell
681    * is currently visible on the screen, nothing is done.
682    *
683    * This function only works if the model is set, and @a path is a valid row on the model.
684    * If the model changes before the tree_view is realized, the centered path will be modified
685    * to reflect this change.
686    *
687    * @param path The path of the row to move to.
688    * @param column The Gtk::TreeViewColumn to move horizontally to.
689    */
690   void scroll_to_cell(const TreeModel::Path& path, TreeViewColumn& column);
691
692   /** Moves the alignments of tree view to the position specified by @a path.
693    * @a row_align determines where the row is placed, and is expected to be between 0.0
694    * and 1.0.  0.0 means top alignment, 1.0 means bottom alignment, 0.5 means center.
695    *
696    * This function only works if the model is set, and @a path is a valid row on the model.
697    * If the model changes before the tree view is realized, the centered path will be
698    * modified to reflect this change.
699    *
700    * @param path The path of the row to move to.
701    * @param row_align The vertical alignment of the row specified by @a path.
702    */
703   void scroll_to_row(const TreeModel::Path& path, float row_align);
704
705   /** Moves the alignments of tree view to the position specified by @a path.
706    * The tree does the minimum amount of work to scroll the row onto the screen. This means
707    * that the row will be scrolled to the edge closest to it's current position. If the row
708    * is currently visible on the screen, nothing is done.
709    *
710    * This function only works if the model is set, and @a path is a valid row on the model.
711    * If the model changes before the tree view is realized, the centered path will be
712    * modified to reflect this change.
713    *
714    * @param path The path of the row to move to.
715    */
716   void scroll_to_row(const TreeModel::Path& path);
717
718   /** Moves the alignments of tree view to the position specified by @a column.
719    * @a col_align determines where the column is placed, and is expected to be between 0.0
720    * and 1.0.  0.0 means left alignment, 1.0 means right alignment, 0.5 means center.
721    *
722    * This function only works if the model is set.  If the model changes before the tree
723    * view is realized, the centered path will be modified to reflect this change.
724    *
725    * @param column The Gtk::TreeViewColumn to move horizontally to.
726    * @param col_align The horizontal alignment of the column specified by @a column.
727    */
728   void scroll_to_column(TreeViewColumn& column, float col_align);
729
730   /** Moves the alignments of tree view to the position specified by @a column.
731    * The tree does the minimum amount of work to scroll the column onto the screen. This means
732    * that the column will be scrolled to the edge closest to it's current position. If the column
733    * is currently visible on the screen, nothing is done.
734    *
735    * This function only works if the model is set.  If the model changes before the
736    * tree view is realized, the centered path will be modified to reflect this change.
737    *
738    * @param column The Gtk::TreeViewColumn to move horizontally to.
739    */
740   void scroll_to_column(TreeViewColumn& column);
741
742   
743   /** Activates the cell determined by @a path  and @a column .
744    * @param path The Gtk::TreePath to be activated.
745    * @param column The Gtk::TreeViewColumn to be activated.
746    */
747   void row_activated(const TreeModel::Path& path,TreeViewColumn& column);
748   
749   /** Recursively expands all nodes in the @a tree_view .
750    */
751   void expand_all();
752   
753   /** Recursively collapses all visible, expanded nodes in @a tree_view .
754    */
755   void collapse_all();
756   
757   /** Expands the row at @a path . This will also expand all parent rows of
758    *  @a path  as necessary.
759    * 
760    * @newin2p2
761    * @param path Path to a row.
762    */
763   void expand_to_path(const TreeModel::Path& path);
764   
765   /** Opens the row so its children are visible.
766    * @param path Path to a row.
767    * @param open_all Whether to recursively expand, or just expand immediate children.
768    * @return <tt>true</tt> if the row existed and had children.
769    */
770   bool expand_row(const TreeModel::Path& path, bool open_all);
771   
772   /** Collapses a row (hides its child rows, if they exist).
773    * @param path Path to a row in the @a tree_view .
774    * @return <tt>true</tt> if the row was collapsed.
775    */
776   bool collapse_row(const TreeModel::Path& path);
777
778   /** For example,
779    * void on_map_expanded_rows(TreeView* tree_view, const TreeModel::Path& path);
780    */
781   typedef sigc::slot<void, TreeView*, const TreeModel::Path&> SlotMapping;
782
783   /** Calls the callback slot on all expanded rows.
784    * @param slot A callback function to be called.
785    */  
786   void map_expanded_rows(const SlotMapping& slot);
787   
788
789   /** Return value: <tt>true</tt> if #path is expanded.
790    * @param path A Gtk::TreePath to test expansion state.
791    * @return <tt>true</tt> if #path is expanded.
792    */
793   bool row_expanded(const TreeModel::Path& path);
794   
795   /** This function is a convenience function to allow you to reorder models that
796    * support the Gtk::DragSourceIface and the Gtk::DragDestIface.  Both
797    * Gtk::TreeStore and Gtk::ListStore support these.  If @a reorderable  is <tt>true</tt>, then
798    * the user can reorder the model by dragging and dropping rows.  The
799    * developer can listen to these changes by connecting to the model's
800    * row_inserted and row_deleted signals.
801    * 
802    * This function does not give you any degree of control over the order -- any
803    * reordering is allowed.  If more control is needed, you should probably
804    * handle drag and drop manually.
805    * @param reorderable <tt>true</tt>, if the tree can be reordered.
806    */
807   void set_reorderable(bool reorderable = true);
808   
809   /** Retrieves whether the user can reorder the tree via drag-and-drop. See
810    * set_reorderable().
811    * @return <tt>true</tt> if the tree can be reordered.
812    */
813   bool get_reorderable() const;
814
815   //TODO: Add set_cursor(path, ModelColumnBase&, start_editing)?
816   
817   /** Sets the current keyboard focus to be at @a path , and selects it.  This is
818    * useful when you want to focus the user's attention on a particular row. Focus is given to the column specified.
819    * Additionally, if @a start_editing  is
820    * <tt>true</tt>, then editing should be started in the specified cell.
821    * This function is often followed by Gtk::Widget::grab_focus( @a tree_view )
822    * in order to give keyboard focus to the widget.  Please note that editing
823    * can only happen when the widget is realized.
824    * @param path A Gtk::TreePath.
825    * @param focus_column A Gtk::TreeViewColumn.
826    * @param start_editing <tt>true</tt> if the specified cell should start being edited.
827    */
828   void set_cursor(const TreeModel::Path& path, TreeViewColumn& focus_column, bool start_editing = false);
829     
830   
831   /** Sets the current keyboard focus to be at @a path , and selects it.  This is
832    * useful when you want to focus the user's attention on a particular row.  If
833    *  @a focus_column  is not <tt>0</tt>, then focus is given to the column specified by
834    * it. If @a focus_column  and @a focus_cell  are not <tt>0</tt>, and @a focus_column 
835    * contains 2 or more editable or activatable cells, then focus is given to
836    * the cell specified by @a focus_cell . Additionally, if @a focus_column  is
837    * specified, and @a start_editing  is <tt>true</tt>, then editing should be started in
838    * the specified cell.  This function is often followed by
839    *  @a gtk_widget_grab_focus  ( @a tree_view ) in order to give keyboard focus to the
840    * widget.  Please note that editing can only happen when the widget is
841    * realized.
842    * 
843    * @newin2p2
844    * @param path A Gtk::TreePath.
845    * @param focus_column A Gtk::TreeViewColumn, or <tt>0</tt>.
846    * @param focus_cell A Gtk::CellRenderer, or <tt>0</tt>.
847    * @param start_editing <tt>true</tt> if the specified cell should start being edited.
848    */
849   void set_cursor(const TreeModel::Path& path, TreeViewColumn& focus_column, CellRenderer& focus_cell, bool start_editing = false);
850
851  
852   /** Sets the current keyboard focus to be at path , and selects it.
853    * This is useful when you want to focus the user's attention on a particular row.
854    * This function is often followed by Gtk::widget::grab_focus(tree_view)
855    * in order to give keyboard focus to the widget.
856    *
857    *  @param path A reference to cursor path.
858    */
859   void set_cursor(const TreeModel::Path& path);
860
861   /**  Fills in path and focus_column with the current path and focus column.
862    *
863    *  @param path A reference to be filled with the current cursor path
864    *  @param focus_column A reference to be filled with the current focus column
865    */
866   void get_cursor(TreeModel::Path& path, TreeViewColumn*& focus_column);
867
868 /* Layout information */
869   
870   /** Return value: A Gdk::Window, or <tt>0</tt> when @a tree_view  hasn't been realized yet
871    * @return A Gdk::Window, or <tt>0</tt> when @a tree_view  hasn't been realized yet.
872    */
873   Glib::RefPtr<Gdk::Window> get_bin_window();
874   
875   /** Return value: A Gdk::Window, or <tt>0</tt> when @a tree_view  hasn't been realized yet
876    * @return A Gdk::Window, or <tt>0</tt> when @a tree_view  hasn't been realized yet.
877    */
878   Glib::RefPtr<const Gdk::Window> get_bin_window() const;
879
880   #ifndef GTKMM_DISABLE_DEPRECATED
881
882   /** @deprecated Use the const version.
883    */
884   bool get_path_at_pos(int x, int y, TreeModel::Path& path, TreeViewColumn*& column, int& cell_x, int& cell_y);
885   #endif // GTKMM_DISABLE_DEPRECATED
886
887
888   /** Finds the path at the point (x, y), relative to widget
889    * coordinates. It is primarily for things like popup menus.
890    *
891    * @param x The x position to be identified
892    * @param y The y position to be identified
893    * @param path A reference to a TreeModel::Path to be filled in
894    * @param column A reference to a TreeViewColumn pointer to be filled in
895    * @param cell_x A reference where the X coordinate relative to the cell
896    *   can be placed
897    * @param cell_y A reference where the Y coordinate relative to the cell
898    *   can be placed
899    * @return true if a row exists at that coordinate.
900    */
901   bool get_path_at_pos(int x, int y, TreeModel::Path& path, TreeViewColumn*& column, int& cell_x, int& cell_y) const;
902
903   
904 #ifndef GTKMM_DISABLE_DEPRECATED
905
906   /** Fills the bounding rectangle in tree window coordinates for the cell at the
907    * row specified by @a path  and the column specified by @a column .  If @a path  points to a path not currently displayed, the @a y  and @a height  fields
908    * of the rectangle will be filled with 0.  The sum of all cell rects does not cover the
909    * entire tree; there are extra pixels in between rows, for example. The
910    * returned rectangle is equivalent to the @a cell_area  passed to
911    * Gtk::CellRenderer::render().  This function is only valid if #tree_view is
912    * realized.
913    * @deprecated Use the const version
914    * @param path A Gtk::TreePath for the row.
915    * @param column A Gtk::TreeViewColumn for the column.
916    * @param rect Rectangle to fill with cell rect.
917    */
918   void get_cell_area(const TreeModel::Path& path, TreeViewColumn& column, Gdk::Rectangle& rect);
919 #endif // GTKMM_DISABLE_DEPRECATED
920
921
922 //We ignore the fact that one of the arguments can be 0 - it does not seem useful.
923
924   
925   /** Fills the bounding rectangle in tree window coordinates for the cell at the
926    * row specified by @a path  and the column specified by @a column .  If @a path  points to a path not currently displayed, the @a y  and @a height  fields
927    * of the rectangle will be filled with 0.  The sum of all cell rects does not cover the
928    * entire tree; there are extra pixels in between rows, for example. The
929    * returned rectangle is equivalent to the @a cell_area  passed to
930    * Gtk::CellRenderer::render().  This function is only valid if #tree_view is
931    * realized.
932    * @param path A Gtk::TreePath for the row.
933    * @param column A Gtk::TreeViewColumn for the column.
934    * @param rect Rectangle to fill with cell rect.
935    */
936   void get_cell_area(const TreeModel::Path& path, TreeViewColumn& column, Gdk::Rectangle& rect) const;
937
938    
939 #ifndef GTKMM_DISABLE_DEPRECATED
940
941   /** Fills the bounding rectangle in tree window coordinates for the cell at the
942    * row specified by @a path  and the column specified by @a column .  The returned rectangle is equivalent to the
943    *  @a background_area  passed to Gtk::CellRenderer::render().  These background
944    * areas tile to cover the entire tree window (except for the area used for
945    * header buttons). Contrast with the @a cell_area , returned by
946    * get_cell_area(), which returns only the cell itself, excluding
947    * surrounding borders and the tree expander area.
948    * @deprecated Use the const version.
949    * @param path A Gtk::TreePath for the row.
950    * @param column A Gtk::TreeViewColumn for the column.
951    * @param rect Rectangle to fill with cell background rect.
952    */
953   void get_background_area(const TreeModel::Path& path, TreeViewColumn& column, Gdk::Rectangle& rect);
954 #endif // GTKMM_DISABLE_DEPRECATED
955
956
957   /** Fills the bounding rectangle in tree window coordinates for the cell at the
958    * row specified by @a path  and the column specified by @a column .  The returned rectangle is equivalent to the
959    *  @a background_area  passed to Gtk::CellRenderer::render().  These background
960    * areas tile to cover the entire tree window (except for the area used for
961    * header buttons). Contrast with the @a cell_area , returned by
962    * get_cell_area(), which returns only the cell itself, excluding
963    * surrounding borders and the tree expander area.
964    * @param path A Gtk::TreePath for the row.
965    * @param column A Gtk::TreeViewColumn for the column.
966    * @param rect Rectangle to fill with cell background rect.
967    */
968   void get_background_area(const TreeModel::Path& path, TreeViewColumn& column, Gdk::Rectangle& rect) const;
969   //We ignore the fact that one of the arguments can be 0 - it does not seem useful.
970
971   
972 #ifndef GTKMM_DISABLE_DEPRECATED
973
974   /** Fills @a visible_rect  with the currently-visible region of the
975    * buffer, in tree coordinates. Convert to bin_window coordinates with
976    * convert_tree_to_bin_window_coords().
977    * Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire
978    * scrollable area of the tree.
979    * @deprecated Use the const version.
980    * @param visible_rect Rectangle to fill.
981    */
982   void get_visible_rect(Gdk::Rectangle&  visible_rect);
983 #endif // GTKMM_DISABLE_DEPRECATED
984
985
986   /** Fills @a visible_rect  with the currently-visible region of the
987    * buffer, in tree coordinates. Convert to bin_window coordinates with
988    * convert_tree_to_bin_window_coords().
989    * Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire
990    * scrollable area of the tree.
991    * @param visible_rect Rectangle to fill.
992    */
993   void get_visible_rect(Gdk::Rectangle&  visible_rect) const;
994
995   
996 #ifndef GTKMM_DISABLE_DEPRECATED
997
998   /** Converts bin_window coordinates to coordinates for the
999    * tree (the full scrollable area of the tree).
1000    * 
1001    * Deprecated: 2.12: Due to historial reasons the name of this function is
1002    * incorrect.  For converting coordinates relative to the widget to
1003    * bin_window coordinates, please see
1004    * convert_widget_to_bin_window_coords().
1005    * @deprecated Use the const version
1006    * @param wx X coordinate relative to bin_window.
1007    * @param wy Y coordinate relative to bin_window.
1008    * @param tx Return location for tree X coordinate.
1009    * @param ty Return location for tree Y coordinate.
1010    */
1011   void widget_to_tree_coords(int wx, int wy, int& tx, int& ty);
1012 #endif // GTKMM_DISABLE_DEPRECATED
1013
1014
1015   /** Converts bin_window coordinates to coordinates for the
1016    * tree (the full scrollable area of the tree).
1017    * 
1018    * Deprecated: 2.12: Due to historial reasons the name of this function is
1019    * incorrect.  For converting coordinates relative to the widget to
1020    * bin_window coordinates, please see
1021    * convert_widget_to_bin_window_coords().
1022    * @param wx X coordinate relative to bin_window.
1023    * @param wy Y coordinate relative to bin_window.
1024    * @param tx Return location for tree X coordinate.
1025    * @param ty Return location for tree Y coordinate.
1026    */
1027   void widget_to_tree_coords(int wx, int wy, int& tx, int& ty) const;
1028
1029   
1030 #ifndef GTKMM_DISABLE_DEPRECATED
1031
1032   /** Converts tree coordinates (coordinates in full scrollable area of the tree)
1033    * to bin_window coordinates.
1034    * 
1035    * Deprecated: 2.12: Due to historial reasons the name of this function is
1036    * incorrect.  For converting bin_window coordinates to coordinates relative
1037    * to bin_window, please see
1038    * convert_bin_window_to_widget_coords().
1039    * @deprecated Use the const version.
1040    * @param tx Tree X coordinate.
1041    * @param ty Tree Y coordinate.
1042    * @param wx Return location for X coordinate relative to bin_window.
1043    * @param wy Return location for Y coordinate relative to bin_window.
1044    */
1045   void tree_to_widget_coords(int tx, int ty, int& wx, int& wy);
1046 #endif // GTKMM_DISABLE_DEPRECATED
1047
1048
1049   /** Converts tree coordinates (coordinates in full scrollable area of the tree)
1050    * to bin_window coordinates.
1051    * 
1052    * Deprecated: 2.12: Due to historial reasons the name of this function is
1053    * incorrect.  For converting bin_window coordinates to coordinates relative
1054    * to bin_window, please see
1055    * convert_bin_window_to_widget_coords().
1056    * @param tx Tree X coordinate.
1057    * @param ty Tree Y coordinate.
1058    * @param wx Return location for X coordinate relative to bin_window.
1059    * @param wy Return location for Y coordinate relative to bin_window.
1060    */
1061   void tree_to_widget_coords(int tx, int ty, int& wx, int& wy) const;
1062
1063    bool get_visible_range(TreeModel::Path& start_path, TreeModel::Path& end_path) const;
1064   
1065
1066 /* Drag-and-Drop support */
1067   
1068
1069   /**
1070    * Turns the TreeView into a drag source for automatic DND.
1071    *
1072    * @param targets Standard container of targets that the drag will support.
1073    * @param start_button_mask Mask of allowed buttons to start drag.
1074    * @param actions The bitmask of possible actions for a drag from this widget.
1075    */
1076   void enable_model_drag_source(const ArrayHandle_TargetEntry& targets,
1077                                 Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK,
1078                                 Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
1079
1080   // Uses the default "GTK_TREE_MODEL_ROW" target, which the TreeView can handle automatically.
1081
1082   /** Turns the TreeView into a drag source for automatic DND.
1083    *
1084    * @param start_button_mask Mask of allowed buttons to start drag.
1085    * @param actions The bitmask of possible actions for a drag from this widget.
1086    */
1087   void enable_model_drag_source(Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK,
1088                                 Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);                                                                                              
1089
1090   
1091   /** Turns the TreeView into a drop destination for automatic DND.
1092    *
1093    * @param targets The table of targets that the drag will support.
1094    * @param actions The bitmask of possible actions for a drag from this widget.
1095    */ 
1096   void enable_model_drag_dest(const ArrayHandle_TargetEntry& targets, Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
1097
1098   /** Turns the TreeView into a drop destination for automatic DND.  This uses the default
1099     *  "GTK_TREE_MODEL_ROW" target, which the TreeView can handle automatically.
1100     *
1101     * @param actions The bitmask of possible actions for a drag from this widget.
1102    */ 
1103   void enable_model_drag_dest(Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
1104
1105   /** Undoes the effect of enable_model_drag_source()
1106    */
1107   
1108   /** Undoes the effect of enable_model_drag_source().
1109    */
1110   void unset_rows_drag_source();
1111
1112   /** Undoes the effect of enable_model_drag_source()
1113    */
1114   
1115   /** Undoes the effect of enable_model_drag_dest().
1116    */
1117   void unset_rows_drag_dest();
1118
1119
1120   /* These are useful to implement your own custom stuff. */
1121
1122   /** Sets the row that is highlighted for feedback.
1123    *
1124    * @param path The path of the row to highlight
1125    * @param pos Specifies whether to drop before, after or into the row
1126    */
1127   
1128   /** Sets the row that is highlighted for feedback.
1129    * @param path The path of the row to highlight, or <tt>0</tt>.
1130    * @param pos Specifies whether to drop before, after or into the row.
1131    */
1132   void set_drag_dest_row(const TreeModel::Path& path, TreeViewDropPosition pos);
1133     
1134   /** Gets information about the row that is highlighted for feedback.
1135    *
1136    * @param path Return location for the path of the highlighted row
1137    * @param pos Return location for the drop position
1138    */
1139   void get_drag_dest_row(TreeModel::Path& path, TreeViewDropPosition& pos) const;
1140
1141   /** Determines the destination row for a given position.
1142    *
1143    * @param drag_x The x position to determine the destination row for
1144    * @param drag_y The y position to determine the destination row for
1145    * @param path Return location for the path of the highlighted row
1146    * @param pos Return location for the drop position
1147    */
1148   bool get_dest_row_at_pos(int drag_x, int drag_y, TreeModel::Path& path, TreeViewDropPosition& pos) const;
1149
1150   
1151   /** Creates a Gdk::Pixmap representation of the row at @a path .  
1152    * This image is used for a drag icon.
1153    * @param path A Gtk::TreePath in @a tree_view .
1154    * @return A newly-allocated pixmap of the drag icon.
1155    */
1156   Glib::RefPtr<Gdk::Pixmap> create_row_drag_icon(const TreeModel::Path& path);
1157
1158 /* Interactive search */
1159   
1160   /** If @a enable_search  is set, then the user can type in text to search through
1161    * the tree interactively (this is sometimes called "typeahead find").
1162    * 
1163    * Note that even if this is <tt>false</tt>, the user can still initiate a search 
1164    * using the "start-interactive-search" key binding.
1165    * @param enable_search <tt>true</tt>, if the user can search interactively.
1166    */
1167   void set_enable_search(bool enable_search = true);
1168   
1169   /** Return value: whether or not to let the user search interactively
1170    * @return Whether or not to let the user search interactively.
1171    */
1172   bool get_enable_search() const;
1173   
1174   /** Gets the column searched on by the interactive search code.
1175    * @return The column the interactive search code searches in.
1176    */
1177   int get_search_column() const;
1178   
1179   /** Sets @a column  as the column where the interactive search code should
1180    * search in. 
1181    * 
1182    * If the sort column is set, users can use the "start-interactive-search"
1183    * key binding to bring up search popup. The enable-search property controls
1184    * whether simply typing text will also start an interactive search.
1185    * 
1186    * Note that @a column  refers to a column of the model.
1187    * @param column The column of the model to search in, or -1 to disable searching.
1188    */
1189   void set_search_column(const TreeModelColumnBase& column);
1190   
1191   /** Sets @a column  as the column where the interactive search code should
1192    * search in. 
1193    * 
1194    * If the sort column is set, users can use the "start-interactive-search"
1195    * key binding to bring up search popup. The enable-search property controls
1196    * whether simply typing text will also start an interactive search.
1197    * 
1198    * Note that @a column  refers to a column of the model.
1199    * @param column The column of the model to search in, or -1 to disable searching.
1200    */
1201   void set_search_column(int column);
1202
1203   ///void on_search_equal(const Glib::RefPtr<TreeModel>& model, int column, const Glib::ustring& key, const TreeModel::iterator& iter)
1204   typedef sigc::slot<bool, const Glib::RefPtr<TreeModel>&, int, const Glib::ustring&, const TreeModel::iterator&> SlotSearchEqual;
1205   //SlotSearchEqual get_search_equal_func();
1206   
1207   
1208   /** Sets the compare function for the interactive search capabilities.
1209    *
1210    * @param slot The compare function to use during the search
1211    */
1212   void set_search_equal_func(const SlotSearchEqual& slot);
1213   
1214
1215   /** Return value: the entry currently in use as search entry.
1216    * @return The entry currently in use as search entry.
1217    * 
1218    * @newin2p10.
1219    */
1220   Entry* get_search_entry();
1221   
1222   /** Return value: the entry currently in use as search entry.
1223    * @return The entry currently in use as search entry.
1224    * 
1225    * @newin2p10.
1226    */
1227   const Entry* get_search_entry() const;
1228   
1229   /** Sets the entry which the interactive search code will use for this
1230    *  @a tree_view .  This is useful when you want to provide a search entry
1231    * in our interface at all time at a fixed position.  Passing <tt>0</tt> for
1232    *  @a entry  will make the interactive search code use the built-in popup
1233    * entry again.
1234    * 
1235    * @newin2p10
1236    * @param entry The entry the interactive search code of @a tree_view  should use or <tt>0</tt>.
1237    */
1238   void set_search_entry(Entry& entry);
1239
1240   ///void on_search_position(Gtk::Widget* search_dialog)
1241   typedef sigc::slot<void, Gtk::Widget* /* search_dialog */> SlotSearchPosition;
1242   void set_search_position_func(const SlotSearchPosition& slot);
1243   
1244
1245   /** Converts widget coordinates to coordinates for the
1246    * tree (the full scrollable area of the tree).
1247    * 
1248    * @newin2p12
1249    * @param wx X coordinate relative to the widget.
1250    * @param wy Y coordinate relative to the widget.
1251    * @param tx Return location for tree X coordinate.
1252    * @param ty Return location for tree Y coordinate.
1253    */
1254   void convert_widget_to_tree_coords(int wx, int wy, int& tx, int& ty) const;
1255   
1256   /** Converts tree coordinates (coordinates in full scrollable area of the tree)
1257    * to widget coordinates.
1258    * 
1259    * @newin2p12
1260    * @param tx X coordinate relative to the tree.
1261    * @param ty Y coordinate relative to the tree.
1262    * @param wx Return location for widget X coordinate.
1263    * @param wy Return location for widget Y coordinate.
1264    */
1265   void convert_tree_to_widget_coords(int tx, int ty, int& wx, int& wy) const;
1266   
1267   /** Converts widget coordinates to coordinates for the bin_window
1268    * (see get_bin_window()).
1269    * 
1270    * @newin2p12
1271    * @param wx X coordinate relative to the widget.
1272    * @param wy Y coordinate relative to the widget.
1273    * @param bx Return location for bin_window X coordinate.
1274    * @param by Return location for bin_window Y coordinate.
1275    */
1276   void convert_widget_to_bin_window_coords(int wx, int wy, int& bx, int& by) const;
1277   
1278   /** Converts bin_window coordinates (see get_bin_window())
1279    * to widget relative coordinates.
1280    * 
1281    * @newin2p12
1282    * @param bx Bin_window X coordinate.
1283    * @param by Bin_window Y coordinate.
1284    * @param wx Return location for widget X coordinate.
1285    * @param wy Return location for widget Y coordinate.
1286    */
1287   void convert_bin_window_to_widget_coords(int bx, int by, int& wx, int& wy) const;
1288   
1289   /** Converts tree coordinates (coordinates in full scrollable area of the tree)
1290    * to bin_window coordinates.
1291    * 
1292    * @newin2p12
1293    * @param tx Tree X coordinate.
1294    * @param ty Tree Y coordinate.
1295    * @param bx Return location for X coordinate relative to bin_window.
1296    * @param by Return location for Y coordinate relative to bin_window.
1297    */
1298   void convert_tree_to_bin_window_coords(int tx, int ty, int& bx, int& by) const;
1299   
1300   /** Converts bin_window coordinates to coordinates for the
1301    * tree (the full scrollable area of the tree).
1302    * 
1303    * @newin2p12
1304    * @param bx X coordinate relative to bin_window.
1305    * @param by Y coordinate relative to bin_window.
1306    * @param tx Return location for tree X coordinate.
1307    * @param ty Return location for tree Y coordinate.
1308    */
1309   void convert_bin_window_to_tree_coords(int bx, int by, int& tx, int& ty) const;
1310
1311
1312   /** Enables or disables the fixed height mode of @a tree_view . 
1313    * Fixed height mode speeds up Gtk::TreeView by assuming that all 
1314    * rows have the same height. 
1315    * Only enable this option if all rows are the same height and all
1316    * columns are of type Gtk::TREE_VIEW_COLUMN_FIXED.
1317    * 
1318    * @newin2p6
1319    * @param enable <tt>true</tt> to enable fixed height mode.
1320    */
1321   void set_fixed_height_mode(bool enable = true);
1322   
1323   /** Return value: <tt>true</tt> if @a tree_view  is in fixed height mode
1324    * @return <tt>true</tt> if @a tree_view  is in fixed height mode
1325    * 
1326    * @newin2p6.
1327    */
1328   bool get_fixed_height_mode() const;
1329   
1330   /** Enables of disables the hover selection mode of @a tree_view .
1331    * Hover selection makes the selected row follow the pointer.
1332    * Currently, this works only for the selection modes 
1333    * Gtk::SELECTION_SINGLE and Gtk::SELECTION_BROWSE.
1334    * 
1335    * @newin2p6
1336    * @param hover <tt>true</tt> to enable hover selection mode.
1337    */
1338   void set_hover_selection(bool hover = true);
1339   
1340   /** Return value: <tt>true</tt> if @a tree_view  is in hover selection mode
1341    * @return <tt>true</tt> if @a tree_view  is in hover selection mode
1342    * 
1343    * @newin2p6.
1344    */
1345   bool get_hover_selection() const;
1346   
1347   /** Enables of disables the hover expansion mode of @a tree_view .
1348    * Hover expansion makes rows expand or collaps if the pointer 
1349    * moves over them.
1350    * 
1351    * @newin2p6
1352    * @param expand <tt>true</tt> to enable hover selection mode.
1353    */
1354   void set_hover_expand(bool expand = true);
1355   
1356   /** Return value: <tt>true</tt> if @a tree_view  is in hover expansion mode
1357    * @return <tt>true</tt> if @a tree_view  is in hover expansion mode
1358    * 
1359    * @newin2p6.
1360    */
1361   bool get_hover_expand() const;
1362   
1363   /** Enables or disables rubber banding in @a tree_view .  If the selection mode
1364    * is Gtk::SELECTION_MULTIPLE, rubber banding will allow the user to select
1365    * multiple rows by dragging the mouse.
1366    * 
1367    * @newin2p10
1368    * @param enable <tt>true</tt> to enable rubber banding.
1369    */
1370   void set_rubber_banding(bool enable = true);
1371   
1372   /** Return value: <tt>true</tt> if rubber banding in @a tree_view  is enabled.
1373    * @return <tt>true</tt> if rubber banding in @a tree_view  is enabled.
1374    * 
1375    * @newin2p10.
1376    */
1377   bool get_rubber_banding() const;
1378
1379   //TODO: Rename to get_is?
1380   
1381   /** Return value: <tt>true</tt> if a rubber banding operation is currently being
1382    * @return <tt>true</tt> if a rubber banding operation is currently being
1383    * done in @a tree_view .
1384    * 
1385    * @newin2p12.
1386    */
1387   bool is_rubber_banding_active() const;
1388
1389   /** For instance,
1390    * void on_row_separator(const Gtk::TreeModel& model, const Gtk::TreeModel::iterator& iter);
1391    */
1392   typedef sigc::slot<bool, const Glib::RefPtr<TreeModel>&, const TreeModel::iterator&> SlotRowSeparator;
1393   
1394   void set_row_separator_func(const SlotRowSeparator& slot);
1395   
1396
1397   /** Sets which grid lines to draw in @a tree_view .
1398    * 
1399    * @newin2p10
1400    * @param grid_lines A Gtk::TreeViewGridLines value indicating which grid lines to
1401    * enable.
1402    */
1403   void set_grid_lines(TreeViewGridLines grid_lines);
1404   
1405   /** Return value: a Gtk::TreeViewGridLines value indicating which grid lines
1406    * @return A Gtk::TreeViewGridLines value indicating which grid lines
1407    * are enabled.
1408    * 
1409    * @newin2p10.
1410    */
1411   TreeViewGridLines get_grid_lines() const;
1412
1413   
1414   /** Sets whether to draw lines interconnecting the expanders in @a tree_view .
1415    * This does not have any visible effects for lists.
1416    * 
1417    * @newin2p10
1418    * @param enabled <tt>true</tt> to enable tree line drawing, <tt>false</tt> otherwise.
1419    */
1420   void set_enable_tree_lines(bool enable = true);
1421   
1422   /** Return value: <tt>true</tt> if tree lines are drawn in @a tree_view , <tt>false</tt>
1423    * @return <tt>true</tt> if tree lines are drawn in @a tree_view , <tt>false</tt>
1424    * otherwise.
1425    * 
1426    * @newin2p10.
1427    */
1428   bool get_enable_tree_lines() const;
1429
1430   
1431   /** Sets whether to draw and enable expanders and indent child rows in
1432    *  @a tree_view .  When disabled there will be no expanders visible in trees
1433    * and there will be no way to expand and collapse rows by default.  Also
1434    * note that hiding the expanders will disable the default indentation.  You
1435    * can set a custom indentation in this case using
1436    * set_level_indentation().
1437    * This does not have any visible effects for lists.
1438    * 
1439    * @newin2p12
1440    * @param enabled <tt>true</tt> to enable expander drawing, <tt>false</tt> otherwise.
1441    */
1442   void set_show_expanders(bool enabled = true);
1443   
1444   /** Return value: <tt>true</tt> if expanders are drawn in @a tree_view , <tt>false</tt>
1445    * @return <tt>true</tt> if expanders are drawn in @a tree_view , <tt>false</tt>
1446    * otherwise.
1447    * 
1448    * @newin2p12.
1449    */
1450   bool get_show_expanders() const;
1451   
1452   /** Sets the amount of extra indentation for child levels to use in @a tree_view 
1453    * in addition to the default indentation.  The value should be specified in
1454    * pixels, a value of 0 disables this feature and in this case only the default
1455    * indentation will be used.
1456    * This does not have any visible effects for lists.
1457    * 
1458    * @newin2p12
1459    * @param indentation The amount, in pixels, of extra indentation in @a tree_view .
1460    */
1461   void set_level_indentation(int indentation);
1462   
1463   /** Return value: the amount of extra indentation for child levels in
1464    * @return The amount of extra indentation for child levels in
1465    *  @a tree_view .  A return value of 0 means that this feature is disabled.
1466    * 
1467    * @newin2p12.
1468    */
1469   int get_level_indentation() const;
1470
1471   
1472   /** Sets the tip area of @a tooltip  to be the area covered by the row at @a path .
1473    * See also gtk_tooltip_set_tip_area().
1474    * 
1475    * @newin2p12
1476    * @param tooltip A Gtk::Tooltip.
1477    * @param path A Gtk::TreePath.
1478    */
1479   void set_tooltip_row(const Glib::RefPtr<Tooltip>& tooltip, const TreePath& path);
1480
1481   //Note that we use pointers instead of references because any one of the 3 arguments may be NULL, and we don't want that many method overloads:
1482  
1483
1484   /** Sets the tip area of @a tooltip  to the area @a path , @a column  and @a cell  have
1485    * in common.  For example if @a path  is <tt>0</tt> and @a column  is set, the tip
1486    * area will be set to the full area covered by @a column .  See also
1487    * gtk_tooltip_set_tip_area().
1488    * 
1489    * @newin2p12
1490    * @param tooltip A Gtk::Tooltip.
1491    * @param path A Gtk::TreePath or <tt>0</tt>.
1492    * @param column A Gtk::TreeViewColumn or <tt>0</tt>.
1493    * @param cell A Gtk::CellRendererText or <tt>0</tt>.
1494    */
1495   void set_tooltip_cell(const Glib::RefPtr<Tooltip>& tooltip, const TreeModel::Path* path, TreeViewColumn* column, CellRenderer* cell);
1496
1497   
1498   /**
1499    * @param x: the x coordinate (relative to widget coordinates)
1500    * @param y: the y coordinate (relative to widget coordinates)
1501    * @param keyboard_tip: whether this is a keyboard tooltip or not
1502    * @param path: a reference to receive a Gtk::TreePath
1503    *
1504    * This function is supposed to be used in a Gtk::Widget::query-tooltip
1505    * signal handler for Gtk::TreeView. The x, y and keyboard_tip values
1506    * which are received in the signal handler, should be passed to this
1507    * function without modification.
1508    *
1509    * The return value indicates whether there is an tree view row at the given
1510    * coordinates (true) or not (false) for mouse tooltips. For keyboard
1511    * tooltips the row returned will be the cursor item. When true, then the
1512    * path which has been provided will be set to point to
1513    * that row and the corresponding model. x and y will always be converted
1514    * to be relative to Gtk::TreeView's bin_window if keyboard_tooltip is false.
1515    *
1516    * Return value: whether or not the given tooltip context points to a row.
1517    *
1518    * @newin2p12
1519    */
1520   bool get_tooltip_context_path(int& x, int& y,
1521                                 bool keyboard_tip,
1522                                 TreeModel::Path& path);
1523
1524   /**
1525    * @param x: the x coordinate (relative to widget coordinates)
1526    * @param y: the y coordinate (relative to widget coordinates)
1527    * @param keyboard_tip: whether this is a keyboard tooltip or not
1528    * @param iter: a pointer to receive a Gtk::TreeIter
1529    *
1530    * This function is supposed to be used in a Gtk::Widget::query-tooltip
1531    * signal handler for Gtk::TreeView. The x, y and keyboard_tip values
1532    * which are received in the signal handler, should be passed to this
1533    * function without modification.
1534    *
1535    * The return value indicates whether there is an tree view row at the given
1536    * coordinates (true) or not (false) for mouse tooltips. For keyboard
1537    * tooltips the row returned will be the cursor item. When true, then the
1538    * iter which has been provided will be set to point to
1539    * that row and the corresponding model. x and y will always be converted
1540    * to be relative to Gtk::TreeView's bin_window if keyboard_tooltip is false.
1541    *
1542    * Return value: whether or not the given tooltip context points to a row.
1543    *
1544    * @newin2p12
1545    */
1546   bool get_tooltip_context_iter(int& x, int& y,
1547                                 bool keyboard_tip,
1548                                 Gtk::TreeModel::iterator& iter);
1549
1550   
1551   void set_tooltip_column(int column);
1552   
1553   int get_tooltip_column() const;
1554
1555
1556   /**
1557    * @par Prototype:
1558    * <tt>void on_my_%set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment)</tt>
1559    */
1560
1561   Glib::SignalProxy2< void,Adjustment*,Adjustment* > signal_set_scroll_adjustments();
1562
1563   
1564   /**
1565    * @par Prototype:
1566    * <tt>void on_my_%row_activated(const TreeModel::Path& path, TreeViewColumn* column)</tt>
1567    */
1568
1569   Glib::SignalProxy2< void,const TreeModel::Path&,TreeViewColumn* > signal_row_activated();
1570
1571   
1572   /**
1573    * @par Prototype:
1574    * <tt>bool on_my_%test_expand_row(const TreeModel::iterator& iter, const TreeModel::Path& path)</tt>
1575    */
1576
1577   Glib::SignalProxy2< bool,const TreeModel::iterator&,const TreeModel::Path& > signal_test_expand_row();
1578
1579   
1580   /**
1581    * @par Prototype:
1582    * <tt>bool on_my_%test_collapse_row(const TreeModel::iterator& iter, const TreeModel::Path& path)</tt>
1583    */
1584
1585   Glib::SignalProxy2< bool,const TreeModel::iterator&,const TreeModel::Path& > signal_test_collapse_row();
1586
1587   
1588   /**
1589    * @par Prototype:
1590    * <tt>void on_my_%row_expanded(const TreeModel::iterator& iter, const TreeModel::Path& path)</tt>
1591    */
1592
1593   Glib::SignalProxy2< void,const TreeModel::iterator&,const TreeModel::Path& > signal_row_expanded();
1594
1595   
1596   /**
1597    * @par Prototype:
1598    * <tt>void on_my_%row_collapsed(const TreeModel::iterator& iter, const TreeModel::Path& path)</tt>
1599    */
1600
1601   Glib::SignalProxy2< void,const TreeModel::iterator&,const TreeModel::Path& > signal_row_collapsed();
1602
1603   
1604   /**
1605    * @par Prototype:
1606    * <tt>void on_my_%cursor_changed()</tt>
1607    */
1608
1609   Glib::SignalProxy0< void > signal_cursor_changed();
1610
1611   
1612   /**
1613    * @par Prototype:
1614    * <tt>void on_my_%columns_changed()</tt>
1615    */
1616
1617   Glib::SignalProxy0< void > signal_columns_changed();
1618
1619
1620   //Don't wrap these. They are keybinding signals, and their API broke for GTK+ 2.2.
1621   
1622   
1623   #ifdef GLIBMM_PROPERTIES_ENABLED
1624 /** The model for the tree view.
1625    *
1626    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1627    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1628    * the value of the property changes.
1629    */
1630   Glib::PropertyProxy< Glib::RefPtr<TreeModel> > property_model() ;
1631 #endif //#GLIBMM_PROPERTIES_ENABLED
1632
1633 #ifdef GLIBMM_PROPERTIES_ENABLED
1634 /** The model for the tree view.
1635    *
1636    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1637    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1638    * the value of the property changes.
1639    */
1640   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TreeModel> > property_model() const;
1641 #endif //#GLIBMM_PROPERTIES_ENABLED
1642
1643   #ifdef GLIBMM_PROPERTIES_ENABLED
1644 /** Horizontal Adjustment for the widget.
1645    *
1646    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1647    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1648    * the value of the property changes.
1649    */
1650   Glib::PropertyProxy<Adjustment*> property_hadjustment() ;
1651 #endif //#GLIBMM_PROPERTIES_ENABLED
1652
1653 #ifdef GLIBMM_PROPERTIES_ENABLED
1654 /** Horizontal Adjustment for the widget.
1655    *
1656    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1657    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1658    * the value of the property changes.
1659    */
1660   Glib::PropertyProxy_ReadOnly<Adjustment*> property_hadjustment() const;
1661 #endif //#GLIBMM_PROPERTIES_ENABLED
1662
1663   #ifdef GLIBMM_PROPERTIES_ENABLED
1664 /** Vertical Adjustment for the widget.
1665    *
1666    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1667    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1668    * the value of the property changes.
1669    */
1670   Glib::PropertyProxy<Adjustment*> property_vadjustment() ;
1671 #endif //#GLIBMM_PROPERTIES_ENABLED
1672
1673 #ifdef GLIBMM_PROPERTIES_ENABLED
1674 /** Vertical Adjustment for the widget.
1675    *
1676    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1677    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1678    * the value of the property changes.
1679    */
1680   Glib::PropertyProxy_ReadOnly<Adjustment*> property_vadjustment() const;
1681 #endif //#GLIBMM_PROPERTIES_ENABLED
1682
1683   #ifdef GLIBMM_PROPERTIES_ENABLED
1684 /** Show the column header buttons.
1685    *
1686    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1687    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1688    * the value of the property changes.
1689    */
1690   Glib::PropertyProxy<bool> property_headers_visible() ;
1691 #endif //#GLIBMM_PROPERTIES_ENABLED
1692
1693 #ifdef GLIBMM_PROPERTIES_ENABLED
1694 /** Show the column header buttons.
1695    *
1696    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1697    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1698    * the value of the property changes.
1699    */
1700   Glib::PropertyProxy_ReadOnly<bool> property_headers_visible() const;
1701 #endif //#GLIBMM_PROPERTIES_ENABLED
1702
1703   #ifdef GLIBMM_PROPERTIES_ENABLED
1704 /** Column headers respond to click events.
1705    *
1706    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1707    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1708    * the value of the property changes.
1709    */
1710   Glib::PropertyProxy<bool> property_headers_clickable() ;
1711 #endif //#GLIBMM_PROPERTIES_ENABLED
1712
1713 #ifdef GLIBMM_PROPERTIES_ENABLED
1714 /** Column headers respond to click events.
1715    *
1716    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1717    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1718    * the value of the property changes.
1719    */
1720   Glib::PropertyProxy_ReadOnly<bool> property_headers_clickable() const;
1721 #endif //#GLIBMM_PROPERTIES_ENABLED
1722
1723   #ifdef GLIBMM_PROPERTIES_ENABLED
1724 /** Set the column for the expander column.
1725    *
1726    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1727    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1728    * the value of the property changes.
1729    */
1730   Glib::PropertyProxy<TreeViewColumn*> property_expander_column() ;
1731 #endif //#GLIBMM_PROPERTIES_ENABLED
1732
1733 #ifdef GLIBMM_PROPERTIES_ENABLED
1734 /** Set the column for the expander column.
1735    *
1736    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1737    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1738    * the value of the property changes.
1739    */
1740   Glib::PropertyProxy_ReadOnly<TreeViewColumn*> property_expander_column() const;
1741 #endif //#GLIBMM_PROPERTIES_ENABLED
1742
1743   #ifdef GLIBMM_PROPERTIES_ENABLED
1744 /** View is reorderable.
1745    *
1746    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1747    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1748    * the value of the property changes.
1749    */
1750   Glib::PropertyProxy<bool> property_reorderable() ;
1751 #endif //#GLIBMM_PROPERTIES_ENABLED
1752
1753 #ifdef GLIBMM_PROPERTIES_ENABLED
1754 /** View is reorderable.
1755    *
1756    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1757    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1758    * the value of the property changes.
1759    */
1760   Glib::PropertyProxy_ReadOnly<bool> property_reorderable() const;
1761 #endif //#GLIBMM_PROPERTIES_ENABLED
1762
1763   #ifdef GLIBMM_PROPERTIES_ENABLED
1764 /** Set a hint to the theme engine to draw rows in alternating colors.
1765    *
1766    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1767    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1768    * the value of the property changes.
1769    */
1770   Glib::PropertyProxy<bool> property_rules_hint() ;
1771 #endif //#GLIBMM_PROPERTIES_ENABLED
1772
1773 #ifdef GLIBMM_PROPERTIES_ENABLED
1774 /** Set a hint to the theme engine to draw rows in alternating colors.
1775    *
1776    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1777    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1778    * the value of the property changes.
1779    */
1780   Glib::PropertyProxy_ReadOnly<bool> property_rules_hint() const;
1781 #endif //#GLIBMM_PROPERTIES_ENABLED
1782
1783   #ifdef GLIBMM_PROPERTIES_ENABLED
1784 /** View allows user to search through columns interactively.
1785    *
1786    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1787    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1788    * the value of the property changes.
1789    */
1790   Glib::PropertyProxy<bool> property_enable_search() ;
1791 #endif //#GLIBMM_PROPERTIES_ENABLED
1792
1793 #ifdef GLIBMM_PROPERTIES_ENABLED
1794 /** View allows user to search through columns interactively.
1795    *
1796    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1797    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1798    * the value of the property changes.
1799    */
1800   Glib::PropertyProxy_ReadOnly<bool> property_enable_search() const;
1801 #endif //#GLIBMM_PROPERTIES_ENABLED
1802
1803   #ifdef GLIBMM_PROPERTIES_ENABLED
1804 /** Model column to search through when searching through code.
1805    *
1806    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1807    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1808    * the value of the property changes.
1809    */
1810   Glib::PropertyProxy<int> property_search_column() ;
1811 #endif //#GLIBMM_PROPERTIES_ENABLED
1812
1813 #ifdef GLIBMM_PROPERTIES_ENABLED
1814 /** Model column to search through when searching through code.
1815    *
1816    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1817    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1818    * the value of the property changes.
1819    */
1820   Glib::PropertyProxy_ReadOnly<int> property_search_column() const;
1821 #endif //#GLIBMM_PROPERTIES_ENABLED
1822
1823   #ifdef GLIBMM_PROPERTIES_ENABLED
1824 /** Speeds up GtkTreeView by assuming that all rows have the same height.
1825    *
1826    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1827    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1828    * the value of the property changes.
1829    */
1830   Glib::PropertyProxy<bool> property_fixed_height_mode() ;
1831 #endif //#GLIBMM_PROPERTIES_ENABLED
1832
1833 #ifdef GLIBMM_PROPERTIES_ENABLED
1834 /** Speeds up GtkTreeView by assuming that all rows have the same height.
1835    *
1836    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1837    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1838    * the value of the property changes.
1839    */
1840   Glib::PropertyProxy_ReadOnly<bool> property_fixed_height_mode() const;
1841 #endif //#GLIBMM_PROPERTIES_ENABLED
1842
1843   #ifdef GLIBMM_PROPERTIES_ENABLED
1844 /** Whether the selection should follow the pointer.
1845    *
1846    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1847    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1848    * the value of the property changes.
1849    */
1850   Glib::PropertyProxy<bool> property_hover_selection() ;
1851 #endif //#GLIBMM_PROPERTIES_ENABLED
1852
1853 #ifdef GLIBMM_PROPERTIES_ENABLED
1854 /** Whether the selection should follow the pointer.
1855    *
1856    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1857    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1858    * the value of the property changes.
1859    */
1860   Glib::PropertyProxy_ReadOnly<bool> property_hover_selection() const;
1861 #endif //#GLIBMM_PROPERTIES_ENABLED
1862
1863   #ifdef GLIBMM_PROPERTIES_ENABLED
1864 /** Whether rows should be expanded/collapsed when the pointer moves over them.
1865    *
1866    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1867    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1868    * the value of the property changes.
1869    */
1870   Glib::PropertyProxy<bool> property_hover_expand() ;
1871 #endif //#GLIBMM_PROPERTIES_ENABLED
1872
1873 #ifdef GLIBMM_PROPERTIES_ENABLED
1874 /** Whether rows should be expanded/collapsed when the pointer moves over them.
1875    *
1876    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1877    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1878    * the value of the property changes.
1879    */
1880   Glib::PropertyProxy_ReadOnly<bool> property_hover_expand() const;
1881 #endif //#GLIBMM_PROPERTIES_ENABLED
1882
1883   #ifdef GLIBMM_PROPERTIES_ENABLED
1884 /** View has expanders.
1885    *
1886    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1887    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1888    * the value of the property changes.
1889    */
1890   Glib::PropertyProxy<bool> property_show_expanders() ;
1891 #endif //#GLIBMM_PROPERTIES_ENABLED
1892
1893 #ifdef GLIBMM_PROPERTIES_ENABLED
1894 /** View has expanders.
1895    *
1896    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1897    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1898    * the value of the property changes.
1899    */
1900   Glib::PropertyProxy_ReadOnly<bool> property_show_expanders() const;
1901 #endif //#GLIBMM_PROPERTIES_ENABLED
1902
1903   #ifdef GLIBMM_PROPERTIES_ENABLED
1904 /** Extra indentation for each level.
1905    *
1906    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1907    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1908    * the value of the property changes.
1909    */
1910   Glib::PropertyProxy<bool> property_level_indentation() ;
1911 #endif //#GLIBMM_PROPERTIES_ENABLED
1912
1913 #ifdef GLIBMM_PROPERTIES_ENABLED
1914 /** Extra indentation for each level.
1915    *
1916    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1917    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1918    * the value of the property changes.
1919    */
1920   Glib::PropertyProxy_ReadOnly<bool> property_level_indentation() const;
1921 #endif //#GLIBMM_PROPERTIES_ENABLED
1922
1923   #ifdef GLIBMM_PROPERTIES_ENABLED
1924 /** Whether to enable selection of multiple items by dragging the mouse pointer.
1925    *
1926    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1927    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1928    * the value of the property changes.
1929    */
1930   Glib::PropertyProxy<bool> property_rubber_banding() ;
1931 #endif //#GLIBMM_PROPERTIES_ENABLED
1932
1933 #ifdef GLIBMM_PROPERTIES_ENABLED
1934 /** Whether to enable selection of multiple items by dragging the mouse pointer.
1935    *
1936    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1937    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1938    * the value of the property changes.
1939    */
1940   Glib::PropertyProxy_ReadOnly<bool> property_rubber_banding() const;
1941 #endif //#GLIBMM_PROPERTIES_ENABLED
1942
1943   #ifdef GLIBMM_PROPERTIES_ENABLED
1944 /** Whether grid lines should be drawn in the tree view.
1945    *
1946    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1947    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1948    * the value of the property changes.
1949    */
1950   Glib::PropertyProxy<bool> property_enable_grid_lines() ;
1951 #endif //#GLIBMM_PROPERTIES_ENABLED
1952
1953 #ifdef GLIBMM_PROPERTIES_ENABLED
1954 /** Whether grid lines should be drawn in the tree view.
1955    *
1956    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1957    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1958    * the value of the property changes.
1959    */
1960   Glib::PropertyProxy_ReadOnly<bool> property_enable_grid_lines() const;
1961 #endif //#GLIBMM_PROPERTIES_ENABLED
1962
1963   #ifdef GLIBMM_PROPERTIES_ENABLED
1964 /** Whether tree lines should be drawn in the tree view.
1965    *
1966    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1967    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1968    * the value of the property changes.
1969    */
1970   Glib::PropertyProxy<bool> property_enable_tree_lines() ;
1971 #endif //#GLIBMM_PROPERTIES_ENABLED
1972
1973 #ifdef GLIBMM_PROPERTIES_ENABLED
1974 /** Whether tree lines should be drawn in the tree view.
1975    *
1976    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1977    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1978    * the value of the property changes.
1979    */
1980   Glib::PropertyProxy_ReadOnly<bool> property_enable_tree_lines() const;
1981 #endif //#GLIBMM_PROPERTIES_ENABLED
1982
1983
1984   /// Get the treeview's model, but actually get the child model if it's a TreeModelFilter.
1985   Glib::RefPtr<Gtk::TreeModel> _get_base_model();
1986  
1987 protected:
1988
1989 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1990   template<class ColumnType> friend
1991   void _auto_store_on_cellrenderer_text_edited_string(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
1992
1993   template <class ColumnType> friend
1994   void _auto_store_on_cellrenderer_text_edited_numerical(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
1995
1996   void _auto_store_on_cellrenderer_toggle_edited_with_model(const Glib::ustring& path_string, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
1997
1998   // This is no longer used, but we must keep it to prevent linker errors with already-compiled applications,
1999   // For instance, applications that were compiled with the older versions of the templates that did use this method.
2000   // TODO: Remove this when we can break API.
2001   void _auto_store_on_cellrenderer_toggle_edited(const Glib::ustring& path_string, int model_column);
2002
2003   template<class ColumnType> friend
2004   void TreeView_Private::_connect_auto_store_editable_signal_handler(TreeView*, CellRenderer*, const TreeModelColumn<ColumnType>&);
2005
2006 #endif //DOXYGEN_SHOULD_SKIP_THIS
2007
2008
2009 };
2010
2011
2012 template <class ColumnType> inline
2013 int TreeView::append_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column)
2014 {
2015   // compilation will fail if there is no appropriate TreeViewColumn
2016   // constructor for this model column type.
2017   TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
2018
2019   return append_column(*pViewColumn);
2020 }
2021
2022 //This is here because sigc::bind once did not work on all platforms, but now it does..
2023 #define GTKMM_HAVE_SIGC_BIND 1
2024
2025 #ifdef GTKMM_HAVE_SIGC_BIND
2026
2027 template <class ColumnType> inline
2028 int TreeView::append_column_numeric(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format)
2029 {
2030   TreeViewColumn* const pViewColumn = Gtk::manage( new TreeViewColumn(title) );
2031     
2032   //Use a CellRendererText:
2033   //We don't use TreeView::Column::append_column(model_column) to generate an appropriate CellRenderer, 
2034   //because that uses set_renderer(), which renders the model value using the automatic glib "transformations" (number-string conversions). As well as being unnecessary here, those automatic conversions can't handle all numeric types.
2035   CellRenderer* pCellRenderer = manage( new CellRendererText() );
2036   pViewColumn->pack_start(*pCellRenderer);
2037   
2038
2039   //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2040   typedef void (*type_fptr)(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter, int model_column, const Glib::ustring& format);
2041   type_fptr fptr = TreeView_Private::_auto_cell_data_func<ColumnType>;
2042
2043   //Connect a cell_data callback, to show the number's text representation in the specified format:
2044   //We use sigc::bind<-1> twice here, instead of sigc::bind() once, because some compilers need the extra hint.
2045   Gtk::TreeViewColumn::SlotCellData slot = sigc::bind<-1>(
2046     sigc::bind<-1>( sigc::ptr_fun(fptr), format),
2047     model_column.index()
2048   );
2049     
2050   pViewColumn->set_cell_data_func(*pCellRenderer, slot);
2051
2052   return append_column(*pViewColumn);
2053 }
2054
2055 #endif //GTKMM_HAVE_SIGC_BIND
2056
2057 template <class ColumnType> inline
2058 int TreeView::append_column_numeric_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format)
2059 {
2060   int cols_count = append_column_numeric(title, model_column, format);
2061   
2062   //connect signal handlers for auto-storing of edited cell data
2063   //Note: This will only work for base-10 (decimal) formatted numbers:
2064   CellRenderer *const cell = get_column_cell_renderer(cols_count - 1);
2065   if(cell)
2066   {
2067     TreeView_Private::_connect_auto_store_editable_signal_handler<ColumnType>(this, cell, model_column);
2068   }
2069    
2070   return cols_count;
2071 }
2072
2073 template <class ColumnType> inline
2074 int TreeView::append_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column)
2075 {
2076   //Don't use this in a header, because it gives warnings when disabled: g_assert(model_column.type() != 0);
2077
2078   // compilation will fail if there is no appropriate TreeViewColumn
2079   // constructor for this model column type.
2080   TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
2081
2082   //connect signal handlers for auto-storing of edited cell data
2083   CellRenderer* pCellRender = pViewColumn->get_first_cell_renderer();
2084   TreeView_Private::_connect_auto_store_editable_signal_handler<ColumnType>(this, pCellRender, model_column);
2085
2086   return append_column(*pViewColumn);
2087 }
2088
2089 template <class ColumnType> inline
2090 int TreeView::insert_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position)
2091 {
2092   // compilation will fail if there is no appropriate TreeViewColumn
2093   // constructor for this model column type.
2094   TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
2095
2096   return insert_column(*pViewColumn, position);
2097 }
2098
2099 template <class ColumnType> inline
2100 int TreeView::insert_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position)
2101 {
2102   // compilation will fail if there is no appropriate TreeViewColumn
2103   // constructor for this model column type.
2104   TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
2105
2106    //connect signal handlers for auto-storing of edited cell data
2107   CellRenderer* pCellRender = pViewColumn->get_first_cell_renderer();
2108   TreeView_Private::_connect_auto_store_editable_signal_handler(this, pCellRender, model_column);
2109
2110   return insert_column(*pViewColumn, position);
2111 }
2112
2113
2114 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2115 namespace TreeView_Private
2116 {
2117
2118 //Template specializations, for different model column types:
2119 //TODO: Move these specializations into the .ccg file - I tried, but the int specialization was not used by the compiler. murrayc.
2120
2121 #ifdef GTKMM_HAVE_SIGC_BIND
2122
2123 //bool specialization:
2124 template<> inline
2125 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<bool>& model_column)
2126 {
2127   Gtk::CellRendererToggle* pCellToggle = dynamic_cast<Gtk::CellRendererToggle*>(pCellRenderer);
2128   if(pCellToggle)
2129   {
2130     //Set the appropriate property,
2131     #ifdef GLIBMM_PROPERTIES_ENABLED
2132     pCellToggle->property_activatable() = true;
2133     #else
2134     pCellToggle->set_property("activatable", true);
2135     #endif
2136
2137     //Connect to the appropriate signal, sending the model_column too
2138
2139     sigc::slot<void, const Glib::ustring&, int> slot_temp = 
2140       sigc::bind<-1>(
2141         sigc::mem_fun(*this_p, &Gtk::TreeView::_auto_store_on_cellrenderer_toggle_edited_with_model), 
2142         this_p->_get_base_model()
2143       );
2144
2145     pCellToggle->signal_toggled().connect(
2146       sigc::bind<-1>( 
2147         slot_temp,
2148         model_column.index()
2149       )
2150     );
2151
2152     //We use bind<1> instead of bind because some compilers need the extra hint.
2153   }
2154 }
2155
2156 //int specialization:
2157 template<> inline
2158 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<int>& model_column)
2159 {
2160   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2161   if(pCellText)
2162   {
2163     //Set the appropriate property,
2164     #ifdef GLIBMM_PROPERTIES_ENABLED
2165     pCellText->property_editable() = true;
2166     #else
2167     pCellText->set_property("editable", true);
2168     #endif
2169
2170     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2171     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2172     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<int>;
2173
2174     //Connect to the appropriate signal, sending the model_column too,
2175     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2176     pCellText->signal_edited().connect(
2177       sigc::bind<-1>(
2178         sigc::bind<-1>( 
2179           sigc::ptr_fun(fptr),
2180           this_p->_get_base_model() ),
2181         model_column.index()
2182       )
2183     );
2184
2185   }
2186 }
2187
2188 //unsigned int specialization:
2189 template<> inline
2190 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<unsigned int>& model_column)
2191 {
2192   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2193   if(pCellText)
2194   {
2195     //Set the appropriate property,
2196     #ifdef GLIBMM_PROPERTIES_ENABLED
2197     pCellText->property_editable() = true;
2198     #else
2199     pCellText->set_property("editable", true);
2200     #endif
2201
2202     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2203     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2204     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<unsigned int>;
2205
2206     //Connect to the appropriate signal, sending the model_column too,
2207     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2208     pCellText->signal_edited().connect(
2209       sigc::bind<-1>(
2210         sigc::bind<-1>( 
2211           sigc::ptr_fun(fptr),
2212           this_p->_get_base_model() ),
2213         model_column.index()
2214       )
2215     );
2216     
2217   }
2218 }
2219
2220 //long specialization:
2221 template<> inline
2222 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<long>& model_column)
2223 {
2224   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2225   if(pCellText)
2226   {
2227     //Set the appropriate property,
2228     #ifdef GLIBMM_PROPERTIES_ENABLED
2229     pCellText->property_editable() = true;
2230     #else
2231     pCellText->set_property("editable", true);
2232     #endif
2233
2234     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2235     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2236     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<long>;
2237
2238     //Connect to the appropriate signal, sending the model_column too,
2239     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2240     pCellText->signal_edited().connect(
2241       sigc::bind<-1>(
2242         sigc::bind<-1>( 
2243           sigc::ptr_fun(fptr),
2244           this_p->_get_base_model() ),
2245         model_column.index()
2246       )
2247     );
2248     
2249   }
2250 }
2251
2252 //unsigned long specialization:
2253 template<> inline
2254 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<unsigned long>& model_column)
2255 {
2256   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2257   if(pCellText)
2258   {
2259     //Set the appropriate property,
2260     #ifdef GLIBMM_PROPERTIES_ENABLED
2261     pCellText->property_editable() = true;
2262     #else
2263     pCellText->set_property("editable", true);
2264     #endif
2265
2266     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2267     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2268     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<unsigned long>;
2269
2270     //Connect to the appropriate signal, sending the model_column too,
2271     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2272     pCellText->signal_edited().connect(
2273       sigc::bind<-1>(
2274         sigc::bind<-1>( 
2275           sigc::ptr_fun(fptr),
2276           this_p->_get_base_model() ),
2277         model_column.index()
2278       )
2279     );
2280  
2281   }
2282 }
2283
2284 //float specialization:
2285 template<> inline
2286 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<float>& model_column)
2287 {
2288   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2289   if(pCellText)
2290   {
2291     //Set the appropriate property,
2292     #ifdef GLIBMM_PROPERTIES_ENABLED
2293     pCellText->property_editable() = true;
2294     #else
2295     pCellText->set_property("editable", true);
2296     #endif
2297
2298     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2299     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2300     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<float>;
2301
2302     //Connect to the appropriate signal, sending the model_column too,
2303     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2304     pCellText->signal_edited().connect(
2305       sigc::bind<-1>(
2306         sigc::bind<-1>( 
2307           sigc::ptr_fun(fptr),
2308           this_p->_get_base_model() ),
2309         model_column.index()
2310       )
2311     );
2312   }
2313 }
2314
2315 //double specialization:
2316 template<> inline
2317 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<double>& model_column)
2318 {
2319   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2320   if(pCellText)
2321   {
2322     //Set the appropriate property,
2323     #ifdef GLIBMM_PROPERTIES_ENABLED
2324     pCellText->property_editable() = true;
2325     #else
2326     pCellText->set_property("editable", true);
2327     #endif
2328
2329     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2330     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2331     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<double>;
2332
2333     //Connect to the appropriate signal, sending the model_column too,
2334     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2335     pCellText->signal_edited().connect(
2336       sigc::bind<-1>(
2337         sigc::bind<-1>( 
2338           sigc::ptr_fun(fptr),
2339           this_p->_get_base_model() ),
2340         model_column.index()
2341       )
2342     );
2343   }
2344 }
2345
2346 #endif //GTKMM_HAVE_SIGC_BIND
2347
2348 } // namespace TreeView_Private
2349 #endif //DOXYGEN_SHOULD_SKIP_THIS
2350
2351
2352 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2353 namespace TreeView_Private
2354 {
2355
2356 #ifdef GTKMM_HAVE_SIGC_BIND
2357
2358 template <class ColumnType> inline
2359 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<ColumnType>& model_column)
2360 {
2361   //Don't use this in a header, because it gives warnings when disabled: g_assert(model_column.type() != 0);
2362
2363   //The different CellRenderers have different "edited" signals,
2364   //and numerical values need to convert the text value to a number,
2365   //so there are specializations for this tempate.
2366
2367   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2368
2369   //Set the appropriate property,
2370   //and connect to the appropriate signal, sending the model_column too,
2371   if(pCellText)
2372   {
2373     #ifdef GLIBMM_PROPERTIES_ENABLED
2374     pCellText->property_editable() = true;
2375     #else
2376     pCellText->set_property("editable", true);
2377     #endif
2378
2379     //Some compilers (IRIX MipsPro) don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2380     typedef void (*type_func)(const Glib::ustring&, const Glib::ustring&, int, const Glib::RefPtr<Gtk::TreeModel>&);
2381     type_func func = &(_auto_store_on_cellrenderer_text_edited_string<ColumnType>);
2382     sigc::slot<void, const Glib::ustring&, const Glib::ustring&, int, const Glib::RefPtr<Gtk::TreeModel>&> theslot  =
2383       sigc::ptr_fun(func);
2384
2385     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2386     pCellText->signal_edited().connect(
2387       sigc::bind<-1>(
2388         sigc::bind<-1>( theslot, this_p->_get_base_model()),
2389         model_column.index()
2390       )
2391     );
2392
2393     
2394   }
2395 }
2396
2397 #endif //GTKMM_HAVE_SIGC_BIND
2398
2399 template <class ColumnType> inline
2400 void _auto_store_on_cellrenderer_text_edited_string(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model)
2401 {
2402   Gtk::TreePath path(path_string);
2403
2404   //Get the row from the path:
2405   if(model)
2406   {
2407     Gtk::TreeModel::iterator iter = model->get_iter(path);
2408     if(iter)
2409     {
2410         //Store the user's new text in the model:
2411         Gtk::TreeRow row = *iter;
2412         row.set_value(model_column, (ColumnType)new_text);
2413     }
2414   }
2415 }
2416
2417 template <class ColumnType> inline
2418 void _auto_store_on_cellrenderer_text_edited_numerical(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model)
2419 {
2420   //This is used on numerical model columns:
2421
2422   Gtk::TreePath path(path_string);
2423
2424   //Get the row from the path:
2425   if(model)
2426   {
2427     Gtk::TreeModel::iterator iter = model->get_iter(path);
2428     if(iter)
2429     {
2430       //std::istringstream astream(new_text); //Put it in a stream.
2431       //ColumnType new_value = ColumnType();
2432       //new_value << astream; //Get it out of the stream as the numerical type.
2433
2434       //Convert the text to a number, using the same logic used by GtkCellRendererText when it stores numbers.
2435       char* pchEnd = 0;
2436       ColumnType new_value = static_cast<ColumnType>( strtod(new_text.c_str(), &pchEnd) );
2437
2438       //Store the user's new text in the model:
2439       Gtk::TreeRow row = *iter;
2440       row.set_value(model_column, (ColumnType)new_value);
2441     }
2442   }
2443 }
2444
2445 template <class ColumnType> inline
2446 void _auto_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter, int model_column, const Glib::ustring& format)
2447 {
2448   Gtk::CellRendererText* pTextRenderer = dynamic_cast<Gtk::CellRendererText*>(cell);
2449   if(!pTextRenderer)
2450   {
2451     g_warning("gtkmm: TextView: append_column_numeric() was used with a non-numeric type.");
2452   }
2453   else
2454   {
2455     if(iter)
2456     {
2457       //Get the value from the model.
2458       Gtk::TreeModel::Row row = *iter;
2459       ColumnType value = ColumnType();
2460       row.get_value(model_column, value);
2461
2462       //Convert it to a string representation:
2463       char buff[20];
2464       int used = g_snprintf(buff, sizeof(buff), format.c_str(), value); //value must be a numeric type.
2465       if(used > 0)
2466       {
2467         //Show the text representation in the view:
2468         #ifdef GLIBMM_PROPERTIES_ENABLED
2469         pTextRenderer->property_text() = buff;
2470         #else
2471         pTextRenderer->set_property("text", (void*)buff);
2472         #endif
2473       }
2474     }
2475   }
2476 }
2477
2478 } // namespace TreeView_Private
2479 #endif //DOXYGEN_SHOULD_SKIP_THIS
2480
2481
2482 } // namespace Gtk
2483
2484
2485 namespace Glib
2486 {
2487   /** A Glib::wrap() method for this object.
2488    * 
2489    * @param object The C instance.
2490    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
2491    * @result A C++ instance that wraps this C instance.
2492    *
2493    * @relates Gtk::TreeView
2494    */
2495   Gtk::TreeView* wrap(GtkTreeView* object, bool take_copy = false);
2496 } //namespace Glib
2497
2498
2499 #endif /* _GTKMM_TREEVIEW_H */
2500