IBus.Config

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable Gio.DBusInterface Gio.DBusInterface GObject.GInterface->Gio.DBusInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object Gio.DBusProxy Gio.DBusProxy GObject.Object->Gio.DBusProxy Gio.AsyncInitable->Gio.DBusProxy Gio.DBusInterface->Gio.DBusProxy IBus.Proxy IBus.Proxy Gio.DBusProxy->IBus.Proxy Gio.Initable->Gio.DBusProxy IBus.Config IBus.Config IBus.Proxy->IBus.Config

Subclasses:

None

Methods

Inherited:

IBus.Proxy (1), Gio.DBusProxy (25), GObject.Object (37), Gio.AsyncInitable (4), Gio.DBusInterface (3), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

new (connection, cancellable)

class

new_async (connection, cancellable, callback, *user_data)

class

new_async_finish (res)

get_value (section, name)

get_value_async (section, name, timeout_ms, cancellable, callback, *user_data)

get_value_async_finish (result)

get_values (section)

get_values_async (section, timeout_ms, cancellable, callback, *user_data)

get_values_async_finish (result)

set_value (section, name, value)

set_value_async (section, name, value, timeout_ms, cancellable, callback, *user_data)

set_value_async_finish (result)

unset (section, name)

unwatch (section, name)

watch (section, name)

Virtual Methods

Inherited:

IBus.Proxy (1), Gio.DBusProxy (2), GObject.Object (7), Gio.AsyncInitable (2), Gio.DBusInterface (3), Gio.Initable (1)

Properties

Inherited:

Gio.DBusProxy (9)

Signals

Inherited:

IBus.Proxy (1), Gio.DBusProxy (2), GObject.Object (1)

Name

Short Description

value-changed

Emitted when configuration value is changed.

Fields

Inherited:

IBus.Proxy (1), Gio.DBusProxy (2), GObject.Object (1)

Name

Type

Access

Description

parent

IBus.Proxy

r

Class Details

class IBus.Config(**kwargs)
Bases:

IBus.Proxy

Abstract:

No

Structure:

IBus.ConfigClass

An IBus.Config provides engine configuration methods such as get and set the configure settings to configuration file.

Currently, IBus.Config supports gconf.

classmethod new(connection, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

A newly allocated IBus.Config corresponding to connection.

Return type:

IBus.Config

Create a new IBus.Config from existing Gio.DBusConnection.

classmethod new_async(connection, cancellable, callback, *user_data)
Parameters:

New an IBus.Config asynchronously.

classmethod new_async_finish(res)
Parameters:

res (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback pass to IBus.Config.new_async().

Raises:

GLib.Error

Returns:

A newly allocated IBus.Config.

Return type:

IBus.Config

Finishes an operation started with IBus.Config.new_async().

get_value(section, name)
Parameters:
  • section (str) – Section name of the configuration option.

  • name (str) – Name of the configure option.

Returns:

A GLib.Variant or None. Free with GLib.Variant.unref().

Return type:

GLib.Variant

Get the value of a configuration option synchronously.

GConf stores configure options in a tree-like structure, and the IBus related setting is at /desktop/ibus, thus, section here is a path from there, while name is the key of that configuration option.

ibus-chewing, for example, stores its setting in /desktop/ibus/engine/Chewing, so the section name for it is “engine/Chewing”. See also: IBus.Config.set_value().

get_value_async(section, name, timeout_ms, cancellable, callback, *user_data)
Parameters:
  • section (str) – Section name of the configuration option.

  • name (str) – Name of the configure option.

  • timeout_ms (int) – The timeout in milliseconds or -1 to use the default timeout.

  • cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

  • callback (Gio.AsyncReadyCallback or None) – Callback function to invoke when the return value is ready.

  • user_data (object or None) – The data to pass to callback.

Get the value of a configuration option asynchronously.

See also: IBus.Config.get_value().

get_value_async_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult.

Raises:

GLib.Error

Returns:

A GLib.Variant or None if error is set. Free with GLib.Variant.unref().

See also: IBus.Config.get_value_async().

Return type:

GLib.Variant

Finish get value of a configuration option.

get_values(section)
Parameters:

section (str) – Section name of the configuration option.

Returns:

A GLib.Variant or None. Free with GLib.Variant.unref().

See also: IBus.Config.set_value().

Return type:

GLib.Variant

Get all values in a section synchronously.

get_values_async(section, timeout_ms, cancellable, callback, *user_data)
Parameters:

Get all values in a section asynchronously.

See also: IBus.Config.get_values().

get_values_async_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult.

Raises:

GLib.Error

Returns:

A GLib.Variant or None if error is set. Free with GLib.Variant.unref().

See also: IBus.Config.get_values_async().

Return type:

GLib.Variant

Finish get values in a section.

set_value(section, name, value)
Parameters:
  • section (str) – Section name of the configuration option.

  • name (str) – Name of the configure option its self.

  • value (GLib.Variant) – A GLib.Variant that holds the value. If the value is floating, the function takes ownership of it.

Returns:

True if succeed; False otherwise.

See also: IBus.Config.get_value().

Return type:

bool

Set the value of a configuration option synchronously.

set_value_async(section, name, value, timeout_ms, cancellable, callback, *user_data)
Parameters:
  • section (str) – Section name of the configuration option.

  • name (str) – Name of the configure option.

  • value (GLib.Variant) – A GLib.Variant that holds the value. If the value is floating, the function takes ownership of it.

  • timeout_ms (int) – The timeout in milliseconds or -1 to use the default timeout.

  • cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

  • callback (Gio.AsyncReadyCallback or None) – Callback function to invoke when the return value is ready.

  • user_data (object or None) – The data to pass to callback.

Set the value of a configuration option asynchronously.

See also: IBus.Config.set_value().

set_value_async_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult.

Raises:

GLib.Error

Returns:

True or False if error is set.

See also: IBus.Config.set_value_async().

Return type:

bool

Finish set value of a configuration option.

unset(section, name)
Parameters:
  • section (str) – Section name of the configuration option.

  • name (str) – Name of the configure option its self.

Returns:

True if succeed; False otherwise.

See also: IBus.Config.get_value().

Return type:

bool

Remove an entry of a configuration option.

unwatch(section, name)
Parameters:
  • section (str or None) – Section name of the configuration option.

  • name (str or None) – Name of the configure option its self.

Returns:

True if succeed; False otherwise.

See also: IBus.Config.watch.

Return type:

bool

Unsubscribe from the configuration option change notification.

watch(section, name)
Parameters:
  • section (str or None) – Section name of the configuration option.

  • name (str or None) – Name of the configure option its self.

Returns:

True if succeed; False otherwise.

See also: IBus.Config.unwatch().

Return type:

bool

Subscribe to the configuration option change notification.

Until this function is called, every change will be notified to the client through IBus.Config ::value-changed signal. Clients should call IBus.Config.watch() with the sections they are interested in, to reduce the number of D-Bus messages.

Signal Details

IBus.Config.signals.value_changed(config, section, name, value)
Signal Name:

value-changed

Flags:

RUN_LAST

Parameters:
  • config (IBus.Config) – The object which received the signal

  • section (str) – Section name.

  • name (str) – Name of the property.

  • value (GLib.Variant) – Value.

Emitted when configuration value is changed.

Argument user_data is ignored in this function.