Debian Codegraph @

gtk/src/cellview.hg

raw
1 /* Copyright (C) 2004 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 _CONFIGINCLUDE(gtkmmconfig.h)
18
19 #include <gtkmm/widget.h>
20 #include <gtkmm/celllayout.h>
21 #include <gtkmm/treemodel.h>
22 #include <gtkmm/treepath.h>
23 #include <gtkmm/cellrenderer.h>
24 #include <gtkmm/cellarea.h>
25 #include <gtkmm/cellareacontext.h>
26 #include <gtkmm/orientable.h>
27 #include <gdkmm/pixbuf.h>
28 #include <gdkmm/rgba.h>
29
30 _DEFS(gtkmm,gtk)
31 _PINCLUDE(gtkmm/private/widget_p.h)
32
33 namespace Gtk
34 {
35
36 /** A widget displaying a single row of a TreeModel.
37 * A CellView displays a single row of a TreeModel, using cell renderers just like TreeView. CellView doesn't support some of the more
38 * complex features of GtkTreeView, like cell editing and drag and drop.
39 *
40 * @ingroup Widgets
41 */
42 class GTKMM_API CellView :
43 public Widget,
44 public CellLayout,
45 public Orientable
46 {
47 _CLASS_GTKOBJECT(CellView, GtkCellView, GTK_CELL_VIEW, Gtk::Widget, GtkWidget, , , GTKMM_API)
48 _IMPLEMENTS_INTERFACE(CellLayout)
49 _IMPLEMENTS_INTERFACE(Orientable)
50
51 public:
52 _CTOR_DEFAULT()
53
54 /** Creates a new CellView widget, adds a CellRendererText to it, and makes it show the text.
55 * Optionally, the text can be marked up with the Pango text markup language.
56 *
57 * @param text The text to display in the cell view
58 * @param use_markup Whether the @a text uses Pango text markup language.
59 */
60 explicit CellView(const Glib::ustring& text, bool use_markup = false);
61 _IGNORE(gtk_cell_view_new_with_text, gtk_cell_view_new_with_markup)
62
63 /** Creates a new CellView widget, adds a CellRendererPixbuf to it, and makes it show the pixbuf.
64 *
65 * @param pixbuf The image to display in the cell view
66 */
67 explicit CellView(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
68 _IGNORE(gtk_cell_view_new_with_pixbuf)
69
70 _WRAP_METHOD(void set_model(const Glib::RefPtr<TreeModel>& model), gtk_cell_view_set_model)
71
72 /** Remove the model from the CellView.
73 *
74 * @see set_model().
75 *
76 * @newin{2,16}
77 */
78 void unset_model();
79
80 _WRAP_METHOD(Glib::RefPtr<TreeModel> get_model(), gtk_cell_view_get_model, refreturn)
81 _WRAP_METHOD(Glib::RefPtr<const TreeModel> get_model() const, gtk_cell_view_get_model, refreturn, constversion)
82
83 _WRAP_METHOD(void set_displayed_row(const TreeModel::Path& path), gtk_cell_view_set_displayed_row)
84 _WRAP_METHOD(TreeModel::Path get_displayed_row() const, gtk_cell_view_get_displayed_row)
85 _IGNORE(gtk_cell_view_get_size_of_row) //deprecated
86
87 _WRAP_METHOD(void set_background_color(const Gdk::Color& color), gtk_cell_view_set_background_color, deprecated "Use set_background_rgba instead.")
88 _WRAP_METHOD(void set_background_rgba(const Gdk::RGBA& rgba), gtk_cell_view_set_background_rgba)
89
90 _WRAP_METHOD(bool get_draw_sensitive() const, gtk_cell_view_get_draw_sensitive)
91 _WRAP_METHOD(void set_draw_sensitive(bool draw_sensitive = true), gtk_cell_view_set_draw_sensitive)
92 _WRAP_METHOD(bool get_fit_model() const, gtk_cell_view_get_fit_model)
93 _WRAP_METHOD(void set_fit_model(bool fit_model = true), gtk_cell_view_set_fit_model)
94
95 _WRAP_PROPERTY("background", Glib::ustring)
96 _WRAP_PROPERTY("background-gdk", Gdk::Color, deprecated "Use property_background_rgba() instead.")
97 _WRAP_PROPERTY("background-rgba", Gdk::RGBA)
98 _WRAP_PROPERTY("background-set", bool)
99 _WRAP_PROPERTY("model", Glib::RefPtr<TreeModel>)
100 _WRAP_PROPERTY("cell-area", Glib::RefPtr<CellArea>)
101 _WRAP_PROPERTY("cell-area-context", Glib::RefPtr<CellAreaContext>)
102 _WRAP_PROPERTY("draw-sensitive", bool)
103 _WRAP_PROPERTY("fit-model", bool)
104 };
105
106 } // namespace Gtk