Top | ![]() |
![]() |
![]() |
![]() |
IMSettingsClient provides interface methods to imsettings-daemon to obtain a sort of informations for Input Method, operating something through imsettings-daemon to Input Method. This class is supposed to be the main entrance for all the client applications.
Either of functionalities in imsettings-daemon can be accessed through DBus instead of this class though, results of them needs to be sorted out to the appropriate types of values as needed.
Please see documentation of each methods for more details of DBus call.
IMSettingsClient *
imsettings_client_new (const gchar *locale
);
Creates an instance of IMSettingsClient.
gboolean imsettings_client_set_locale (IMSettingsClient *client
,const gchar *locale
);
Update the locale information in client
with locale
.
const gchar *
imsettings_client_get_locale (IMSettingsClient *client
);
Obtains current locale information in client
.
gboolean imsettings_client_set_desktop (IMSettingsClient *client
,const gchar *desktop
);
Update the desktop name in client
to desktop
. if desktop
is NULL
,
the desktop detection will be done in the server side.
const gchar *
imsettings_client_get_desktop (IMSettingsClient *client
);
Obtains current desktop information in client
.
gboolean
imsettings_client_ping (IMSettingsClient *client
);
Check whether the process is running.
guint imsettings_client_get_version (IMSettingsClient *client
,GCancellable *cancellable
,GError **error
);
Obtains the version information of imsettings-daemon running.
This is expected to invoke at first if the return value is same to
IMSETTINGS_SETTINGS_API_VERSION
. otherwise it may not works as expected
due to the changes of the implementation between imsettings-daemon and
client APIs.
You could access through DBus API instead:
1 2 3 4 5 |
<interface name='com.redhat.imsettings'> <method name='GetVersion'> <arg type='u' name='version' direction='out' /> </method> </interface> |
GVariant * imsettings_client_get_info_variants (IMSettingsClient *client
,GCancellable *cancellable
,GError **error
);
Obtains all of the Input Method information available on the system.
You could access through DBus API instead:
1 2 3 4 5 6 |
<interface name='com.redhat.imsettings'> <method name='GetInfoVariants'> <arg type='s' name='lang' direction='in' /> <arg type='a{sv}' name='ret' direction='out' /> </method> </interface> |
client |
||
cancellable |
a GCancellable or |
[allow-none] |
error |
a GError to store an error if any, or |
[allow-none] |
a GVariant contains some pairs of an Input Method name and
a GVariant that can converts to IMSettingsInfo through
imsettings_info_new()
. otherwise NULL
.
GVariant * imsettings_client_get_info_variant (IMSettingsClient *client
,const gchar *module
,GCancellable *cancellable
,GError **error
);
Obtains the information for the specific Input Method in module
.
You could access through DBus API instead:
1 2 3 4 5 6 7 |
<interface name='com.redhat.imsettings'> <method name='GetInfoVariant'> <arg type='s' name='lang' direction='in' /> <arg type='s' name='name' direction='in' /> <arg type='a{sv}' name='ret' direction='out' /> </method> </interface> |
client |
||
module |
an Input Method name to obtain the information. |
|
cancellable |
a GCancellable or |
[allow-none] |
error |
a GError to store an error if any, or |
[allow-none] |
a GVariant that can converts to IMSettingsInfo through
imsettings_info_new()
. otherwise NULL
.
IMSettingsInfo * imsettings_client_get_info_object (IMSettingsClient *client
,const gchar *module
,GCancellable *cancellable
,GError **error
);
A convenient function to get IMSettingsInfo from the result of
imsettings_client_get_info_variant()
.
gchar * imsettings_client_get_user_im (IMSettingsClient *client
,GCancellable *cancellable
,GError **error
);
Obtains an Input Method name that currently is active for the user.
If one doesn't have the user xinputrc on their home, this simply returns the same
value to what imsettings_client_get_system_im()
returns.
You could access through DBus API instead:
1 2 3 4 5 6 7 8 |
<interface name='com.redhat.imsettings'> <method name='GetUserIM'> <arg type='s' name='lang' direction='in' /> <arg type='s' name='ret' direction='out'> <annotation name='org.freedesktop.DBus.GLib.Const' value='' /> </arg> </method> </interface> |
gchar * imsettings_client_get_system_im (IMSettingsClient *client
,GCancellable *cancellable
,GError **error
);
Obtains an Input Method name that currently is active for the system-wide.
You could access through DBus API instead:
1 2 3 4 5 6 7 8 |
<interface name='com.redhat.imsettings'> <method name='GetSystemIM'> <arg type='s' name='lang' direction='in' /> <arg type='s' name='ret' direction='out'> <annotation name='org.freedesktop.DBus.GLib.Const' value='' /> </arg> </method> </interface> |
IMSettingsInfo * imsettings_client_get_active_im_info (IMSettingsClient *client
,GCancellable *cancellable
,GError **error
);
Obtains the Input Method information that is currently running on.
You could access through DBus API instead:
1 2 3 4 5 |
<interface name='com.redhat.imsettings'> <method name='GetActiveVariant'> <arg type='a{sv}' name='ret' direction='out' /> </method> </interface> |
gboolean imsettings_client_im_is_system_default (IMSettingsClient *client
,const gchar *module
,GCancellable *cancellable
,GError **error
);
Checks whether module
is the system default or not.
You could access through DBus API instead:
1 2 3 4 5 6 7 |
<interface name='com.redhat.imsettings'> <method name='IsSystemDefault'> <arg type='s' name='lang' direction='in' /> <arg type='s' name='imname' direction='in' /> <arg type='b' name='ret' direction='out' /> </method> </interface> |
gboolean imsettings_client_im_is_user_default (IMSettingsClient *client
,const gchar *module
,GCancellable *cancellable
,GError **error
);
Checks whether module
is the user default or not.
You could access through DBus API instead:
1 2 3 4 5 6 7 |
<interface name='com.redhat.imsettings'> <method name='IsUserDefault'> <arg type='s' name='lang' direction='in' /> <arg type='s' name='imname' direction='in' /> <arg type='b' name='ret' direction='out' /> </method> </interface> |
gboolean imsettings_client_im_is_xim (IMSettingsClient *client
,const gchar *module
,GCancellable *cancellable
,GError **error
);
Checks whether module
is the Input Method for XIM only or not.
You could access through DBus API instead:
1 2 3 4 5 6 7 |
<interface name='com.redhat.imsettings'> <method name='IsXIM'> <arg type='s' name='lang' direction='in' /> <arg type='s' name='imname' direction='in' /> <arg type='b' name='ret' direction='out' /> </method> </interface> |
gboolean imsettings_client_is_supported_desktop (IMSettingsClient *client
,GCancellable *cancellable
,GError **error
);
Check if current desktop is supported by IMSettings or not.
You could access through DBus API instead:
1 2 3 4 5 6 |
<interface name='com.redhat.imsettings'> <method name='IsSupportedDesktop'> <arg type='s' name='desktop' direction='in' /> <arg type='b' name='ret' direction'out' /> </method> </interface> |
gboolean imsettings_client_can_x_display_open (IMSettingsClient *client
,GCancellable *cancellable
,GError **error
);
Check if X Display can be open or not.
You could access through DBus API instead:
1 2 3 4 5 |
<interface name='com.redhat.imsettings'> <method name='CanXDisplayOpen'> <arg type='b' name='ret' direction'out' /> </method> </interface> |
gboolean imsettings_client_switch_im (IMSettingsClient *client
,const gchar *module
,gboolean update_xinputrc
,GCancellable *cancellable
,GError **error
);
Changes the Input Method to module
.
You could access through DBus API instead:
1 2 3 4 5 6 7 8 |
<interface name='com.redhat.imsettings'> <method name='SwitchIM'> <arg type='s' name='lang' direction='in' /> <arg type='s' name='module' direction='in' /> <arg type='b' name='update_xinputrc' direction='in' /> <arg type='b' name='ret' direction='out' /> </method> </interface> |
gboolean imsettings_client_reload (IMSettingsClient *client
,gboolean send_signal
,GCancellable *cancellable
,GError **error
);
Reloads imsettings-daemon.
Note that send_signal
option is for the backward compatibility.
imsettings-daemon doesn't do anything since IMSETTINGS_SETTINGS_API_VERSION
is 4. so you will get the expected behavior with:
1 2 3 4 5 |
int api_version; if ((api_version = imsettings_client_get_version(client)) != IMSETTINGS_SETTINGS_API_VERSION) { imsettings_client_reload(client, api_version < 4, NULL, &error); } |
You could access through DBus API instead:
1 2 3 4 5 6 7 8 |
<interface name='com.redhat.imsettings'> <signal name='Reload'> <arg type='b' name='ret' direction='out' /> </signal> <method name='StopService'> <arg type='b' name='ret' direction='out' /> </method> </interface> |
GVariant * imsettings_client_get_module_settings (IMSettingsClient *client
,GCancellable *cancellable
,GError **error
);
Obtains current Input Method settings in the backend modules.
You could access through DBus API instead:
1 2 3 4 5 |
<interface name='com.redhat.imsettings'> <method name='DumpModuleSettings'> <arg type='a{ss}' name='ret' direction='out' /> </method> </interface> |
void imsettings_client_get_info_variants_start (IMSettingsClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request obtaining asynchronously all of the Input Method information available on the system.
gpointer imsettings_client_get_info_variants_finish (IMSettingsClient *client
,GAsyncResult *result
,GError **error
);
Obtains the result of the request from
imsettings_client_get_info_variants_start()
.
client |
||
result |
a GAsyncResult pushed through GAsyncReadyCallback. |
|
error |
a GError to store an error if any, or |
[allow-none] |
a GVariant contains some pairs of an Input Method name and
a GVariant that can converts to IMSettingsInfo through
imsettings_info_new()
. otherwise NULL
.
[out][transfer full][allow-none]
void imsettings_client_get_info_variant_start (IMSettingsClient *client
,const gchar *module
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request obtaining asynchronously the Input Method information for module
.
GVariant * imsettings_client_get_info_variant_finish (IMSettingsClient *client
,GAsyncResult *result
,GError **error
);
Obtains the result of the request from
imsettings_client_get_info_variant_start()
.
client |
||
result |
a GAsyncResult pushed through GAsyncReadyCallback. |
|
error |
a GError to store an error if any, or |
[allow-none] |
a GVariant that can converts to IMSettingsInfo through
imsettings_info_new()
. otherwise NULL
.
void imsettings_client_get_user_im_start (IMSettingsClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request obtaining asynchronously an input method name that currently is active for the user.
gchar * imsettings_client_get_user_im_finish (IMSettingsClient *client
,GAsyncResult *result
,GError **error
);
Obtains the result of the request from
imsettings_client_get_user_im_start()
.
void imsettings_client_get_system_im_start (IMSettingsClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request obtaining asynchronously an input method name that currently is active for the system-wide.
gchar * imsettings_client_get_system_im_finish (IMSettingsClient *client
,GAsyncResult *result
,GError **error
);
Obtains the result of the request from
imsettings_client_get_system_im_start()
.
void imsettings_client_is_supported_desktop_start (IMSettingsClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request asking if current desktop is supported or not asynchronously
gboolean imsettings_client_is_supported_desktop_finish (IMSettingsClient *client
,GAsyncResult *result
,GError **error
);
Obtains the result of the request from
imsettings_client_is_supported_desktop_start()
.
void imsettings_client_can_x_display_open_start (IMSettingsClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request asking if current desktop is supported or not asynchronously
gboolean imsettings_client_can_x_display_open_finish (IMSettingsClient *client
,GAsyncResult *result
,GError **error
);
Obtains the result of the request from
imsettings_client_can_x_display_open_start()
.
void imsettings_client_switch_im_start (IMSettingsClient *client
,const gchar *module
,gboolean update_xinputrc
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request changing asynchronously the Input Method to module
.
client |
||
module |
an Input Method name changing to, or |
|
update_xinputrc |
|
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback. |
[scope async] |
user_data |
a pointer of the user data to give it to |
[closure] |
gboolean imsettings_client_switch_im_finish (IMSettingsClient *client
,GAsyncResult *result
,GError **error
);
Obtains the result of the request from
imsettings_client_switch_im_start()
.