Imported Upstream version 2.50.2
[platform/upstream/glib.git] / docs / reference / gio / html / GNotification.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GNotification: GIO Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="application.html" title="Application support">
9 <link rel="prev" href="GDBusMenuModel.html" title="GDBusMenuModel">
10 <link rel="next" href="extending.html" title="Extending GIO">
11 <meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
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="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
18                   <a href="#GNotification.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
19                   <a href="#GNotification.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
20 </td>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
22 <td><a accesskey="u" href="application.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
23 <td><a accesskey="p" href="GDBusMenuModel.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
24 <td><a accesskey="n" href="extending.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
25 </tr></table>
26 <div class="refentry">
27 <a name="GNotification"></a><div class="titlepage"></div>
28 <div class="refnamediv"><table width="100%"><tr>
29 <td valign="top">
30 <h2><span class="refentrytitle"><a name="GNotification.top_of_page"></a>GNotification</span></h2>
31 <p>GNotification — User Notifications (pop up messages)</p>
32 </td>
33 <td class="gallery_image" valign="top" align="right"></td>
34 </tr></table></div>
35 <div class="refsect1">
36 <a name="GNotification.functions"></a><h2>Functions</h2>
37 <div class="informaltable"><table class="informaltable" width="100%" border="0">
38 <colgroup>
39 <col width="150px" class="functions_return">
40 <col class="functions_name">
41 </colgroup>
42 <tbody>
43 <tr>
44 <td class="function_type">
45 <a class="link" href="GNotification.html" title="GNotification"><span class="returnvalue">GNotification</span></a> *
46 </td>
47 <td class="function_name">
48 <a class="link" href="GNotification.html#g-notification-new" title="g_notification_new ()">g_notification_new</a> <span class="c_punctuation">()</span>
49 </td>
50 </tr>
51 <tr>
52 <td class="function_type">
53 <span class="returnvalue">void</span>
54 </td>
55 <td class="function_name">
56 <a class="link" href="GNotification.html#g-notification-set-title" title="g_notification_set_title ()">g_notification_set_title</a> <span class="c_punctuation">()</span>
57 </td>
58 </tr>
59 <tr>
60 <td class="function_type">
61 <span class="returnvalue">void</span>
62 </td>
63 <td class="function_name">
64 <a class="link" href="GNotification.html#g-notification-set-body" title="g_notification_set_body ()">g_notification_set_body</a> <span class="c_punctuation">()</span>
65 </td>
66 </tr>
67 <tr>
68 <td class="function_type">
69 <span class="returnvalue">void</span>
70 </td>
71 <td class="function_name">
72 <a class="link" href="GNotification.html#g-notification-set-icon" title="g_notification_set_icon ()">g_notification_set_icon</a> <span class="c_punctuation">()</span>
73 </td>
74 </tr>
75 <tr>
76 <td class="function_type">
77 <span class="returnvalue">void</span>
78 </td>
79 <td class="function_name">
80 <a class="link" href="GNotification.html#g-notification-set-priority" title="g_notification_set_priority ()">g_notification_set_priority</a> <span class="c_punctuation">()</span>
81 </td>
82 </tr>
83 <tr>
84 <td class="function_type">
85 <span class="returnvalue">void</span>
86 </td>
87 <td class="function_name">
88 <a class="link" href="GNotification.html#g-notification-set-urgent" title="g_notification_set_urgent ()">g_notification_set_urgent</a> <span class="c_punctuation">()</span>
89 </td>
90 </tr>
91 <tr>
92 <td class="function_type">
93 <span class="returnvalue">void</span>
94 </td>
95 <td class="function_name">
96 <a class="link" href="GNotification.html#g-notification-set-default-action" title="g_notification_set_default_action ()">g_notification_set_default_action</a> <span class="c_punctuation">()</span>
97 </td>
98 </tr>
99 <tr>
100 <td class="function_type">
101 <span class="returnvalue">void</span>
102 </td>
103 <td class="function_name">
104 <a class="link" href="GNotification.html#g-notification-set-default-action-and-target" title="g_notification_set_default_action_and_target ()">g_notification_set_default_action_and_target</a> <span class="c_punctuation">()</span>
105 </td>
106 </tr>
107 <tr>
108 <td class="function_type">
109 <span class="returnvalue">void</span>
110 </td>
111 <td class="function_name">
112 <a class="link" href="GNotification.html#g-notification-set-default-action-and-target-value" title="g_notification_set_default_action_and_target_value ()">g_notification_set_default_action_and_target_value</a> <span class="c_punctuation">()</span>
113 </td>
114 </tr>
115 <tr>
116 <td class="function_type">
117 <span class="returnvalue">void</span>
118 </td>
119 <td class="function_name">
120 <a class="link" href="GNotification.html#g-notification-add-button" title="g_notification_add_button ()">g_notification_add_button</a> <span class="c_punctuation">()</span>
121 </td>
122 </tr>
123 <tr>
124 <td class="function_type">
125 <span class="returnvalue">void</span>
126 </td>
127 <td class="function_name">
128 <a class="link" href="GNotification.html#g-notification-add-button-with-target" title="g_notification_add_button_with_target ()">g_notification_add_button_with_target</a> <span class="c_punctuation">()</span>
129 </td>
130 </tr>
131 <tr>
132 <td class="function_type">
133 <span class="returnvalue">void</span>
134 </td>
135 <td class="function_name">
136 <a class="link" href="GNotification.html#g-notification-add-button-with-target-value" title="g_notification_add_button_with_target_value ()">g_notification_add_button_with_target_value</a> <span class="c_punctuation">()</span>
137 </td>
138 </tr>
139 </tbody>
140 </table></div>
141 </div>
142 <div class="refsect1">
143 <a name="GNotification.other"></a><h2>Types and Values</h2>
144 <div class="informaltable"><table class="informaltable" width="100%" border="0">
145 <colgroup>
146 <col width="150px" class="name">
147 <col class="description">
148 </colgroup>
149 <tbody>
150 <tr>
151 <td class="datatype_keyword"> </td>
152 <td class="function_name"><a class="link" href="GNotification.html#GNotification-struct" title="GNotification">GNotification</a></td>
153 </tr>
154 <tr>
155 <td class="datatype_keyword">enum</td>
156 <td class="function_name"><a class="link" href="GNotification.html#GNotificationPriority" title="enum GNotificationPriority">GNotificationPriority</a></td>
157 </tr>
158 </tbody>
159 </table></div>
160 </div>
161 <div class="refsect1">
162 <a name="GNotification.object-hierarchy"></a><h2>Object Hierarchy</h2>
163 <pre class="screen">    <a href="../gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
164     <span class="lineart">╰──</span> GNotification
165 </pre>
166 </div>
167 <div class="refsect1">
168 <a name="GNotification.includes"></a><h2>Includes</h2>
169 <pre class="synopsis">#include &lt;gio/gio.h&gt;
170 </pre>
171 </div>
172 <div class="refsect1">
173 <a name="GNotification.description"></a><h2>Description</h2>
174 <p><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> is a mechanism for creating a notification to be shown
175 to the user -- typically as a pop-up notification presented by the
176 desktop environment shell.</p>
177 <p>The key difference between <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> and other similar APIs is
178 that, if supported by the desktop environment, notifications sent
179 with <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> will persist after the application has exited,
180 and even across system reboots.</p>
181 <p>Since the user may click on a notification while the application is
182 not running, applications using <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> should be able to be
183 started as a D-Bus service, using <a class="link" href="GApplication.html" title="GApplication"><span class="type">GApplication</span></a>.</p>
184 <p>User interaction with a notification (either the default action, or
185 buttons) must be associated with actions on the application (ie:
186 "app." actions).  It is not possible to route user interaction
187 through the notification itself, because the object will not exist if
188 the application is autostarted as a result of a notification being
189 clicked.</p>
190 <p>A notification can be sent with <a class="link" href="GApplication.html#g-application-send-notification" title="g_application_send_notification ()"><code class="function">g_application_send_notification()</code></a>.</p>
191 </div>
192 <div class="refsect1">
193 <a name="GNotification.functions_details"></a><h2>Functions</h2>
194 <div class="refsect2">
195 <a name="g-notification-new"></a><h3>g_notification_new ()</h3>
196 <pre class="programlisting"><a class="link" href="GNotification.html" title="GNotification"><span class="returnvalue">GNotification</span></a> *
197 g_notification_new (<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>);</pre>
198 <p>Creates a new <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> with <em class="parameter"><code>title</code></em>
199  as its title.</p>
200 <p>After populating <em class="parameter"><code>notification</code></em>
201  with more details, it can be sent to
202 the desktop shell with <a class="link" href="GApplication.html#g-application-send-notification" title="g_application_send_notification ()"><code class="function">g_application_send_notification()</code></a>. Changing
203 any properties after this call will not have any effect until
204 resending <em class="parameter"><code>notification</code></em>
205 .</p>
206 <div class="refsect3">
207 <a name="g-notification-new.parameters"></a><h4>Parameters</h4>
208 <div class="informaltable"><table class="informaltable" width="100%" border="0">
209 <colgroup>
210 <col width="150px" class="parameters_name">
211 <col class="parameters_description">
212 <col width="200px" class="parameters_annotations">
213 </colgroup>
214 <tbody><tr>
215 <td class="parameter_name"><p>title</p></td>
216 <td class="parameter_description"><p>the title of the notification</p></td>
217 <td class="parameter_annotations"> </td>
218 </tr></tbody>
219 </table></div>
220 </div>
221 <div class="refsect3">
222 <a name="g-notification-new.returns"></a><h4>Returns</h4>
223 <p> a new <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> instance</p>
224 </div>
225 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
226 </div>
227 <hr>
228 <div class="refsect2">
229 <a name="g-notification-set-title"></a><h3>g_notification_set_title ()</h3>
230 <pre class="programlisting"><span class="returnvalue">void</span>
231 g_notification_set_title (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
232                           <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>);</pre>
233 <p>Sets the title of <em class="parameter"><code>notification</code></em>
234  to <em class="parameter"><code>title</code></em>
235 .</p>
236 <div class="refsect3">
237 <a name="g-notification-set-title.parameters"></a><h4>Parameters</h4>
238 <div class="informaltable"><table class="informaltable" width="100%" border="0">
239 <colgroup>
240 <col width="150px" class="parameters_name">
241 <col class="parameters_description">
242 <col width="200px" class="parameters_annotations">
243 </colgroup>
244 <tbody>
245 <tr>
246 <td class="parameter_name"><p>notification</p></td>
247 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
248 <td class="parameter_annotations"> </td>
249 </tr>
250 <tr>
251 <td class="parameter_name"><p>title</p></td>
252 <td class="parameter_description"><p>the new title for <em class="parameter"><code>notification</code></em>
253 </p></td>
254 <td class="parameter_annotations"> </td>
255 </tr>
256 </tbody>
257 </table></div>
258 </div>
259 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
260 </div>
261 <hr>
262 <div class="refsect2">
263 <a name="g-notification-set-body"></a><h3>g_notification_set_body ()</h3>
264 <pre class="programlisting"><span class="returnvalue">void</span>
265 g_notification_set_body (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
266                          <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *body</code></em>);</pre>
267 <p>Sets the body of <em class="parameter"><code>notification</code></em>
268  to <em class="parameter"><code>body</code></em>
269 .</p>
270 <div class="refsect3">
271 <a name="g-notification-set-body.parameters"></a><h4>Parameters</h4>
272 <div class="informaltable"><table class="informaltable" width="100%" border="0">
273 <colgroup>
274 <col width="150px" class="parameters_name">
275 <col class="parameters_description">
276 <col width="200px" class="parameters_annotations">
277 </colgroup>
278 <tbody>
279 <tr>
280 <td class="parameter_name"><p>notification</p></td>
281 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
282 <td class="parameter_annotations"> </td>
283 </tr>
284 <tr>
285 <td class="parameter_name"><p>body</p></td>
286 <td class="parameter_description"><p> the new body for <em class="parameter"><code>notification</code></em>
287 , or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
288 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
289 </tr>
290 </tbody>
291 </table></div>
292 </div>
293 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
294 </div>
295 <hr>
296 <div class="refsect2">
297 <a name="g-notification-set-icon"></a><h3>g_notification_set_icon ()</h3>
298 <pre class="programlisting"><span class="returnvalue">void</span>
299 g_notification_set_icon (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
300                          <em class="parameter"><code><a class="link" href="GIcon.html" title="GIcon"><span class="type">GIcon</span></a> *icon</code></em>);</pre>
301 <p>Sets the icon of <em class="parameter"><code>notification</code></em>
302  to <em class="parameter"><code>icon</code></em>
303 .</p>
304 <div class="refsect3">
305 <a name="g-notification-set-icon.parameters"></a><h4>Parameters</h4>
306 <div class="informaltable"><table class="informaltable" width="100%" border="0">
307 <colgroup>
308 <col width="150px" class="parameters_name">
309 <col class="parameters_description">
310 <col width="200px" class="parameters_annotations">
311 </colgroup>
312 <tbody>
313 <tr>
314 <td class="parameter_name"><p>notification</p></td>
315 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
316 <td class="parameter_annotations"> </td>
317 </tr>
318 <tr>
319 <td class="parameter_name"><p>icon</p></td>
320 <td class="parameter_description"><p>the icon to be shown in <em class="parameter"><code>notification</code></em>
321 , as a <a class="link" href="GIcon.html" title="GIcon"><span class="type">GIcon</span></a></p></td>
322 <td class="parameter_annotations"> </td>
323 </tr>
324 </tbody>
325 </table></div>
326 </div>
327 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
328 </div>
329 <hr>
330 <div class="refsect2">
331 <a name="g-notification-set-priority"></a><h3>g_notification_set_priority ()</h3>
332 <pre class="programlisting"><span class="returnvalue">void</span>
333 g_notification_set_priority (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
334                              <em class="parameter"><code><a class="link" href="GNotification.html#GNotificationPriority" title="enum GNotificationPriority"><span class="type">GNotificationPriority</span></a> priority</code></em>);</pre>
335 <p>Sets the priority of <em class="parameter"><code>notification</code></em>
336  to <em class="parameter"><code>priority</code></em>
337 . See
338 <a class="link" href="GNotification.html#GNotificationPriority" title="enum GNotificationPriority"><span class="type">GNotificationPriority</span></a> for possible values.</p>
339 <div class="refsect3">
340 <a name="g-notification-set-priority.parameters"></a><h4>Parameters</h4>
341 <div class="informaltable"><table class="informaltable" width="100%" border="0">
342 <colgroup>
343 <col width="150px" class="parameters_name">
344 <col class="parameters_description">
345 <col width="200px" class="parameters_annotations">
346 </colgroup>
347 <tbody>
348 <tr>
349 <td class="parameter_name"><p>notification</p></td>
350 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
351 <td class="parameter_annotations"> </td>
352 </tr>
353 <tr>
354 <td class="parameter_name"><p>priority</p></td>
355 <td class="parameter_description"><p>a <a class="link" href="GNotification.html#GNotificationPriority" title="enum GNotificationPriority"><span class="type">GNotificationPriority</span></a></p></td>
356 <td class="parameter_annotations"> </td>
357 </tr>
358 </tbody>
359 </table></div>
360 </div>
361 </div>
362 <hr>
363 <div class="refsect2">
364 <a name="g-notification-set-urgent"></a><h3>g_notification_set_urgent ()</h3>
365 <pre class="programlisting"><span class="returnvalue">void</span>
366 g_notification_set_urgent (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
367                            <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> urgent</code></em>);</pre>
368 <div class="warning"><p><code class="literal">g_notification_set_urgent</code> is deprecated and should not be used in newly-written code.</p></div>
369 <p>Deprecated in favor of <a class="link" href="GNotification.html#g-notification-set-priority" title="g_notification_set_priority ()"><code class="function">g_notification_set_priority()</code></a>.</p>
370 <div class="refsect3">
371 <a name="g-notification-set-urgent.parameters"></a><h4>Parameters</h4>
372 <div class="informaltable"><table class="informaltable" width="100%" border="0">
373 <colgroup>
374 <col width="150px" class="parameters_name">
375 <col class="parameters_description">
376 <col width="200px" class="parameters_annotations">
377 </colgroup>
378 <tbody>
379 <tr>
380 <td class="parameter_name"><p>notification</p></td>
381 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
382 <td class="parameter_annotations"> </td>
383 </tr>
384 <tr>
385 <td class="parameter_name"><p>urgent</p></td>
386 <td class="parameter_description"><p><a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>notification</code></em>
387 is urgent</p></td>
388 <td class="parameter_annotations"> </td>
389 </tr>
390 </tbody>
391 </table></div>
392 </div>
393 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
394 </div>
395 <hr>
396 <div class="refsect2">
397 <a name="g-notification-set-default-action"></a><h3>g_notification_set_default_action ()</h3>
398 <pre class="programlisting"><span class="returnvalue">void</span>
399 g_notification_set_default_action (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
400                                    <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *detailed_action</code></em>);</pre>
401 <p>Sets the default action of <em class="parameter"><code>notification</code></em>
402  to <em class="parameter"><code>detailed_action</code></em>
403 . This
404 action is activated when the notification is clicked on.</p>
405 <p>The action in <em class="parameter"><code>detailed_action</code></em>
406  must be an application-wide action (it
407 must start with "app."). If <em class="parameter"><code>detailed_action</code></em>
408  contains a target, the
409 given action will be activated with that target as its parameter.
410 See <a class="link" href="GAction.html#g-action-parse-detailed-name" title="g_action_parse_detailed_name ()"><code class="function">g_action_parse_detailed_name()</code></a> for a description of the format
411 for <em class="parameter"><code>detailed_action</code></em>
412 .</p>
413 <p>When no default action is set, the application that the notification
414 was sent on is activated.</p>
415 <div class="refsect3">
416 <a name="g-notification-set-default-action.parameters"></a><h4>Parameters</h4>
417 <div class="informaltable"><table class="informaltable" width="100%" border="0">
418 <colgroup>
419 <col width="150px" class="parameters_name">
420 <col class="parameters_description">
421 <col width="200px" class="parameters_annotations">
422 </colgroup>
423 <tbody>
424 <tr>
425 <td class="parameter_name"><p>notification</p></td>
426 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
427 <td class="parameter_annotations"> </td>
428 </tr>
429 <tr>
430 <td class="parameter_name"><p>detailed_action</p></td>
431 <td class="parameter_description"><p>a detailed action name</p></td>
432 <td class="parameter_annotations"> </td>
433 </tr>
434 </tbody>
435 </table></div>
436 </div>
437 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
438 </div>
439 <hr>
440 <div class="refsect2">
441 <a name="g-notification-set-default-action-and-target"></a><h3>g_notification_set_default_action_and_target ()</h3>
442 <pre class="programlisting"><span class="returnvalue">void</span>
443 g_notification_set_default_action_and_target
444                                (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
445                                 <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action</code></em>,
446                                 <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *target_format</code></em>,
447                                 <em class="parameter"><code>...</code></em>);</pre>
448 <p>Sets the default action of <em class="parameter"><code>notification</code></em>
449  to <em class="parameter"><code>action</code></em>
450 . This action is
451 activated when the notification is clicked on. It must be an
452 application-wide action (it must start with "app.").</p>
453 <p>If <em class="parameter"><code>target_format</code></em>
454  is given, it is used to collect remaining
455 positional parameters into a <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> instance, similar to
456 <a href="../glib-GVariant.html#g-variant-new"><code class="function">g_variant_new()</code></a>. <em class="parameter"><code>action</code></em>
457  will be activated with that <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> as its
458 parameter.</p>
459 <p>When no default action is set, the application that the notification
460 was sent on is activated.</p>
461 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
462 <div class="refsect3">
463 <a name="g-notification-set-default-action-and-target.parameters"></a><h4>Parameters</h4>
464 <div class="informaltable"><table class="informaltable" width="100%" border="0">
465 <colgroup>
466 <col width="150px" class="parameters_name">
467 <col class="parameters_description">
468 <col width="200px" class="parameters_annotations">
469 </colgroup>
470 <tbody>
471 <tr>
472 <td class="parameter_name"><p>notification</p></td>
473 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
474 <td class="parameter_annotations"> </td>
475 </tr>
476 <tr>
477 <td class="parameter_name"><p>action</p></td>
478 <td class="parameter_description"><p>an action name</p></td>
479 <td class="parameter_annotations"> </td>
480 </tr>
481 <tr>
482 <td class="parameter_name"><p>target_format</p></td>
483 <td class="parameter_description"><p> a <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> format string, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
484 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
485 </tr>
486 <tr>
487 <td class="parameter_name"><p>...</p></td>
488 <td class="parameter_description"><p>positional parameters, as determined by <em class="parameter"><code>target_format</code></em>
489 </p></td>
490 <td class="parameter_annotations"> </td>
491 </tr>
492 </tbody>
493 </table></div>
494 </div>
495 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
496 </div>
497 <hr>
498 <div class="refsect2">
499 <a name="g-notification-set-default-action-and-target-value"></a><h3>g_notification_set_default_action_and_target_value ()</h3>
500 <pre class="programlisting"><span class="returnvalue">void</span>
501 g_notification_set_default_action_and_target_value
502                                (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
503                                 <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action</code></em>,
504                                 <em class="parameter"><code><a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *target</code></em>);</pre>
505 <p>Sets the default action of <em class="parameter"><code>notification</code></em>
506  to <em class="parameter"><code>action</code></em>
507 . This action is
508 activated when the notification is clicked on. It must be an
509 application-wide action (start with "app.").</p>
510 <p>If <em class="parameter"><code>target</code></em>
511  is non-<a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, <em class="parameter"><code>action</code></em>
512  will be activated with <em class="parameter"><code>target</code></em>
513  as
514 its parameter.</p>
515 <p>When no default action is set, the application that the notification
516 was sent on is activated.</p>
517 <p><span class="annotation">[<acronym title="Rename the original symbol's name to SYMBOL."><span class="acronym">rename-to</span></acronym> g_notification_set_default_action_and_target]</span></p>
518 <div class="refsect3">
519 <a name="g-notification-set-default-action-and-target-value.parameters"></a><h4>Parameters</h4>
520 <div class="informaltable"><table class="informaltable" width="100%" border="0">
521 <colgroup>
522 <col width="150px" class="parameters_name">
523 <col class="parameters_description">
524 <col width="200px" class="parameters_annotations">
525 </colgroup>
526 <tbody>
527 <tr>
528 <td class="parameter_name"><p>notification</p></td>
529 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
530 <td class="parameter_annotations"> </td>
531 </tr>
532 <tr>
533 <td class="parameter_name"><p>action</p></td>
534 <td class="parameter_description"><p>an action name</p></td>
535 <td class="parameter_annotations"> </td>
536 </tr>
537 <tr>
538 <td class="parameter_name"><p>target</p></td>
539 <td class="parameter_description"><p> a <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> to use as <em class="parameter"><code>action</code></em>
540 's parameter, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
541 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
542 </tr>
543 </tbody>
544 </table></div>
545 </div>
546 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
547 </div>
548 <hr>
549 <div class="refsect2">
550 <a name="g-notification-add-button"></a><h3>g_notification_add_button ()</h3>
551 <pre class="programlisting"><span class="returnvalue">void</span>
552 g_notification_add_button (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
553                            <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>,
554                            <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *detailed_action</code></em>);</pre>
555 <p>Adds a button to <em class="parameter"><code>notification</code></em>
556  that activates the action in
557 <em class="parameter"><code>detailed_action</code></em>
558  when clicked. That action must be an
559 application-wide action (starting with "app."). If <em class="parameter"><code>detailed_action</code></em>
560
561 contains a target, the action will be activated with that target as
562 its parameter.</p>
563 <p>See <a class="link" href="GAction.html#g-action-parse-detailed-name" title="g_action_parse_detailed_name ()"><code class="function">g_action_parse_detailed_name()</code></a> for a description of the format
564 for <em class="parameter"><code>detailed_action</code></em>
565 .</p>
566 <div class="refsect3">
567 <a name="g-notification-add-button.parameters"></a><h4>Parameters</h4>
568 <div class="informaltable"><table class="informaltable" width="100%" border="0">
569 <colgroup>
570 <col width="150px" class="parameters_name">
571 <col class="parameters_description">
572 <col width="200px" class="parameters_annotations">
573 </colgroup>
574 <tbody>
575 <tr>
576 <td class="parameter_name"><p>notification</p></td>
577 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
578 <td class="parameter_annotations"> </td>
579 </tr>
580 <tr>
581 <td class="parameter_name"><p>label</p></td>
582 <td class="parameter_description"><p>label of the button</p></td>
583 <td class="parameter_annotations"> </td>
584 </tr>
585 <tr>
586 <td class="parameter_name"><p>detailed_action</p></td>
587 <td class="parameter_description"><p>a detailed action name</p></td>
588 <td class="parameter_annotations"> </td>
589 </tr>
590 </tbody>
591 </table></div>
592 </div>
593 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
594 </div>
595 <hr>
596 <div class="refsect2">
597 <a name="g-notification-add-button-with-target"></a><h3>g_notification_add_button_with_target ()</h3>
598 <pre class="programlisting"><span class="returnvalue">void</span>
599 g_notification_add_button_with_target (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
600                                        <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>,
601                                        <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action</code></em>,
602                                        <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *target_format</code></em>,
603                                        <em class="parameter"><code>...</code></em>);</pre>
604 <p>Adds a button to <em class="parameter"><code>notification</code></em>
605  that activates <em class="parameter"><code>action</code></em>
606  when clicked.
607 <em class="parameter"><code>action</code></em>
608  must be an application-wide action (it must start with "app.").</p>
609 <p>If <em class="parameter"><code>target_format</code></em>
610  is given, it is used to collect remaining
611 positional parameters into a <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> instance, similar to
612 <a href="../glib-GVariant.html#g-variant-new"><code class="function">g_variant_new()</code></a>. <em class="parameter"><code>action</code></em>
613  will be activated with that <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> as its
614 parameter.</p>
615 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
616 <div class="refsect3">
617 <a name="g-notification-add-button-with-target.parameters"></a><h4>Parameters</h4>
618 <div class="informaltable"><table class="informaltable" width="100%" border="0">
619 <colgroup>
620 <col width="150px" class="parameters_name">
621 <col class="parameters_description">
622 <col width="200px" class="parameters_annotations">
623 </colgroup>
624 <tbody>
625 <tr>
626 <td class="parameter_name"><p>notification</p></td>
627 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
628 <td class="parameter_annotations"> </td>
629 </tr>
630 <tr>
631 <td class="parameter_name"><p>label</p></td>
632 <td class="parameter_description"><p>label of the button</p></td>
633 <td class="parameter_annotations"> </td>
634 </tr>
635 <tr>
636 <td class="parameter_name"><p>action</p></td>
637 <td class="parameter_description"><p>an action name</p></td>
638 <td class="parameter_annotations"> </td>
639 </tr>
640 <tr>
641 <td class="parameter_name"><p>target_format</p></td>
642 <td class="parameter_description"><p> a <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> format string, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
643 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
644 </tr>
645 <tr>
646 <td class="parameter_name"><p>...</p></td>
647 <td class="parameter_description"><p>positional parameters, as determined by <em class="parameter"><code>target_format</code></em>
648 </p></td>
649 <td class="parameter_annotations"> </td>
650 </tr>
651 </tbody>
652 </table></div>
653 </div>
654 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
655 </div>
656 <hr>
657 <div class="refsect2">
658 <a name="g-notification-add-button-with-target-value"></a><h3>g_notification_add_button_with_target_value ()</h3>
659 <pre class="programlisting"><span class="returnvalue">void</span>
660 g_notification_add_button_with_target_value
661                                (<em class="parameter"><code><a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a> *notification</code></em>,
662                                 <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>,
663                                 <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action</code></em>,
664                                 <em class="parameter"><code><a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *target</code></em>);</pre>
665 <p>Adds a button to <em class="parameter"><code>notification</code></em>
666  that activates <em class="parameter"><code>action</code></em>
667  when clicked.
668 <em class="parameter"><code>action</code></em>
669  must be an application-wide action (it must start with "app.").</p>
670 <p>If <em class="parameter"><code>target</code></em>
671  is non-<a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, <em class="parameter"><code>action</code></em>
672  will be activated with <em class="parameter"><code>target</code></em>
673  as
674 its parameter.</p>
675 <p><span class="annotation">[<acronym title="Rename the original symbol's name to SYMBOL."><span class="acronym">rename-to</span></acronym> g_notification_add_button_with_target]</span></p>
676 <div class="refsect3">
677 <a name="g-notification-add-button-with-target-value.parameters"></a><h4>Parameters</h4>
678 <div class="informaltable"><table class="informaltable" width="100%" border="0">
679 <colgroup>
680 <col width="150px" class="parameters_name">
681 <col class="parameters_description">
682 <col width="200px" class="parameters_annotations">
683 </colgroup>
684 <tbody>
685 <tr>
686 <td class="parameter_name"><p>notification</p></td>
687 <td class="parameter_description"><p>a <a class="link" href="GNotification.html" title="GNotification"><span class="type">GNotification</span></a></p></td>
688 <td class="parameter_annotations"> </td>
689 </tr>
690 <tr>
691 <td class="parameter_name"><p>label</p></td>
692 <td class="parameter_description"><p>label of the button</p></td>
693 <td class="parameter_annotations"> </td>
694 </tr>
695 <tr>
696 <td class="parameter_name"><p>action</p></td>
697 <td class="parameter_description"><p>an action name</p></td>
698 <td class="parameter_annotations"> </td>
699 </tr>
700 <tr>
701 <td class="parameter_name"><p>target</p></td>
702 <td class="parameter_description"><p> a <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> to use as <em class="parameter"><code>action</code></em>
703 's parameter, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
704 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
705 </tr>
706 </tbody>
707 </table></div>
708 </div>
709 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
710 </div>
711 </div>
712 <div class="refsect1">
713 <a name="GNotification.other_details"></a><h2>Types and Values</h2>
714 <div class="refsect2">
715 <a name="GNotification-struct"></a><h3>GNotification</h3>
716 <pre class="programlisting">typedef struct _GNotification GNotification;</pre>
717 <p>This structure type is private and should only be accessed using the
718 public APIs.</p>
719 <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
720 </div>
721 <hr>
722 <div class="refsect2">
723 <a name="GNotificationPriority"></a><h3>enum GNotificationPriority</h3>
724 <p>Priority levels for <a href="GNotification.html#GNotification-struct"><span class="type">GNotifications</span></a>.</p>
725 <div class="refsect3">
726 <a name="GNotificationPriority.members"></a><h4>Members</h4>
727 <div class="informaltable"><table class="informaltable" width="100%" border="0">
728 <colgroup>
729 <col width="300px" class="enum_members_name">
730 <col class="enum_members_description">
731 <col width="200px" class="enum_members_annotations">
732 </colgroup>
733 <tbody>
734 <tr>
735 <td class="enum_member_name"><p><a name="G-NOTIFICATION-PRIORITY-NORMAL:CAPS"></a>G_NOTIFICATION_PRIORITY_NORMAL</p></td>
736 <td class="enum_member_description">
737 <p>the default priority, to be used for the
738   majority of notifications (for example email messages, software updates,
739   completed download/sync operations)</p>
740 </td>
741 <td class="enum_member_annotations"> </td>
742 </tr>
743 <tr>
744 <td class="enum_member_name"><p><a name="G-NOTIFICATION-PRIORITY-LOW:CAPS"></a>G_NOTIFICATION_PRIORITY_LOW</p></td>
745 <td class="enum_member_description">
746 <p>for notifications that do not require
747   immediate attention - typically used for contextual background
748   information, such as contact birthdays or local weather</p>
749 </td>
750 <td class="enum_member_annotations"> </td>
751 </tr>
752 <tr>
753 <td class="enum_member_name"><p><a name="G-NOTIFICATION-PRIORITY-HIGH:CAPS"></a>G_NOTIFICATION_PRIORITY_HIGH</p></td>
754 <td class="enum_member_description">
755 <p>for events that require more attention,
756   usually because responses are time-sensitive (for example chat and SMS
757   messages or alarms)</p>
758 </td>
759 <td class="enum_member_annotations"> </td>
760 </tr>
761 <tr>
762 <td class="enum_member_name"><p><a name="G-NOTIFICATION-PRIORITY-URGENT:CAPS"></a>G_NOTIFICATION_PRIORITY_URGENT</p></td>
763 <td class="enum_member_description">
764 <p>for urgent notifications, or notifications
765   that require a response in a short space of time (for example phone calls
766   or emergency warnings)</p>
767 </td>
768 <td class="enum_member_annotations"> </td>
769 </tr>
770 </tbody>
771 </table></div>
772 </div>
773 <p class="since">Since: <a class="link" href="api-index-2-42.html#api-index-2.42">2.42</a></p>
774 </div>
775 </div>
776 </div>
777 <div class="footer">
778 <hr>Generated by GTK-Doc V1.25.1</div>
779 </body>
780 </html>