IBusHotkeyProfile

## IBusHotkeyProfile IBusHotkeyProfile — Hotkeys and associated events. |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

    struct              IBusHotkeyProfile;
    struct              IBusHotkeyProfileClass;
    gboolean            ibus_hotkey_profile_add_hotkey      (IBusHotkeyProfile *profile,
                                                             guint keyval,
                                                             guint modifiers,
                                                             GQuark event);
    gboolean            ibus_hotkey_profile_add_hotkey_from_string
                                                            (IBusHotkeyProfile *profile,
                                                             const gchar *str,
                                                             GQuark event);
    GQuark              ibus_hotkey_profile_filter_key_event
                                                            (IBusHotkeyProfile *profile,
                                                             guint keyval,
                                                             guint modifiers,
                                                             guint prev_keyval,
                                                             guint prev_modifiers,
                                                             gpointer user_data);
    GQuark              ibus_hotkey_profile_lookup_hotkey   (IBusHotkeyProfile *profile,
                                                             guint keyval,
                                                             guint modifiers);
    gboolean            ibus_hotkey_profile_remove_hotkey   (IBusHotkeyProfile *profile,
                                                             guint keyval,
                                                             guint modifiers);
    gboolean            ibus_hotkey_profile_remove_hotkey_by_event
                                                            (IBusHotkeyProfile *profile,
                                                             GQuark event);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----IBusObject
                   +----IBusSerializable
                         +----IBusHotkeyProfile

## Signals

      "trigger"                                        : Has Details

## Description

An IBusHotkeyProfile associates a hotkey and an event.

## Details

### struct IBusHotkeyProfile

    struct IBusHotkeyProfile;

An opaque data type representing an IBusHotkeyProfile.

### struct IBusHotkeyProfileClass

    struct IBusHotkeyProfileClass {
        IBusSerializableClass parent;

        void (* trigger) (IBusHotkeyProfile *profile,
                          GQuark             event,
                          gpointer           user_data);
    };

### ibus_hotkey_profile_add_hotkey ()

    gboolean            ibus_hotkey_profile_add_hotkey      (IBusHotkeyProfile *profile,
                                                             guint keyval,
                                                             guint modifiers,
                                                             GQuark event);

Add a hotkey and its associated event to an IBusHotkeyProfile.

`profile` : | An IBusHotkeyProfile.
`keyval` : | Keycode of the hotkey.
`modifiers` : | Modifiers of the hotkey.
`event` : | The event to be associated.
Returns : | Always TRUE.

### ibus_hotkey_profile_add_hotkey_from_string ()

    gboolean            ibus_hotkey_profile_add_hotkey_from_string
                                                            (IBusHotkeyProfile *profile,
                                                             const gchar *str,
                                                             GQuark event);

Add a hotkey and its associated event to an IBusHotkeyProfile. The hotkey is in string format, such like `Control+Shift+A`.

`profile` : | An IBusHotkeyProfile.
`str` : | Key in string representation. '+' is the separator.
`event` : | The event to be associated.
Returns : | FALSE if `str` contains invalid symbol; TRUE otherwise.

### ibus_hotkey_profile_filter_key_event ()

    GQuark              ibus_hotkey_profile_filter_key_event
                                                            (IBusHotkeyProfile *profile,
                                                             guint keyval,
                                                             guint modifiers,
                                                             guint prev_keyval,
                                                             guint prev_modifiers,
                                                             gpointer user_data);

Emit a `::trigger` signal when a hotkey is in a profile.

`see_also`: ::trigger

`profile` : | An IBusHotkeyProfile.
`keyval` : | Keycode of the hotkey.
`modifiers` : | Modifiers of the hotkey.
`prev_keyval` : | Keycode of the hotkey.
`prev_modifiers` : | Modifiers of the hotkey.
`user_data` : | user data for signal "trigger".
Returns : | 0 if releasing a hotkey and the hotkey is not in the profile ; an associated event otherwise.

### ibus_hotkey_profile_lookup_hotkey ()

    GQuark              ibus_hotkey_profile_lookup_hotkey   (IBusHotkeyProfile *profile,
                                                             guint keyval,
                                                             guint modifiers);

`profile` : | An IBusHotkeyProfile.
`keyval` : | Keycode of the hotkey.
`modifiers` : | Modifiers of the hotkey.
Returns : | The event associated to the hotkey or 0 if the hotkey is not in the profile.

### ibus_hotkey_profile_remove_hotkey ()

    gboolean            ibus_hotkey_profile_remove_hotkey   (IBusHotkeyProfile *profile,
                                                             guint keyval,
                                                             guint modifiers);

Remove the hotkey for an IBusHotkeyProfile.

`profile` : | An IBusHotkeyProfile.
`keyval` : | Keycode of the hotkey.
`modifiers` : | Modifiers of the hotkey.
Returns : | FALSE if the key is not in `profile`, TRUE otherwise.

### ibus_hotkey_profile_remove_hotkey_by_event ()

    gboolean            ibus_hotkey_profile_remove_hotkey_by_event
                                                            (IBusHotkeyProfile *profile,
                                                             GQuark event);

Remove the hotkey for an IBusHotkeyProfile by event.

`profile` : | An IBusHotkeyProfile.
`event` : | The associated event.
Returns : | FALSE if no such event in `profile`, TRUE otherwise.

## Signal Details

### The `"trigger"` signal

    void                user_function                      (IBusHotkeyProfile *profile,
                                                            guint              event,
                                                            gpointer           user_data,
                                                            gpointer           user_data)      : Has Details

Emitted when a hotkey is pressed and the hotkey is in profile. Implement the member function `trigger()` in extended class to receive this signal.

### Note

The last parameter, user_data is not actually a valid parameter. It is displayed because of GtkDoc bug.

`profile` : | An IBusHotkeyProfile.
`event` : | An event in GQuark.
`user_data` : | User data for callback.
`user_data` : | user data set when the signal handler was connected.