Merge branch 'upstream' into tizen
[platform/upstream/glib.git] / gio / gdbusmethodinvocation.h
1 /* GDBus - GLib D-Bus Library
2  *
3  * Copyright (C) 2008-2010 Red Hat, Inc.
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
16  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
17  *
18  * Author: David Zeuthen <davidz@redhat.com>
19  */
20
21 #ifndef __G_DBUS_METHOD_INVOCATION_H__
22 #define __G_DBUS_METHOD_INVOCATION_H__
23
24 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25 #error "Only <gio/gio.h> can be included directly."
26 #endif
27
28 #include <gio/giotypes.h>
29 #include <gio/tizen_header_glib.h>  /* for TIZEN_PUBLIC_DEPRECATED_API */
30
31 G_BEGIN_DECLS
32
33 #define G_TYPE_DBUS_METHOD_INVOCATION         (g_dbus_method_invocation_get_type ())
34 #define G_DBUS_METHOD_INVOCATION(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_METHOD_INVOCATION, GDBusMethodInvocation))
35 #define G_IS_DBUS_METHOD_INVOCATION(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_METHOD_INVOCATION))
36
37 /**
38  * G_DBUS_METHOD_INVOCATION_HANDLED:
39  *
40  * The value returned by handlers of the signals generated by
41  * the `gdbus-codegen` tool to indicate that a method call has been
42  * handled by an implementation. It is equal to %TRUE, but using
43  * this macro is sometimes more readable.
44  *
45  * In code that needs to be backwards-compatible with older GLib,
46  * use %TRUE instead, often written like this:
47  *
48  * |[
49  *   g_dbus_method_invocation_return_error (invocation, ...);
50  *   return TRUE;    // handled
51  * ]|
52  *
53  * Since: 2.68
54  */
55 #define G_DBUS_METHOD_INVOCATION_HANDLED TRUE GLIB_AVAILABLE_MACRO_IN_2_68
56
57 /**
58  * G_DBUS_METHOD_INVOCATION_UNHANDLED:
59  *
60  * The value returned by handlers of the signals generated by
61  * the `gdbus-codegen` tool to indicate that a method call has not been
62  * handled by an implementation. It is equal to %FALSE, but using
63  * this macro is sometimes more readable.
64  *
65  * In code that needs to be backwards-compatible with older GLib,
66  * use %FALSE instead.
67  *
68  * Since: 2.68
69  */
70 #define G_DBUS_METHOD_INVOCATION_UNHANDLED FALSE GLIB_AVAILABLE_MACRO_IN_2_68
71
72 GLIB_AVAILABLE_IN_ALL
73 GType                  g_dbus_method_invocation_get_type             (void) G_GNUC_CONST TIZEN_PUBLIC_DEPRECATED_API;
74 GLIB_AVAILABLE_IN_ALL
75 const gchar           *g_dbus_method_invocation_get_sender           (GDBusMethodInvocation *invocation) TIZEN_PUBLIC_DEPRECATED_API;
76 GLIB_AVAILABLE_IN_ALL
77 const gchar           *g_dbus_method_invocation_get_object_path      (GDBusMethodInvocation *invocation) TIZEN_PUBLIC_DEPRECATED_API;
78 GLIB_AVAILABLE_IN_ALL
79 const gchar           *g_dbus_method_invocation_get_interface_name   (GDBusMethodInvocation *invocation) TIZEN_PUBLIC_DEPRECATED_API;
80 GLIB_AVAILABLE_IN_ALL
81 const gchar           *g_dbus_method_invocation_get_method_name      (GDBusMethodInvocation *invocation) TIZEN_PUBLIC_DEPRECATED_API;
82 GLIB_AVAILABLE_IN_ALL
83 const GDBusMethodInfo *g_dbus_method_invocation_get_method_info      (GDBusMethodInvocation *invocation) TIZEN_PUBLIC_DEPRECATED_API;
84 GLIB_AVAILABLE_IN_2_38
85 const GDBusPropertyInfo *g_dbus_method_invocation_get_property_info  (GDBusMethodInvocation *invocation) TIZEN_PUBLIC_DEPRECATED_API;
86 GLIB_AVAILABLE_IN_ALL
87 GDBusConnection       *g_dbus_method_invocation_get_connection       (GDBusMethodInvocation *invocation) TIZEN_PUBLIC_DEPRECATED_API;
88 GLIB_AVAILABLE_IN_ALL
89 GDBusMessage          *g_dbus_method_invocation_get_message          (GDBusMethodInvocation *invocation) TIZEN_PUBLIC_DEPRECATED_API;
90 GLIB_AVAILABLE_IN_ALL
91 GVariant              *g_dbus_method_invocation_get_parameters       (GDBusMethodInvocation *invocation) TIZEN_PUBLIC_DEPRECATED_API;
92 #ifdef G_OS_UNIX
93 GLIB_AVAILABLE_IN_2_44
94 gint                   g_dbus_method_invocation_peek_unix_fd         (GDBusMethodInvocation *invocation,
95                                                                       guint                  index_) TIZEN_PUBLIC_DEPRECATED_API;
96 #endif
97 GLIB_AVAILABLE_IN_ALL
98 gpointer               g_dbus_method_invocation_get_user_data        (GDBusMethodInvocation *invocation) TIZEN_PUBLIC_DEPRECATED_API;
99
100 GLIB_AVAILABLE_IN_ALL
101 void                   g_dbus_method_invocation_return_value         (GDBusMethodInvocation *invocation,
102                                                                       GVariant              *parameters) TIZEN_PUBLIC_DEPRECATED_API;
103 GLIB_AVAILABLE_IN_ALL
104 void                   g_dbus_method_invocation_return_value_with_unix_fd_list (GDBusMethodInvocation *invocation,
105                                                                                 GVariant              *parameters,
106                                                                                 GUnixFDList           *fd_list) TIZEN_PUBLIC_DEPRECATED_API;
107 GLIB_AVAILABLE_IN_ALL
108 void                   g_dbus_method_invocation_return_error         (GDBusMethodInvocation *invocation,
109                                                                       GQuark                 domain,
110                                                                       gint                   code,
111                                                                       const gchar           *format,
112                                                                       ...) G_GNUC_PRINTF(4, 5) TIZEN_PUBLIC_DEPRECATED_API;
113 GLIB_AVAILABLE_IN_ALL
114 void                   g_dbus_method_invocation_return_error_valist  (GDBusMethodInvocation *invocation,
115                                                                       GQuark                 domain,
116                                                                       gint                   code,
117                                                                       const gchar           *format,
118                                                                       va_list                var_args)
119                                                                       G_GNUC_PRINTF(4, 0) TIZEN_PUBLIC_DEPRECATED_API;
120 GLIB_AVAILABLE_IN_ALL
121 void                   g_dbus_method_invocation_return_error_literal (GDBusMethodInvocation *invocation,
122                                                                       GQuark                 domain,
123                                                                       gint                   code,
124                                                                       const gchar           *message) TIZEN_PUBLIC_DEPRECATED_API;
125 GLIB_AVAILABLE_IN_ALL
126 void                   g_dbus_method_invocation_return_gerror        (GDBusMethodInvocation *invocation,
127                                                                       const GError          *error) TIZEN_PUBLIC_DEPRECATED_API;
128 GLIB_AVAILABLE_IN_ALL
129 void                   g_dbus_method_invocation_take_error           (GDBusMethodInvocation *invocation,
130                                                                       GError                *error) TIZEN_PUBLIC_DEPRECATED_API;
131 GLIB_AVAILABLE_IN_ALL
132 void                   g_dbus_method_invocation_return_dbus_error    (GDBusMethodInvocation *invocation,
133                                                                       const gchar           *error_name,
134                                                                       const gchar           *error_message) TIZEN_PUBLIC_DEPRECATED_API;
135
136 G_END_DECLS
137
138 #endif /* __G_DBUS_METHOD_INVOCATION_H__ */