Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / treeviewcolumn.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREEVIEWCOLUMN_H
4 #define _GTKMM_TREEVIEWCOLUMN_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* Copyright(C) 2002 The gtkmm Development Team
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or(at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26
27 #include <gtkmm/object.h>
28 #include <gtkmm/treeiter.h>
29 #include <gtkmm/widget.h>
30 #include <gdkmm/window.h>
31 #include <gtkmm/treemodel.h>
32 #include <glibmm/listhandle.h>
33 #include <gtkmm/cellrenderer_generation.h>
34
35
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
37 typedef struct _GtkTreeViewColumn GtkTreeViewColumn;
38 typedef struct _GtkTreeViewColumnClass GtkTreeViewColumnClass;
39 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40
41
42 namespace Gtk
43 { class TreeViewColumn_Class; } // namespace Gtk
44 namespace Gtk
45 {
46
47
48 /** @addtogroup gtkmmEnums Enums and Flags */
49
50 /**
51  * @ingroup gtkmmEnums
52  */
53 enum TreeViewColumnSizing
54 {
55   TREE_VIEW_COLUMN_GROW_ONLY,
56   TREE_VIEW_COLUMN_AUTOSIZE,
57   TREE_VIEW_COLUMN_FIXED
58 };
59
60 } // namespace Gtk
61
62
63 #ifndef DOXYGEN_SHOULD_SKIP_THIS
64 namespace Glib
65 {
66
67 template <>
68 class Value<Gtk::TreeViewColumnSizing> : public Glib::Value_Enum<Gtk::TreeViewColumnSizing>
69 {
70 public:
71   static GType value_type() G_GNUC_CONST;
72 };
73
74 } // namespace Glib
75 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
76
77
78 namespace Gtk
79 {
80
81
82 /** Typedefed as Gtk::TreeView::Column.
83  * This is a visible column in a Gtk::TreeView widget. It determines the geometry, type.
84  *
85  * @ingroup TreeView
86 */
87
88 class TreeViewColumn : public Gtk::Object
89 {
90   public:
91 #ifndef DOXYGEN_SHOULD_SKIP_THIS
92   typedef TreeViewColumn CppObjectType;
93   typedef TreeViewColumn_Class CppClassType;
94   typedef GtkTreeViewColumn BaseObjectType;
95   typedef GtkTreeViewColumnClass BaseClassType;
96 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
97
98   virtual ~TreeViewColumn();
99
100 #ifndef DOXYGEN_SHOULD_SKIP_THIS
101
102 private:
103   friend class TreeViewColumn_Class;
104   static CppClassType treeviewcolumn_class_;
105
106   // noncopyable
107   TreeViewColumn(const TreeViewColumn&);
108   TreeViewColumn& operator=(const TreeViewColumn&);
109
110 protected:
111   explicit TreeViewColumn(const Glib::ConstructParams& construct_params);
112   explicit TreeViewColumn(GtkTreeViewColumn* castitem);
113
114 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
115
116 public:
117 #ifndef DOXYGEN_SHOULD_SKIP_THIS
118   static GType get_type()      G_GNUC_CONST;
119   static GType get_base_type() G_GNUC_CONST;
120 #endif
121
122   ///Provides access to the underlying C GtkObject.
123   GtkTreeViewColumn*       gobj()       { return reinterpret_cast<GtkTreeViewColumn*>(gobject_); }
124
125   ///Provides access to the underlying C GtkObject.
126   const GtkTreeViewColumn* gobj() const { return reinterpret_cast<GtkTreeViewColumn*>(gobject_); }
127
128
129 public:
130   //C++ methods used to invoke GTK+ virtual functions:
131
132 protected:
133   //GTK+ Virtual Functions (override these to change behaviour):
134
135   //Default Signal Handlers::
136   virtual void on_clicked();
137
138
139 private:
140
141   
142 public:
143   typedef TreeViewColumn Column;
144
145   TreeViewColumn();
146
147   explicit TreeViewColumn(const Glib::ustring& title);
148   TreeViewColumn(const Glib::ustring& title, CellRenderer& cell);
149
150   /** Create a default view column for the given model column type.
151    */
152   template<class T_ModelColumnType>
153   TreeViewColumn(const Glib::ustring& title, const TreeModelColumn<T_ModelColumnType>& column);
154
155   
156   /** Packs the @a cell  into the beginning of the column. If @a expand  is <tt>false</tt>, then
157    * the @a cell  is allocated no more space than it needs. Any unused space is divided
158    * evenly between cells for which @a expand  is <tt>true</tt>.
159    * @param cell The Gtk::CellRenderer.
160    * @param expand <tt>true</tt> if @a cell  is to be given extra space allocated to @a tree_column .
161    */
162   void pack_start(CellRenderer& cell, bool expand = true);
163   
164   /** Adds the @a cell  to end of the column. If @a expand  is <tt>false</tt>, then the @a cell 
165    * is allocated no more space than it needs. Any unused space is divided
166    * evenly between cells for which @a expand  is <tt>true</tt>.
167    * @param cell The Gtk::CellRenderer.
168    * @param expand <tt>true</tt> if @a cell  is to be given extra space allocated to @a tree_column .
169    */
170   void pack_end(CellRenderer& cell, bool expand = true);
171
172   /** Creates an appropriate CellRenderer for the @a column, and packs that cell into the beginning of the column.
173    * If @a expand  is <tt>false</tt>, then
174    * the cell is allocated no more space than it needs. Any unused space is divided
175    * evenly between cells for which @a expand is <tt>true</tt>.
176    *
177    * You can use get_first_cell_renderer() or get_cell_renderers() to access the generated CellRenderer.
178    *
179    * @param column The model column that will be rendered by the view cell.
180    * @param expand <tt>true</tt> if the cell is to be given extra space allocated to the view column.
181    */
182   template<class T_ModelColumnType>
183   void pack_start(const TreeModelColumn<T_ModelColumnType>& column, bool expand = true);
184
185   /** Creates an appropriate CellRenderer for the @a column, and packs that cell at the end of the column.
186    * If @a expand  is <tt>false</tt>, then
187    * the cell is allocated no more space than it needs. Any unused space is divided
188    * evenly between cells for which @a expand is <tt>true</tt>.
189    *
190    * You can use get_first_cell_renderer() or get_cell_renderers() to access the generated CellRenderer.
191    *
192    * @param column The model column that will be rendered by the view cell.
193    * @param expand <tt>true</tt> if the cell is to be given extra space allocated to the view column.
194    */
195   template<class T_ModelColumnType>
196   void pack_end(const TreeModelColumn<T_ModelColumnType>& column, bool expand = true);
197
198   
199   /** Unsets all the mappings on all renderers on the @a tree_column .
200    */
201   void clear();
202
203   /** Gets the CellRenderer for the column.
204     * You should dynamic_cast<> to the expected derived CellRenderer type.
205     * This assumes that the TreeViewColumn contains only one CellRenderer.
206     */
207   CellRenderer* get_first_cell_renderer();
208
209   /** Gets the CellRenderer for the column.
210     * You should dynamic_cast<> to the expected derived CellRenderer type.
211     * This assumes that the TreeViewColumn contains only one CellRenderer.
212     */
213   const CellRenderer* get_first_cell_renderer() const;
214
215   
216   /** Returns a list of all the cell renderers in the column,
217    * in no particular order.
218    * @return A list of Gtk::CellRenderers.
219    */
220   Glib::ListHandle<CellRenderer*> get_cell_renderers();
221   
222   /** Returns a list of all the cell renderers in the column,
223    * in no particular order.
224    * @return A list of Gtk::CellRenderers.
225    */
226   Glib::ListHandle<const CellRenderer*> get_cell_renderers() const;
227
228   
229   /** Adds an attribute mapping to the list in @a tree_column .  The @a column  is the
230    * column of the model to get a value from, and the @a attribute  is the
231    * parameter on @a cell_renderer  to be set from the value. So for example
232    * if column 2 of the model contains strings, you could have the
233    * "text" attribute of a Gtk::CellRendererText get its values from
234    * column 2.
235    * @param cell_renderer The Gtk::CellRenderer to set attributes on.
236    * @param attribute An attribute on the renderer.
237    * @param column The column position on the model to get the attribute from.
238    */
239   void add_attribute(CellRenderer& cell_renderer, const Glib::ustring& attribute, int column);
240
241   void add_attribute(const Glib::PropertyProxy_Base& property, const TreeModelColumnBase& column);
242   
243
244   /** Associate a view CellRenderer with a model column, so that the CellRenderer renders the data in the model column.
245    *
246    * @param renderer The view cell renderer which will render the model column.
247    * @param column The model column to be renderered by this view.
248    */
249   void set_renderer(Gtk::CellRenderer& renderer, const TreeModelColumnBase& column);
250
251  // _WRAP_METHOD(void set_attributes(CellRenderer& cell_renderer, ...), )
252
253   /** For instance,
254    * void on_cell_data(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
255    *
256    * This function is used instead of the standard attributes mapping for setting the column value, and should set the
257    * value of the column's cell renderer as appropriate.
258    */
259   typedef sigc::slot<void, CellRenderer*, const Gtk::TreeModel::iterator&> SlotCellData;
260
261   /** Sets the slot callback to use for the column.
262    * This callback function is used instead of the standard attributes mapping for setting the column value, and should set the
263    * value of the column's cell renderer as appropriate.
264    *
265    * See also unset_cell_data_func().
266    *
267    * @param cell_renderer A Gtk::CellRenderer
268    * @param slot The callback slot to use. Create this with sigc::mem_fun(), or sigc::ptr_fun().
269    */  
270   void set_cell_data_func(CellRenderer& cell_renderer, const SlotCellData& slot);
271
272   /** Removes a previously set callback slot. See set_cell_data_func().
273    */ 
274   void unset_cell_data_func(CellRenderer& cell_renderer);
275
276   
277   /** Clears all existing attributes previously set with
278    * set_attributes().
279    * @param cell_renderer A Gtk::CellRenderer to clear the attribute mapping on.
280    */
281   void clear_attributes(CellRenderer& cell_renderer);
282   
283   /** Sets the spacing field of @a tree_column , which is the number of pixels to
284    * place between cell renderers packed into it.
285    * @param spacing Distance between cell renderers in pixels.
286    */
287   void set_spacing(int spacing);
288   
289   /** Returns the spacing of @a tree_column .
290    * @return The spacing of @a tree_column .
291    */
292   int get_spacing() const;
293   
294   /** Sets the visibility of @a tree_column .
295    * @param visible <tt>true</tt> if the @a tree_column  is visible.
296    */
297   void set_visible(bool visible = true);
298   
299   /** Returns <tt>true</tt> if @a tree_column  is visible.
300    * @return Whether the column is visible or not.  If it is visible, then
301    * the tree will show the column.
302    */
303   bool get_visible() const;
304   
305   /** If @a resizable  is <tt>true</tt>, then the user can explicitly resize the column by
306    * grabbing the outer edge of the column button.  If resizable is <tt>true</tt> and
307    * sizing mode of the column is Gtk::TREE_VIEW_COLUMN_AUTOSIZE, then the sizing
308    * mode is changed to Gtk::TREE_VIEW_COLUMN_GROW_ONLY.
309    * @param resizable <tt>true</tt>, if the column can be resized.
310    */
311   void set_resizable(bool resizable = true);
312   
313   /** Returns <tt>true</tt> if the @a tree_column  can be resized by the end user.
314    * @return <tt>true</tt>, if the @a tree_column  can be resized.
315    */
316   bool get_resizable() const;
317   
318   /** Sets the growth behavior of @a tree_column  to @a type .
319    * @param type The Gtk::TreeViewColumnSizing.
320    */
321   void set_sizing(TreeViewColumnSizing type);
322   
323   /** Returns the current type of @a tree_column .
324    * @return The type of @a tree_column .
325    */
326   TreeViewColumnSizing get_sizing();
327   
328   /** Returns the current size of @a tree_column  in pixels.
329    * @return The current width of @a tree_column .
330    */
331   int get_width() const;
332   
333   /** Gets the fixed width of the column.  This value is only meaning may not be
334    * the actual width of the column on the screen, just what is requested.
335    * @return The fixed width of the column.
336    */
337   int get_fixed_width() const;
338   
339   /** Sets the size of the column in pixels.  This is meaningful only if the sizing
340    * type is Gtk::TREE_VIEW_COLUMN_FIXED.  The size of the column is clamped to
341    * the min/max width for the column.  Please note that the min/max width of the
342    * column doesn't actually affect the "fixed_width" property of the widget, just
343    * the actual size when displayed.
344    * @param fixed_width The size to set @a tree_column  to. Must be greater than 0.
345    */
346   void set_fixed_width(int fixed_width);
347   
348   /** Sets the minimum width of the @a tree_column .  If @a min_width  is -1, then the
349    * minimum width is unset.
350    * @param min_width The minimum width of the column in pixels, or -1.
351    */
352   void set_min_width(int min_width);
353   
354   /** Returns the minimum width in pixels of the @a tree_column , or -1 if no minimum
355    * width is set.
356    * @return The minimum width of the @a tree_column .
357    */
358   int get_min_width() const;
359   
360   /** Sets the maximum width of the @a tree_column .  If @a max_width  is -1, then the
361    * maximum width is unset.  Note, the column can actually be wider than max
362    * width if it's the last column in a view.  In this case, the column expands to
363    * fill any extra space.
364    * @param max_width The maximum width of the column in pixels, or -1.
365    */
366   void set_max_width(int max_width);
367   
368   /** Returns the maximum width in pixels of the @a tree_column , or -1 if no maximum
369    * width is set.
370    * @return The maximum width of the @a tree_column .
371    */
372   int get_max_width() const;
373   
374   /** Emits the "clicked" signal on the column.  This function will only work if
375    *  @a tree_column  is clickable.
376    */
377   void clicked();
378
379   
380   /** Sets the title of the @a tree_column .  If a custom widget has been set, then
381    * this value is ignored.
382    * @param title The title of the @a tree_column .
383    */
384   void set_title(const Glib::ustring& title);
385   
386   /** Returns the title of the widget.
387    * @return The title of the column. This string should not be
388    * modified or freed.
389    */
390   Glib::ustring get_title() const;
391
392   
393   /** Sets the column to take available extra space.  This space is shared equally
394    * amongst all columns that have the expand set to <tt>true</tt>.  If no column has this
395    * option set, then the last column gets all extra space.  By default, every
396    * column is created with this <tt>false</tt>.
397    * 
398    * Since: 2.4
399    */
400   void set_expand(bool expand = true);
401   
402   /** Return <tt>true</tt> if the column expands to take any available space.
403    * @return <tt>true</tt>, if the column expands
404    * 
405    * Since: 2.4.
406    */
407   bool get_expand() const;
408
409   
410   /** Sets the header to be active if @a active  is <tt>true</tt>.  When the header is active,
411    * then it can take keyboard focus, and can be clicked.
412    * @param clickable <tt>true</tt> if the header is active.
413    */
414   void set_clickable(bool clickable = true);
415   
416   /** Returns <tt>true</tt> if the user can click on the header for the column.
417    * @return <tt>true</tt> if user can click the column header.
418    */
419   bool get_clickable() const;
420   
421   /** Sets the widget in the header to be @a widget .  If widget is <tt>0</tt>, then the
422    * header button is set with a Gtk::Label set to the title of @a tree_column .
423    * @param widget A child Gtk::Widget, or <tt>0</tt>.
424    */
425   void set_widget(Gtk::Widget& widget);
426   
427   /** Returns the Gtk::Widget in the button on the column header.  If a custom
428    * widget has not been set then <tt>0</tt> is returned.
429    * @return The Gtk::Widget in the column header, or <tt>0</tt>.
430    */
431   Widget* get_widget();
432   
433   /** Returns the Gtk::Widget in the button on the column header.  If a custom
434    * widget has not been set then <tt>0</tt> is returned.
435    * @return The Gtk::Widget in the column header, or <tt>0</tt>.
436    */
437   const Widget* get_widget() const;
438
439   
440   /** Sets the alignment of the title or custom widget inside the column header.
441    * The alignment determines its location inside the button -- 0.0 for left, 0.5
442    * for center, 1.0 for right.
443    * @param xalign The alignment, which is between [0.0 and 1.0] inclusive.
444    */
445   void set_alignment(float xalign);
446   
447   /** Sets the alignment of the title or custom widget inside the column header.
448    * The alignment determines its location inside the button -- 0.0 for left, 0.5
449    * for center, 1.0 for right.
450    * @param xalign The alignment, which is between [0.0 and 1.0] inclusive.
451    */
452   void set_alignment(AlignmentEnum xalign);
453
454   
455   /** Returns the current x alignment of @a tree_column .  This value can range
456    * between 0.0 and 1.0.
457    * @return The current alignent of @a tree_column .
458    */
459   float get_alignment() const;
460   
461   /** If @a reorderable  is <tt>true</tt>, then the column can be reordered by the end user
462    * dragging the header.
463    * @param reorderable <tt>true</tt>, if the column can be reordered.
464    */
465   void set_reorderable(bool reorderable = true);
466   
467   /** Returns <tt>true</tt> if the @a tree_column  can be reordered by the user.
468    * @return <tt>true</tt> if the @a tree_column  can be reordered by the user.
469    */
470   bool get_reorderable() const;
471
472   
473   /** Sets the logical @a sort_column_id  that this column sorts on when this column 
474    * is selected for sorting.  Doing so makes the column header clickable.
475    * @param sort_column_id The @a sort_column_id  of the model to sort on.
476    */
477   void set_sort_column(const TreeModelColumnBase& sort_column_id);
478   
479   /** Sets the logical @a sort_column_id  that this column sorts on when this column 
480    * is selected for sorting.  Doing so makes the column header clickable.
481    * @param sort_column_id The @a sort_column_id  of the model to sort on.
482    */
483   void set_sort_column(int sort_column_id);
484
485   #ifndef GTKMM_DISABLE_DEPRECATED
486   /** @deprecated Use set_sort_column() instead.
487    */
488   void set_sort_column_id(const TreeModelColumnBase& sort_column_id);
489
490   /** @deprecated Use set_sort_column() instead.
491    */
492   void set_sort_column_id(int sort_column_id);
493   #endif //GTKMM_DISABLE_DEPRECATED
494   
495   
496   /** Gets the logical @a sort_column_id  that the model sorts on when this
497    * column is selected for sorting.
498    * See set_sort_column_id().
499    * @return The current @a sort_column_id  for this column, or -1 if
500    * this column can't be used for sorting.
501    */
502   int get_sort_column_id() const;
503   
504   /** Call this function with a @a setting  of <tt>true</tt> to display an arrow in
505    * the header button indicating the column is sorted. Call
506    * set_sort_order() to change the direction of
507    * the arrow.
508    * @param setting <tt>true</tt> to display an indicator that the column is sorted.
509    */
510   void set_sort_indicator(bool setting);
511   
512   /** Gets the value set by set_sort_indicator().
513    * @return Whether the sort indicator arrow is displayed.
514    */
515   bool get_sort_indicator() const;
516   
517   /** Changes the appearance of the sort indicator. 
518    * 
519    * This <em>does not</em> actually sort the model.  Use
520    * set_sort_column_id() if you want automatic sorting
521    * support.  This function is primarily for custom sorting behavior, and should
522    * be used in conjunction with gtk_tree_sortable_set_sort_column() to do
523    * that. For custom models, the mechanism will vary. 
524    * 
525    * The sort indicator changes direction to indicate normal sort or reverse sort.
526    * Note that you must have the sort indicator enabled to see anything when 
527    * calling this function; see set_sort_indicator().
528    * @param order Sort order that the sort indicator should indicate.
529    */
530   void set_sort_order(SortType order);
531   
532   /** Gets the value set by set_sort_order().
533    * @return The sort order the sort indicator is indicating.
534    */
535   SortType get_sort_order() const;
536
537
538   /** Sets the cell renderer based on the @a tree_model  and @a iter .  That is, for
539    * every attribute mapping in @a tree_column , it will get a value from the set
540    * column on the @a iter , and use that value to set the attribute on the cell
541    * renderer.  This is used primarily by the Gtk::TreeView.
542    * @param tree_model The Gtk::TreeModel to to get the cell renderers attributes from.
543    * @param iter The Gtk::TreeIter to to get the cell renderer's attributes from.
544    * @param is_expander <tt>true</tt>, if the row has children.
545    * @param is_expanded <tt>true</tt>, if the row has visible children.
546    */
547   void cell_set_cell_data(const Glib::RefPtr<TreeModel>& tree_model, const TreeModel::iterator& iter, bool is_expander, bool is_expanded);
548   
549   /** Obtains the width and height needed to render the column.  This is used
550    * primarily by the Gtk::TreeView.
551    * @param cell_area The area a cell in the column will be allocated.
552    * @param x_offset Location to return x offset of a cell relative to @a cell_area .
553    * @param y_offset Location to return y offset of a cell relative to @a cell_area .
554    * @param width Location to return width needed to render a cell.
555    * @param height Location to return height needed to render a cell.
556    */
557   void cell_get_size(Gdk::Rectangle& cell_area, int& x_offset, int& y_offset, int& width, int& height) const;
558   
559   /** Returns <tt>true</tt> if any of the cells packed into the @a tree_column  are visible.
560    * For this to be meaningful, you must first initialize the cells with
561    * cell_set_cell_data()
562    * @return <tt>true</tt>, if any of the cells packed into the @a tree_column  are currently visible.
563    */
564   bool cell_is_visible() const;
565   
566   /** Sets the current keyboard focus to be at @a cell , if the column contains
567    * 2 or more editable and activatable cells.
568    * 
569    * Since: 2.2
570    * @param cell A Gtk::CellRenderer.
571    */
572   void focus_cell(CellRenderer& cell);
573
574   
575   /** Obtains the horizontal position and size of a cell in a column. If the
576    * cell is not found in the column, @a start_pos  and @a width  are not changed and
577    * <tt>false</tt> is returned.
578    * @param cell_renderer A Gtk::CellRenderer.
579    * @param start_pos Return location for the horizontal position of @a cell  within
580    *  @a tree_column .
581    * @param width Return location for the width of @a cell .
582    * @return <tt>true</tt> if @a cell  belongs to @a tree_column .
583    */
584   bool get_cell_position(const CellRenderer& cell_renderer, int& start_pos, int& width) const;
585
586   
587   Glib::SignalProxy0< void > signal_clicked();
588
589
590   /** Whether to display the column.
591    *
592    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
593    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
594    * the value of the property changes.
595    */
596   Glib::PropertyProxy<bool> property_visible() ;
597
598 /** Whether to display the column.
599    *
600    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
601    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
602    * the value of the property changes.
603    */
604   Glib::PropertyProxy_ReadOnly<bool> property_visible() const;
605
606   /** Current width of the column.
607    *
608    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
609    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
610    * the value of the property changes.
611    */
612   Glib::PropertyProxy_ReadOnly<int> property_width() const;
613
614
615   /** Resize mode of the column.
616    *
617    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
618    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
619    * the value of the property changes.
620    */
621   Glib::PropertyProxy<TreeViewColumnSizing> property_sizing() ;
622
623 /** Resize mode of the column.
624    *
625    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
626    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
627    * the value of the property changes.
628    */
629   Glib::PropertyProxy_ReadOnly<TreeViewColumnSizing> property_sizing() const;
630
631   /** Current fixed width of the column.
632    *
633    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
634    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
635    * the value of the property changes.
636    */
637   Glib::PropertyProxy<int> property_fixed_width() ;
638
639 /** Current fixed width of the column.
640    *
641    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
642    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
643    * the value of the property changes.
644    */
645   Glib::PropertyProxy_ReadOnly<int> property_fixed_width() const;
646
647   /** Minimum allowed width of the column.
648    *
649    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
650    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
651    * the value of the property changes.
652    */
653   Glib::PropertyProxy<int> property_min_width() ;
654
655 /** Minimum allowed width of the column.
656    *
657    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
658    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
659    * the value of the property changes.
660    */
661   Glib::PropertyProxy_ReadOnly<int> property_min_width() const;
662
663   /** Maximum allowed width of the column.
664    *
665    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
666    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
667    * the value of the property changes.
668    */
669   Glib::PropertyProxy<int> property_max_width() ;
670
671 /** Maximum allowed width of the column.
672    *
673    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
674    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
675    * the value of the property changes.
676    */
677   Glib::PropertyProxy_ReadOnly<int> property_max_width() const;
678
679   /** Title to appear in column header.
680    *
681    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
682    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
683    * the value of the property changes.
684    */
685   Glib::PropertyProxy<Glib::ustring> property_title() ;
686
687 /** Title to appear in column header.
688    *
689    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
690    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
691    * the value of the property changes.
692    */
693   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_title() const;
694
695   /** Column gets share of extra width allocated to the widget.
696    *
697    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
698    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
699    * the value of the property changes.
700    */
701   Glib::PropertyProxy<bool> property_expand() ;
702
703 /** Column gets share of extra width allocated to the widget.
704    *
705    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
706    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
707    * the value of the property changes.
708    */
709   Glib::PropertyProxy_ReadOnly<bool> property_expand() const;
710
711   /** Whether the header can be clicked.
712    *
713    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
714    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
715    * the value of the property changes.
716    */
717   Glib::PropertyProxy<bool> property_clickable() ;
718
719 /** Whether the header can be clicked.
720    *
721    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
722    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
723    * the value of the property changes.
724    */
725   Glib::PropertyProxy_ReadOnly<bool> property_clickable() const;
726
727   /** Widget to put in column header button instead of column title.
728    *
729    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
730    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
731    * the value of the property changes.
732    */
733   Glib::PropertyProxy<Widget*> property_widget() ;
734
735 /** Widget to put in column header button instead of column title.
736    *
737    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
738    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
739    * the value of the property changes.
740    */
741   Glib::PropertyProxy_ReadOnly<Widget*> property_widget() const;
742
743   /** X Alignment of the column header text or widget.
744    *
745    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
746    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
747    * the value of the property changes.
748    */
749   Glib::PropertyProxy<float> property_alignment() ;
750
751 /** X Alignment of the column header text or widget.
752    *
753    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
754    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
755    * the value of the property changes.
756    */
757   Glib::PropertyProxy_ReadOnly<float> property_alignment() const;
758
759   /** Whether the column can be reordered around the headers.
760    *
761    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
762    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
763    * the value of the property changes.
764    */
765   Glib::PropertyProxy<bool> property_reorderable() ;
766
767 /** Whether the column can be reordered around the headers.
768    *
769    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
770    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
771    * the value of the property changes.
772    */
773   Glib::PropertyProxy_ReadOnly<bool> property_reorderable() const;
774
775   /** Whether to show a sort indicator.
776    *
777    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
778    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
779    * the value of the property changes.
780    */
781   Glib::PropertyProxy<bool> property_sort_indicator() ;
782
783 /** Whether to show a sort indicator.
784    *
785    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
786    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
787    * the value of the property changes.
788    */
789   Glib::PropertyProxy_ReadOnly<bool> property_sort_indicator() const;
790
791   /** Sort direction the sort indicator should indicate.
792    *
793    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
794    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
795    * the value of the property changes.
796    */
797   Glib::PropertyProxy<SortType> property_sort_order() ;
798
799 /** Sort direction the sort indicator should indicate.
800    *
801    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
802    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
803    * the value of the property changes.
804    */
805   Glib::PropertyProxy_ReadOnly<SortType> property_sort_order() const;
806
807
808 #ifndef DOXYGEN_SHOULD_SKIP_THIS
809 private:
810   // Only necessary because of the templated ctor, see below.
811   static const Glib::Class& class_init_();
812 #endif //DOXYGEN_SHOULD_SKIP_THIS
813
814
815 };
816
817 #ifndef DOXYGEN_SHOULD_SKIP_THIS
818
819 template<class T_ModelColumnType>
820 void TreeViewColumn::pack_start(const TreeModelColumn<T_ModelColumnType>& column, bool expand)
821 {
822   //Generate appropriate Renderer for the column:
823   CellRenderer* pCellRenderer = manage( CellRenderer_Generation::generate_cellrenderer<T_ModelColumnType>() );
824
825   //Use the renderer:
826   pack_start(*pCellRenderer, expand);
827   set_renderer(*pCellRenderer, column);
828 }
829
830 template<class T_ModelColumnType>
831 void TreeViewColumn::pack_end(const TreeModelColumn<T_ModelColumnType>& column, bool expand)
832 {
833   //Generate appropriate Renderer for the column:
834   CellRenderer* pCellRenderer= manage( CellRenderer_Generation::generate_cellrenderer<T_ModelColumnType>() );
835
836   //Use the renderer:
837   pack_end(*pCellRenderer, expand);
838   set_renderer(*pCellRenderer, column);
839 }
840
841
842 template <class T_ModelColumnType>
843 TreeViewColumn::TreeViewColumn(const Glib::ustring& title,
844                                const TreeModelColumn<T_ModelColumnType>& column)
845 :
846   Glib::ObjectBase(0), // not (yet) a custom class
847   Gtk::Object(Glib::ConstructParams(class_init_(), "title", title.c_str(), (char*) 0))
848 {
849   pack_start(column, true /* expand */);
850 }
851
852
853 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
854
855 } // namespace Gtk
856
857
858 namespace Glib
859 {
860   /** @relates Gtk::TreeViewColumn
861    * @param object The C instance
862    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
863    * @result A C++ instance that wraps this C instance.
864    */
865   Gtk::TreeViewColumn* wrap(GtkTreeViewColumn* object, bool take_copy = false);
866 }
867 #endif /* _GTKMM_TREEVIEWCOLUMN_H */
868