Blame src/ibusinputcontext.h

Packit 3ff832
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
Packit 3ff832
/* vim:set et sts=4: */
Packit 3ff832
/* ibus - The Input Bus
Packit 3ff832
 * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
Packit 3ff832
 * Copyright (C) 2008-2013 Red Hat, Inc.
Packit 3ff832
 *
Packit 3ff832
 * This library is free software; you can redistribute it and/or
Packit 3ff832
 * modify it under the terms of the GNU Lesser General Public
Packit 3ff832
 * License as published by the Free Software Foundation; either
Packit 3ff832
 * version 2.1 of the License, or (at your option) any later version.
Packit 3ff832
 *
Packit 3ff832
 * This library is distributed in the hope that it will be useful,
Packit 3ff832
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 3ff832
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 3ff832
 * Lesser General Public License for more details.
Packit 3ff832
 *
Packit 3ff832
 * You should have received a copy of the GNU Lesser General Public
Packit 3ff832
 * License along with this library; if not, write to the Free Software
Packit 3ff832
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
Packit 3ff832
 * USA
Packit 3ff832
 */
Packit 3ff832
Packit 3ff832
#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
Packit 3ff832
#error "Only <ibus.h> can be included directly"
Packit 3ff832
#endif
Packit 3ff832
Packit 3ff832
#ifndef __IBUS_INPUT_CONTEXT_H_
Packit 3ff832
#define __IBUS_INPUT_CONTEXT_H_
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * SECTION: ibusinputcontext
Packit 3ff832
 * @short_description: IBus input context proxy object.
Packit 3ff832
 * @stability: Stable
Packit 3ff832
 *
Packit 3ff832
 * An IBusInputContext is a proxy object of BusInputContext,
Packit 3ff832
 * which manages the context for input methods that supports
Packit 3ff832
 * text input in various natural languages.
Packit 3ff832
 *
Packit 3ff832
 * Clients call the IBusInputContext to invoke BusInputContext,
Packit 3ff832
 * through which invokes IBusEngine.
Packit 3ff832
 */
Packit 3ff832
#include "ibusproxy.h"
Packit 3ff832
#include "ibusenginedesc.h"
Packit 3ff832
#include "ibustext.h"
Packit 3ff832
Packit 3ff832
/*
Packit 3ff832
 * Type macros.
Packit 3ff832
 */
Packit 3ff832
Packit 3ff832
/* define GOBJECT macros */
Packit 3ff832
#define IBUS_TYPE_INPUT_CONTEXT             \
Packit 3ff832
    (ibus_input_context_get_type ())
Packit 3ff832
#define IBUS_INPUT_CONTEXT(obj)             \
Packit 3ff832
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_INPUT_CONTEXT, IBusInputContext))
Packit 3ff832
#define IBUS_INPUT_CONTEXT_CLASS(klass)     \
Packit 3ff832
    (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_INPUT_CONTEXT, IBusInputContextClass))
Packit 3ff832
#define IBUS_IS_INPUT_CONTEXT(obj)          \
Packit 3ff832
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_INPUT_CONTEXT))
Packit 3ff832
#define IBUS_IS_INPUT_CONTEXT_CLASS(klass)  \
Packit 3ff832
    (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_INPUT_CONTEXT))
Packit 3ff832
#define IBUS_INPUT_CONTEXT_GET_CLASS(obj)   \
Packit 3ff832
    (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_INPUT_CONTEXT, IBusInputContextClass))
Packit 3ff832
Packit 3ff832
G_BEGIN_DECLS
Packit 3ff832
Packit 3ff832
typedef struct _IBusInputContext IBusInputContext;
Packit 3ff832
typedef struct _IBusInputContextClass IBusInputContextClass;
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * IBusInputContext:
Packit 3ff832
 *
Packit 3ff832
 * An opaque data type representing an IBusInputContext.
Packit 3ff832
 */
Packit 3ff832
struct _IBusInputContext {
Packit 3ff832
    IBusProxy parent;
Packit 3ff832
    /* instance members */
Packit 3ff832
};
Packit 3ff832
Packit 3ff832
struct _IBusInputContextClass {
Packit 3ff832
    IBusProxyClass parent;
Packit 3ff832
    /* signals */
Packit 3ff832
Packit 3ff832
    /*< private >*/
Packit 3ff832
    /* padding */
Packit 3ff832
    gpointer pdummy[24];
Packit 3ff832
};
Packit 3ff832
Packit 3ff832
GType        ibus_input_context_get_type    (void);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_new:
Packit 3ff832
 * @path: The path to the object that emitting the signal.
