Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / cellview.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_CELLVIEW_H
4 #define _GTKMM_CELLVIEW_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* cellview.h
11  * 
12  * Copyright (C) 2004 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 Library General Public
16  * License as published by the Free Software Foundation; either
17  * version 2 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  * Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU Library 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
30 #include <gtkmm/widget.h>
31 #include <gtkmm/celllayout.h>
32 #include <gtkmm/treemodel.h>
33 #include <gtkmm/treepath.h>
34 #include <gtkmm/cellrenderer.h>
35 #include <gdkmm/pixbuf.h>
36
37
38 #ifndef DOXYGEN_SHOULD_SKIP_THIS
39 typedef struct _GtkCellView GtkCellView;
40 typedef struct _GtkCellViewClass GtkCellViewClass;
41 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
42
43
44 namespace Gtk
45 { class CellView_Class; } // namespace Gtk
46 namespace Gtk
47 {
48
49 /** A widget displaying a single row of a TreeModel.
50  * A CellView displays a single row of a TreeModel, using cell renderers just like TreeView. CellView doesn't support some of the more 
51  * complex features of GtkTreeView, like cell editing and drag and drop.
52  *
53  * @ingroup Widgets
54  */
55
56 class CellView :
57   public Widget,
58   public CellLayout
59 {
60   public:
61 #ifndef DOXYGEN_SHOULD_SKIP_THIS
62   typedef CellView CppObjectType;
63   typedef CellView_Class CppClassType;
64   typedef GtkCellView BaseObjectType;
65   typedef GtkCellViewClass BaseClassType;
66 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
67
68   virtual ~CellView();
69
70 #ifndef DOXYGEN_SHOULD_SKIP_THIS
71
72 private:
73   friend class CellView_Class;
74   static CppClassType cellview_class_;
75
76   // noncopyable
77   CellView(const CellView&);
78   CellView& operator=(const CellView&);
79
80 protected:
81   explicit CellView(const Glib::ConstructParams& construct_params);
82   explicit CellView(GtkCellView* castitem);
83
84 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
85
86 public:
87 #ifndef DOXYGEN_SHOULD_SKIP_THIS
88   static GType get_type()      G_GNUC_CONST;
89   static GType get_base_type() G_GNUC_CONST;
90 #endif
91
92   ///Provides access to the underlying C GtkObject.
93   GtkCellView*       gobj()       { return reinterpret_cast<GtkCellView*>(gobject_); }
94
95   ///Provides access to the underlying C GtkObject.
96   const GtkCellView* gobj() const { return reinterpret_cast<GtkCellView*>(gobject_); }
97
98
99 public:
100   //C++ methods used to invoke GTK+ virtual functions:
101
102 protected:
103   //GTK+ Virtual Functions (override these to change behaviour):
104
105   //Default Signal Handlers::
106
107
108 private:
109
110   
111 public:
112   CellView();
113   
114   /** Creates a new CellView widget, adds a CellRendererText to it, and makes it show the text. 
115    * Optionally, the text can be marked up with the Pango text markup language.
116    *
117    * @param text The text to display in the cell view
118    * @param markup Whether the @a text uses Pango text markup language.
119    */
120   explicit CellView(const Glib::ustring& text, bool use_markup = false);
121   
122   
123   /** Creates a new CellView widget, adds a CellRendererPixbuf to it, and makes it show the pixbuf.
124    *
125    * @param pixbuf The image to display in the cell view
126    * @param markup Whether the @a text uses Pango text markup language.
127    */
128   explicit CellView(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
129   
130
131   //_WRAP_METHOD(void set_value(CellRenderer& renderer, const Glib::ustring& property, const Glib::ValueBase& value), gtk_cell_view_set_value)
132   
133
134   /** Sets the model for @a cell_view .  If @a cell_view  already has a model
135    * set, it will remove it before setting the new model.  If @a model  is 
136    * <tt>0</tt>, then it will unset the old model.
137    * 
138    * Since: 2.6
139    * @param model A Gtk::TreeModel.
140    */
141   void set_model(const Glib::RefPtr<TreeModel>& model);
142   
143   /** Sets the row of the model that is currently displayed
144    * by the Gtk::CellView. If the path is unset, then the
145    * contents of the cellview "stick" at their last value;
146    * this is not normally a desired result, but may be
147    * a needed intermediate state if say, the model for
148    * the Gtk::CellView becomes temporarily empty.
149    * 
150    * Since: 2.6
151    * @param path A Gtk::TreePath or <tt>0</tt> to unset.
152    */
153   void set_displayed_row(const TreeModel::Path& path);
154   
155   TreeModel::Path get_displayed_row() const;
156   
157   /** Sets @a requisition  to the size needed by @a cell_view  to display 
158    * the model row pointed to by @a path .
159    * @param path A Gtk::TreePath.
160    * @param requisition Return location for the size.
161    * @return <tt>true</tt>
162    * 
163    * Since: 2.6.
164    */
165   bool get_size_of_row(const TreeModel::Path& path, Requisition& requisition) const;
166
167   
168   /** Sets the background color of @a view .
169    * 
170    * Since: 2.6
171    * @param color The new background color.
172    */
173   void set_background_color(const Gdk::Color& color);
174
175   
176   /** Returns the cell renderers which have been added to @a cell_view .
177    * @return A list of cell renderers. The list, but not the
178    * renderers has been newly allocated and should be freed with
179    * Glib::list_free() when no longer needed.
180    * 
181    * Since: 2.6.
182    */
183   Glib::ListHandle<CellRenderer*> get_cell_renderers();
184   
185   /** Returns the cell renderers which have been added to @a cell_view .
186    * @return A list of cell renderers. The list, but not the
187    * renderers has been newly allocated and should be freed with
188    * Glib::list_free() when no longer needed.
189    * 
190    * Since: 2.6.
191    */
192   Glib::ListHandle<const CellRenderer*> get_cell_renderers() const;
193
194
195 };
196
197 } // namespace Gtk
198
199
200 namespace Glib
201 {
202   /** @relates Gtk::CellView
203    * @param object The C instance
204    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
205    * @result A C++ instance that wraps this C instance.
206    */
207   Gtk::CellView* wrap(GtkCellView* object, bool take_copy = false);
208 }
209 #endif /* _GTKMM_CELLVIEW_H */
210