Debian Codegraph @

gtk/gtkmm/childpropertyproxy_base.h

raw symbols SCIP
1 #ifndef _GTKMM_CHILDPROPERTYPROXY_BASE_H
2 #define _GTKMM_CHILDPROPERTYPROXY_BASE_H
3
4 /* childpropertyproxy_base.h
5 *
6 * Copyright (C) 2014 The gtkmm Development Team
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #include <glibmm/value.h>
23 #include <glibmm/propertyproxy_base.h>
24 #include <gtkmm/widget.h>
25
26 #include <sigc++/sigc++.h>
27
28
29 namespace Gtk
30 {
31
32 // We need to reimplement the connect() method so that it uses
33 // "child-notify" as prefix for notify signal.
34 class GTKMM_API SignalProxyChildProperty : public Glib::SignalProxyProperty
35 {
36 public:
37 SignalProxyChildProperty(Widget* child, const char* property_name)
38 : Glib::SignalProxyProperty(child, property_name) {}
39
40 sigc::connection connect(const SlotType& sl);
41 };
42
43 class GTKMM_API Container;
44
45 class GTKMM_API ChildPropertyProxy_Base
46 {
47 public:
48 ChildPropertyProxy_Base(Container* parent, Widget& child, const char* property_name);
49 ChildPropertyProxy_Base(const ChildPropertyProxy_Base& other);
50
51 SignalProxyChildProperty signal_changed();
52
53 Container* get_parent() const { return parent_; }
54 Widget& get_child() const { return child_; }
55 const char* get_name() const { return property_name_; }
56
57 protected:
58 void set_property_(const Glib::ValueBase& value);
59 void get_property_(Glib::ValueBase& value) const;
60 void reset_property_();
61
62 Container* parent_;
63 Widget& child_;
64 const char* property_name_;
65 };
66
67 } // namespace Gtk
68
69 #endif /* _GTKMM_CHILDPROPERTYPROXY_BASE_H */