Packit 3ff832
 * @connection: A #GDBusConnection.
Packit 3ff832
 * @cancellable: A #GCancellable or %NULL.
Packit 3ff832
 * @error: Return location for error or %NULL.
Packit 3ff832
 *
Packit 3ff832
 * Creates a new #IBusInputContext.
Packit 3ff832
 *
Packit 3ff832
 * Returns: A newly allocated #IBusInputContext.
Packit 3ff832
 */
Packit 3ff832
IBusInputContext *
Packit 3ff832
             ibus_input_context_new         (const gchar        *path,
Packit 3ff832
                                             GDBusConnection    *connection,
Packit 3ff832
                                             GCancellable       *cancellable,
Packit 3ff832
                                             GError            **error);
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_new_async:
Packit 3ff832
 * @path: The path to the object that emitting the signal.
Packit 3ff832
 * @connection: A #GDBusConnection.
Packit 3ff832
 * @cancellable: A #GCancellable or %NULL.
Packit 3ff832
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
Packit 3ff832
 *      The callback should not be %NULL.
Packit 3ff832
 * @user_data: The data to pass to callback.
Packit 3ff832
 *
Packit 3ff832
 * Creates a new #IBusInputContext asynchronously.
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_new_async   (const gchar        *path,
Packit 3ff832
                                             GDBusConnection    *connection,
Packit 3ff832
                                             GCancellable       *cancellable,
Packit 3ff832
                                             GAsyncReadyCallback callback,
Packit 3ff832
                                             gpointer            user_data);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_new_async_finish:
Packit 3ff832
 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback pass to
Packit 3ff832
 *      ibus_input_context_new_async().
Packit 3ff832
 * @error: Return location for error or %NULL.
Packit 3ff832
 *
Packit 3ff832
 * Finishes an operation started with ibus_input_context_new_async().
Packit 3ff832
 *
Packit 3ff832
 * Returns: A newly allocated #IBusInputContext.
Packit 3ff832
 */
Packit 3ff832
IBusInputContext *
Packit 3ff832
             ibus_input_context_new_async_finish
Packit 3ff832
                                            (GAsyncResult       *res,
Packit 3ff832
                                             GError            **error);
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_get_input_context:
Packit 3ff832
 * @path: The path to the object that emitting the signal.
Packit 3ff832
 * @connection: A GDBusConnection.
Packit 3ff832
 *
Packit 3ff832
 * Gets an existing IBusInputContext.
Packit 3ff832
 *
Packit 3ff832
 * Returns: (transfer none): An existing #IBusInputContext.
Packit 3ff832
 */
Packit 3ff832
IBusInputContext *
Packit 3ff832
             ibus_input_context_get_input_context
Packit 3ff832
                                            (const gchar        *path,
Packit 3ff832
                                             GDBusConnection    *connection);
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_get_input_context_async:
Packit 3ff832
 * @path: The path to the object that emitting the signal.
Packit 3ff832
 * @connection: A #GDBusConnection.
Packit 3ff832
 * @cancellable: A #GCancellable or %NULL.
Packit 3ff832
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
Packit 3ff832
 *      The callback should not be %NULL.
Packit 3ff832
 * @user_data: The data to pass to callback.
Packit 3ff832
 *
Packit 3ff832
 * Gets an existing #IBusInputContext asynchronously.
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_get_input_context_async
Packit 3ff832
                                            (const gchar        *path,
Packit 3ff832
                                             GDBusConnection    *connection,
Packit 3ff832
                                             GCancellable       *cancellable,
Packit 3ff832
                                             GAsyncReadyCallback callback,
Packit 3ff832
                                             gpointer            user_data);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_get_input_context_async_finish:
Packit 3ff832
 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback pass to
Packit 3ff832
 *      ibus_input_context_get_input_context_async().
Packit 3ff832
 * @error: Return location for error or %NULL.
Packit 3ff832
 *
Packit 3ff832
 * Finishes an operation started with
Packit 3ff832
 * ibus_input_context_get_input_context_async().
Packit 3ff832
 *
Packit 3ff832
 * Returns: (transfer none): An existing #IBusInputContext.
Packit 3ff832
 */
Packit 3ff832
IBusInputContext *
Packit 3ff832
             ibus_input_context_get_input_context_async_finish
Packit 3ff832
                                            (GAsyncResult       *res,
Packit 3ff832
                                             GError            **error);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_process_hand_writing_event:
Packit 3ff832
 * @context: An IBusInputContext.
Packit 3ff832
 * @coordinates: An array of gdouble (0.0 to 1.0) which represents a stroke (i.e. [x1, y1, x2, y2, x3, y3, ...]).
