![]() |
![]() |
![]() |
libaccounts-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
AgAccountClass; AgAccountPrivate; AgAccount; gboolean ag_account_supports_service (AgAccount *account
,const gchar *service_type
); GList * ag_account_list_services (AgAccount *account
); GList * ag_account_list_services_by_type (AgAccount *account
,const gchar *service_type
); GList * ag_account_list_enabled_services (AgAccount *account
); AgManager * ag_account_get_manager (AgAccount *account
); const gchar * ag_account_get_provider_name (AgAccount *account
); const gchar * ag_account_get_display_name (AgAccount *account
); void ag_account_set_display_name (AgAccount *account
,const gchar *display_name
); void ag_account_select_service (AgAccount *account
,AgService *service
); AgService * ag_account_get_selected_service (AgAccount *account
); gboolean ag_account_get_enabled (AgAccount *account
); void ag_account_set_enabled (AgAccount *account
,gboolean enabled
); void ag_account_delete (AgAccount *account
); enum AgSettingSource; AgSettingSource ag_account_get_value (AgAccount *account
,const gchar *key
,GValue *value
); void ag_account_set_value (AgAccount *account
,const gchar *key
,const GValue *value
); AgAccountSettingIter; void ag_account_settings_iter_init (AgAccount *account
,AgAccountSettingIter *iter
,const gchar *key_prefix
); gboolean ag_account_settings_iter_next (AgAccountSettingIter *iter
,const gchar **key
,const GValue **value
); typedef AgAccountWatch; void (*AgAccountNotifyCb) (AgAccount *account
,const gchar *key
,gpointer user_data
); AgAccountWatch ag_account_watch_key (AgAccount *account
,const gchar *key
,AgAccountNotifyCb callback
,gpointer user_data
); AgAccountWatch ag_account_watch_dir (AgAccount *account
,const gchar *key_prefix
,AgAccountNotifyCb callback
,gpointer user_data
); void ag_account_remove_watch (AgAccount *account
,AgAccountWatch watch
); void (*AgAccountStoreCb) (AgAccount *account
,const GError *error
,gpointer user_data
); void ag_account_store (AgAccount *account
,AgAccountStoreCb callback
,gpointer user_data
); gboolean ag_account_store_blocking (AgAccount *account
,GError **error
); void ag_account_sign (AgAccount *account
,const gchar *key
,const gchar *token
); gboolean ag_account_verify (AgAccount *account
,const gchar *key
,const gchar **token
); gboolean ag_account_verify_with_tokens (AgAccount *account
,const gchar *key
,const gchar **tokens
);
"foreign" gboolean : Write / Construct Only "id" guint : Write / Construct Only "manager" AgManager* : Write / Construct Only "provider" gchar* : Write / Construct Only
An AgAccount is an object which represents an account. It provides a method for enabling/disabling the account and methods for editing the account settings.
typedef struct { GObjectClass parent_class; void (*_ag_reserved1) (void); void (*_ag_reserved2) (void); void (*_ag_reserved3) (void); void (*_ag_reserved4) (void); void (*_ag_reserved5) (void); void (*_ag_reserved6) (void); void (*_ag_reserved7) (void); } AgAccountClass;
gboolean ag_account_supports_service (AgAccount *account
,const gchar *service_type
);
|
the AgAccount. |
|
|
Returns : |
a gboolean which tells whether account supports the service type
service_type .
|
GList * ag_account_list_services (AgAccount *account
);
|
the AgAccount. |
Returns : |
a GList of AgService items representing all the services
supported by this account. If the AgManager was created with specified
service_type this will return only services with this service_type.
Must be free'd with ag_service_list_free() .
|
GList * ag_account_list_services_by_type (AgAccount *account
,const gchar *service_type
);
|
the AgAccount. |
|
the service type which all the returned services should provide. |
Returns : |
a GList of AgService items representing all the services
supported by this account which provide service_type . Must be free'd with
ag_service_list_free() .
|
GList * ag_account_list_enabled_services (AgAccount *account
);
|
the AgAccount. |
Returns : |
a GList of AgService items representing all the services
which are enabled. Must be free'd with ag_service_list_free() .
|
AgManager * ag_account_get_manager (AgAccount *account
);
|
the AgAccount. |
Returns : |
the AccountManager. |
const gchar * ag_account_get_provider_name (AgAccount *account
);
|
the AgAccount. |
Returns : |
the name of the provider of account .
|
const gchar * ag_account_get_display_name (AgAccount *account
);
|
the AgAccount. |
Returns : |
the display name for account .
|
void ag_account_set_display_name (AgAccount *account
,const gchar *display_name
);
Changes the display name for account
to display_name
.
|
the AgAccount. |
|
the display name to set. |
void ag_account_select_service (AgAccount *account
,AgService *service
);
Selects the configuration of service service
: from now on, all the
subsequent calls on the AgAccount configuration will act on the service
.
If service
is NULL
, the global account configuration is selected.
Note that if account
is being shared with other code one must take special
care to make sure the desired service is always selected.
AgService * ag_account_get_selected_service (AgAccount *account
);
|
the AgAccount. |
Returns : |
the selected service, or NULL if no service is selected.
|
gboolean ag_account_get_enabled (AgAccount *account
);
|
the AgAccount. |
Returns : |
a gboolean which tells whether the selected service for account is
enabled.
|
void ag_account_set_enabled (AgAccount *account
,gboolean enabled
);
Sets the "enabled" flag on the selected service for account
.
|
the AgAccount. |
|
whether account should be enabled.
|
void ag_account_delete (AgAccount *account
);
Deletes the account. Call ag_account_store()
in order to record the change
in the storage.
|
the AgAccount. |
typedef enum { AG_SETTING_SOURCE_NONE = 0, AG_SETTING_SOURCE_ACCOUNT, AG_SETTING_SOURCE_PROFILE, } AgSettingSource;
AgSettingSource ag_account_get_value (AgAccount *account
,const gchar *key
,GValue *value
);
Gets the value of the configuration setting key
: value
must be a
GValue initialized to the type of the setting.
|
the AgAccount. |
|
the name of the setting to retrieve. |
|
an initialized GValue to receive the setting's value. |
Returns : |
one of AgSettingSource: AG_SETTING_SOURCE_NONE if the setting is
not present, AG_SETTING_SOURCE_ACCOUNT if the setting comes from the
account configuration, or AG_SETTING_SOURCE_PROFILE if the value comes as
predefined in the profile.
|
void ag_account_set_value (AgAccount *account
,const gchar *key
,const GValue *value
);
Sets the value of the configuration setting key
to the value value
.
If value
is NULL
, then the setting is unset.
|
the AgAccount. |
|
the name of the setting to change. |
|
a GValue holding the new setting's value. |
void ag_account_settings_iter_init (AgAccount *account
,AgAccountSettingIter *iter
,const gchar *key_prefix
);
Initializes iter
to iterate over the account settings. If key_prefix
is
not NULL
, only keys whose names start with key_prefix
will be iterated
over.
|
the AgAccount. |
|
an uninitialized AgAccountSettingIter structure. |
|
enumerate only the settings whose key starts with key_prefix .
|
gboolean ag_account_settings_iter_next (AgAccountSettingIter *iter
,const gchar **key
,const GValue **value
);
Iterates over the account keys. iter
must be an iterator previously
initialized with ag_account_settings_iter_init()
.
|
an initialized AgAccountSettingIter structure. |
|
a pointer to a string receiving the key name. |
|
a pointer to a pointer to a GValue, to receive the key value. |
Returns : |
TRUE if key and value have been set, FALSE if we there are no
more account settings to iterate over.
|
void (*AgAccountNotifyCb) (AgAccount *account
,const gchar *key
,gpointer user_data
);
This callback is invoked when the value of an account configuration setting
changes. If the callback was installed with ag_account_watch_key()
then key
is the name of the configuration setting which changed; if it was installed
with ag_account_watch_dir()
then key
is the same key prefix that was used
when installing this callback.
|
the AgAccount. |
|
the name of the key whose value has changed. |
|
the user data that was passed when installing this callback. |
AgAccountWatch ag_account_watch_key (AgAccount *account
,const gchar *key
,AgAccountNotifyCb callback
,gpointer user_data
);
Installs a watch on key
: callback
will be invoked whenever the value of
key
changes (or the key is removed).
|
the AgAccount. |
|
the name of the key to watch. |
|
a AgAccountNotifyCb callback to be called. |
|
pointer to user data, to be passed to callback .
|
Returns : |
a AgAccountWatch, which can then be used to remove this watch. |
AgAccountWatch ag_account_watch_dir (AgAccount *account
,const gchar *key_prefix
,AgAccountNotifyCb callback
,gpointer user_data
);
Installs a watch on all the keys under key_prefix
: callback
will be
invoked whenever the value of any of these keys changes (or a key is
removed).
|
the AgAccount. |
|
the prefix of the keys to watch. |
|
a AgAccountNotifyCb callback to be called. |
|
pointer to user data, to be passed to callback .
|
Returns : |
a AgAccountWatch, which can then be used to remove this watch. |
void ag_account_remove_watch (AgAccount *account
,AgAccountWatch watch
);
Removes the notification callback identified by watch
.
|
the AgAccount. |
|
the watch to remove. |
void (*AgAccountStoreCb) (AgAccount *account
,const GError *error
,gpointer user_data
);
This callback is invoked when storing the account settings is completed. If
error
is not NULL
, then some error occurred and the data has most likely
not been written.
|
the AgAccount. |
|
a GError, or NULL .
|
|
the user data that was passed to ag_account_store() .
|
void ag_account_store (AgAccount *account
,AgAccountStoreCb callback
,gpointer user_data
);
Store the account settings which have been changed into the account
database, and invoke callback
when the operation has been completed.
|
the AgAccount. |
|
function to be called when the settings have been written. |
|
pointer to user data, to be passed to callback .
|
gboolean ag_account_store_blocking (AgAccount *account
,GError **error
);
Store the account settings which have been changed into the account database. This function does not return until the operation has completed.
|
the AgAccount. |
|
pointer to receive the GError, or NULL .
|
Returns : |
TRUE on success, FALSE on failure.
|
void ag_account_sign (AgAccount *account
,const gchar *key
,const gchar *token
);
Creates signature of the key
with given token
. The account must be
stored prior to calling this function.
|
|
|
the name of the key or prefix of the keys to be signed. |
|
aegis token (NULL teminated string) or NULL in order to use the application aegis ID token, for creating the signature. The application must possess (request) the token. |
gboolean ag_account_verify (AgAccount *account
,const gchar *key
,const gchar **token
);
Verify if the key is signed and the signature matches the value
and provides the aegis token which was used for signing the key
.
|
|
|
the name of the key or prefix of the keys to be verified. |
|
location to receive the pointer to aegis token. |
Returns : |
TRUE if the key is signed and the signature matches
the value.
|
gboolean ag_account_verify_with_tokens (AgAccount *account
,const gchar *key
,const gchar **tokens
);
Verify if the key
is signed with any of the tokens from the tokens
and the signature is valid.
|
|
|
the name of the key or prefix of the keys to be verified. |
|
array of aegis tokens. |
Returns : |
TRUE if the key is signed with any of the given tokens
and the signature is valid.
|
"deleted"
signalvoid user_function (AgAccount *account, gpointer user_data) : Run Last
Emitted when the account has been deleted.
|
the AgAccount. |
|
user data set when the signal handler was connected. |
"display-name-changed"
signalvoid user_function (AgAccount *account, gpointer user_data) : Run Last
Emitted when the account display name has changed.
|
the AgAccount. |
|
user data set when the signal handler was connected. |
"enabled"
signalvoid user_function (AgAccount *account, gchar *service, gboolean enabled, gpointer user_data) : Run Last
Emitted when the account "enabled" status was changed for one of its services, or for the account globally.
|
the AgAccount. |
|
the service which was enabled/disabled, or NULL if the global
enabledness of the account changed.
|
|
the new state of the account .
|
|
user data set when the signal handler was connected. |