Debian Codegraph @

gtk/src/scrollable.hg

raw
1 /* Copyright (C) 2010 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/adjustment.h>
18 #include <gtkmm/border.h>
19 #include <glibmm/interface.h>
20 #include <gtkmm/enums.h>
21 _DEFS(gtkmm,gtk)
22 _PINCLUDE(glibmm/private/interface_p.h)
23
24 #ifndef DOXYGEN_SHOULD_SKIP_THIS
25 extern "C"
26 {
27 typedef struct _GtkScrollableInterface GtkScrollableInterface;
28 }
29 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
30
31 namespace Gtk
32 {
33
34 _WRAP_ENUM(ScrollablePolicy, GtkScrollablePolicy, decl_prefix GTKMM_API)
35
36 /** This interface is implemented by widgets with native
37 * scrolling ability.
38 *
39 * @newin{3,0}
40 */
41 class GTKMM_API Scrollable : public Glib::Interface
42 {
43 _CLASS_INTERFACE(Scrollable, GtkScrollable, GTK_SCROLLABLE, GtkScrollableInterface, , , GTKMM_API)
44
45 public:
46 _WRAP_METHOD(Glib::RefPtr<Adjustment> get_hadjustment(), gtk_scrollable_get_hadjustment, refreturn)
47 _WRAP_METHOD(Glib::RefPtr<const Adjustment> get_hadjustment() const, gtk_scrollable_get_hadjustment, refreturn, constversion)
48
49 _WRAP_METHOD(void set_hadjustment(const Glib::RefPtr<Adjustment>& hadjustment), gtk_scrollable_set_hadjustment)
50
51 /** This method removes the hadjustment.
52 * @see set_hadjustment().
53 */
54 void unset_hadjustment();
55
56 _WRAP_METHOD(Glib::RefPtr<Adjustment> get_vadjustment(), gtk_scrollable_get_vadjustment, refreturn)
57 _WRAP_METHOD(Glib::RefPtr<const Adjustment> get_vadjustment() const, gtk_scrollable_get_vadjustment, refreturn, constversoin)
58
59 _WRAP_METHOD(void set_vadjustment(const Glib::RefPtr<Adjustment>& vadjustment), gtk_scrollable_set_vadjustment)
60
61 /** This method removes the vadjustment.
62 * @see set_vadjustment().
63 */
64 void unset_vadjustment();
65
66 _WRAP_METHOD(ScrollablePolicy get_hscroll_policy() const, gtk_scrollable_get_hscroll_policy)
67 _WRAP_METHOD(void set_hscroll_policy(ScrollablePolicy policy), gtk_scrollable_set_hscroll_policy)
68 _WRAP_METHOD(ScrollablePolicy get_vscroll_policy() const, gtk_scrollable_get_vscroll_policy)
69 _WRAP_METHOD(void set_vscroll_policy(ScrollablePolicy policy), gtk_scrollable_set_vscroll_policy)
70 _WRAP_METHOD(bool get_border(Border& border) const, gtk_scrollable_get_border)
71
72 _WRAP_PROPERTY("hadjustment", Glib::RefPtr<Adjustment>)
73 _WRAP_PROPERTY("vadjustment", Glib::RefPtr<Adjustment>)
74 _WRAP_PROPERTY("hscroll-policy", ScrollablePolicy)
75 _WRAP_PROPERTY("vscroll-policy", ScrollablePolicy)
76
77 //TODO: Add when we can break ABI:
78 //_WRAP_VFUNC(bool get_border(Border& border) const, get_border)
79 };
80
81 } // namespace Gtk