Service type description file format

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

Example 7. Service type description for e-mail

1
2
3
4
5
6
7
8
9
10
11
12
<?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>

The example service type description describes a service type called e-mail, indicated by the id attribute on the service-type root element. The name element contains a human-readable version of the service type name. The description is a string that describes the service type in general. The icon element specifies a themed icon to represent the service type. The translations 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 tags element is a container of tag elements, which are used to describe the service type in abstract terms.

Installation

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

1
pkg-config --variable=servicetypefilesdir libaccounts-glib