gi-ibus-1.5.2: IBus bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.IBus.Objects.Config

Description

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

Currently, IBusConfig supports gconf.

Synopsis

Exported types

newtype Config Source #

Memory-managed wrapper type.

Constructors

Config (ManagedPtr Config) 

Instances

Instances details
Eq Config Source # 
Instance details

Defined in GI.IBus.Objects.Config

Methods

(==) :: Config -> Config -> Bool

(/=) :: Config -> Config -> Bool

GObject Config Source # 
Instance details

Defined in GI.IBus.Objects.Config

ManagedPtrNewtype Config Source # 
Instance details

Defined in GI.IBus.Objects.Config

Methods

toManagedPtr :: Config -> ManagedPtr Config

TypedObject Config Source # 
Instance details

Defined in GI.IBus.Objects.Config

Methods

glibType :: IO GType

IsGValue Config Source #

Convert Config to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.IBus.Objects.Config

Methods

toGValue :: Config -> IO GValue

fromGValue :: GValue -> IO Config

HasParentTypes Config Source # 
Instance details

Defined in GI.IBus.Objects.Config

type ParentTypes Config Source # 
Instance details

Defined in GI.IBus.Objects.Config

type ParentTypes Config = '[Proxy, DBusProxy, Object, AsyncInitable, DBusInterface, Initable]

class (GObject o, IsDescendantOf Config o) => IsConfig o Source #

Type class for types which can be safely cast to Config, for instance with toConfig.

Instances

Instances details
(GObject o, IsDescendantOf Config o) => IsConfig o Source # 
Instance details

Defined in GI.IBus.Objects.Config

toConfig :: (MonadIO m, IsConfig o) => o -> m Config Source #

Cast to Config, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getValue

configGetValue Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a) 
=> a

config: An Config

-> Text

section: Section name of the configuration option.

-> Text

name: Name of the configure option.

-> m GVariant

Returns: A GVariant or Nothing. Free with variantUnref.

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: configSetValue.

getValueAsync

configGetValueAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a, IsCancellable b) 
=> a

config: An Config

-> Text

section: Section name of the configuration option.

-> Text

name: Name of the configure option.

-> Int32

timeoutMs: The timeout in milliseconds or -1 to use the default timeout.

-> Maybe b

cancellable: A Cancellable or Nothing.

-> Maybe AsyncReadyCallback

callback: Callback function to invoke when the return value is ready.

-> m () 

Get the value of a configuration option asynchronously.

See also: configGetValue.

getValueAsyncFinish

configGetValueAsyncFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a, IsAsyncResult b) 
=> a

config: A Config.

-> b

result: A AsyncResult.

-> m GVariant

Returns: A GVariant or Nothing if error is set. Free with variantUnref.

See also: configGetValueAsync. (Can throw GError)

Finish get value of a configuration option.

getValues

configGetValues Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a) 
=> a

config: An Config

-> Text

section: Section name of the configuration option.

-> m GVariant

Returns: A GVariant or Nothing. Free with variantUnref.

See also: configSetValue.

Get all values in a section synchronously.

getValuesAsync

configGetValuesAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a, IsCancellable b) 
=> a

config: An Config

-> Text

section: Section name of the configuration option.

-> Int32

timeoutMs: The timeout in milliseconds or -1 to use the default timeout.

-> Maybe b

cancellable: A Cancellable or Nothing.

-> Maybe AsyncReadyCallback

callback: Callback function to invoke when the return value is ready.

-> m () 

Get all values in a section asynchronously.

See also: configGetValues.

getValuesAsyncFinish

configGetValuesAsyncFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a, IsAsyncResult b) 
=> a

config: A Config.

-> b

result: A AsyncResult.

-> m GVariant

Returns: A GVariant or Nothing if error is set. Free with variantUnref.

See also: configGetValuesAsync. (Can throw GError)

Finish get values in a section.

new

configNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) 
=> a

connection: A DBusConnection.

-> Maybe b

cancellable: A Cancellable or Nothing.

