Accounts.AccountService

g Accounts.AccountService Accounts.AccountService GObject.Object GObject.Object GObject.Object->Accounts.AccountService

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (account, service)

class

settings_iter_next (iter)

get_account ()

get_auth_data ()

get_changed_fields ()

get_enabled ()

get_service ()

get_settings_iter (key_prefix)

get_value (key, value)

get_variant (key)

set_value (key, value)

set_variant (key, value)

settings_iter_init (iter, key_prefix)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

account

Accounts.Account

r/w/co

account

enabled

bool

r

Whether the account service is enabled

service

Accounts.Service

r/w/co

service

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

Emitted when some setting has changed on the account service.

enabled

Emitted when the service enabled state changes.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Accounts.AccountService(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Accounts.AccountServiceClass

Opaque structure. Use related accessor functions.

classmethod new(account, service)
Parameters:
Returns:

a new Accounts.AccountService; call GObject.Object.unref() when you don’t need this object anymore.

Return type:

Accounts.AccountService

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 initialized Accounts.AccountSettingIter structure.

Returns:

True if key and value have been set, False if 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 call GObject.Object.ref() on it yourself.

Return type:

Accounts.Account

Get the Accounts.Account associated with self.

get_auth_data()
Returns:

a newly allocated Accounts.AuthData structure.

Return type:

Accounts.AuthData

Reads the authentication data stored in the account (merging the service-specific settings with the global account settings) and returns an Accounts.AuthData structure. 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 ::changed signal, and can be used to retrieve the set of changes.

get_enabled()
Returns:

True if the service is enabled, False otherwise.

Return type:

bool

Checks whether the underlying Accounts.Account is enabled and the selected Accounts.Service is enabled on it. If this method returns False, 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 call Accounts.Service.ref() on it yourself.

Return type:

Accounts.Service

Get the Accounts.Service associated with self.

get_settings_iter(key_prefix)
Parameters:

key_prefix (str or None) – enumerate only the settings whose key starts with key_prefix.

Returns:

an Accounts.AccountSettingIter.

Return type:

Accounts.AccountSettingIter

Creates a new iterator. This method is useful for language bindings only.

get_value(key, value)
Parameters:
Returns:

one of #AgSettingSource : Accounts.SettingSource.NONE if the setting is not present, Accounts.SettingSource.ACCOUNT if the setting comes from the account configuration, or Accounts.SettingSource.PROFILE if the value comes as predefined in the profile.

value:

an initialized GObject.Value to 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.Value initialized 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.Variant holding the setting value, or None. The returned GLib.Variant is owned by the account, and no guarantees are made about its lifetime. If the client wishes to keep it, it should call GLib.Variant.ref() on it.

source:

a pointer to an Accounts.SettingSource variable 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:

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:

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:

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 call Accounts.AccountSettingIter.get_next() to read the settings one by one.

Signal Details

Accounts.AccountService.signals.changed(account_service)
Signal Name:

changed

Flags:

RUN_LAST

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:

RUN_LAST

Parameters:
  • account_service (Accounts.AccountService) – The object which received the signal

  • enabled (bool) – whether the service is enabled.

Emitted when the service enabled state changes.

Property Details

Accounts.AccountService.props.account
Name:

account

Type:

Accounts.Account

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Accounts.Account used by the account service.

New in version 1.4.

Accounts.AccountService.props.enabled
Name:

enabled

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the account service is currently enabled. The value of this property is True if and only if the underlying Accounts.Account is enabled and the selected Accounts.Service is enabled on it. If this property is False, applications should not try to use this object.

New in version 1.4.

Accounts.AccountService.props.service
Name:

service

Type:

Accounts.Service

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Accounts.Service used by the account service.

New in version 1.4.