Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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
- newtype Config = Config (ManagedPtr Config)
- class (GObject o, IsDescendantOf Config o) => IsConfig o
- toConfig :: (MonadIO m, IsConfig o) => o -> m Config
- configGetValue :: (HasCallStack, MonadIO m, IsConfig a) => a -> Text -> Text -> m GVariant
- configGetValueAsync :: (HasCallStack, MonadIO m, IsConfig a, IsCancellable b) => a -> Text -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- configGetValueAsyncFinish :: (HasCallStack, MonadIO m, IsConfig a, IsAsyncResult b) => a -> b -> m GVariant
- configGetValues :: (HasCallStack, MonadIO m, IsConfig a) => a -> Text -> m GVariant
- configGetValuesAsync :: (HasCallStack, MonadIO m, IsConfig a, IsCancellable b) => a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- configGetValuesAsyncFinish :: (HasCallStack, MonadIO m, IsConfig a, IsAsyncResult b) => a -> b -> m GVariant
- configNew :: (HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) => a -> Maybe b -> m Config
- configNewAsync :: (HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- configNewAsyncFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m Config
- configSetValue :: (HasCallStack, MonadIO m, IsConfig a) => a -> Text -> Text -> GVariant -> m Bool
- configSetValueAsync :: (HasCallStack, MonadIO m, IsConfig a, IsCancellable b) => a -> Text -> Text -> GVariant -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- configSetValueAsyncFinish :: (HasCallStack, MonadIO m, IsConfig a, IsAsyncResult b) => a -> b -> m ()
- configUnset :: (HasCallStack, MonadIO m, IsConfig a) => a -> Text -> Text -> m Bool
- configUnwatch :: (HasCallStack, MonadIO m, IsConfig a) => a -> Maybe Text -> Maybe Text -> m Bool
- configWatch :: (HasCallStack, MonadIO m, IsConfig a) => a -> Maybe Text -> Maybe Text -> m Bool
- type C_ConfigValueChangedCallback = Ptr () -> CString -> CString -> Ptr GVariant -> Ptr () -> IO ()
- type ConfigValueChangedCallback = Text -> Text -> GVariant -> IO ()
- afterConfigValueChanged :: (IsConfig a, MonadIO m) => a -> ConfigValueChangedCallback -> m SignalHandlerId
- genClosure_ConfigValueChanged :: MonadIO m => ConfigValueChangedCallback -> m (GClosure C_ConfigValueChangedCallback)
- mk_ConfigValueChangedCallback :: C_ConfigValueChangedCallback -> IO (FunPtr C_ConfigValueChangedCallback)
- noConfigValueChangedCallback :: Maybe ConfigValueChangedCallback
- onConfigValueChanged :: (IsConfig a, MonadIO m) => a -> ConfigValueChangedCallback -> m SignalHandlerId
- wrap_ConfigValueChangedCallback :: ConfigValueChangedCallback -> C_ConfigValueChangedCallback
Exported types
Memory-managed wrapper type.
Constructors
Config (ManagedPtr Config) |
Instances
Eq Config Source # | |
IsGValue Config Source # | Convert |
GObject Config Source # | |
Defined in GI.IBus.Objects.Config Methods gobjectType :: IO GType # | |
HasParentTypes Config Source # | |
Defined in GI.IBus.Objects.Config | |
type ParentTypes Config Source # | |
Defined in GI.IBus.Objects.Config |
class (GObject o, IsDescendantOf Config o) => IsConfig o Source #
Instances
(GObject o, IsDescendantOf Config o) => IsConfig o Source # | |
Defined in GI.IBus.Objects.Config |
Methods
Overloaded methods
getValue
Arguments
:: (HasCallStack, MonadIO m, IsConfig a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m GVariant | Returns: A |
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
Arguments
:: (HasCallStack, MonadIO m, IsConfig a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Text |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Get the value of a configuration option asynchronously.
See also: configGetValue
.
getValueAsyncFinish
configGetValueAsyncFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsConfig a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m GVariant | Returns: A See also: |
Finish get value of a configuration option.
getValues
Arguments
:: (HasCallStack, MonadIO m, IsConfig a) | |
=> a |
|
-> Text |
|
-> m GVariant | Returns: A See also: |
Get all values in a section synchronously.
getValuesAsync
Arguments
:: (HasCallStack, MonadIO m, IsConfig a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Get all values in a section asynchronously.
See also: configGetValues
.
getValuesAsyncFinish
configGetValuesAsyncFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsConfig a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m GVariant | Returns: A See also: |
Finish get values in a section.
new
Arguments
:: (HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> m Config | Returns: A newly allocated |
Create a new Config
from existing DBusConnection
.
newAsync
Arguments
:: (HasCallStack, MonadIO m, IsDBusConnection a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
New an Config
asynchronously.
newAsyncFinish
Arguments
:: (HasCallStack, MonadIO m, IsAsyncResult a) | |
=> a |
|
-> m Config |
Finishes an operation started with configNewAsync
.
setValue
Arguments
:: (HasCallStack, MonadIO m, IsConfig a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> GVariant |
|
-> m Bool | Returns: See also: |
Set the value of a configuration option synchronously.
setValueAsync
Arguments
:: (HasCallStack, MonadIO m, IsConfig a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Text |
|
-> GVariant |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Set the value of a configuration option asynchronously.
See also: configSetValue
.
setValueAsyncFinish
configSetValueAsyncFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsConfig a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finish set value of a configuration option.
unset
Arguments
:: (HasCallStack, MonadIO m, IsConfig a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m Bool | Returns: See also: |
Remove an entry of a configuration option.
unwatch
Arguments
:: (HasCallStack, MonadIO m, IsConfig a) | |
=> a |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m Bool | Returns: See also: ibus_config_watch. |
Unsubscribe from the configuration option change notification.
watch
Arguments
:: (HasCallStack, MonadIO m, IsConfig a) | |
=> a |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m Bool | Returns: See also: |
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 |
|
-> Text |
|
-> GVariant |
|
-> 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
genClosure_ConfigValueChanged :: MonadIO m => ConfigValueChangedCallback -> m (GClosure C_ConfigValueChangedCallback) Source #
Wrap the callback into a GClosure
.
mk_ConfigValueChangedCallback :: C_ConfigValueChangedCallback -> IO (FunPtr C_ConfigValueChangedCallback) Source #
Generate a function pointer callable from C code, from a C_ConfigValueChangedCallback
.
noConfigValueChangedCallback :: Maybe ConfigValueChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
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