/* Copyright (C) 2012 The gtkmm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see . */ _CONFIGINCLUDE(gtkmmconfig.h) #include _DEFS(gtkmm,gtk) _PINCLUDE(glibmm/private/interface_p.h) #ifndef DOXYGEN_SHOULD_SKIP_THIS extern "C" { typedef struct _GtkActionableInterface GtkActionableInterface; } #endif /* DOXYGEN_SHOULD_SKIP_THIS */ namespace Gtk { //TODO: Have the appropriate widgets derive from this interface when there is //an ABI break. See: //https://docs.gtk.org/gtk3/iface.Actionable.html#implementations. /** This interface provides a convenient way of associating widgets with * actions on a ApplicationWindow or Application. * * It primarily consists of two properties: "action-name" and "action-target". * There are also some convenience APIs for setting these properties. * * This interface is presently only meaningful if used on a widget that is (or * will be) located inside of a ApplicationWindow and can only be used to * associate the widget with actions on that window, or its associated * Application. * @newin{3,4} */ class GTKMM_API Actionable : public Glib::Interface { _CLASS_INTERFACE(Actionable, GtkActionable, GTK_ACTIONABLE, GtkActionableInterface, , , GTKMM_API) public: _WRAP_METHOD(Glib::ustring get_action_name() const, gtk_actionable_get_action_name) _WRAP_METHOD(void set_action_name(const Glib::ustring& action_name), gtk_actionable_set_action_name) #m4 _CONVERSION(`GVariant*',`Glib::VariantBase',`Glib::wrap($3,true)') _WRAP_METHOD(Glib::VariantBase get_action_target_value(), gtk_actionable_get_action_target_value) _WRAP_METHOD(const Glib::VariantBase get_action_target_value() const, gtk_actionable_get_action_target_value, constversion) _WRAP_METHOD(void set_action_target_value(const Glib::VariantBase& target_value), gtk_actionable_set_action_target_value) _IGNORE(gtk_actionable_set_action_target) //gtk_actionable_set_action_target() is just a C convenience method. _WRAP_METHOD(void set_detailed_action_name(const Glib::ustring& detailed_action_name), gtk_actionable_set_detailed_action_name) _WRAP_PROPERTY("action-name", Glib::ustring) _WRAP_PROPERTY("action-target", Glib::VariantBase) #m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.empty() ? nullptr : $3.c_str()') _WRAP_VFUNC(Glib::ustring get_action_name() const, "get_action_name", keep_return) _WRAP_VFUNC(void set_action_name(const Glib::ustring& action_name), "set_action_name") #m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj()') _WRAP_VFUNC(Glib::VariantBase get_action_target_value() const, "get_action_target_value", keep_return) #m4 _CONVERSION(`GVariant*',`const Glib::VariantBase&',`Glib::wrap($3,true)') _WRAP_VFUNC(void set_action_target_value(const Glib::VariantBase& action_target_value), "set_action_target_value") }; } // namespace Gtk