1
// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3
/* Copyright (C) 2012 The gtkmm Development Team
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free
17
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
#include <glibmm/interface.h>
23
_PINCLUDE(glibmm/private/interface_p.h)
25
#ifndef DOXYGEN_SHOULD_SKIP_THIS
28
typedef struct _GtkActionableInterface GtkActionableInterface;
30
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
35
//TODO: Have the appropriate widgets derive from this interface when there is
37
//http://developer.gnome.org/gtk3/3.3/GtkActionable.html#GtkActionable.implementations.
39
/** This interface provides a convenient way of associating widgets with
40
* actions on a ApplicationWindow or Application.
42
* It primarily consists of two properties: "action-name" and "action-target".
43
* There are also some convenience APIs for setting these properties.
45
* This interface is presently only meaningful if used on a widget that is (or
46
* will be) located inside of a ApplicationWindow and can only be used to
47
* associate the widget with actions on that window, or its associated
51
class Actionable : public Glib::Interface
53
_CLASS_INTERFACE(Actionable, GtkActionable, GTK_ACTIONABLE, GtkActionableInterface)
56
_WRAP_METHOD(Glib::ustring get_action_name() const, gtk_actionable_get_action_name)
57
_WRAP_METHOD(void set_action_name(const Glib::ustring& action_name), gtk_actionable_set_action_name)
59
_WRAP_METHOD(Glib::VariantBase get_action_target_value(), gtk_actionable_get_action_target_value)
60
_WRAP_METHOD(const Glib::VariantBase get_action_target_value() const, gtk_actionable_get_action_target_value, constversion)
62
_WRAP_METHOD(void set_action_target_value(const Glib::VariantBase& target_value), gtk_actionable_set_action_target_value)
64
//TODO: _WRAP_METHOD(void set_action_target(const char* format_string, ...), gtk_actionable_set_action_target)
66
_WRAP_METHOD(void set_detailed_action_name(const Glib::ustring& detailed_action_name), gtk_actionable_set_detailed_action_name)
68
_WRAP_PROPERTY("action-name", Glib::ustring)
69
_WRAP_PROPERTY("action-target", Glib::VariantBase)
71
#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.c_str()')
72
_WRAP_VFUNC(Glib::ustring get_action_name() const, "get_action_name")
74
_WRAP_VFUNC(void set_action_name(const Glib::ustring& action_name), "set_action_name")
76
#m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj()')
77
_WRAP_VFUNC(Glib::VariantBase get_action_target_value() const, "get_action_target_value")
79
#m4 _CONVERSION(`GVariant*',`const Glib::VariantBase&',`Glib::wrap($3,true)')
80
_WRAP_VFUNC(void set_action_target_value(const Glib::VariantBase& action_target_value), "set_action_target_value")