Packit 3ff832
 * @coordinates_len: The number of elements in the array. The number should be even and >= 4.
Packit 3ff832
 *
Packit 3ff832
 * Pass a handwriting stroke to an input method engine.
Packit 3ff832
 *
Packit 3ff832
 * In this API, a coordinate (0.0, 0.0) represents the top-left corner of an area for
Packit 3ff832
 * handwriting, and (1.0, 1.0) does the bottom-right. Therefore, for example, if
Packit 3ff832
 * a user writes a character 'L', the array would be something like [0.0, 0.0, 0.0, 1.0, 1.0, 1.0]
Packit 3ff832
 * and coordinates_len would be 6.
Packit 3ff832
 *
Packit 3ff832
 * The function is usually called when a user releases the mouse button in a hand
Packit 3ff832
 * writing area.
Packit 3ff832
 *
Packit 3ff832
 * see_also: #IBusEngine::process-hand-writing-event
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_process_hand_writing_event
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             const gdouble      *coordinates,
Packit 3ff832
                                             guint               coordinates_len);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_cancel_hand_writing:
Packit 3ff832
 * @context: An IBusInputContext.
Packit 3ff832
 * @n_strokes: The number of strokes to be removed. Pass 0 to remove all.
Packit 3ff832
 *
Packit 3ff832
 * Clear handwriting stroke(s) in the current input method engine.
Packit 3ff832
 *
Packit 3ff832
 * see_also: #IBusEngine::cancel-hand-writing
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_cancel_hand_writing
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             guint               n_strokes);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_process_key_event_async:
Packit 3ff832
 * @context: An IBusInputContext.
Packit 3ff832
 * @keyval: Key symbol of a key event.
Packit 3ff832
 * @keycode: Keycode of a key event.
Packit 3ff832
 * @state: Key modifier flags.
Packit 3ff832
 * @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
Packit 3ff832
 * @cancellable: A GCancellable or NULL.
Packit 3ff832
 * @callback: A GAsyncReadyCallback to call when the request is satisfied or NULL
Packit 3ff832
 *      if you don't care about the result of the method invocation.
Packit 3ff832
 * @user_data: The data to pass to callback.
Packit 3ff832
 *
Packit 3ff832
 * Pass the key event to input method engine.
Packit 3ff832
 *
Packit 3ff832
 * Key symbols are characters/symbols produced by key press, for example,
Packit 3ff832
 * pressing "s" generates key symbol "s"; pressing shift-"s" generates key symbol "S".
Packit 3ff832
 * Same key on keyboard may produce different key symbols on different keyboard layout.
Packit 3ff832
 * e.g., "s" key on QWERTY keyboard produces "o" in DVORAK layout.
Packit 3ff832
 *
Packit 3ff832
 * Unlike key symbol, keycode is only determined by the location of the key, and
Packit 3ff832
 * irrelevant of the keyboard layout.
Packit 3ff832
 *
Packit 3ff832
 * Briefly speaking, input methods that expect certain keyboard layout should use
Packit 3ff832
 * keycode; otherwise keyval is sufficient.
Packit 3ff832
 * For example, Chewing, Cangjie, Wubi expect an en-US QWERTY keyboard, these should
Packit 3ff832
 * use keycode; while pinyin can rely on keyval only, as it is less sensitive to
Packit 3ff832
 * the keyboard layout change, DVORAK users can still use DVORAK layout to input pinyin.
Packit 3ff832
 *
Packit 3ff832
 * Use ibus_keymap_lookup_keysym() to convert keycode to keysym in given keyboard layout.
Packit 3ff832
 *
Packit 3ff832
 * see_also: #IBusEngine::process-key-event
Packit 3ff832
 */
Packit 3ff832
void        ibus_input_context_process_key_event_async
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             guint32             keyval,
Packit 3ff832
                                             guint32             keycode,
Packit 3ff832
                                             guint32             state,
Packit 3ff832
                                             gint                timeout_msec,
Packit 3ff832
                                             GCancellable       *cancellable,
Packit 3ff832
                                             GAsyncReadyCallback callback,
Packit 3ff832
                                             gpointer            user_data);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_process_key_event_async_finish:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to
Packit 3ff832
 *      ibus_input_context_process_key_event_async().
Packit 3ff832
 * @error: Return location for error or %NULL.
Packit 3ff832
 *
Packit 3ff832
 * Finishes an operation started with
Packit 3ff832
 *      ibus_input_context_process_key_event_async().
Packit 3ff832
 *
