File: service-type-file-format.xml

package info (click to toggle)
libaccounts-glib 1.27-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 944 kB
  • sloc: ansic: 11,312; xml: 1,175; python: 72; sh: 7; makefile: 7
file content (71 lines) | stat: -rw-r--r-- 2,781 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
    "http://www.oasis-open.org/doxbook/xml/4.3/docbookx.dtd">

<section id="service-type-file-format" xreflabel="service type description files">

<title>Service type description file format</title>

<para>
Services types for libaccounts-glib providers are described with a simple XML
file. An example for a hypothetical <literal>CoolProvider</literal> chat
service is shown below:
</para>

<example>
  <title>Service type description for e-mail</title>
  <programlisting>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;service-type id="e-mail"&gt;
  &lt;name&gt;Electronic mail&lt;/name&gt;
  &lt;description&gt;Send mail without harming snails&lt;/description&gt;
  &lt;icon&gt;email&lt;/icon&gt;
  &lt;translations&gt;email&lt;/translations&gt;
  &lt;tags&gt;
    &lt;tag&gt;e-mail&lt;/tag&gt;
    &lt;tag&gt;messaging&lt;/tag&gt;
  &lt;/tags&gt;

&lt;/service-type&gt;</programlisting>
</example>

<para>
The example service type description describes a service type called
<literal>e-mail</literal>, indicated by the
<sgmltag class="attribute" role="xml">id</sgmltag> attribute on the
<sgmltag class="element" role="xml">service-type</sgmltag> root element. The
<sgmltag class="element" role="xml">name</sgmltag> element contains a
human-readable version of the service type name. The
<sgmltag class="element" role="xml">description</sgmltag> is a string that
describes the service type in general. The
<sgmltag class="element" role="xml">icon</sgmltag> element specifies a themed
icon to represent the service type. The
<sgmltag class="element" role="xml">translations</sgmltag> element is used to
indicate the gettext translation domain for the name and description elements,
to be used by applications when showing those elements in a UI. The
<sgmltag class="element" role="xml">tags</sgmltag> element is a container of
<sgmltag class="element" role="xml">tag</sgmltag> elements, which are used to
describe the service type in abstract terms.
</para>

  <section>

  <title>Installation</title>

  <para>
  Service type description filenames should end in
  <filename class="extension">.service-type</filename> and be installed to
  <filename class="directory">${prefix}/share/accounts/service_types</filename>,
  which normally expands to
  <filename class="directory">/usr/share/accounts/service_types</filename>. The
  path can be queried with <command>pkg-config</command> by checking the
  <varname>servicetypefilesdir</varname> variable of the libaccounts-glib
  pkg-config file, for example:
  </para>

  <informalexample>
  <programlisting>pkg-config --variable=servicetypefilesdir libaccounts-glib</programlisting>
  </informalexample>

  </section>

</section>