Accounts.Account¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r |
The display name of the account |
||
r |
Whether the account is enabled |
||
w/co |
foreign |
||
r/w/co |
The AgAccountId of the account |
||
r/w/co |
manager |
||
r/w/co |
provider |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Emitted when the account has been deleted. |
|
Emitted when the account display name has changed. |
|
Emitted when the account “enabled” status was changed for one of its services, or for the account globally. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
id |
r |
||
parent_instance |
r |
Class Details¶
- class Accounts.Account(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Opaque structure. Use related accessor functions.
- delete()¶
Deletes the account. Call
Accounts.Account.store() in order to record the change in the storage.
- get_enabled()¶
-
Gets whether the selected service is enabled for self.
- get_manager()¶
- Returns:
the
Accounts.Manager.- Return type:
Get the
Accounts.Managerfor self.
- get_provider_name()¶
- Returns:
the name of the provider.
- Return type:
Get the name of the provider of self.
- get_selected_service()¶
- Returns:
the selected service, or
Noneif no service is selected.- Return type:
Gets the selected
Accounts.Servicefor self.
- get_settings_iter(key_prefix)¶
- Parameters:
key_prefix (
strorNone) – enumerate only the settings whose key starts with key_prefix.- Returns:
- Return type:
Creates a new iterator. This method is useful for language bindings only.
- get_value(key, value)¶
- Parameters:
key (
str) – the name of the setting to retrieve.value (
GObject.Value) – an initializedGObject.Valueto receive the setting’s value.
- Returns:
one of
Accounts.SettingSource:Accounts.SettingSource.NONEif the setting is not present,Accounts.SettingSource.ACCOUNTif the setting comes from the account configuration, orAccounts.SettingSource.PROFILEif the value comes as predefined in the profile.- value:
an initialized
GObject.Valueto receive the setting’s value.
- Return type:
(
Accounts.SettingSource, value:GObject.Value)
Gets the value of the configuration setting key: value must be a
GObject.Valueinitialized to the type of the setting.Deprecated since version 1.4: Use
Accounts.Account.get_variant() instead.
- get_variant(key)¶
- Parameters:
key (
str) – the name of the setting to retrieve.- Returns:
a
GLib.Variantholding the setting value, orNone. The returnedGLib.Variantis owned by the account, and no guarantees are made about its lifetime. If the client wishes to keep it, it should callGLib.Variant.ref() on it.- source:
a pointer to an
Accounts.SettingSourcevariable which will tell whether the setting was retrieved from the accounts DB or from a service template.
- Return type:
(
GLib.Variant, source:Accounts.SettingSource)
Gets the value of the configuration setting key.
New in version 1.4.
- list_enabled_services()¶
- Returns:
a
GLib.ListofAccounts.Serviceitems representing all the services which are enabled. Must be free’d withAccounts.Service.list_free().- Return type:
Gets a list of services that are enabled for self.
- list_services()¶
- Returns:
a
GLib.ListofAccounts.Serviceitems representing all the services supported by this account. Must be free’d withAccounts.Service.list_free().- Return type:
Get the list of services for self. If the
Accounts.Managerwas created with specified service_type this will return only services with this service_type.
- list_services_by_type(service_type)¶
- Parameters:
service_type (
str) – the service type which all the returned services should provide.- Returns:
a
GLib.ListofAccounts.Serviceitems representing all the services supported by this account which provide service_type. Must be free’d withAccounts.Service.list_free().- Return type:
Get the list of services supported by self, filtered by service_type.
- remove_watch(watch)¶
- Parameters:
watch (
Accounts.AccountWatch) – the watch to remove.
Removes the notification callback identified by watch.
- select_service(service)¶
- Parameters:
service (
Accounts.ServiceorNone) – theAccounts.Serviceto select.
Selects the configuration of service service: from now on, all the subsequent calls on the
Accounts.Accountconfiguration will act on the service. If service isNone, the global account configuration is selected.Note that if self is being shared with other code one must take special care to make sure the desired service is always selected.
- set_display_name(display_name)¶
- Parameters:
display_name (
str) – the display name to set.
Changes the display name for self to display_name.
- set_enabled(enabled)¶
- Parameters:
enabled (
bool) – whether self should be enabled.
Sets the “enabled” flag on the selected service for self.
- set_value(key, value)¶
- Parameters:
key (
str) – the name of the setting to change.value (
GObject.ValueorNone) – aGObject.Valueholding the new setting’s value.
Sets the value of the configuration setting key to the value value. If value is
None, then the setting is unset.Deprecated since version 1.4: Use
Accounts.Account.set_variant() instead.
- set_variant(key, value)¶
- Parameters:
key (
str) – the name of the setting to change.value (
GLib.VariantorNone) – aGLib.Variantholding the new setting’s value.
Sets the value of the configuration setting key to the value value. If value has a floating reference, the self will take ownership of it. If value is
None, then the setting is unset.New in version 1.4.
- settings_iter_init(iter, key_prefix)¶
- Parameters:
iter (
Accounts.AccountSettingIter) – an uninitializedAccounts.AccountSettingIterstructure.key_prefix (
strorNone) – enumerate only the settings whose key starts with key_prefix.
Initializes iter to iterate over the account settings. If key_prefix is not
None, only keys whose names start with key_prefix will be iterated over.
- sign(key, token)¶
- Parameters:
Creates signature of the key with given token. The account must be stored prior to calling this function.
- store(callback, *user_data)¶
- Parameters:
callback (
Accounts.AccountStoreCb) – function to be called when the settings have been written.user_data (
objectorNone) – pointer to user data, to be passed to callback.
Commit the changed account settings to the account database, and invoke callback when the operation has been completed.
Deprecated since version 1.4: Use
Accounts.Account.store_async() instead.
- store_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.callback (
Gio.AsyncReadyCallbackorNone) – function to be called when the settings have been written.user_data (
objectorNone) – pointer to user data, to be passed to callback.
Commit the changed account settings to the account database, and invoke callback when the operation has been completed.
New in version 1.4.
- store_blocking()¶
- Raises:
- Returns:
- Return type:
Commit the changed account settings to the account database, and invoke callback when the operation has been completed.
- store_finish(res)¶
- Parameters:
res (
Gio.AsyncResult) – AGio.AsyncResultobtained from theGio.AsyncReadyCallbackpassed toAccounts.Account.store_async().- Raises:
- Returns:
- Return type:
Finishes the store operation started by
Accounts.Account.store_async().New in version 1.4.
- supports_service(service_type)¶
- Parameters:
service_type (
str) – the name of the service type to check for- Returns:
Trueif self supports the service type service_type,Falseotherwise.- Return type:
Get whether service_type is supported on self.
- verify(key, token)¶
- Parameters:
- Returns:
Trueif the key is signed and the signature matches the value,Falseotherwise.- Return type:
Verify if the key is signed and the signature matches the value and provides the aegis token which was used for signing the key.
- verify_with_tokens(key, tokens)¶
- Parameters:
- Returns:
Trueif the key is signed with any of the given tokens and the signature is valid,Falseotherwise.- Return type:
Verify if the key is signed with any of the tokens from the tokens and the signature is valid.
- watch_dir(key_prefix, callback, *user_data)¶
- Parameters:
key_prefix (
str) – the prefix of the keys to watch.callback (
Accounts.AccountNotifyCb) – aAccounts.AccountNotifyCbcallback to be called.user_data (
objectorNone) – pointer to user data, to be passed to callback.
- Returns:
a
Accounts.AccountWatch, which can then be used to remove this watch.- Return type:
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).
- watch_key(key, callback, *user_data)¶
- Parameters:
key (
str) – the name of the key to watch.callback (
Accounts.AccountNotifyCb) – aAccounts.AccountNotifyCbcallback to be called.user_data (
objectorNone) – pointer to user data, to be passed to callback.
- Returns:
a
Accounts.AccountWatch, which can then be used to remove this watch.- Return type:
Installs a watch on key: callback will be invoked whenever the value of key changes (or the key is removed).
Signal Details¶
- Accounts.Account.signals.deleted(account)¶
- Signal Name:
deleted- Flags:
- Parameters:
account (
Accounts.Account) – The object which received the signal
Emitted when the account has been deleted.
- Accounts.Account.signals.display_name_changed(account)¶
- Signal Name:
display-name-changed- Flags:
- Parameters:
account (
Accounts.Account) – The object which received the signal
Emitted when the account display name has changed.
- Accounts.Account.signals.enabled(account, service, enabled)¶
- Signal Name:
enabled- Flags:
- Parameters:
account (
Accounts.Account) – The object which received the signalservice (
str) – the service which was enabled/disabled, orNoneif the global enabledness of the account changed.enabled (
bool) – the new state of the account.
Emitted when the account “enabled” status was changed for one of its services, or for the account globally.
Property Details¶
- Accounts.Account.props.display_name¶
-
The display name of the account.
New in version 1.4.
- Accounts.Account.props.enabled¶
-
Whether the account is currently enabled.
New in version 1.4.
- Accounts.Account.props.foreign¶
- Name:
foreign- Type:
- Default Value:
- Flags:
foreign
- Accounts.Account.props.id¶
- Name:
id- Type:
- Default Value:
0- Flags:
The AgAccountId for the account.
- Accounts.Account.props.manager¶
- Name:
manager- Type:
- Default Value:
- Flags:
The
Accounts.Managerfrom which the account was instantiated.New in version 1.4.