Packit 3ff832
 * Returns: %TRUE if the key event is processed;
Packit 3ff832
 *      %FALSE otherwise or some errors happen and the @error will be set.
Packit 3ff832
 */
Packit 3ff832
gboolean     ibus_input_context_process_key_event_async_finish
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             GAsyncResult       *res,
Packit 3ff832
                                             GError            **error);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_process_key_event:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 * @keyval: Key symbol of a key event.
Packit 3ff832
 * @keycode: Keycode of a key event.
Packit 3ff832
 * @state: Key modifier flags.
Packit 3ff832
 *
Packit 3ff832
 * Pass the key event to input method engine and wait for the reply from
Packit 3ff832
 * ibus (i.e. synchronous IPC).
Packit 3ff832
 *
Packit 3ff832
 * Returns: %TRUE for successfully process the key; %FALSE otherwise.
Packit 3ff832
 *
Packit 3ff832
 * See also: ibus_input_context_process_key_event_async()
Packit 3ff832
 */
Packit 3ff832
gboolean     ibus_input_context_process_key_event
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             guint32             keyval,
Packit 3ff832
                                             guint32             keycode,
Packit 3ff832
                                             guint32             state);
Packit 3ff832
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_set_cursor_location:
Packit 3ff832
 * @context: An IBusInputContext.
Packit 3ff832
 * @x: X coordinate of the cursor.
Packit 3ff832
 * @y: Y coordinate of the cursor.
Packit 3ff832
 * @w: Width of the cursor.
Packit 3ff832
 * @h: Height of the cursor.
Packit 3ff832
 *
Packit 3ff832
 * Set the cursor location of IBus input context asynchronously.
Packit 3ff832
 *
Packit 3ff832
 * see_also: #IBusEngine::set-cursor-location
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_set_cursor_location
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             gint32              x,
Packit 3ff832
                                             gint32              y,
Packit 3ff832
                                             gint32              w,
Packit 3ff832
                                             gint32              h);
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_set_cursor_location_relative:
Packit 3ff832
 * @context: An IBusInputContext.
Packit 3ff832
 * @x: X coordinate of the cursor.
Packit 3ff832
 * @y: Y coordinate of the cursor.
Packit 3ff832
 * @w: Width of the cursor.
Packit 3ff832
 * @h: Height of the cursor.
Packit 3ff832
 *
Packit 3ff832
 * Set the relative cursor location of IBus input context asynchronously.
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_set_cursor_location_relative
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             gint32              x,
Packit 3ff832
                                             gint32              y,
Packit 3ff832
                                             gint32              w,
Packit 3ff832
                                             gint32              h);
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_set_capabilities:
Packit 3ff832
 * @context: An IBusInputContext.
Packit 3ff832
 * @capabilities: Capabilities flags of IBusEngine, see #IBusCapabilite
Packit 3ff832
 *
Packit 3ff832
 * Set the capabilities flags of client application asynchronously.
Packit 3ff832
 * When IBUS_CAP_FOCUS is not set, IBUS_CAP_PREEDIT_TEXT, IBUS_CAP_AUXILIARY_TEXT, IBUS_CAP_LOOKUP_TABLE, and IBUS_CAP_PROPERTY have to be all set.
Packit 3ff832
 * The panel component does nothing for an application that doesn't support focus.
Packit 3ff832
 *
Packit 3ff832
 * see_also: #IBusEngine::set-capabilities
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_set_capabilities
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             guint32             capabilities);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_property_activate:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 * @prop_name: A property name (e.g. "InputMode.WideLatin")
Packit 3ff832
 * @state: A status of the property (e.g. PROP_STATE_CHECKED)
Packit 3ff832
 *
Packit 3ff832
 * Activate the property asynchronously.
Packit 3ff832
 *
Packit 3ff832
 * See also: #IBusEngine::property_activate
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_property_activate
Packit 3ff832
                                            (IBusInputContext *context,
Packit 3ff832
                                             const gchar      *prop_name,
Packit 3ff832
                                             guint32           state);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_focus_in:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 *
Packit 3ff832
 * Invoked when the client application get focus. An asynchronous IPC will
Packit 3ff832
 * be performed.
Packit 3ff832
 *
Packit 3ff832
 * see_also: #IBusEngine::focus_in.
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_focus_in    (IBusInputContext   *context);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_focus_out:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 *
Packit 3ff832
 * Invoked when the client application get focus. An asynchronous IPC will be performed.
Packit 3ff832
 *
