Accounts.AccountService¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
account |
||
r |
Whether the account service is enabled |
||
r/w/co |
service |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Emitted when some setting has changed on the account service. |
|
Emitted when the service enabled state changes. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Accounts.AccountService(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Opaque structure. Use related accessor functions.
- classmethod new(account, service)¶
- Parameters:
account (
Accounts.Account) – anAccounts.Account.service (
Accounts.ServiceorNone) – anAccounts.Servicesupported by account.
- Returns:
a new
Accounts.AccountService; callGObject.Object.unref() when you don’t need this object anymore.- Return type:
Constructor. If service is
None, the returned object will operate on the global account settings.
- classmethod settings_iter_next(iter)¶
- Parameters:
iter (
Accounts.AccountSettingIter) – an initializedAccounts.AccountSettingIterstructure.- Returns:
Trueif key and value have been set,Falseif we there are no more account settings to iterate over.- key:
a pointer to a string receiving the key name.
- value:
a pointer to a pointer to a
GObject.Value, to receive the key value.
- Return type:
(
bool, key:str, value:GObject.Value)
Iterates over the account keys. iter must be an iterator previously initialized with
Accounts.AccountService.settings_iter_init().Deprecated since version 1.4: Use
Accounts.AccountSettingIter.get_next() instead.
- get_account()¶
- Returns:
the underlying
Accounts.Account. The reference count on it is not incremented, so if you need to use it beyond the lifetime of self, you need to callGObject.Object.ref() on it yourself.- Return type:
Get the
Accounts.Accountassociated with self.
- get_auth_data()¶
- Returns:
a newly allocated
Accounts.AuthDatastructure.- Return type:
Reads the authentication data stored in the account (merging the service-specific settings with the global account settings) and returns an
Accounts.AuthDatastructure. The method and mechanism are read from the “auth/method” and “auth/mechanism” keys, respectively. The authentication parameters are found under the “auth/<method>/<mechanism>/” group.
- get_changed_fields()¶
- Returns:
a newly allocated array of strings describing the keys of the fields which have been altered. It must be free’d with
GLib.strfreev().- Return type:
[
str]
This method should be called only in the context of a handler of the
Accounts.AccountService::changedsignal, and can be used to retrieve the set of changes.
- get_enabled()¶
-
Checks whether the underlying
Accounts.Accountis enabled and the selectedAccounts.Serviceis enabled on it. If this method returnsFalse, applications should not try to use this object.
- get_service()¶
- Returns:
the underlying
Accounts.Service. The reference count on it is not incremented, so if you need to use it beyond the lifetime of self, you need to callAccounts.Service.ref() on it yourself.- Return type:
Get the
Accounts.Serviceassociated with 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
#AgSettingSource: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.AccountService.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.
- 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.AccountService.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 account 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. After calling this method, one would typically callAccounts.AccountSettingIter.get_next() to read the settings one by one.
Signal Details¶
- Accounts.AccountService.signals.changed(account_service)¶
- Signal Name:
changed- Flags:
- Parameters:
account_service (
Accounts.AccountService) – The object which received the signal
Emitted when some setting has changed on the account service. You can use the
Accounts.AccountService.get_changed_fields() method to retrieve the list of the settings which have changed.
- Accounts.AccountService.signals.enabled(account_service, enabled)¶
- Signal Name:
enabled- Flags:
- Parameters:
account_service (
Accounts.AccountService) – The object which received the signalenabled (
bool) – whether the service is enabled.
Emitted when the service enabled state changes.
Property Details¶
- Accounts.AccountService.props.account¶
- Name:
account- Type:
- Default Value:
- Flags:
The
Accounts.Accountused by the account service.New in version 1.4.
- Accounts.AccountService.props.enabled¶
-
Whether the account service is currently enabled. The value of this property is
Trueif and only if the underlyingAccounts.Accountis enabled and the selectedAccounts.Serviceis enabled on it. If this property isFalse, applications should not try to use this object.New in version 1.4.
- Accounts.AccountService.props.service¶
- Name:
service- Type:
- Default Value:
- Flags:
The
Accounts.Serviceused by the account service.New in version 1.4.