~ubuntu-branches/ubuntu/quantal/gtkmm3.0/quantal

« back to all changes in this revision

Viewing changes to gtk/src/actionable.hg

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-03-01 23:42:36 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20120301234236-12w6m0hkomhi7h53
Tags: 3.3.16-0ubuntu1
* New upstream version
* debian/control.in: updated the glib requirement

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 
2
 
 
3
/* Copyright (C) 2012 The gtkmm Development Team
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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.
 
18
 */
 
19
 
 
20
#include <glibmm/interface.h>
 
21
 
 
22
_DEFS(gtkmm,gtk)
 
23
_PINCLUDE(glibmm/private/interface_p.h)
 
24
 
 
25
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
26
extern "C"
 
27
{
 
28
typedef struct _GtkActionableInterface GtkActionableInterface;
 
29
}
 
30
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
31
 
 
32
namespace Gtk
 
33
{
 
34
 
 
35
//TODO: Have the appropriate widgets derive from this interface when there is
 
36
//an ABI break.  See:
 
37
//http://developer.gnome.org/gtk3/3.3/GtkActionable.html#GtkActionable.implementations.
 
38
 
 
39
/** This interface provides a convenient way of associating widgets with
 
40
 * actions on a ApplicationWindow or Application.
 
41
 *
 
42
 * It primarily consists of two properties: "action-name" and "action-target".
 
43
 * There are also some convenience APIs for setting these properties.
 
44
 *
 
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
 
48
 * Application.
 
49
 * @newin{3,4}
 
50
 */
 
51
class Actionable : public Glib::Interface
 
52
{
 
53
  _CLASS_INTERFACE(Actionable, GtkActionable, GTK_ACTIONABLE, GtkActionableInterface)
 
54
 
 
55
public:
 
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)
 
58
 
 
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)
 
61
 
 
62
  _WRAP_METHOD(void set_action_target_value(const Glib::VariantBase& target_value), gtk_actionable_set_action_target_value)
 
63
 
 
64
  //TODO: _WRAP_METHOD(void set_action_target(const char* format_string, ...), gtk_actionable_set_action_target)
 
65
 
 
66
  _WRAP_METHOD(void set_detailed_action_name(const Glib::ustring& detailed_action_name), gtk_actionable_set_detailed_action_name)
 
67
 
 
68
  _WRAP_PROPERTY("action-name", Glib::ustring)
 
69
  _WRAP_PROPERTY("action-target", Glib::VariantBase)
 
70
 
 
71
#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.c_str()')
 
72
  _WRAP_VFUNC(Glib::ustring get_action_name() const, "get_action_name")
 
73
 
 
74
  _WRAP_VFUNC(void set_action_name(const Glib::ustring& action_name), "set_action_name")
 
75
 
 
76
#m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj()')
 
77
  _WRAP_VFUNC(Glib::VariantBase get_action_target_value() const, "get_action_target_value")
 
78
 
 
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")
 
81
};
 
82
 
 
83
} // namespace Gio