summaryrefslogtreecommitdiff
path: root/gio/src/remoteactiongroup.hg
blob: 0ce71599b7e377a2c5fd938f9dae64271de24f19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-

/* Copyright (C) 2012 The giomm 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, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <glibmm/interface.h>

_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/interface_p.h)
_PINCLUDE(gio/gio.h)

#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GRemoteActionGroupInterface GRemoteActionGroupInterface;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

namespace Gio
{


//TODO: Instead derive from ActionGroup, when we can break ABI,
//because the GRemoteActionGroup interface requires the GActionGroup interface.
//LoadableIcon does a similar thing correctly, for instance.


/** RemoteActionGroup - a ActionGroup that interacts with other processes.
 * The RemoteActionGroup interface is implemented by ActionGroup instances that
 * either transmit action invocations to other processes or receive action
 * invocations in the local process from other processes.
 *
 * The interface has variants of the two methods on ActionGroup used to
 * activate actions: Gio::ActionGroup::activate_action() and
 * Gio::ActionGroup::change_action_state(). These variants allow a "platform
 * data" Glib::VariantBase to be specified: a dictionary providing context for
 * the action invocation (for example: timestamps, startup notification IDs,
 * etc).
 *
 * Gio::DBus::ActionGroup implements RemoteActionGroup. This provides a
 * mechanism to send platform data for action invocations over D-Bus.
 *
 * Additionally, Gio::DBus::Connection::export_action_group() will check if the
 * exported ActionGroup implements RemoteActionGroup and use the variants of
 * the calls if available. This provides a mechanism by which to receive
 * platform data for action invocations that arrive by way of D-Bus.
 * @newin{2,32}
 */
class RemoteActionGroup : public Glib::Interface
{
  _CLASS_INTERFACE(RemoteActionGroup, GRemoteActionGroup, G_REMOTE_ACTION_GROUP, GRemoteActionGroupInterface)

public:
  _WRAP_METHOD(void activate_action(const Glib::ustring& action_name, const Glib::VariantBase& parameter, const Glib::VariantBase& platform_data), g_remote_action_group_activate_action_full)
  _WRAP_METHOD(void change_action_state(const Glib::ustring& action_name, const Glib::VariantBase& value, const Glib::VariantBase& platform_data), g_remote_action_group_change_action_state_full)

#m4 _CONVERSION(`GVariant*',`const Glib::VariantBase&',`Glib::wrap($3, true)')

  _WRAP_VFUNC(void activate_action(const Glib::ustring& action_name, const Glib::VariantBase& parameter, const Glib::VariantBase& platform_data), "activate_action_full")
  _WRAP_VFUNC(void change_action_state(const Glib::ustring& action_name, const Glib::VariantBase& value, const Glib::VariantBase& platform_data), "change_action_state_full")
};

} // namespace Gio