![]() |
![]() |
![]() |
libaccounts-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <libaccounts-glib/ag-provider.h> AgProvider; const gchar * ag_provider_get_display_name (AgProvider *provider
); const gchar * ag_provider_get_description (AgProvider *provider
); void ag_provider_get_file_contents (AgProvider *provider
,const gchar **contents
); const gchar * ag_provider_get_i18n_domain (AgProvider *provider
); const gchar * ag_provider_get_icon_name (AgProvider *provider
); const gchar * ag_provider_get_name (AgProvider *provider
); const gchar * ag_provider_get_domains_regex (AgProvider *provider
); gboolean ag_provider_match_domain (AgProvider *provider
,const gchar *domain
); const gchar * ag_provider_get_plugin_name (AgProvider *provider
); gboolean ag_provider_get_single_account (AgProvider *provider
); void ag_provider_list_free (GList *list
); AgProvider * ag_provider_ref (AgProvider *provider
); void ag_provider_unref (AgProvider *provider
);
The AgProvider structure represents an account provider. The structure is
not directly exposed to applications, but its fields are accessible via
getter methods. It can be instantiated by AgManager with
ag_manager_get_provider()
or ag_manager_list_providers()
.
The structure is reference counted. One must use ag_provider_unref()
when
done with it.
See the example of creating a new AgAccount to see how AgProvider can be used.
const gchar * ag_provider_get_display_name (AgProvider *provider
);
Get the display name of the AgProvider.
|
the AgProvider. |
Returns : |
the display name of provider . |
const gchar * ag_provider_get_description (AgProvider *provider
);
Get the description of the AgProvider.
|
the AgProvider. |
Returns : |
the description of provider , or NULL upon failure. |
Since 1.2
void ag_provider_get_file_contents (AgProvider *provider
,const gchar **contents
);
Gets the contents of the XML provider file. The buffer returned in contents
should not be modified or freed, and is guaranteed to be valid as long as
provider
is referenced.
If some error occurs, contents
is set to NULL
.
|
the AgProvider. |
|
location to receive the pointer to the file contents. |
const gchar * ag_provider_get_i18n_domain (AgProvider *provider
);
Get the translation domain of the AgProvider.
|
the AgProvider. |
Returns : |
the translation domain. |
const gchar * ag_provider_get_icon_name (AgProvider *provider
);
Get the icon name of the AgProvider.
|
the AgProvider. |
Returns : |
the icon_name. |
const gchar * ag_provider_get_name (AgProvider *provider
);
Get the name of the AgProvider.
|
the AgProvider. |
Returns : |
the name of provider . |
const gchar * ag_provider_get_domains_regex (AgProvider *provider
);
Get a regular expression matching all domains where this provider's accounts can be used.
|
the AgProvider. |
Returns : |
a regular expression matching the domain names. |
Since 1.1
gboolean ag_provider_match_domain (AgProvider *provider
,const gchar *domain
);
Check whether domain
is supported by this provider, by matching it with the
regex returned by ag_provider_get_domains_regex()
.
If the provider does not define a regular expression to match the supported
domains, this function will return FALSE
.
|
the AgProvider. |
|
a domain name. |
Returns : |
TRUE if the given domain is supported, FALSE otherwise. |
Since 1.2
const gchar * ag_provider_get_plugin_name (AgProvider *provider
);
Get the name of the account plugin which manages all accounts created from this AgProvider. Some platforms might find it useful to store plugin names in the provider XML files, especially when the same plugin can work for different providers.
|
the AgProvider. |
Returns : |
the plugin name for provider , or NULL if a plugin name is not
defined. |
Since 1.5
gboolean ag_provider_get_single_account (AgProvider *provider
);
Tell whether the provider doesn't support creating more than one account. Note that libaccounts itself does not enforce preventing the creation of multiple accounts when this flag is set: the flag is only informative, and its implementation is left to the client.
|
the AgProvider. |
Returns : |
FALSE if multiple accounts can be created from this provider,
TRUE otherwise. |
Since 1.14
void ag_provider_list_free (GList *list
);
Frees the list list
.
|
a GList of providers returned by some function of this library. [element-type AgProvider] |
AgProvider * ag_provider_ref (AgProvider *provider
);
Adds a reference to provider
.
|
the AgProvider. |
Returns : |
provider . |
void ag_provider_unref (AgProvider *provider
);
Used to unreference the AgProvider structure.
|
the AgProvider. |