Ardour  9.0-pre0-582-g084a23a80d
treeviewcolumn.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREEVIEWCOLUMN_H
4 #define _GTKMM_TREEVIEWCOLUMN_H
5 
6 #include <gtkmmconfig.h>
7 
8 
9 #include <glibmm/ustring.h>
10 #include <sigc++/sigc++.h>
11 
12 /* Copyright(C) 2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or(at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29  // This is for including the config header before any code (such as
30 // the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
31 
32 
33 #include <gtkmm/object.h>
34 #include <gtkmm/widget.h>
35 #include <gdkmm/window.h>
36 #include <gtkmm/treeiter.h>
37 #include <gtkmm/treemodel.h>
38 #include <glibmm/listhandle.h>
40 
41 
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
45 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
46 
47 
48 namespace Gtk
49 { class TreeViewColumn_Class; } // namespace Gtk
50 namespace Gtk
51 {
52 
53 
61 {
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 class TreeView;
96 
103 class GTKMM_API TreeViewColumn : public Gtk::Object
104 {
105  public:
106 #ifndef DOXYGEN_SHOULD_SKIP_THIS
107  typedef TreeViewColumn CppObjectType;
108  typedef TreeViewColumn_Class CppClassType;
109  typedef GtkTreeViewColumn BaseObjectType;
110  typedef GtkTreeViewColumnClass BaseClassType;
111 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
112 
113  virtual ~TreeViewColumn();
114 
115 #ifndef DOXYGEN_SHOULD_SKIP_THIS
116 
117 private:
118  friend class TreeViewColumn_Class;
119  static CppClassType treeviewcolumn_class_;
120 
121  // noncopyable
123  TreeViewColumn& operator=(const TreeViewColumn&);
124 
125 protected:
126  explicit TreeViewColumn(const Glib::ConstructParams& construct_params);
127  explicit TreeViewColumn(GtkTreeViewColumn* castitem);
128 
129 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
130 
131 public:
132 #ifndef DOXYGEN_SHOULD_SKIP_THIS
133  static GType get_type() G_GNUC_CONST;
134 
135 
136  static GType get_base_type() G_GNUC_CONST;
137 #endif
138 
140  GtkTreeViewColumn* gobj() { return reinterpret_cast<GtkTreeViewColumn*>(gobject_); }
141 
143  const GtkTreeViewColumn* gobj() const { return reinterpret_cast<GtkTreeViewColumn*>(gobject_); }
144 
145 
146 public:
147  //C++ methods used to invoke GTK+ virtual functions:
148 
149 protected:
150  //GTK+ Virtual Functions (override these to change behaviour):
151 
152  //Default Signal Handlers::
154  virtual void on_clicked();
155 
156 
157 private:
158 
159 
160 public:
162 
164 
165  explicit TreeViewColumn(const Glib::ustring& title);
166  TreeViewColumn(const Glib::ustring& title, CellRenderer& cell);
167 
170  template<class T_ModelColumnType>
171  TreeViewColumn(const Glib::ustring& title, const TreeModelColumn<T_ModelColumnType>& column);
172 
173 
181  void pack_start(CellRenderer& cell, bool expand = true);
182 
190  void pack_end(CellRenderer& cell, bool expand = true);
191 
202  template<class T_ModelColumnType>
203  void pack_start(const TreeModelColumn<T_ModelColumnType>& column, bool expand = true);
204 
215  template<class T_ModelColumnType>
216  void pack_end(const TreeModelColumn<T_ModelColumnType>& column, bool expand = true);
217 
218 
221  void clear();
222 
223  //We replaced get_first_cell() with get_first_cell() because that
224  //is the name of the method in CellLayout, which this class derives from in gtkmm-3.0.
225  //That allows more code to be ported before actually using gtkmm-3.0.
226 
232 
237  const CellRenderer* get_first_cell() const;
238 
239  #ifndef GTKMM_DISABLE_DEPRECATED
240 
248 
256  #endif // GTKMM_DISABLE_DEPRECATED
257 
258 
259  // TODO: Should be deprecated, but we cannot derive from CellLayout
260  // without breaking API and ABI.
261 
267  Glib::ListHandle<CellRenderer*> get_cell_renderers();
268 
274  Glib::ListHandle<const CellRenderer*> get_cell_renderers() const;
275 
276 
288  void add_attribute(CellRenderer& cell_renderer, const Glib::ustring& attribute, int column);
289 
290  void add_attribute(const Glib::PropertyProxy_Base& property, const TreeModelColumnBase& column);
291 
292  void add_attribute(Gtk::CellRenderer& cell, const Glib::ustring& property_name, const TreeModelColumnBase& column);
293 
294 
300  void set_renderer(Gtk::CellRenderer& renderer, const TreeModelColumnBase& column);
301 
302  // _WRAP_METHOD(void set_attributes(CellRenderer& cell_renderer, ...), )
303 
310  typedef sigc::slot<void, CellRenderer*, const Gtk::TreeModel::iterator&> SlotCellData;
311 
321  void set_cell_data_func(CellRenderer& cell_renderer, const SlotCellData& slot);
322 
325  void unset_cell_data_func(CellRenderer& cell_renderer);
326 
327 
333  void clear_attributes(CellRenderer& cell_renderer);
334 
340  void set_spacing(int spacing);
341 
346  int get_spacing() const;
347 
352  void set_visible(bool visible = true);
353 
359  bool get_visible() const;
360 
368  void set_resizable(bool resizable = true);
369 
374  bool get_resizable() const;
375 
381 
387 
392  int get_width() const;
393 
399  int get_fixed_width() const;
400 
409  void set_fixed_width(int fixed_width);
410 
416  void set_min_width(int min_width);
417 
423  int get_min_width() const;
424 
432  void set_max_width(int max_width);
433 
439  int get_max_width() const;
440 
444  void clicked();
445 
446 
452  void set_title(const Glib::ustring& title);
453 
459  Glib::ustring get_title() const;
460 
461 
469  void set_expand(bool expand = true);
470 
475  bool get_expand() const;
476 
477 
483  void set_clickable(bool clickable = true);
484 
489  bool get_clickable() const;
490 
496  void set_widget(Gtk::Widget& widget);
497 
505 
512  const Widget* get_widget() const;
513 
514 
521  void set_alignment(float xalign);
522 
530 
531 
537  float get_alignment() const;
538 
544  void set_reorderable(bool reorderable = true);
545 
550  bool get_reorderable() const;
551 
552 
558  void set_sort_column(const TreeModelColumnBase& sort_column_id);
559 
565  void set_sort_column(int sort_column_id);
566 
567  #ifndef GTKMM_DISABLE_DEPRECATED
568 
571  void set_sort_column_id(const TreeModelColumnBase& sort_column_id);
572 
575  void set_sort_column_id(int sort_column_id);
576  #endif // GTKMM_DISABLE_DEPRECATED
577 
578 
586  int get_sort_column_id() const;
587 
595  void set_sort_indicator(bool setting);
596 
601  bool get_sort_indicator() const;
602 
618 
624 
625 
636  void cell_set_cell_data(const Glib::RefPtr<TreeModel>& tree_model, const TreeModel::iterator& iter, bool is_expander, bool is_expanded);
637 
638  //This is obviously a bad cast, but we need it to preserve this (wrong) deprecated version of this function:
639 
640 
641 #ifndef GTKMM_DISABLE_DEPRECATED
642 
654  void cell_get_size(Gdk::Rectangle& cell_area, int& x_offset, int& y_offset, int& width, int& height) const;
655 #endif // GTKMM_DISABLE_DEPRECATED
656 
657 
658  //TODO: cell_area can be NULL. Add a method override.
659  //But see http://bugzilla.gnome.org/show_bug.cgi?id=542329 about the lack of C documentation.
660 
670  void cell_get_size(const Gdk::Rectangle& cell_area, int& x_offset, int& y_offset, int& width, int& height) const;
671 
672 
679  bool cell_is_visible() const;
680 
687 
688 
699  bool get_cell_position(const CellRenderer& cell_renderer, int& start_pos, int& width) const;
700 
704  void queue_resize();
705 
706 
715 
723  const TreeView* get_tree_view() const;
724 
725 
732  Glib::SignalProxy0< void > signal_clicked();
733 
734 
740  Glib::PropertyProxy< bool > property_visible() ;
741 
747  Glib::PropertyProxy_ReadOnly< bool > property_visible() const;
748 
754  Glib::PropertyProxy< bool > property_resizable() ;
755 
761  Glib::PropertyProxy_ReadOnly< bool > property_resizable() const;
762 
768  Glib::PropertyProxy_ReadOnly< int > property_width() const;
769 
770 
776  Glib::PropertyProxy< int > property_spacing() ;
777 
783  Glib::PropertyProxy_ReadOnly< int > property_spacing() const;
784 
790  Glib::PropertyProxy< TreeViewColumnSizing > property_sizing() ;
791 
797  Glib::PropertyProxy_ReadOnly< TreeViewColumnSizing > property_sizing() const;
798 
804  Glib::PropertyProxy< int > property_fixed_width() ;
805 
811  Glib::PropertyProxy_ReadOnly< int > property_fixed_width() const;
812 
818  Glib::PropertyProxy< int > property_min_width() ;
819 
825  Glib::PropertyProxy_ReadOnly< int > property_min_width() const;
826 
832  Glib::PropertyProxy< int > property_max_width() ;
833 
839  Glib::PropertyProxy_ReadOnly< int > property_max_width() const;
840 
846  Glib::PropertyProxy< Glib::ustring > property_title() ;
847 
853  Glib::PropertyProxy_ReadOnly< Glib::ustring > property_title() const;
854 
860  Glib::PropertyProxy< bool > property_expand() ;
861 
867  Glib::PropertyProxy_ReadOnly< bool > property_expand() const;
868 
874  Glib::PropertyProxy< bool > property_clickable() ;
875 
881  Glib::PropertyProxy_ReadOnly< bool > property_clickable() const;
882 
888  Glib::PropertyProxy< Widget* > property_widget() ;
889 
895  Glib::PropertyProxy_ReadOnly< Widget* > property_widget() const;
896 
902  Glib::PropertyProxy< float > property_alignment() ;
903 
909  Glib::PropertyProxy_ReadOnly< float > property_alignment() const;
910 
916  Glib::PropertyProxy< bool > property_reorderable() ;
917 
923  Glib::PropertyProxy_ReadOnly< bool > property_reorderable() const;
924 
930  Glib::PropertyProxy< bool > property_sort_indicator() ;
931 
937  Glib::PropertyProxy_ReadOnly< bool > property_sort_indicator() const;
938 
944  Glib::PropertyProxy< SortType > property_sort_order() ;
945 
951  Glib::PropertyProxy_ReadOnly< SortType > property_sort_order() const;
952 
958  Glib::PropertyProxy< int > property_sort_column_id() ;
959 
965  Glib::PropertyProxy_ReadOnly< int > property_sort_column_id() const;
966 
967 
968 #ifndef DOXYGEN_SHOULD_SKIP_THIS
969 private:
970  // Only necessary because of the templated ctor, see below.
971  static const Glib::Class& class_init_();
972 #endif //DOXYGEN_SHOULD_SKIP_THIS
973 
974 
975 };
976 
977 #ifndef DOXYGEN_SHOULD_SKIP_THIS
978 
979 template<class T_ModelColumnType> inline
980 void TreeViewColumn::pack_start(const TreeModelColumn<T_ModelColumnType>& column, bool expand)
981 {
982  //Generate appropriate Renderer for the column:
983  CellRenderer* pCellRenderer = manage( CellRenderer_Generation::generate_cellrenderer<T_ModelColumnType>() );
984 
985  //Use the renderer:
986  pack_start(*pCellRenderer, expand);
987  set_renderer(*pCellRenderer, column);
988 }
989 
990 template<class T_ModelColumnType> inline
991 void TreeViewColumn::pack_end(const TreeModelColumn<T_ModelColumnType>& column, bool expand)
992 {
993  //Generate appropriate Renderer for the column:
994  CellRenderer* pCellRenderer= manage( CellRenderer_Generation::generate_cellrenderer<T_ModelColumnType>() );
995 
996  //Use the renderer:
997  pack_end(*pCellRenderer, expand);
998  set_renderer(*pCellRenderer, column);
999 }
1000 
1001 template <class T_ModelColumnType> inline
1002 TreeViewColumn::TreeViewColumn(const Glib::ustring& title,
1003  const TreeModelColumn<T_ModelColumnType>& column)
1004 :
1005  Glib::ObjectBase(0), // not (yet) a custom class
1006  Gtk::Object(Glib::ConstructParams(class_init_(), "title", title.c_str(), (char*) 0))
1007 {
1008  pack_start(column, true /* expand */);
1009 }
1010 
1011 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
1012 
1013 } // namespace Gtk
1014 
1015 
1016 namespace Glib
1017 {
1026  Gtk::TreeViewColumn* wrap(GtkTreeViewColumn* object, bool take_copy = false);
1027 } //namespace Glib
1028 
1029 
1030 #endif /* _GTKMM_TREEVIEWCOLUMN_H */
1031 
void set_renderer(Gtk::CellRenderer &renderer, const TreeModelColumnBase &column)
void focus_cell(CellRenderer &cell)
void set_sort_column_id(int sort_column_id)
virtual void on_clicked()
This is a default handler for the signal signal_clicked().
const CellRenderer * get_first_cell() const
void set_alignment(float xalign)
void cell_get_size(const Gdk::Rectangle &cell_area, int &x_offset, int &y_offset, int &width, int &height) const
void add_attribute(CellRenderer &cell_renderer, const Glib::ustring &attribute, int column)
const Widget * get_widget() const
Glib::PropertyProxy< float > property_alignment()
Glib::PropertyProxy< bool > property_reorderable()
Glib::PropertyProxy< bool > property_sort_indicator()
Glib::PropertyProxy< TreeViewColumnSizing > property_sizing()
void set_expand(bool expand=true)
void set_clickable(bool clickable=true)
void set_reorderable(bool reorderable=true)
TreeViewColumn(const Glib::ustring &title, CellRenderer &cell)
Glib::PropertyProxy_ReadOnly< Widget * > property_widget() const
bool get_visible() const
void pack_start(CellRenderer &cell, bool expand=true)
Glib::PropertyProxy_ReadOnly< bool > property_resizable() const
void set_sort_order(SortType order)
Glib::PropertyProxy_ReadOnly< float > property_alignment() const
bool get_resizable() const
Glib::PropertyProxy_ReadOnly< bool > property_reorderable() const
bool cell_is_visible() const
Glib::PropertyProxy< bool > property_visible()
void set_widget(Gtk::Widget &widget)
Glib::PropertyProxy_ReadOnly< bool > property_clickable() const
void set_title(const Glib::ustring &title)
Glib::PropertyProxy_ReadOnly< int > property_max_width() const
virtual ~TreeViewColumn()
Glib::PropertyProxy_ReadOnly< bool > property_expand() const
Glib::PropertyProxy_ReadOnly< SortType > property_sort_order() const
Glib::PropertyProxy_ReadOnly< int > property_sort_column_id() const
void set_sort_indicator(bool setting)
Glib::ListHandle< const CellRenderer * > get_cell_renderers() const
void set_sort_column(const TreeModelColumnBase &sort_column_id)
void pack_end(const TreeModelColumn< T_ModelColumnType > &column, bool expand=true)
CellRenderer * get_first_cell_renderer()
Glib::PropertyProxy< int > property_min_width()
void set_spacing(int spacing)
void set_alignment(AlignmentEnum xalign)
Glib::PropertyProxy< int > property_max_width()
sigc::slot< void, CellRenderer *, const Gtk::TreeModel::iterator & > SlotCellData
Glib::PropertyProxy< int > property_sort_column_id()
void set_sort_column(int sort_column_id)
TreeViewColumn(const Glib::ustring &title, const TreeModelColumn< T_ModelColumnType > &column)
int get_sort_column_id() const
Widget * get_widget()
Glib::PropertyProxy_ReadOnly< bool > property_sort_indicator() const
void set_cell_data_func(CellRenderer &cell_renderer, const SlotCellData &slot)
void unset_cell_data_func(CellRenderer &cell_renderer)
Glib::PropertyProxy_ReadOnly< int > property_min_width() const
TreeViewColumn(const Glib::ustring &title)
Gtk::TreeViewColumn * wrap(GtkTreeViewColumn *object, bool take_copy=false)
const GtkTreeViewColumn * gobj() const
Provides access to the underlying C GtkObject.
const CellRenderer * get_first_cell_renderer() const
bool get_clickable() const
void add_attribute(const Glib::PropertyProxy_Base &property, const TreeModelColumnBase &column)
void add_attribute(Gtk::CellRenderer &cell, const Glib::ustring &property_name, const TreeModelColumnBase &column)
Glib::PropertyProxy< int > property_fixed_width()
void set_sizing(TreeViewColumnSizing type)
void clear_attributes(CellRenderer &cell_renderer)
int get_max_width() const
bool get_reorderable() const
Glib::PropertyProxy_ReadOnly< int > property_fixed_width() const
int get_spacing() const
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_title() const
Glib::PropertyProxy< int > property_spacing()
int get_width() const
Glib::PropertyProxy_ReadOnly< bool > property_visible() const
void set_visible(bool visible=true)
Glib::PropertyProxy< bool > property_resizable()
bool get_cell_position(const CellRenderer &cell_renderer, int &start_pos, int &width) const
Glib::PropertyProxy< bool > property_expand()
void pack_end(CellRenderer &cell, bool expand=true)
void cell_set_cell_data(const Glib::RefPtr< TreeModel > &tree_model, const TreeModel::iterator &iter, bool is_expander, bool is_expanded)
Glib::PropertyProxy< SortType > property_sort_order()
void pack_start(const TreeModelColumn< T_ModelColumnType > &column, bool expand=true)
Glib::PropertyProxy< Widget * > property_widget()
Glib::PropertyProxy_ReadOnly< int > property_width() const
void set_resizable(bool resizable=true)
void cell_get_size(Gdk::Rectangle &cell_area, int &x_offset, int &y_offset, int &width, int &height) const
CellRenderer * get_first_cell()
TreeView * get_tree_view()
bool get_expand() const
void set_min_width(int min_width)
GtkTreeViewColumn * gobj()
Provides access to the underlying C GtkObject.
float get_alignment() const
Glib::PropertyProxy_ReadOnly< int > property_spacing() const
TreeViewColumnSizing get_sizing()
Glib::PropertyProxy< bool > property_clickable()
TreeViewColumn Column
Glib::SignalProxy0< void > signal_clicked()
bool get_sort_indicator() const
SortType get_sort_order() const
int get_fixed_width() const
Glib::PropertyProxy_ReadOnly< TreeViewColumnSizing > property_sizing() const
Glib::PropertyProxy< Glib::ustring > property_title()
Glib::ustring get_title() const
void set_max_width(int max_width)
Glib::ListHandle< CellRenderer * > get_cell_renderers()
int get_min_width() const
void set_sort_column_id(const TreeModelColumnBase &sort_column_id)
const TreeView * get_tree_view() const
void set_fixed_width(int fixed_width)
TreeViewColumnSizing
@ TREE_VIEW_COLUMN_AUTOSIZE
@ TREE_VIEW_COLUMN_GROW_ONLY
@ TREE_VIEW_COLUMN_FIXED
PBD::PropertyDescriptor< uint32_t > order
Definition: ardour_ui.h:188
T * manage(T *obj)
Definition: object.h:58
Definition: lobject.h:100
gint height
Definition: xcursors.h:1
gint width
Definition: xcursors.h:1