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:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when configuration value is changed. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class IBus.Config(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
connection (
Gio.DBusConnection
) – AGio.DBusConnection
.cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
.
- Raises:
- Returns:
A newly allocated
IBus.Config
corresponding to connection.- Return type:
Create a new
IBus.Config
from existingGio.DBusConnection
.
- classmethod new_async(connection, cancellable, callback, *user_data)¶
- Parameters:
connection (
Gio.DBusConnection
) – AnGio.DBusConnection
.cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – AGio.AsyncReadyCallback
to call when the request is satisfied. The callback should not beNone
.
New an
IBus.Config
asynchronously.
- classmethod new_async_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – AGio.AsyncResult
obtained from theGio.AsyncReadyCallback
pass toIBus.Config.new_async
().- Raises:
- Returns:
A newly allocated
IBus.Config
.- Return type:
Finishes an operation started with
IBus.Config.new_async
().
- get_value(section, name)¶
- Parameters:
- Returns:
A
GLib.Variant
orNone
. Free withGLib.Variant.unref
().- Return type:
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
orNone
) – AGio.Cancellable
orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – Callback function to invoke when the return value is ready.
Get the value of a configuration option asynchronously.
See also:
IBus.Config.get_value
().
- get_value_async_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
.- Raises:
- Returns:
A
GLib.Variant
orNone
if error is set. Free withGLib.Variant.unref
().See also:
IBus.Config.get_value_async
().- Return type:
Finish get value of a configuration option.
- get_values(section)¶
- Parameters:
section (
str
) – Section name of the configuration option.- Returns:
A
GLib.Variant
orNone
. Free withGLib.Variant.unref
().See also:
IBus.Config.set_value
().- Return type:
Get all values in a section synchronously.
- get_values_async(section, timeout_ms, cancellable, callback, *user_data)¶
- Parameters:
section (
str
) – Section name of the configuration option.timeout_ms (
int
) – The timeout in milliseconds or -1 to use the default timeout.cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – Callback function to invoke when the return value is ready.
Get all values in a section asynchronously.
See also:
IBus.Config.get_values
().
- get_values_async_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
.- Raises:
- Returns:
A
GLib.Variant
orNone
if error is set. Free withGLib.Variant.unref
().See also:
IBus.Config.get_values_async
().- Return type:
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
) – AGLib.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:
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
) – AGLib.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
orNone
) – AGio.Cancellable
orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – Callback function to invoke when the return value is ready.
Set the value of a configuration option asynchronously.
See also:
IBus.Config.set_value
().
- set_value_async_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
.- Raises:
- Returns:
True
orFalse
if error is set.See also:
IBus.Config.set_value_async
().- Return type:
Finish set value of a configuration option.
- unset(section, name)¶
- Parameters:
- Returns:
True
if succeed;False
otherwise.See also:
IBus.Config.get_value
().- Return type:
Remove an entry of a configuration option.
- unwatch(section, name)¶
- Parameters:
- Returns:
True
if succeed;False
otherwise.See also:
IBus.Config.watch
.- Return type:
Unsubscribe from the configuration option change notification.
- watch(section, name)¶
- Parameters:
- Returns:
True
if succeed;False
otherwise.See also:
IBus.Config.unwatch
().- Return type:
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 callIBus.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:
- Parameters:
config (
IBus.Config
) – The object which received the signalsection (
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.