1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GDBusMethodInvocation</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="gdbus-lowlevel.html" title="Lowlevel D-Bus Support">
9 <link rel="prev" href="GDBusConnection.html" title="GDBusConnection">
10 <link rel="next" href="GDBusServer.html" title="GDBusServer">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="GDBusConnection.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gdbus-lowlevel.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GIO Reference Manual</th>
21 <td><a accesskey="n" href="GDBusServer.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#GDBusMethodInvocation.synopsis" class="shortcut">Top</a>
26 <a href="#GDBusMethodInvocation.description" class="shortcut">Description</a>
28 <a href="#GDBusMethodInvocation.object-hierarchy" class="shortcut">Object Hierarchy</a>
31 <div class="refentry">
32 <a name="GDBusMethodInvocation"></a><div class="titlepage"></div>
33 <div class="refnamediv"><table width="100%"><tr>
35 <h2><span class="refentrytitle"><a name="GDBusMethodInvocation.top_of_page"></a>GDBusMethodInvocation</span></h2>
36 <p>GDBusMethodInvocation — Object for handling remote calls</p>
38 <td valign="top" align="right"></td>
40 <div class="refsynopsisdiv">
41 <a name="GDBusMethodInvocation.synopsis"></a><h2>Synopsis</h2>
42 <pre class="synopsis">
43 #include <gio/gio.h>
45 <a class="link" href="GDBusMethodInvocation.html#GDBusMethodInvocation-struct" title="GDBusMethodInvocation">GDBusMethodInvocation</a>;
46 const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-get-sender" title="g_dbus_method_invocation_get_sender ()">g_dbus_method_invocation_get_sender</a> (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);
47 const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-get-object-path" title="g_dbus_method_invocation_get_object_path ()">g_dbus_method_invocation_get_object_path</a>
48 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);
49 const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-get-interface-name" title="g_dbus_method_invocation_get_interface_name ()">g_dbus_method_invocation_get_interface_name</a>
50 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);
51 const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-get-method-name" title="g_dbus_method_invocation_get_method_name ()">g_dbus_method_invocation_get_method_name</a>
52 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);
53 const <a class="link" href="gio-D-Bus-Introspection-Data.html#GDBusMethodInfo"><span class="returnvalue">GDBusMethodInfo</span></a> * <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-get-method-info" title="g_dbus_method_invocation_get_method_info ()">g_dbus_method_invocation_get_method_info</a>
54 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);
55 <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-get-connection" title="g_dbus_method_invocation_get_connection ()">g_dbus_method_invocation_get_connection</a>
56 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);
57 <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="returnvalue">GDBusMessage</span></a> * <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-get-message" title="g_dbus_method_invocation_get_message ()">g_dbus_method_invocation_get_message</a>
58 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);
59 <a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> * <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-get-parameters" title="g_dbus_method_invocation_get_parameters ()">g_dbus_method_invocation_get_parameters</a>
60 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);
61 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-get-user-data" title="g_dbus_method_invocation_get_user_data ()">g_dbus_method_invocation_get_user_data</a>
62 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);
63 <span class="returnvalue">void</span> <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-value" title="g_dbus_method_invocation_return_value ()">g_dbus_method_invocation_return_value</a>
64 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
65 <em class="parameter"><code><a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *parameters</code></em>);
66 <span class="returnvalue">void</span> <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-error" title="g_dbus_method_invocation_return_error ()">g_dbus_method_invocation_return_error</a>
67 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
68 <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
69 <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
70 <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
71 <em class="parameter"><code>...</code></em>);
72 <span class="returnvalue">void</span> <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-error-valist" title="g_dbus_method_invocation_return_error_valist ()">g_dbus_method_invocation_return_error_valist</a>
73 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
74 <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
75 <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
76 <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
77 <em class="parameter"><code><span class="type">va_list</span> var_args</code></em>);
78 <span class="returnvalue">void</span> <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-error-literal" title="g_dbus_method_invocation_return_error_literal ()">g_dbus_method_invocation_return_error_literal</a>
79 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
80 <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
81 <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
82 <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *message</code></em>);
83 <span class="returnvalue">void</span> <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-gerror" title="g_dbus_method_invocation_return_gerror ()">g_dbus_method_invocation_return_gerror</a>
84 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
85 <em class="parameter"><code>const <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
86 <span class="returnvalue">void</span> <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-dbus-error" title="g_dbus_method_invocation_return_dbus_error ()">g_dbus_method_invocation_return_dbus_error</a>
87 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
88 <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *error_name</code></em>,
89 <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *error_message</code></em>);
90 <span class="returnvalue">void</span> <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-take-error" title="g_dbus_method_invocation_take_error ()">g_dbus_method_invocation_take_error</a> (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
91 <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
92 <span class="returnvalue">void</span> <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-value-with-unix-fd-list" title="g_dbus_method_invocation_return_value_with_unix_fd_list ()">g_dbus_method_invocation_return_value_with_unix_fd_list</a>
93 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
94 <em class="parameter"><code><a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *parameters</code></em>,
95 <em class="parameter"><code><a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> *fd_list</code></em>);
98 <div class="refsect1">
99 <a name="GDBusMethodInvocation.object-hierarchy"></a><h2>Object Hierarchy</h2>
100 <pre class="synopsis">
101 <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
102 +----GDBusMethodInvocation
105 <div class="refsect1">
106 <a name="GDBusMethodInvocation.description"></a><h2>Description</h2>
108 Instances of the <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> class are used when
109 handling D-Bus method calls. It provides a way to asynchronously
110 return results and errors.
113 The normal way to obtain a <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> object is to receive
114 it as an argument to the <code class="function">handle_method_call()</code> function in a
115 <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="type">GDBusInterfaceVTable</span></a> that was passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object" title="g_dbus_connection_register_object ()"><code class="function">g_dbus_connection_register_object()</code></a>.
118 <div class="refsect1">
119 <a name="GDBusMethodInvocation.details"></a><h2>Details</h2>
120 <div class="refsect2">
121 <a name="GDBusMethodInvocation-struct"></a><h3>GDBusMethodInvocation</h3>
122 <pre class="programlisting">typedef struct _GDBusMethodInvocation GDBusMethodInvocation;</pre>
124 The <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> structure contains only private data and
125 should only be accessed using the provided API.
127 <p class="since">Since 2.26</p>
130 <div class="refsect2">
131 <a name="g-dbus-method-invocation-get-sender"></a><h3>g_dbus_method_invocation_get_sender ()</h3>
132 <pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_dbus_method_invocation_get_sender (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);</pre>
134 Gets the bus name that invoked the method.
136 <div class="variablelist"><table border="0">
137 <col align="left" valign="top">
140 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
141 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>.</td>
144 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
145 <td>A string. Do not free, it is owned by <em class="parameter"><code>invocation</code></em>.</td>
149 <p class="since">Since 2.26</p>
152 <div class="refsect2">
153 <a name="g-dbus-method-invocation-get-object-path"></a><h3>g_dbus_method_invocation_get_object_path ()</h3>
154 <pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_dbus_method_invocation_get_object_path
155 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);</pre>
157 Gets the object path the method was invoked on.
159 <div class="variablelist"><table border="0">
160 <col align="left" valign="top">
163 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
164 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>.</td>
167 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
168 <td>A string. Do not free, it is owned by <em class="parameter"><code>invocation</code></em>.</td>
172 <p class="since">Since 2.26</p>
175 <div class="refsect2">
176 <a name="g-dbus-method-invocation-get-interface-name"></a><h3>g_dbus_method_invocation_get_interface_name ()</h3>
177 <pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_dbus_method_invocation_get_interface_name
178 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);</pre>
180 Gets the name of the D-Bus interface the method was invoked on.
182 <div class="variablelist"><table border="0">
183 <col align="left" valign="top">
186 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
187 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>.</td>
190 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
191 <td>A string. Do not free, it is owned by <em class="parameter"><code>invocation</code></em>.</td>
195 <p class="since">Since 2.26</p>
198 <div class="refsect2">
199 <a name="g-dbus-method-invocation-get-method-name"></a><h3>g_dbus_method_invocation_get_method_name ()</h3>
200 <pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_dbus_method_invocation_get_method_name
201 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);</pre>
203 Gets the name of the method that was invoked.
205 <div class="variablelist"><table border="0">
206 <col align="left" valign="top">
209 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
210 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>.</td>
213 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
214 <td>A string. Do not free, it is owned by <em class="parameter"><code>invocation</code></em>.</td>
218 <p class="since">Since 2.26</p>
221 <div class="refsect2">
222 <a name="g-dbus-method-invocation-get-method-info"></a><h3>g_dbus_method_invocation_get_method_info ()</h3>
223 <pre class="programlisting">const <a class="link" href="gio-D-Bus-Introspection-Data.html#GDBusMethodInfo"><span class="returnvalue">GDBusMethodInfo</span></a> * g_dbus_method_invocation_get_method_info
224 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);</pre>
226 Gets information about the method call, if any.
228 <div class="variablelist"><table border="0">
229 <col align="left" valign="top">
232 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
233 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>.</td>
236 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
237 <td>A <a class="link" href="gio-D-Bus-Introspection-Data.html#GDBusMethodInfo"><span class="type">GDBusMethodInfo</span></a> or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Do not free, it is owned by <em class="parameter"><code>invocation</code></em>.</td>
241 <p class="since">Since 2.26</p>
244 <div class="refsect2">
245 <a name="g-dbus-method-invocation-get-connection"></a><h3>g_dbus_method_invocation_get_connection ()</h3>
246 <pre class="programlisting"><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * g_dbus_method_invocation_get_connection
247 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);</pre>
249 Gets the <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> the method was invoked on.
251 <div class="variablelist"><table border="0">
252 <col align="left" valign="top">
255 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
256 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>.</td>
259 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
260 <td>A <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>. Do not free, it is owned by <em class="parameter"><code>invocation</code></em>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
265 <p class="since">Since 2.26</p>
268 <div class="refsect2">
269 <a name="g-dbus-method-invocation-get-message"></a><h3>g_dbus_method_invocation_get_message ()</h3>
270 <pre class="programlisting"><a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="returnvalue">GDBusMessage</span></a> * g_dbus_method_invocation_get_message
271 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);</pre>
273 Gets the <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> for the method invocation. This is useful if
274 you need to use low-level protocol features, such as UNIX file
275 descriptor passing, that cannot be properly expressed in the
276 <a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> API.
279 See <a class="xref" href="GDBusConnection.html#gdbus-server" title="Example 2. D-Bus server example">Example 2, “D-Bus server example”</a> and <a class="xref" href="GDBusConnection.html#gdbus-unix-fd-client" title="Example 4. D-Bus UNIX File Descriptor example">Example 4, “D-Bus UNIX File Descriptor example”</a> for an example of how to use this
280 low-level API to send and receive UNIX file descriptors.
282 <div class="variablelist"><table border="0">
283 <col align="left" valign="top">
286 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
287 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>.</td>
290 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
292 <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a>. Do not free, it is owned by <em class="parameter"><code>invocation</code></em>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
297 <p class="since">Since 2.26</p>
300 <div class="refsect2">
301 <a name="g-dbus-method-invocation-get-parameters"></a><h3>g_dbus_method_invocation_get_parameters ()</h3>
302 <pre class="programlisting"><a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> * g_dbus_method_invocation_get_parameters
303 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);</pre>
305 Gets the parameters of the method invocation. If there are no input
306 parameters then this will return a GVariant with 0 children rather than NULL.
308 <div class="variablelist"><table border="0">
309 <col align="left" valign="top">
312 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
313 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>.</td>
316 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
317 <td>A <a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> tuple. Do not unref this because it is owned by <em class="parameter"><code>invocation</code></em>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
322 <p class="since">Since 2.26</p>
325 <div class="refsect2">
326 <a name="g-dbus-method-invocation-get-user-data"></a><h3>g_dbus_method_invocation_get_user_data ()</h3>
327 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> g_dbus_method_invocation_get_user_data
328 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>);</pre>
330 Gets the <em class="parameter"><code>user_data</code></em> <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object" title="g_dbus_connection_register_object ()"><code class="function">g_dbus_connection_register_object()</code></a>.
332 <div class="variablelist"><table border="0">
333 <col align="left" valign="top">
336 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
337 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>.</td>
340 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
341 <td>A <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>.</td>
345 <p class="since">Since 2.26</p>
348 <div class="refsect2">
349 <a name="g-dbus-method-invocation-return-value"></a><h3>g_dbus_method_invocation_return_value ()</h3>
350 <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_method_invocation_return_value
351 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
352 <em class="parameter"><code><a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *parameters</code></em>);</pre>
354 Finishes handling a D-Bus method call by returning <em class="parameter"><code>parameters</code></em>.
355 If the <em class="parameter"><code>parameters</code></em> GVariant is floating, it is consumed.
358 It is an error if <em class="parameter"><code>parameters</code></em> is not of the right format.
361 This method will free <em class="parameter"><code>invocation</code></em>, you cannot use it afterwards.
363 <div class="variablelist"><table border="0">
364 <col align="left" valign="top">
367 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
368 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
372 <td><p><span class="term"><em class="parameter"><code>parameters</code></em> :</span></p></td>
373 <td>A <a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> tuple with out parameters for the method or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if not passing any parameters. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
378 <p class="since">Since 2.26</p>
381 <div class="refsect2">
382 <a name="g-dbus-method-invocation-return-error"></a><h3>g_dbus_method_invocation_return_error ()</h3>
383 <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_method_invocation_return_error
384 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
385 <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
386 <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
387 <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
388 <em class="parameter"><code>...</code></em>);</pre>
390 Finishes handling a D-Bus method call by returning an error.
393 See <a class="link" href="gio-GDBusError.html#g-dbus-error-encode-gerror" title="g_dbus_error_encode_gerror ()"><code class="function">g_dbus_error_encode_gerror()</code></a> for details about what error name
394 will be returned on the wire. In a nutshell, if the given error is
395 registered using <a class="link" href="gio-GDBusError.html#g-dbus-error-register-error" title="g_dbus_error_register_error ()"><code class="function">g_dbus_error_register_error()</code></a> the name given
396 during registration is used. Otherwise, a name of the form
397 <code class="literal">org.gtk.GDBus.UnmappedGError.Quark...</code> is
398 used. This provides transparent mapping of <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> between
399 applications using GDBus.
402 If you are writing an application intended to be portable,
403 <span class="emphasis"><em>always</em></span> register errors with <a class="link" href="gio-GDBusError.html#g-dbus-error-register-error" title="g_dbus_error_register_error ()"><code class="function">g_dbus_error_register_error()</code></a>
404 or use <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-dbus-error" title="g_dbus_method_invocation_return_dbus_error ()"><code class="function">g_dbus_method_invocation_return_dbus_error()</code></a>.
407 This method will free <em class="parameter"><code>invocation</code></em>, you cannot use it afterwards.
409 <div class="variablelist"><table border="0">
410 <col align="left" valign="top">
413 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
414 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
418 <td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
419 <td>A <a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> for the <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> error domain.</td>
422 <td><p><span class="term"><em class="parameter"><code>code</code></em> :</span></p></td>
423 <td>The error code.</td>
426 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
427 <td>printf()-style format.</td>
430 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
431 <td>Parameters for <em class="parameter"><code>format</code></em>.</td>
435 <p class="since">Since 2.26</p>
438 <div class="refsect2">
439 <a name="g-dbus-method-invocation-return-error-valist"></a><h3>g_dbus_method_invocation_return_error_valist ()</h3>
440 <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_method_invocation_return_error_valist
441 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
442 <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
443 <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
444 <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
445 <em class="parameter"><code><span class="type">va_list</span> var_args</code></em>);</pre>
447 Like <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-error" title="g_dbus_method_invocation_return_error ()"><code class="function">g_dbus_method_invocation_return_error()</code></a> but intended for
451 This method will free <em class="parameter"><code>invocation</code></em>, you cannot use it afterwards.
453 <div class="variablelist"><table border="0">
454 <col align="left" valign="top">
457 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
458 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
462 <td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
463 <td>A <a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> for the <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> error domain.</td>
466 <td><p><span class="term"><em class="parameter"><code>code</code></em> :</span></p></td>
467 <td>The error code.</td>
470 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
471 <td>printf()-style format.</td>
474 <td><p><span class="term"><em class="parameter"><code>var_args</code></em> :</span></p></td>
476 <span class="type">va_list</span> of parameters for <em class="parameter"><code>format</code></em>.</td>
480 <p class="since">Since 2.26</p>
483 <div class="refsect2">
484 <a name="g-dbus-method-invocation-return-error-literal"></a><h3>g_dbus_method_invocation_return_error_literal ()</h3>
485 <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_method_invocation_return_error_literal
486 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
487 <em class="parameter"><code><a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
488 <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
489 <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *message</code></em>);</pre>
491 Like <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-error" title="g_dbus_method_invocation_return_error ()"><code class="function">g_dbus_method_invocation_return_error()</code></a> but without <code class="function">printf()</code>-style formatting.
494 This method will free <em class="parameter"><code>invocation</code></em>, you cannot use it afterwards.
496 <div class="variablelist"><table border="0">
497 <col align="left" valign="top">
500 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
501 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
505 <td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
506 <td>A <a href="./../glib/glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> for the <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> error domain.</td>
509 <td><p><span class="term"><em class="parameter"><code>code</code></em> :</span></p></td>
510 <td>The error code.</td>
513 <td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
514 <td>The error message.</td>
518 <p class="since">Since 2.26</p>
521 <div class="refsect2">
522 <a name="g-dbus-method-invocation-return-gerror"></a><h3>g_dbus_method_invocation_return_gerror ()</h3>
523 <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_method_invocation_return_gerror
524 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
525 <em class="parameter"><code>const <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
527 Like <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-error" title="g_dbus_method_invocation_return_error ()"><code class="function">g_dbus_method_invocation_return_error()</code></a> but takes a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>
528 instead of the error domain, error code and message.
531 This method will free <em class="parameter"><code>invocation</code></em>, you cannot use it afterwards.
533 <div class="variablelist"><table border="0">
534 <col align="left" valign="top">
537 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
538 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
542 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
543 <td>A <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.</td>
547 <p class="since">Since 2.26</p>
550 <div class="refsect2">
551 <a name="g-dbus-method-invocation-return-dbus-error"></a><h3>g_dbus_method_invocation_return_dbus_error ()</h3>
552 <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_method_invocation_return_dbus_error
553 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
554 <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *error_name</code></em>,
555 <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *error_message</code></em>);</pre>
557 Finishes handling a D-Bus method call by returning an error.
560 This method will free <em class="parameter"><code>invocation</code></em>, you cannot use it afterwards.
562 <div class="variablelist"><table border="0">
563 <col align="left" valign="top">
566 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
567 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
571 <td><p><span class="term"><em class="parameter"><code>error_name</code></em> :</span></p></td>
572 <td>A valid D-Bus error name.</td>
575 <td><p><span class="term"><em class="parameter"><code>error_message</code></em> :</span></p></td>
576 <td>A valid D-Bus error message.</td>
580 <p class="since">Since 2.26</p>
583 <div class="refsect2">
584 <a name="g-dbus-method-invocation-take-error"></a><h3>g_dbus_method_invocation_take_error ()</h3>
585 <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_method_invocation_take_error (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
586 <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
588 Like <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-gerror" title="g_dbus_method_invocation_return_gerror ()"><code class="function">g_dbus_method_invocation_return_gerror()</code></a> but takes ownership
589 of <em class="parameter"><code>error</code></em> so the caller does not need to free it.
592 This method will free <em class="parameter"><code>invocation</code></em>, you cannot use it afterwards.
594 <div class="variablelist"><table border="0">
595 <col align="left" valign="top">
598 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
599 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
603 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
604 <td>A <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
609 <p class="since">Since 2.30</p>
612 <div class="refsect2">
613 <a name="g-dbus-method-invocation-return-value-with-unix-fd-list"></a><h3>g_dbus_method_invocation_return_value_with_unix_fd_list ()</h3>
614 <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_method_invocation_return_value_with_unix_fd_list
615 (<em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>,
616 <em class="parameter"><code><a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *parameters</code></em>,
617 <em class="parameter"><code><a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> *fd_list</code></em>);</pre>
619 Like <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-value" title="g_dbus_method_invocation_return_value ()"><code class="function">g_dbus_method_invocation_return_value()</code></a> but also takes a <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a>.
622 This method is only available on UNIX.
625 This method will free <em class="parameter"><code>invocation</code></em>, you cannot use it afterwards.
627 <div class="variablelist"><table border="0">
628 <col align="left" valign="top">
631 <td><p><span class="term"><em class="parameter"><code>invocation</code></em> :</span></p></td>
632 <td>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
636 <td><p><span class="term"><em class="parameter"><code>parameters</code></em> :</span></p></td>
637 <td>A <a href="./../glib/glib/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> tuple with out parameters for the method or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if not passing any parameters. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
641 <td><p><span class="term"><em class="parameter"><code>fd_list</code></em> :</span></p></td>
642 <td>A <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
647 <p class="since">Since 2.30</p>
653 Generated by GTK-Doc V1.18</div>