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><?xml version="1.0" encoding="UTF-8"?>
<service-type id="e-mail">
<name>Electronic mail</name>
<description>Send mail without harming snails</description>
<icon>email</icon>
<translations>email</translations>
<tags>
<tag>e-mail</tag>
<tag>messaging</tag>
</tags>
</service-type></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>
|