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