IBusBus

## IBusBus IBusBus — Connect with IBus daemon. |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

                        IBusBus;
                        IBusBusClass;
    IBusBus *           ibus_bus_new                        (void);
    gboolean            ibus_bus_is_connected               (IBusBus *bus);
    const gchar *       ibus_bus_hello                      (IBusBus *bus);
    guint               ibus_bus_request_name               (IBusBus *bus,
                                                             const gchar *name,
                                                             guint flags);
    guint               ibus_bus_release_name               (IBusBus *bus,
                                                             const gchar *name);
    gboolean            ibus_bus_name_has_owner             (IBusBus *bus,
                                                             const gchar *name);
    GList *             ibus_bus_list_names                 (IBusBus *bus);
    void                ibus_bus_add_match                  (IBusBus *bus,
                                                             const gchar *rule);
    void                ibus_bus_remove_match               (IBusBus *bus,
                                                             const gchar *rule);
    gchar *             ibus_bus_get_name_owner             (IBusBus *bus,
                                                             const gchar *name);
    gboolean            ibus_bus_exit                       (IBusBus *bus,
                                                             gboolean restart);
    gchar *             ibus_bus_current_input_context      (IBusBus *bus);
    gboolean            ibus_bus_register_component         (IBusBus *bus,
                                                             IBusComponent *component);
    GList *             ibus_bus_list_engines               (IBusBus *bus);
    GList *             ibus_bus_list_active_engines        (IBusBus *bus);
    gboolean            ibus_bus_get_use_sys_layout         (IBusBus *bus);
    gboolean            ibus_bus_get_use_global_engine      (IBusBus *bus);
    gboolean            ibus_bus_is_global_engine_enabled   (IBusBus *bus);
    gboolean            ibus_bus_set_global_engine          (IBusBus *bus,
                                                             const gchar *global_engine);
    IBusConfig *        ibus_bus_get_config                 (IBusBus *bus);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----IBusObject
                   +----IBusBus

## Signals

      "connected"                                      : Run Last
      "disconnected"                                   : Run Last
      "global-engine-changed"                          : Run Last

## Description

An IBusBus connects with IBus daemon.

## Details

### IBusBus

    typedef struct _IBusBus IBusBus;

An opaque data type representing IBus bus (daemon communication) status.

### IBusBusClass

    typedef struct {
      IBusObjectClass parent;
      /* class members */
    } IBusBusClass;

### ibus_bus_new ()

    IBusBus *           ibus_bus_new                        (void);

New an IBusBus instance.

Returns : | A newly allocated IBusBus instance, and the instance is not floating.

### ibus_bus_is_connected ()

    gboolean            ibus_bus_is_connected               (IBusBus *bus);

Return TRUE if `bus` is connected to IBus daemon.

`bus` : | An IBusBus.
Returns : | TRUE if `bus` is connected, FALSE otherwise.

### ibus_bus_hello ()

    const gchar *       ibus_bus_hello                      (IBusBus *bus);

This function sends a "HELLO" message to DBus daemon, which replies the unique name of current IBus process.

`bus` : | An IBusBus.
Returns : | The unique name of IBus process in DBus.

### ibus_bus_request_name ()

    guint               ibus_bus_request_name               (IBusBus *bus,
                                                             const gchar *name,
                                                             guint flags);

Request a name from IBus daemon.

`bus` : | the IBusBus instance to be processed.
`name` : | Name to be requested.
`flags` : | Flags (FixMe).
Returns : | 0 if failed; positive number otherwise.

### ibus_bus_release_name ()

    guint               ibus_bus_release_name               (IBusBus *bus,
                                                             const gchar *name);

Release a name to IBus daemon.

`bus` : | An IBusBus.
`name` : | Name to be released.
Returns : | 0 if failed; positive number otherwise.

### ibus_bus_name_has_owner ()

    gboolean            ibus_bus_name_has_owner             (IBusBus *bus,
                                                             const gchar *name);

Whether the name has owner.

`bus` : | An IBusBus.
`name` : | Name to be released.
Returns : | TRUE if the name has owner, FALSE otherwise.

### ibus_bus_list_names ()

    GList *             ibus_bus_list_names                 (IBusBus *bus);

Return lists that attached to `bus`.

### Note

[FixMe] Not implemented yet, only return NULL.

`bus` : | An IBusBus.
Returns : | Lists that attached to `bus`. [transfer full][element-type utf8]

### ibus_bus_add_match ()

    void                ibus_bus_add_match                  (IBusBus *bus,
                                                             const gchar *rule);