Packit 3ff832
 * see_also: #IBusEngine::focus_out.
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_focus_out   (IBusInputContext   *context);
Packit 3ff832
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_reset:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 *
Packit 3ff832
 * Invoked when the IME is reset. An asynchronous IPC will be performed.
Packit 3ff832
 *
Packit 3ff832
 * see_also: #IBusEngine::reset
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_reset       (IBusInputContext   *context);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_get_engine_async:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 * @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
Packit 3ff832
 * @cancellable: A #GCancellable or %NULL.
Packit 3ff832
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or
Packit 3ff832
 *     %NULL if you don't care about the result of the method invocation.
Packit 3ff832
 * @user_data: The data to pass to callback.
Packit 3ff832
 *
Packit 3ff832
 * An asynchronous IPC will be performed.
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_get_engine_async
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             gint                timeout_msec,
Packit 3ff832
                                             GCancellable       *cancellable,
Packit 3ff832
                                             GAsyncReadyCallback callback,
Packit 3ff832
                                             gpointer            user_data);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_get_engine_async_finish:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to
Packit 3ff832
 *   ibus_input_context_get_engine_async().
Packit 3ff832
 * @error: Return location for error or %NULL.
Packit 3ff832
 *
Packit 3ff832
 * Finishes an operation started with ibus_input_context_get_engine_async().
Packit 3ff832
 *
Packit 3ff832
 * Returns: (transfer none): An IME engine description for the context, or
Packit 3ff832
 *     %NULL.
Packit 3ff832
 */
Packit 3ff832
IBusEngineDesc *
Packit 3ff832
             ibus_input_context_get_engine_async_finish
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             GAsyncResult       *res,
Packit 3ff832
                                             GError            **error);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_get_engine:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 *
Packit 3ff832
 * Gets an IME engine description for the context.
Packit 3ff832
 * A synchronous IPC will be performed.
Packit 3ff832
 *
Packit 3ff832
 * Returns: (transfer none): An IME engine description for the context, or NULL.
Packit 3ff832
 */
Packit 3ff832
IBusEngineDesc *
Packit 3ff832
             ibus_input_context_get_engine  (IBusInputContext   *context);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_set_engine:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 * @name: A name of the engine.
Packit 3ff832
 *
Packit 3ff832
 * Invoked when the IME engine is changed.
Packit 3ff832
 * An asynchronous IPC will be performed.
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_set_engine  (IBusInputContext   *context,
Packit 3ff832
                                             const gchar        *name);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_set_surrounding_text:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 * @text: An #IBusText surrounding the current cursor on the application.
Packit 3ff832
 * @cursor_pos: Current cursor position in characters in @text.
Packit 3ff832
 * @anchor_pos: Anchor position of selection in @text.
Packit 3ff832
*/
Packit 3ff832
void         ibus_input_context_set_surrounding_text
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             IBusText           *text,
Packit 3ff832
                                             guint32             cursor_pos,
Packit 3ff832
                                             guint32             anchor_pos);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_needs_surrounding_text:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 *
Packit 3ff832
 * Check whether the current engine requires surrounding-text.
Packit 3ff832
 *
Packit 3ff832
 * Returns: %TRUE if surrounding-text is needed by the current engine;
Packit 3ff832
 * %FALSE otherwise.
Packit 3ff832
 */
Packit 3ff832
gboolean     ibus_input_context_needs_surrounding_text
Packit 3ff832
                                            (IBusInputContext   *context);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_input_context_set_content_type:
Packit 3ff832
 * @context: An #IBusInputContext.
Packit 3ff832
 * @purpose: Primary purpose of the input context, as an #IBusInputPurpose.
Packit 3ff832
 * @hints: Hints that augment @purpose, as an #IBusInputHints.
Packit 3ff832
 *
Packit 3ff832
 * Set content-type (primary purpose and hints) of the context.  This
Packit 3ff832
 * information is particularly useful to implement intelligent
Packit 3ff832
 * behavior in engines, such as automatic input-mode switch and text
Packit 3ff832
 * prediction.  For example, to restrict input to numbers, the client
Packit 3ff832
 * can call this function with @purpose set to
Packit 3ff832
 * #IBUS_INPUT_PURPOSE_NUMBER.
Packit 3ff832
 *
Packit 3ff832
 * See also: #IBusEngine::set-content-type
Packit 3ff832
 */
Packit 3ff832
void         ibus_input_context_set_content_type
Packit 3ff832
                                            (IBusInputContext   *context,
Packit 3ff832
                                             guint               purpose,
Packit 3ff832
                                             guint               hints);
Packit 3ff832
Packit 3ff832
G_END_DECLS
Packit 3ff832
#endif