-> m Config

Returns: A newly allocated Config corresponding to connection. (Can throw GError)

Create a new Config from existing DBusConnection.

newAsync

configNewAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) 
=> a

connection: An DBusConnection.

-> Maybe b

cancellable: A Cancellable or Nothing.

-> Maybe AsyncReadyCallback

callback: A AsyncReadyCallback to call when the request is satisfied. The callback should not be Nothing.

-> m () 

New an Config asynchronously.

newAsyncFinish

configNewAsyncFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsAsyncResult a) 
=> a

res: A AsyncResult obtained from the AsyncReadyCallback pass to configNewAsync.

-> m Config

Returns: A newly allocated Config. (Can throw GError)

Finishes an operation started with configNewAsync.

setValue

configSetValue Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a) 
=> a

config: An Config

-> Text

section: Section name of the configuration option.

-> Text

name: Name of the configure option its self.

-> GVariant

value: A GVariant that holds the value. If the value is floating, the function takes ownership of it.

-> m Bool

Returns: True if succeed; False otherwise.

See also: configGetValue.

Set the value of a configuration option synchronously.

setValueAsync

configSetValueAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a, IsCancellable b) 
=> a

config: An Config

-> Text

section: Section name of the configuration option.

-> Text

name: Name of the configure option.

-> GVariant

value: A GVariant that holds the value. If the value is floating, the function takes ownership of it.

-> Int32

timeoutMs: The timeout in milliseconds or -1 to use the default timeout.

-> Maybe b

cancellable: A Cancellable or Nothing.

-> Maybe AsyncReadyCallback

callback: Callback function to invoke when the return value is ready.

-> m () 

Set the value of a configuration option asynchronously.

See also: configSetValue.

setValueAsyncFinish

configSetValueAsyncFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a, IsAsyncResult b) 
=> a

config: A Config.

-> b

result: A AsyncResult.

-> m ()

(Can throw GError)

Finish set value of a configuration option.

unset

configUnset Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a) 
=> a

config: An Config

-> Text

section: Section name of the configuration option.

-> Text

name: Name of the configure option its self.

-> m Bool

Returns: True if succeed; False otherwise.

See also: configGetValue.

Remove an entry of a configuration option.

unwatch

configUnwatch Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a) 
=> a

config: An Config

-> Maybe Text

section: Section name of the configuration option.

-> Maybe Text

name: Name of the configure option its self.

-> m Bool

Returns: True if succeed; False otherwise.

See also: ibus_config_watch.

Unsubscribe from the configuration option change notification.

watch

configWatch Source #

Arguments

:: (HasCallStack, MonadIO m, IsConfig a) 
=> a

config: An Config

-> Maybe Text

section: Section name of the configuration option.

-> Maybe Text

name: Name of the configure option its self.

-> m Bool

Returns: True if succeed; False otherwise.

See also: configUnwatch.

Subscribe to the configuration option change notification.

Until this function is called, every change will be notified to the client through valueChanged signal. Clients should call configWatch with the sections they are interested in, to reduce the number of D-Bus messages.

Signals

valueChanged

type C_ConfigValueChangedCallback = Ptr () -> CString -> CString -> Ptr GVariant -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type ConfigValueChangedCallback Source #

Arguments

 = Text

section: Section name.

-> Text

name: Name of the property.

-> GVariant

value: Value.

-> IO () 

Emitted when configuration value is changed. <note><para>Argument userData is ignored in this function.</para></note>

afterConfigValueChanged :: (IsConfig a, MonadIO m) => a -> ConfigValueChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the valueChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after config #valueChanged callback

mk_ConfigValueChangedCallback :: C_ConfigValueChangedCallback -> IO (FunPtr C_ConfigValueChangedCallback) Source #

Generate a function pointer callable from C code, from a C_ConfigValueChangedCallback.

onConfigValueChanged :: (IsConfig a, MonadIO m) => a -> ConfigValueChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the valueChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on config #valueChanged callback