Add a match rule to an IBusBus.

`bus` : | An IBusBus.
`rule` : | Match rule.

### ibus_bus_remove_match ()

    void                ibus_bus_remove_match               (IBusBus *bus,
                                                             const gchar *rule);

Remove a match rule to an IBusBus.

`bus` : | An IBusBus.
`rule` : | Match rule.

### ibus_bus_get_name_owner ()

    gchar *             ibus_bus_get_name_owner             (IBusBus *bus,
                                                             const gchar *name);

Return the name owner.

`bus` : | An IBusBus.
`name` : | Name.
Returns : | Owner of the name. The returned value must be freed with `g_free()`.

### ibus_bus_exit ()

    gboolean            ibus_bus_exit                       (IBusBus *bus,
                                                             gboolean restart);

Exit or restart an IBusBus.

`bus` : | An IBusBus.
`restart` : | Whether restarting the ibus.
Returns : | TRUE if the "Exit" call is suceeded, FALSE otherwise.

### ibus_bus_current_input_context ()

    gchar *             ibus_bus_current_input_context      (IBusBus *bus);

Get the current focused input context.

`bus` : | An IBusBus.
Returns : | The named of currently focued IBusInputContext if the "CurrentInputContext" call suceeded, NULL otherwise. The return value must be freed with `g_free()`.

### ibus_bus_register_component ()

    gboolean            ibus_bus_register_component         (IBusBus *bus,
                                                             IBusComponent *component);

Register a componet to an IBusBus.

`bus` : | An IBusBus.
`component` : | A input engine component.
Returns : | TRUE if the "RegisterComponent" call is suceeded, FALSE otherwise.

### ibus_bus_list_engines ()

    GList *             ibus_bus_list_engines               (IBusBus *bus);

List engines. Note that this function is not yet implemented.

`bus` : | An IBusBus.
Returns : | A List of engines. [transfer full][element-type IBusEngineDesc]

### ibus_bus_list_active_engines ()

    GList *             ibus_bus_list_active_engines        (IBusBus *bus);

List active engines. Note that this function is not yet implemented.

### Note

Not yet implemented.

`bus` : | An IBusBus.
Returns : | A List of active engines. [transfer full][element-type IBusEngineDesc]

### ibus_bus_get_use_sys_layout ()

    gboolean            ibus_bus_get_use_sys_layout         (IBusBus *bus);

Check if the bus's "use_sys_layout" option is enabled or not.

`bus` : | An IBusBus.
Returns : | TRUE if "use_sys_layout" option is enabled.

### ibus_bus_get_use_global_engine ()

    gboolean            ibus_bus_get_use_global_engine      (IBusBus *bus);

Check if the bus's "use_global_engine" option is enabled or not.

`bus` : | An IBusBus.
Returns : | TRUE if "use_global_engine" option is enabled.

### ibus_bus_is_global_engine_enabled ()

    gboolean            ibus_bus_is_global_engine_enabled   (IBusBus *bus);

Check if the current global engine is enabled or not.

`bus` : | An IBusBus.
Returns : | TRUE if the current global engine is enabled.

### ibus_bus_set_global_engine ()

    gboolean            ibus_bus_set_global_engine          (IBusBus *bus,
                                                             const gchar *global_engine);

Set current global engine.

`bus` : | An IBusBus.
`global_engine` : | A new engine name.
Returns : | TRUE if the global engine was set successfully.

### ibus_bus_get_config ()

    IBusConfig *        ibus_bus_get_config                 (IBusBus *bus);

Get the config instance from IBusBus.

`bus` : | An IBusBus.
Returns : | An newly allocated IBusConfig which is configurable with `bus`.

## Signal Details

### The `"connected"` signal

    void                user_function                      (IBusBus *arg0,
                                                            gpointer user_data)      : Run Last

Emitted when IBusBus is connected.

### Note

Argument `user_data` is ignored in this function.

`user_data` : | user data set when the signal handler was connected.

### The `"disconnected"` signal

    void                user_function                      (IBusBus *arg0,
                                                            gpointer user_data)      : Run Last

Emitted when IBusBus is disconnected.

### Note

Argument `user_data` is ignored in this function.

`user_data` : | user data set when the signal handler was connected.

### The `"global-engine-changed"` signal

    void                user_function                      (IBusBus *arg0,
                                                            gpointer user_data)      : Run Last

Emitted when global engine is changed.

### Note

Argument `user_data` is ignored in this function.

`user_data` : | user data set when the signal handler was connected.