Providers for libaccounts-glib are described with a simple XML file. An example
for a hypothetical CoolProvider is shown below:
Example 5. Provider description for CoolProvider
<?xml version="1.0" encoding="UTF-8"?> <provider id="coolprovider"> <name>CoolProvider</name> <description>CoolProvider brings frost to your desktop</description> <translations>coolprovider</translations> <icon>coolprovider</icon> <domains>.*coolprovider\.com</domains> </provider>
The example provider description describes a provider called
coolprovider, indicated by the
id attribute on the
provider element. The
name element contains a
human-readable version of the provider name. The
description is a string that
describes the provider in general, and is especially useful if the provider
supports a wide range of services. 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
icon element specifies a themed
icon to represent the provider. Finally, a
domains element is a regular
expression which should match all the web domains where the account with
coolprovider can be used. This can be used with an Ubuntu
Webapp to automatically create an account when the user logs in to an accepted
domain.
Provider description filenames should end in
.provider and be installed to
${prefix}/share/accounts/providers,
which normally expands to
/usr/share/accounts/providers. The
path can be queried with pkg-config by checking the
providerfilesdir variable of the libaccounts-glib
pkg-config file, for example:
pkg-config --variable=providerfilesdir libaccounts-glib