2010-05-06 20:13:59 +02:00
|
|
|
/* GDBus - GLib D-Bus Library
|
|
|
|
*
|
2010-05-09 19:14:55 +02:00
|
|
|
* Copyright (C) 2008-2010 Red Hat, Inc.
|
2010-05-06 20:13:59 +02:00
|
|
|
*
|
2022-05-18 10:12:45 +02:00
|
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
*
|
2010-05-06 20:13:59 +02:00
|
|
|
* 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
|
2017-05-27 18:21:30 +02:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2010-05-06 20:13:59 +02:00
|
|
|
*
|
|
|
|
* 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
|
2014-01-23 12:58:29 +01:00
|
|
|
* Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
2010-05-06 20:13:59 +02:00
|
|
|
*
|
|
|
|
* Author: David Zeuthen <davidz@redhat.com>
|
|
|
|
*/
|
|
|
|
|
2012-12-28 05:43:14 +01:00
|
|
|
#ifndef __G_DBUS_METHOD_INVOCATION_H__
|
|
|
|
#define __G_DBUS_METHOD_INVOCATION_H__
|
|
|
|
|
2010-06-06 22:20:21 +02:00
|
|
|
#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
|
|
|
|
#error "Only <gio/gio.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2010-05-06 20:13:59 +02:00
|
|
|
#include <gio/giotypes.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define G_TYPE_DBUS_METHOD_INVOCATION (g_dbus_method_invocation_get_type ())
|
|
|
|
#define G_DBUS_METHOD_INVOCATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_METHOD_INVOCATION, GDBusMethodInvocation))
|
|
|
|
#define G_IS_DBUS_METHOD_INVOCATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_METHOD_INVOCATION))
|
|
|
|
|
2020-08-03 17:04:12 +02:00
|
|
|
/**
|
|
|
|
* G_DBUS_METHOD_INVOCATION_HANDLED:
|
|
|
|
*
|
|
|
|
* The value returned by handlers of the signals generated by
|
|
|
|
* the `gdbus-codegen` tool to indicate that a method call has been
|
|
|
|
* handled by an implementation. It is equal to %TRUE, but using
|
|
|
|
* this macro is sometimes more readable.
|
|
|
|
*
|
|
|
|
* In code that needs to be backwards-compatible with older GLib,
|
|
|
|
* use %TRUE instead, often written like this:
|
|
|
|
*
|
|
|
|
* |[
|
|
|
|
* g_dbus_method_invocation_return_error (invocation, ...);
|
|
|
|
* return TRUE; // handled
|
|
|
|
* ]|
|
|
|
|
*
|
|
|
|
* Since: 2.68
|
|
|
|
*/
|
2022-10-05 19:39:21 +02:00
|
|
|
#define G_DBUS_METHOD_INVOCATION_HANDLED TRUE GIO_AVAILABLE_MACRO_IN_2_68
|
2020-08-03 17:04:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* G_DBUS_METHOD_INVOCATION_UNHANDLED:
|
|
|
|
*
|
|
|
|
* The value returned by handlers of the signals generated by
|
|
|
|
* the `gdbus-codegen` tool to indicate that a method call has not been
|
|
|
|
* handled by an implementation. It is equal to %FALSE, but using
|
|
|
|
* this macro is sometimes more readable.
|
|
|
|
*
|
|
|
|
* In code that needs to be backwards-compatible with older GLib,
|
|
|
|
* use %FALSE instead.
|
|
|
|
*
|
|
|
|
* Since: 2.68
|
|
|
|
*/
|
2022-10-05 19:39:21 +02:00
|
|
|
#define G_DBUS_METHOD_INVOCATION_UNHANDLED FALSE GIO_AVAILABLE_MACRO_IN_2_68
|
2020-08-03 17:04:12 +02:00
|
|
|
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
GType g_dbus_method_invocation_get_type (void) G_GNUC_CONST;
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
const gchar *g_dbus_method_invocation_get_sender (GDBusMethodInvocation *invocation);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
const gchar *g_dbus_method_invocation_get_object_path (GDBusMethodInvocation *invocation);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
const gchar *g_dbus_method_invocation_get_interface_name (GDBusMethodInvocation *invocation);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
const gchar *g_dbus_method_invocation_get_method_name (GDBusMethodInvocation *invocation);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
const GDBusMethodInfo *g_dbus_method_invocation_get_method_info (GDBusMethodInvocation *invocation);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_2_38
|
2013-04-17 15:28:05 +02:00
|
|
|
const GDBusPropertyInfo *g_dbus_method_invocation_get_property_info (GDBusMethodInvocation *invocation);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
GDBusConnection *g_dbus_method_invocation_get_connection (GDBusMethodInvocation *invocation);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
GDBusMessage *g_dbus_method_invocation_get_message (GDBusMethodInvocation *invocation);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
GVariant *g_dbus_method_invocation_get_parameters (GDBusMethodInvocation *invocation);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
gpointer g_dbus_method_invocation_get_user_data (GDBusMethodInvocation *invocation);
|
|
|
|
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
void g_dbus_method_invocation_return_value (GDBusMethodInvocation *invocation,
|
|
|
|
GVariant *parameters);
|
2022-04-04 20:30:22 +02:00
|
|
|
#ifdef G_OS_UNIX
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2011-07-21 22:03:27 +02:00
|
|
|
void g_dbus_method_invocation_return_value_with_unix_fd_list (GDBusMethodInvocation *invocation,
|
|
|
|
GVariant *parameters,
|
|
|
|
GUnixFDList *fd_list);
|
2022-04-04 20:30:22 +02:00
|
|
|
#endif /* G_OS_UNIX */
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
void g_dbus_method_invocation_return_error (GDBusMethodInvocation *invocation,
|
|
|
|
GQuark domain,
|
|
|
|
gint code,
|
|
|
|
const gchar *format,
|
2013-01-13 17:05:14 +01:00
|
|
|
...) G_GNUC_PRINTF(4, 5);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
void g_dbus_method_invocation_return_error_valist (GDBusMethodInvocation *invocation,
|
|
|
|
GQuark domain,
|
|
|
|
gint code,
|
|
|
|
const gchar *format,
|
2013-01-13 17:05:14 +01:00
|
|
|
va_list var_args)
|
|
|
|
G_GNUC_PRINTF(4, 0);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
void g_dbus_method_invocation_return_error_literal (GDBusMethodInvocation *invocation,
|
|
|
|
GQuark domain,
|
|
|
|
gint code,
|
|
|
|
const gchar *message);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
void g_dbus_method_invocation_return_gerror (GDBusMethodInvocation *invocation,
|
|
|
|
const GError *error);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2011-05-12 02:57:54 +02:00
|
|
|
void g_dbus_method_invocation_take_error (GDBusMethodInvocation *invocation,
|
|
|
|
GError *error);
|
2022-10-05 19:39:21 +02:00
|
|
|
GIO_AVAILABLE_IN_ALL
|
2010-05-06 20:13:59 +02:00
|
|
|
void g_dbus_method_invocation_return_dbus_error (GDBusMethodInvocation *invocation,
|
|
|
|
const gchar *error_name,
|
|
|
|
const gchar *error_message);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __G_DBUS_METHOD_INVOCATION_H__ */
|