Debian Codegraph @

gtk/src/cellrenderertext.hg

raw
1 /* Copyright (C) 1998-2002 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 #include <gtkmm/cellrenderer.h>
18 #include <pangomm/attrlist.h>
19 #include <pangomm/fontdescription.h>
20 _DEFS(gtkmm,gtk)
21 _PINCLUDE(gtkmm/private/cellrenderer_p.h)
22
23
24 namespace Gtk
25 {
26
27 /** Renders text in a cell.
28 *
29 * @ingroup TreeView
30 */
31 class GTKMM_API CellRendererText : public CellRenderer
32 {
33 _CLASS_GTKOBJECT(CellRendererText,GtkCellRendererText,GTK_CELL_RENDERER_TEXT,Gtk::CellRenderer,GtkCellRenderer,,,GTKMM_API)
34 public:
35 _CTOR_DEFAULT()
36
37 _WRAP_METHOD(void set_fixed_height_from_font(int number_of_rows), gtk_cell_renderer_text_set_fixed_height_from_font)
38
39 #m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
40 _WRAP_SIGNAL(void edited(const Glib::ustring& path, const Glib::ustring& new_text), "edited")
41
42 _WRAP_PROPERTY("text", Glib::ustring)
43 _WRAP_PROPERTY("markup", Glib::ustring)
44 _WRAP_PROPERTY("attributes", Pango::AttrList)
45 _WRAP_PROPERTY("background", Glib::ustring)
46 _WRAP_PROPERTY("foreground", Glib::ustring)
47 _WRAP_PROPERTY("background-gdk", Gdk::Color, deprecated "Use property_background_rgba() instead.")
48 _WRAP_PROPERTY("foreground-gdk", Gdk::Color, deprecated "Use property_background_rgba() instead.")
49 _WRAP_PROPERTY("background-rgba", Gdk::RGBA)
50 _WRAP_PROPERTY("foreground-rgba", Gdk::RGBA)
51 _WRAP_PROPERTY("font", Glib::ustring)
52 _WRAP_PROPERTY("font-desc", Pango::FontDescription)
53 _WRAP_PROPERTY("family", Glib::ustring)
54 _WRAP_PROPERTY("style", Pango::Style)
55 _WRAP_PROPERTY("variant", Pango::Variant)
56 _WRAP_PROPERTY("weight", int)
57 _WRAP_PROPERTY("stretch", Pango::Stretch)
58 _WRAP_PROPERTY("size", int)
59 _WRAP_PROPERTY("size-points", double)
60 _WRAP_PROPERTY("scale", double)
61 _WRAP_PROPERTY("editable", bool)
62 _WRAP_PROPERTY("strikethrough", bool)
63 _WRAP_PROPERTY("underline", Pango::Underline)
64 _WRAP_PROPERTY("rise", int)
65 _WRAP_PROPERTY("language", Glib::ustring)
66 _WRAP_PROPERTY("ellipsize", Pango::EllipsizeMode)
67 _WRAP_PROPERTY("width-chars", int)
68 _WRAP_PROPERTY("max-width-chars", int)
69 _WRAP_PROPERTY("wrap-mode", Pango::WrapMode)
70 _WRAP_PROPERTY("wrap-width", int)
71 _WRAP_PROPERTY("alignment", Pango::Alignment)
72 _WRAP_PROPERTY("background-set", bool)
73 _WRAP_PROPERTY("foreground-set", bool)
74 _WRAP_PROPERTY("family-set", bool)
75 _WRAP_PROPERTY("style-set", bool)
76 _WRAP_PROPERTY("variant-set", bool)
77 _WRAP_PROPERTY("weight-set", bool)
78 _WRAP_PROPERTY("stretch-set", bool)
79 _WRAP_PROPERTY("size-set", bool)
80 _WRAP_PROPERTY("scale-set", bool)
81 _WRAP_PROPERTY("editable-set", bool)
82 _WRAP_PROPERTY("strikethrough-set", bool)
83 _WRAP_PROPERTY("underline-set", bool)
84 _WRAP_PROPERTY("rise-set", bool)
85 _WRAP_PROPERTY("language-set", bool)
86 _WRAP_PROPERTY("ellipsize-set", bool)
87 _WRAP_PROPERTY("single-paragraph-mode", bool)
88 _WRAP_PROPERTY("align-set", bool)
89 _WRAP_PROPERTY("placeholder-text", Glib::ustring)
90
91 Glib::PropertyProxy_Base _property_renderable() override;
92
93 protected:
94 /** Emits the "edited" signal.
95 * This is useful when implementing custom CellRenderers.
96 */
97 void edited(const Glib::ustring& path, const Glib::ustring& new_text);
98 };
99
100 } // namespace Gtk