root/trunk/libnotify/docs/notification-spec.xml

Revision 2990 (checked in by chipx86, 1 year ago)

- Add a spec_version return value for GetServerInformation?.
- Bump to version 1.0. It's about time, and things are pretty solid now.

Line 
1 <?xml version="1.0"?>
2 <!DOCTYPE article PUBLIC "-//OASIS/DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
3 <article id="index">
4  <articleinfo>
5   <title>Desktop Notifications Specification</title>
6   <releaseinfo>Version 1.0</releaseinfo>
7   <date>25 August 2007</date>
8   <authorgroup>
9    <author>
10     <firstname>Mike</firstname>
11     <surname>Hearn</surname>
12     <affiliation>
13      <address>
14       <email>mike@navi.cx</email>
15      </address>
16     </affiliation>
17    </author>
18    <author>
19     <firstname>Christian</firstname>
20     <surname>Hammond</surname>
21     <affiliation>
22      <address>
23       <email>chipx86@chipx86.com</email>
24      </address>
25     </affiliation>
26    </author>
27   </authorgroup>
28   <revhistory>
29    <revision>
30     <revnumber>1.0</revnumber>
31     <date>25 August 2007</date>
32     <authorinitials>cdh</authorinitials>
33     <revremark>
34      Added spec_version to the GetServerInformation return values.
35      Mark this specification as a 1.0.
36     </revremark>
37    </revision>
38    <revision>
39     <revnumber>0.9</revnumber>
40     <date>15 January 2006</date>
41     <authorinitials>cdh</authorinitials>
42     <revremark>
43      Clarify the naming for the application IDs.
44      Put back a number of things that probably shouldn't have been removed
45      from the spec.
46     </revremark>
47    </revision>
48    <revision>
49     <revnumber>0.8</revnumber>
50     <date>23 September 2005</date>
51     <authorinitials>J5</authorinitials>
52     <revremark>
53      Major overhaul of spec to work with the newer D-Bus recursive type system.
54      Simplify protocol.
55      Changed the verbage notification type to category
56     </revremark>
57    </revision>
58    <revision>
59     <revnumber>0.7</revnumber>
60     <date>28 July 2005</date>
61     <authorinitials>cdh</authorinitials>
62     <revremark>
63      Added "x" and "y" hints. Talk about the variant type for hint values.
64     </revremark>
65    </revision>
66    <revision>
67     <revnumber>0.6</revnumber>
68     <date>1 April 2005</date>
69     <authorinitials>cdh</authorinitials>
70     <revremark>
71      Updated to work with D-BUS 0.31+.
72     </revremark>
73    </revision>
74    <revision>
75     <revnumber>0.5</revnumber>
76     <date>2 October 2004</date>
77     <authorinitials>cdh</authorinitials>
78     <revremark>
79      Added a "suppress-sound" hint. Added a "sound" capability. Renamed the
80      "soundfile" hint to sound-file".
81     </revremark>
82    </revision>
83    <revision>
84     <revnumber>0.4</revnumber>
85     <date>29 September 2004</date>
86     <authorinitials>cdh</authorinitials>
87     <revremark>
88      Added image support in markup, and made the restrictions on markup more
89      clear. Removed the High urgency. Added new notification types. Fixed
90      notification expiration.
91     </revremark>
92    </revision>
93    <revision>
94     <revnumber>0.3</revnumber>
95     <date>15 September 2004</date>
96     <authorinitials>cdh</authorinitials>
97     <revremark>Added hint and notification type sections</revremark>
98    </revision>
99    <revision>
100     <revnumber>0.2</revnumber>
101     <date>foo</date>
102     <authorinitials>mh</authorinitials>
103     <revremark>Added replaces field to protocol</revremark>
104    </revision>
105    <revision>
106     <revnumber>0.1</revnumber>
107     <date>foo</date>
108     <authorinitials>mh</authorinitials>
109     <revremark>Initial version</revremark>
110    </revision>
111   </revhistory>
112  </articleinfo>
113
114  <sect1 id="introduction">
115   <title>Introduction</title>
116   <para>
117    This is a draft standard for a desktop notifications service, through
118    which applications can generate passive popups (sometimes known as
119    "poptarts") to notify the user in an asynchronous manner of events.
120   </para>
121   <para>
122    This specification explicitly does not include other types of
123    notification presentation such as modal message boxes, window manager
124    decorations or window list annotations.
125   </para>
126   <para>
127    Example use cases include:
128   </para>
129   <itemizedlist>
130    <listitem>
131     <para>
132      Presence changes in IM programs: for instance, MSN Messenger on
133      Windows pioneered the use of passive popups to indicate presence
134      changes.
135     </para>
136    </listitem>
137    <listitem><para>Scheduled alarm</para></listitem>
138    <listitem><para>Completed file transfer</para></listitem>
139    <listitem><para>New mail notification</para></listitem>
140    <listitem><para>Low disk space/battery warnings</para></listitem>
141   </itemizedlist>
142  </sect1>
143
144  <sect1 id="basic-design">
145   <title>Basic Design</title>
146   <para>
147    In order to ensure that multiple notifications can easily be
148    displayed at once, and to provide a convenient implementation, all
149    notifications are controlled by a single session-scoped service which
150    exposes a D-BUS interface.
151   </para>
152   <para>
153    On startup, a conforming implementation should take the
154    <literal>org.freedesktop.Notifications</literal> service on
155    the session bus. This service will be referred to as the "notification
156    server" or just "the server" in this document. It can optionally be
157    activated automatically by the bus process, however this is not required
158    and notification server clients must not assume that it is available.
159   </para>
160   <para>
161    The server should implement the
162    <literal>org.freedesktop.Notifications</literal> interface on
163    an object with the path <literal>"/org/freedesktop/Notifications"</literal>.
164    This is the only interface required by this version of the specification.
165   </para>
166   <para>
167    A notification has the following components:
168   </para>
169   <table>
170    <title>Notification Components</title>
171    <tgroup cols="2">
172     <thead>
173      <row>
174       <entry>Component</entry>
175       <entry>Description</entry>
176      </row>
177     </thead>
178     <tbody valign="top">
179      <row>
180       <entry>Application Name</entry>
181       <entry>
182        This is the optional name of the application sending the notification.
183        This should be the application's formal name, rather than some sort
184        of ID. An example would be "FredApp E-Mail Client," rather than
185        "fredapp-email-client."
186       </entry>
187      </row>
188      <row>
189       <entry>Replaces ID</entry>
190       <entry>
191        An optional ID of an existing notification that this
192        notification is intended to replace.
193       </entry>
194      </row>
195      <row>
196       <entry>Notification Icon</entry>
197       <entry>
198        The notification icon. This is represented either as a URI
199        (file:// is the only URI schema supported right now) or a name in
200        a freedesktop.org-compliant icon theme (not a GTK+ stock ID).
201       </entry>
202      </row>
203      <row>
204       <entry>Summary</entry>
205       <entry>
206        This is a single line overview of the notification. For instance,
207        "You have mail" or "A friend has come online". It should generally
208        not be longer than 40 characters, though this is not a requirement,
209        and server implementations should word wrap if necessary. The summary
210        must be encoded using UTF-8.
211       </entry>
212      </row>
213      <row>
214       <entry>Body</entry>
215       <entry>
216        <para>
217         This is a multi-line body of text. Each line is a paragraph, server
218         implementations are free to word wrap them as they see fit.
219        </para>
220        <para>
221         The body may contain simple markup as specified in
222         <xref linkend="markup"/>. It must be encoded using UTF-8.
223        </para>
224        <para>
225         If the body is omitted, just the summary is displayed.
226        </para>
227       </entry>
228      </row>
229      <row>
230       <entry>Actions</entry>
231       <entry>
232        <para>
233         The actions send a request message back to the notification client
234         when invoked. This functionality may not be implemented by the
235         notification server, conforming clients should check if it is available
236         before using it (see the GetCapabilities message in
237         <xref linkend="protocol"/>). An implementation is free to ignore any
238         requested by the client. As an example one possible rendering of
239         actions would be as buttons in the notification popup.
240        </para>
241        <para>
242         Actions are sent over as a list of pairs. Each even element in the
243         list (starting at index 0) represents the identifier for the action.
244         Each odd element in the list is the localized string that will be
245         displayed to the user.
246        </para>
247        <para>
248         The default action (usually invoked my clicking the notification)
249         should have a key named <literal>"default"</literal>. The name can
250         be anything, though implementations are free not to display it.
251        </para>
252       </entry>
253      </row>
254      <row>
255       <entry>Hints</entry>
256       <entry>
257        <para>See <xref linkend="hints"/>.</para>
258        <para>
259         Beyond the core protocol is the hints table. A couple of core
260         elements have been moved to hints mostly because in a huge number
261         of cases their default values would be sufficent. The elements moved
262         to hints are:
263        </para>
264        <segmentedlist>
265         <title>Elements Moved to Hints</title>
266         <segtitle>Element</segtitle>
267         <segtitle>Description</segtitle>
268         <seglistitem>
269          <seg>Category ID</seg>
270          <seg>An optional ID representing the type of notification (the name
271               has been changed from Notification Type ID in pervious versions).
272               See <xref linkend="categories"/>.</seg>
273         </seglistitem>
274         <seglistitem>
275          <seg>Urgency Level</seg>
276          <seg>The urgency of the notification. See
277               <xref linkend="urgency-levels"/>. (Defaults to 1 - Normal)</seg>
278         </seglistitem>
279         <seglistitem>
280          <seg>Icon Data</seg>
281          <seg>Instead of overloading the icon field we now have an icon_data
282               field that is used when icon is blank.</seg>
283         </seglistitem>
284        </segmentedlist>
285       </entry>
286      </row>
287      <row>
288       <entry>Expiration Timeout</entry>
289       <entry>
290        <para>
291         The timeout time in milliseconds since the display of the notification
292         at which the notification should automatically close.
293        </para>
294        <para>
295         If -1, the notification's expiration time is dependent on the
296         notification server's settings, and may vary for the type of
297         notification.
298        </para>
299        <para>
300         If 0, the notification never expires.
301        </para>
302       </entry>
303      </row>
304     </tbody>
305    </tgroup>
306   </table>
307   <para>
308    Each notification displayed is allocated a unique ID by the server.
309    This is unique within the session. While the notification server is
310    running, the ID will not be recycled unless the capacity of a uint32 is
311    exceeded.
312   </para>
313   <para>
314    This can be used to hide the notification before the expiration timeout
315    is reached. It can also be used to atomically replace the notification
316    with another. This allows you to (for instance) modify the contents of
317    a notification while it's on-screen.
318   </para>
319  </sect1>
320
321  <sect1 id="backwards-compat" xreflabel="Backwards Compatibility">
322   <title>Backwards Compatibility</title>
323   <para>
324    Clients should try and avoid making assumptions about the presentation and
325    abilities of the notification server. The message content is the most
326    important thing.
327   </para>
328   <para>
329    Clients can check with the server what capabilities are supported
330    using the <literal>GetCapabilities</literal> message. See
331    <xref linkend="protocol"/>.
332   </para>
333   <para>
334    If a client requires a response from a passive popup, it should be
335    coded such that a non-focus-stealing message box can be used in the
336    case that the notification server does not support this feature.
337   </para>
338  </sect1>
339
340  <sect1 id="markup" xreflabel="Markup">
341   <title>Markup</title>
342   <para>
343    Body text may contain markup. The markup is XML-based, and consists
344    of a small subset of HTML along with a few additional tags.
345   </para>
346   <para>
347    The following tags should be supported by the notification server.
348    Though it is optional, it is recommended. Notification servers that do
349    not support these tags should filter them out.
350   </para>
351   <informaltable>
352    <tgroup cols="2">
353     <tbody valign="top">
354      <row>
355       <entry>
356        <sgmltag class="starttag">b</sgmltag> ...
357        <sgmltag class="endtag">b</sgmltag>
358       </entry>
359       <entry>Bold</entry>
360      </row>
361      <row>
362       <entry>
363        <sgmltag class="starttag">i</sgmltag> ...
364        <sgmltag class="endtag">i</sgmltag>
365       </entry>
366       <entry>Italic</entry>
367      </row>
368      <row>
369       <entry>
370        <sgmltag class="starttag">u</sgmltag> ...
371        <sgmltag class="endtag">u</sgmltag>
372       </entry>
373       <entry>Underline</entry>
374      </row>
375      <row>
376       <entry>
377        <sgmltag class="starttag">a href="..."</sgmltag> ...
378        <sgmltag class="endtag">a</sgmltag>
379       </entry>
380       <entry>Hyperlink</entry>
381      </row>
382      <row>
383       <entry>
384        <sgmltag class="emptytag">img src="..." alt="..."</sgmltag>
385       </entry>
386       <entry>Image</entry>
387      </row>
388     </tbody>
389    </tgroup>
390   </informaltable>
391   <para>
392    A full-blown HTML implementation is not required of this spec, and
393    notifications should never take advantage of tags that are not listed
394    above. As notifications are not a substitute for web browsers or complex
395    dialogs, advanced layout is not necessary, and may in fact limit the
396    number of systems that notification services can run on, due to memory
397    usage and screen space. Such examples are PDAs, certain cell phones, and
398    slow PCs or laptops with little memory.
399   </para>
400   <para>
401    For the same reason, a full XML or XHTML implementation using XSLT or
402    CSS stylesheets is not part of this specification. Information that
403    must be presented in a more complex form should use an application-specific
404    dialog, a web browser, or some other display mechanism.
405   </para>
406   <para>
407    The tags specified above mark up the content in a way that allows them
408    to be stripped out on some implementations without impacting the actual
409    content.
410   </para>
411
412   <sect2 id="hyperlinks" xreflabel="Hyperlinks">
413    <title>Hyperlinks</title>
414    <para>
415     Hyperlinks allow for linking one or more words to a URI. There is no
416     requirement to allow for images to be linked, and it is highly suggested
417     that implementations do not allow this, as there is no clean-looking,
418     standard visual indicator for a hyperlinked image.
419    </para>
420    <para>
421     Hyperlinked text should appear in the standard blue underline format.
422    </para>
423    <para>
424     Hyperlinks cannot function as a replacement for actions. They are
425     used to link to local directories or remote sites using standard URI
426     schemes.
427    </para>
428    <para>
429     Implementations are not required to support hyperlinks.
430    </para>
431   </sect2>
432
433   <sect2 id="images" xreflabel="Images">
434    <title>Images</title>
435    <para>
436     Images may be placed in the notification, but this should be done with
437     caution. The image should never exceed 200x100, but this should be thought
438     of as a maximum size. Images should always have alternative text
439     provided through the <literal>alt="..."</literal> attribute.
440    </para>
441    <para>
442     Image data cannot be embedded in the message itself. Images referenced
443     must always be local files.
444    </para>
445    <para>
446     Implementations are not required to support images.
447    </para>
448   </sect2>
449  </sect1>
450
451  <sect1 id="icons" xreflabel="Icons">
452   <title>Icons</title>
453   <para>
454    A notification can optionally have an icon specified by the Notification
455    Icon field or by the icon_data hint.
456   </para>
457   <para>
458    The icon_data field should be a raw image data structure of signature
459    (iiibiiay) which describes the width, height, rowstride, has alpha, bits
460    per sample, channels and image data respectively.
461   </para>
462  </sect1>
463
464  <sect1 id="categories" xreflabel="Categories">
465   <title>Categories</title>
466   <para>
467    Notifications can optionally have a type indicator. Although neither
468    client or nor server must support this, some may choose to. Those servers
469    implementing categories may use them to intelligently display
470    the notification in a certain way, or group notifications of similar
471    types.
472   </para>
473   <para>
474    Categories are in
475    <literal><replaceable>class.specific</replaceable></literal> form.
476    <literal>class</literal> specifies the generic type of notification, and
477    <literal>specific</literal> specifies the more specific type of
478    notification.
479   </para>
480   <para>
481    If a specific type of notification does not exist for your notification,
482    but the generic kind does, a notification of type
483    <literal><replaceable>class</replaceable></literal> is acceptable.
484   </para>
485   <para>
486    Third parties, when defining their own categories, should discuss
487    the possibility of standardizing on the hint with other parties, preferably
488    in a place such as the
489    <ulink url="http://freedesktop.org/mailman/listinfo/xdg">xdg</ulink>
490    mailing list at
491    <ulink url="http://freedesktop.org/">freedesktop.org</ulink>. If it
492    warrants a standard, it will be added to the table above. If no
493    consensus is reached, the category should be in the form of
494    "<literal>x-<replaceable>vendor</replaceable>.<replaceable>class</replaceable>.<replaceable>name</replaceable></literal>."
495   </para>
496   <para>
497    The following table lists standard notifications as defined by this spec.
498    More will be added in time.
499   </para>
500   <table>
501    <title>Categories</title>
502    <tgroup cols="2">
503     <thead>
504      <row>
505       <entry>Type</entry>
506       <entry>Description</entry>
507      </row>
508     </thead>
509     <tbody valign="top">
510      <row>
511       <entry><literal>"device"</literal></entry>
512       <entry>
513        A generic device-related notification that doesn't fit into
514        any other category.
515       </entry>
516      </row>
517      <row>
518       <entry><literal>"device.added"</literal></entry>
519       <entry>A device, such as a USB device, was added to the system.</entry>
520      </row>
521      <row>
522       <entry><literal>"device.error"</literal></entry>
523       <entry>A device had some kind of error.</entry>
524      </row>
525      <row>
526       <entry><literal>"device.removed"</literal></entry>
527       <entry>
528        A device, such as a USB device, was removed from the system.
529       </entry>
530      </row>
531      <row>
532       <entry><literal>"email"</literal></entry>
533       <entry>
534        A generic e-mail-related notification that doesn't fit into any
535        other category.
536       </entry>
537      </row>
538      <row>
539       <entry><literal>"email.arrived"</literal></entry>
540       <entry>A new e-mail notification.</entry>
541      </row>
542      <row>
543       <entry><literal>"email.bounced"</literal></entry>
544       <entry>A notification stating that an e-mail has bounced.</entry>
545      </row>
546      <row>
547       <entry><literal>"im"</literal></entry>
548       <entry>
549        A generic instant message-related notification that doesn't fit
550        into any other category.
551       </entry>
552      </row>
553      <row>
554       <entry><literal>"im.error"</literal></entry>
555       <entry>An instant message error notification.</entry>
556      </row>
557      <row>
558       <entry><literal>"im.received"</literal></entry>
559       <entry>A received instant message notification.</entry>
560      </row>
561      <row>
562       <entry><literal>"network"</literal></entry>
563       <entry>
564        A generic network notification that doesn't fit into any other
565        category.
566       </entry>
567      </row>
568      <row>
569       <entry><literal>"network.connected"</literal></entry>
570       <entry>
571        A network connection notification, such as successful sign-on to a
572        network service. This should not be confused with
573        <literal>device.added</literal> for new network devices.
574       </entry>
575      </row>
576      <row>
577       <entry><literal>"network.disconnected"</literal></entry>
578       <entry>
579        A network disconnected notification. This should not be confused with
580        <literal>device.removed</literal> for disconnected network devices.
581       </entry>
582      </row>
583      <row>
584       <entry><literal>"network.error"</literal></entry>
585       <entry>
586        A network-related or connection-related error.
587       </entry>
588      </row>
589      <row>
590       <entry><literal>"presence"</literal></entry>
591       <entry>
592        A generic presence change notification that doesn't fit into
593        any other category, such as going away or idle.
594       </entry>
595      </row>
596      <row>
597       <entry><literal>"presence.offline"</literal></entry>
598       <entry>An offline presence change notification.</entry>
599      </row>
600      <row>
601       <entry><literal>"presence.online"</literal></entry>
602       <entry>An online presence change notification.</entry>
603      </row>
604      <row>
605       <entry><literal>"transfer"</literal></entry>
606       <entry>
607        A generic file transfer or download notification that doesn't fit
608        into any other category.
609       </entry>
610      </row>
611      <row>
612       <entry><literal>"transfer.complete"</literal></entry>
613       <entry>A file transfer or download complete notification.</entry>
614      </row>
615      <row>
616       <entry><literal>"transfer.error"</literal></entry>
617       <entry>A file transfer or download error.</entry>
618      </row>
619     </tbody>
620    </tgroup>
621   </table>
622  </sect1>
623
624  <sect1 id="urgency-levels" xreflabel="Urgency Levels">
625   <title>Urgency Levels</title>
626   <para>
627    Notifications have an urgency level associated with them. This defines
628    the importance of the notification. For example, "Joe Bob signed on"
629    would be a low urgency. "You have new mail" or "A USB device was unplugged"
630    would be a normal urgency. "Your computer is on fire" would be a critical
631    urgency.
632   </para>
633   <para>Urgency levels are defined as follows:</para>
634   <table>
635    <title>Urgency Levels</title>
636    <tgroup cols="2">
637     <thead>
638      <row>
639       <entry>Type</entry>
640       <entry>Description</entry>
641      </row>
642     </thead>
643     <tbody valign="top">
644      <row>
645       <entry>0</entry>
646       <entry>Low</entry>
647      </row>
648      <row>
649       <entry>1</entry>
650       <entry>Normal</entry>
651      </row>
652      <row>
653       <entry>2</entry>
654       <entry>Critical</entry>
655      </row>
656     </tbody>
657    </tgroup>
658   </table>
659   <para>
660    Developers must use their own judgement when deciding the urgency of a
661    notification. Typically, if the majority of programs are using the same
662    level for a specific type of urgency, other applications should follow
663    them.
664   </para>
665   <para>
666    For low and normal urgencies, server implementations may display the
667    notifications how they choose. They should, however, have a sane
668    expiration timeout dependent on the urgency level.
669   </para>
670   <para>
671    Critical notifications should not automatically expire, as they are
672    things that the user will most likely want to know about. They should
673    only be closed when the user dismisses them, for example, by clicking on
674    the notification.
675   </para>
676  </sect1>
677
678  <sect1 id="hints" xreflabel="Hints">
679   <title>Hints</title>
680   <para>
681    Hints are a way to provide extra data to a notification server that
682    the server may be able to make use of.
683   </para>
684   <para>
685    Neither clients nor notification servers are required to support any
686    hints. Both sides should assume that hints are not passed, and should
687    ignore any hints they do not understand.
688   </para>
689   <para>
690    Third parties, when defining their own hints, should discuss the
691    possibility of standardizing on the hint with other parties, preferably
692    in a place such as the
693    <ulink url="http://freedesktop.org/mailman/listinfo/xdg">xdg</ulink>
694    mailing list at
695    <ulink url="http://freedesktop.org/">freedesktop.org</ulink>. If it
696    warrants a standard, it will be added to the table above. If no
697    consensus is reached, the hint name should be in the form of
698    <literal>"x-<replaceable>vendor</replaceable>-<replaceable>name</replaceable>."</literal>
699   </para>
700   <para>
701    The value type for the hint dictionary in D-BUS is of the
702    <literal>DBUS_TYPE_VARIANT</literal> container type. This allows different
703    data types (string, integer, boolean, etc.) to be used for hints. When
704    adding a dictionary of hints, this type must be used, rather than putting
705    the actual hint value in as the dictionary value.
706   </para>
707   <para>
708    The following table lists the standard hints as defined by this
709    specification. Future hints may be proposed and added to this list
710    over time. Once again, implementations are not required to support these.
711   </para>
712   <table>
713    <title>Standard Hints</title>
714    <tgroup cols="2">
715     <thead>
716      <row>
717       <entry>Name</entry>
718       <entry>Value Type</entry>
719       <entry>Description</entry>
720      </row>
721     </thead>
722     <tbody valign="top">
723      <row>
724       <entry><literal>"urgency"</literal></entry>
725       <entry>byte</entry>
726       <entry>
727        The urgency level.
728       </entry>
729      </row>
730      <row>
731       <entry><literal>"category"</literal></entry>
732       <entry>string</entry>
733       <entry>
734        The type of notification this is.
735       </entry>
736      </row>
737      <row>
738       <entry><literal>"desktop-entry"></literal></entry>
739       <entry>string</entry>
740       <entry>
741        This specifies the name of the desktop filename representing the
742        calling program. This should be the same as the prefix used for the
743        application's .desktop file. An example would be "rhythmbox" from
744        "rhythmbox.desktop". This can be used by the daemon to retrieve the
745        correct icon for the application, for logging purposes, etc.
746       </entry>
747      </row>
748      <row>
749       <entry><literal>"image_data"</literal></entry>
750       <entry>(iiibiiay)</entry>
751       <entry>
752         This is a raw data image format which describes the width, height,
753         rowstride, has alpha, bits per sample, channels and image data
754         respectively. We use this value if the icon field is left blank.
755       </entry>
756      </row>
757      <row>
758       <entry><literal>"sound-file"</literal></entry>
759       <entry>string</entry>
760       <entry>
761        The path to a sound file to play when the notification pops up.
762       </entry>
763      </row>
764      <row>
765       <entry><literal>"suppress-sound"</literal></entry>
766       <entry>boolean</entry>
767       <entry>
768        Causes the server to suppress playing any sounds, if it has that
769        ability. This is usually set when the client itself is going to
770        play its own sound.
771       </entry>
772      </row>
773      <row>
774       <entry><literal>"x"</literal></entry>
775       <entry>int</entry>
776       <entry>
777        Specifies the X location on the screen that the notification should
778        point to. The <literal>"y"</literal> hint must also be specified.
779       </entry>
780      </row>
781      <row>
782       <entry><literal>"y"</literal></entry>
783       <entry>int</entry>
784       <entry>
785        Specifies the Y location on the screen that the notification should
786        point to. The <literal>"x"</literal> hint must also be specified.
787       </entry>
788      </row>
789     </tbody>
790    </tgroup>
791   </table>
792  </sect1>
793
794  <sect1 id="protocol" xreflabel="Protocol">
795   <title>D-BUS Protocol</title>
796   <para>
797    The following messages <emphasis>must</emphasis> be supported by all
798    implementations.
799   </para>
800
801   <sect2 id="commands">
802    <title>Message commands</title>
803
804    <sect3 id="command-get-capabilities">
805     <title><literal>org.freedesktop.Notifications.GetCapabilities</literal></title>
806     <funcsynopsis>
807      <funcprototype>
808       <funcdef>STRING_ARRAY
809        <function>org.freedesktop.Notifications.GetCapabilities</function>
810       </funcdef>
811       <void/>
812      </funcprototype>
813     </funcsynopsis>
814     <para>
815      This message takes no parameters.
816     </para>
817     <para>
818      It returns an array of strings. Each string describes an optional
819      capability implemented by the server. The following values are
820      defined by this spec:
821     </para>
822     <table>
823      <title>Server Capabilities</title>
824      <tgroup cols="2">
825       <tbody valign="top">
826        <row>
827         <entry><literal>"actions"</literal></entry>
828         <entry>
829          The server will provide the specified actions to the user. Even if
830          this cap is missing, actions may still be specified by the client,
831          however the server is free to ignore them.
832         </entry>
833        </row>
834        <row>
835         <entry><literal>"body"</literal></entry>
836         <entry>
837          Supports body text. Some implementations may only show the
838          summary (for instance, onscreen displays, marquee/scrollers)
839         </entry>
840        </row>
841        <row>
842         <entry><literal>"body-hyperlinks"</literal></entry>
843         <entry>
844          The server supports hyperlinks in the notifications.
845         </entry>
846        </row>
847        <row>
848         <entry><literal>"body-images"</literal></entry>
849         <entry>
850          The server supports images in the notifications.
851         </entry>
852        </row>
853        <row>
854         <entry><literal>"body-markup"</literal></entry>
855         <entry>
856          Supports markup in the body text. If marked up text is sent
857          to a server that does not give this cap, the markup will show
858          through as regular text so must be stripped clientside.
859         </entry>
860        </row>
861        <row>
862         <entry><literal>"icon-multi"</literal></entry>
863         <entry>
864          The server will render an animation of all the frames in a given
865          image array. The client may still specify multiple frames even if
866          this cap and/or <literal>"icon-static"</literal> is missing, however
867          the server is free to ignore them and use only the primary frame.
868         </entry>
869        </row>
870        <row>
871         <entry><literal>"icon-static"</literal></entry>
872         <entry>
873          Supports display of exactly 1 frame of any given image array.
874          This value is mutually exclusive with
875          <literal>"icon-multi"</literal>, it is a protocol error for the
876          server to specify both.
877         </entry>
878        </row>
879        <row>
880         <entry><literal>"sound"</literal></entry>
881         <entry>
882          The server supports sounds on notifications. If returned, the
883          server must support the <literal>"sound-file"</literal> and
884          <literal>"suppress-sound"</literal> hints.
885         </entry>
886        </row>
887       </tbody>
888      </tgroup>
889     </table>
890     <para>
891      New vendor-specific caps may be specified as long as they start with
892      <literal>"x-<replaceable>vendor</replaceable>"</literal>. For instance,
893      <literal>"x-gnome-foo-cap"</literal>. Capability names must not
894      contain spaces. They are limited to alpha-numeric characters and dashes
895      (<literal>"-"</literal>).
896     </para>
897    </sect3>
898
899    <sect3 id="command-notify">
900     <title><literal>org.freedesktop.Notifications.Notify</literal></title>
901     <funcsynopsis>
902      <funcprototype>
903       <funcdef>UINT32
904        <function>org.freedesktop.Notifications.Notify</function>
905       </funcdef>
906       <paramdef>STRING <parameter>app_name</parameter></paramdef>
907       <paramdef>UINT32 <parameter>replaces_id</parameter></paramdef>
908       <paramdef>STRING <parameter>app_icon</parameter></paramdef>
909       <paramdef>STRING <parameter>summary</parameter></paramdef>
910       <paramdef>STRING <parameter>body</parameter></paramdef>
911       <paramdef>ARRAY <parameter>actions</parameter></paramdef>
912       <paramdef>DICT <parameter>hints</parameter></paramdef>
913       <paramdef>INT32 <parameter>expire_timeout</parameter></paramdef>
914      </funcprototype>
915     </funcsynopsis>
916     <para>
917      Sends a notification to the notification server.
918     </para>
919     <table>
920      <title>Notify Parameters</title>
921      <tgroup cols="3">
922       <thead>
923        <row>
924         <entry>Name</entry>
925         <entry>Type</entry>
926         <entry>Description</entry>
927        </row>
928       </thead>
929       <tbody valign="top">
930        <row>
931         <entry><parameter>app_name</parameter></entry>
932         <entry>STRING</entry>
933         <entry>
934          The optional name of the application sending the notification.
935          Can be blank.
936         </entry>
937        </row>
938        <row>
939         <entry><parameter>replaces_id</parameter></entry>
940         <entry>UINT32</entry>
941         <entry>
942          The optional notification ID that this notification replaces. The
943          server must atomically (ie with no flicker or other visual cues)
944          replace the given notification with this one. This allows clients to
945          effectively modify the notification while it's active. A value of
946          value of 0 means that this notification won't replace any
947          existing notifications.
948         </entry>
949        </row>
950        <row>
951         <entry><parameter>app_icon</parameter></entry>
952         <entry>STRING</entry>
953         <entry>
954          The optional program icon of the calling application. See <xref linkend="icons"/>.
955          Can be an empty string, indicating no icon.
956         </entry>
957        </row>
958        <row>
959         <entry><parameter>summary</parameter></entry>
960         <entry>STRING</entry>
961         <entry>The summary text briefly describing the notification.</entry>
962        </row>
963        <row>
964         <entry><parameter>body</parameter></entry>
965         <entry>STRING</entry>
966         <entry>The optional detailed body text. Can be empty.</entry>
967        </row>
968        <row>
969         <entry><parameter>actions</parameter></entry>
970         <entry>ARRAY</entry>
971         <entry>
972          Actions are sent over as a list of pairs. Each even element in
973          the list (starting at index 0) represents the identifier for the
974          action. Each odd element in the list is the localized string
975          that will be displayed to the user.
976         </entry>
977        </row>
978        <row>
979         <entry><parameter>hints</parameter></entry>
980         <entry>DICT</entry>
981         <entry>
982          Optional hints that can be passed to the server from the client
983          program. Although clients and servers should never assume each other
984          supports any specific hints, they can be used to pass along
985          information, such as the process PID or window ID, that the server
986          may be able to make use of. See <xref linkend="hints"/>. Can be
987          empty.
988         </entry>
989        </row>
990        <row>
991         <entry><parameter>expire_timeout</parameter></entry>
992         <entry>INT32</entry>
993         <entry>
994          <para>
995           The timeout time in milliseconds since the display of the notification at
996           which the notification should automatically close.
997          </para>
998          <para>
999           If -1, the notification's expiration time is dependent on the
1000           notification server's settings, and may vary for the type of
1001           notification.
1002
1003           If 0, never expire.
1004          </para>
1005         </entry>
1006        </row>
1007       </tbody>
1008      </tgroup>
1009     </table>
1010     <para>
1011      If <parameter>replaces_id</parameter> is 0, the return value is a
1012      UINT32 that represent the notification. It is unique, and will not be
1013      reused unless a <constant>MAXINT</constant> number of notifications
1014      have been generated. An acceptable implementation may just use an
1015      incrementing counter for the ID. The returned ID is always greater than
1016      zero. Servers must make sure not to return zero as an ID.
1017     </para>
1018     <para>
1019      If <parameter>replaces_id</parameter> is not 0, the returned value
1020      is the same value as <parameter>replaces_id</parameter>.
1021     </para>
1022    </sect3>
1023
1024    <sect3 id="command-close-notification">
1025     <title><literal>org.freedesktop.Notifications.CloseNotification</literal></title>
1026     <funcsynopsis>
1027      <funcprototype>
1028       <funcdef>void
1029        <function>org.freedesktop.Notifications.CloseNotification</function>
1030       </funcdef>
1031       <paramdef>UINT32 id</paramdef>
1032      </funcprototype>
1033     </funcsynopsis>
1034     <para>
1035      Causes a notification to be forcefully closed and removed from the user's
1036      view. It can be used, for example, in the event that what the
1037      notification pertains to is no longer relevant, or to cancel a
1038      notification with no expiration time.
1039     </para>
1040     <para>
1041      The <literal>NotificationClosed</literal> signal is emitted by this
1042      method.
1043     </para>
1044     <para>
1045      If the notification no longer exists, an empty D-BUS Error message is
1046      sent back.
1047     </para>
1048    </sect3>
1049
1050    <sect3 id="command-get-server-information">
1051     <title><literal>org.freedesktop.Notifications.GetServerInformation</literal></title>
1052     <funcsynopsis>
1053      <funcprototype>
1054       <funcdef>
1055        void
1056        <function>org.freedesktop.Notifications.GetServerInformation</function>
1057       </funcdef>
1058       <paramdef>out STRING <parameter>name</parameter></paramdef>
1059       <paramdef>out STRING <parameter>vendor</parameter></paramdef>
1060       <paramdef>out STRING <parameter>version</parameter></paramdef>
1061       <paramdef>out STRING <parameter>spec_version</parameter></paramdef>
1062      </funcprototype>
1063     </funcsynopsis>
1064     <para>
1065      This message returns the information on the server. Specifically,
1066      the server name, vendor, and version number.
1067     </para>
1068     <table>
1069      <title>GetServerInformation Return Values</title>
1070      <tgroup cols="2">
1071       <thead>
1072        <row>
1073         <entry>Name</entry>
1074         <entry>Type</entry>
1075         <entry>Description</entry>
1076        </row>
1077       </thead>
1078       <tbody valign="top">
1079        <row>
1080         <entry><parameter>name</parameter></entry>