You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2132 lines
85 KiB

#ifndef _ECORE_IMF_H
#define _ECORE_IMF_H
#include <Eina.h>
#ifdef EAPI
# undef EAPI
#endif
#ifdef _WIN32
# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
# endif
# else
# define EAPI __declspec(dllimport)
# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
# else
# define EAPI
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define ECORE_IMF_INPUT_HINT_AUTOFILL_MASK 0xff00 /* @deprecated since 1.24 */
/**
* @defgroup Ecore_IMF_Lib_Group Ecore_IMF - Ecore Input Method Library Functions
* @ingroup Ecore
*
* Utility functions that set up and shut down the Ecore Input Method
* library.
*/
/**
* @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions
* @ingroup Ecore_IMF_Lib_Group
*
* @section ecore_imf_intro Introduction
*
* Functions that operate on Ecore Input Method Context objects.
* Ecore Input Method Context Function defines the interface for EFL input methods.
* An input method is used by EFL text input widgets like elm_entry
* (based on edje_entry) to map from key events to Unicode character strings.
*
* The default input method can be set through setting the ECORE_IMF_MODULE environment variable.
* eg) export ECORE_IMF_MODULE=xim (or scim or ibus)
*
* An input method may consume multiple key events in sequence and finally output the composed result.
* This is called preediting, and an input method may provide feedback about
* this process by displaying the intermediate composition states as preedit text.
*
* Immodule is plugin to connect your application and input method framework such as SCIM, ibus, and so on.@n
* ecore_imf_init() should be called to initialize and load immodule.@n
* ecore_imf_shutdown() is used for shutdowning and unloading immodule.
*
* @section how-to-compose How to process key event for composition or prediction
*
* To input Chinese, Japanese, Korean and other complex languages, the editor widget (as known as entry) should be connected with input method framework.@n
* Each editor widget should have each input context to connect with input service framework.@n
* Key event is processed by input method engine. The result is notified to application through ECORE_IMF_CALLBACK_PREEDIT_CHANGED and ECORE_IMF_CALLBACK_COMMIT event.@n
* @n
* The following example demonstrates how to connect input method framework and handle preedit and commit string from input method framework.
* @li @ref ecore_imf_example_c
*
* @section media-content How to receive media contents from input method editor
*
* Users sometimes wants to send images and other rich content with their input method editor (as known as virtual keyboard or soft keyboard).@n
* According to this requirement, the way to receive the media content URI such as images and other rich content as well as text have been provided since 1.20.@n
* @n
* The following code shows how to receive the media content URI.
*
* @code
* #include <glib.h>
*
* static void
* _imf_event_commit_content_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
* {
* Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event_info;
* if (!commit_content) return;
*
* // convert URI to filename
* gchar *filepath = g_filename_from_uri(commit_content->content_uri, NULL, NULL);
* printf("filepath : %s, description : %s, mime types : %s\n", filepath, commit_content->description, commit_content->mime_types);
*
* // do something to use filepath
*
* if (filepath)
* g_free(filepath);
* }
*
* ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _imf_event_commit_content_cb, data);
* @endcode
*
*/
/**
* @addtogroup Ecore_IMF_Context_Group
*
* @{
*/
/**
* @example ecore_imf_example.c
* Shows how to write simple editor using the Ecore_IMF library.
*/
/* ecore_imf_context_input_panel_event_callback_add() flag */
/**
* @typedef Ecore_IMF_Input_Panel_Event
* Enum containing input panel events.
*/
typedef enum
{
ECORE_IMF_INPUT_PANEL_STATE_EVENT, /**< called when the state of the input panel is changed. @since 1.7 */
ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, /**< called when the language of the input panel is changed. @since 1.7 */
ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT, /**< called when the shift key state of the input panel is changed @since 1.7 */
ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, /**< called when the size of the input panel is changed. @since 1.7 */
ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT, /**< called when the state of the candidate word panel is changed. @since 1.7 */
ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT, /**< called when the size of the candidate word panel is changed. @since 1.7 */
ECORE_IMF_INPUT_PANEL_KEYBOARD_MODE_EVENT /**< called when the keyboard mode state of the input panel is changed @since 1.20 */
} Ecore_IMF_Input_Panel_Event;
/**
* @typedef Ecore_IMF_Input_Panel_State
* Enum containing input panel state notifications.
*/
typedef enum
{
ECORE_IMF_INPUT_PANEL_STATE_SHOW, /**< Notification after the display of the input panel @since 1.7 */
ECORE_IMF_INPUT_PANEL_STATE_HIDE, /**< Notification prior to the dismissal of the input panel @since 1.7 */
ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW /**< Notification prior to the display of the input panel @since 1.7 */
} Ecore_IMF_Input_Panel_State;
/**
* @typedef Ecore_IMF_Input_Panel_Shift_Mode
* Enum containing input shift mode states.
*/
typedef enum
{
ECORE_IMF_INPUT_PANEL_SHIFT_MODE_OFF, /**< @since 1.7 */
ECORE_IMF_INPUT_PANEL_SHIFT_MODE_ON /**< @since 1.7 */
} Ecore_IMF_Input_Panel_Shift_Mode;
/**
* @typedef Ecore_IMF_Candidate_Panel_State
* Enum containing candidate word panel state notifications.
*/
typedef enum
{
ECORE_IMF_CANDIDATE_PANEL_SHOW, /**< Notification after the display of the candidate word panel @since 1.7 */
ECORE_IMF_CANDIDATE_PANEL_HIDE /**< Notification prior to the dismissal of the candidate word panel @since 1.7 */
} Ecore_IMF_Candidate_Panel_State;
/**
* @typedef Ecore_IMF_Input_Panel_Keyboard_Mode
* Enum containing keyboard mode states.
*/
typedef enum
{
ECORE_IMF_INPUT_PANEL_HW_KEYBOARD_MODE, /**< @since 1.20 */
ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE /**< @since 1.20 */
} Ecore_IMF_Input_Panel_Keyboard_Mode;
/* Events sent by the Input Method */
typedef struct _Ecore_IMF_Event_Preedit_Start Ecore_IMF_Event_Preedit_Start;
typedef struct _Ecore_IMF_Event_Preedit_End Ecore_IMF_Event_Preedit_End;
typedef struct _Ecore_IMF_Event_Preedit_Changed Ecore_IMF_Event_Preedit_Changed;
typedef struct _Ecore_IMF_Event_Commit Ecore_IMF_Event_Commit;
typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding;
typedef struct _Ecore_IMF_Event_Selection Ecore_IMF_Event_Selection;
typedef struct _Ecore_IMF_Event_Commit_Content Ecore_IMF_Event_Commit_Content;
/* Events to filter */
typedef struct _Ecore_IMF_Event_Mouse_Down Ecore_IMF_Event_Mouse_Down;
typedef struct _Ecore_IMF_Event_Mouse_Up Ecore_IMF_Event_Mouse_Up;
typedef struct _Ecore_IMF_Event_Mouse_In Ecore_IMF_Event_Mouse_In;
typedef struct _Ecore_IMF_Event_Mouse_Out Ecore_IMF_Event_Mouse_Out;
typedef struct _Ecore_IMF_Event_Mouse_Move Ecore_IMF_Event_Mouse_Move;
typedef struct _Ecore_IMF_Event_Mouse_Wheel Ecore_IMF_Event_Mouse_Wheel;
typedef struct _Ecore_IMF_Event_Key_Down Ecore_IMF_Event_Key_Down;
typedef struct _Ecore_IMF_Event_Key_Up Ecore_IMF_Event_Key_Up;
typedef union _Ecore_IMF_Event Ecore_IMF_Event;
typedef struct _Ecore_IMF_Context Ecore_IMF_Context; /**< An Input Method Context */
typedef struct _Ecore_IMF_Context_Class Ecore_IMF_Context_Class; /**< An Input Method Context class */
typedef struct _Ecore_IMF_Context_Info Ecore_IMF_Context_Info; /**< An Input Method Context info */
/* Preedit attribute info */
typedef struct _Ecore_IMF_Preedit_Attr Ecore_IMF_Preedit_Attr;
EAPI extern int ECORE_IMF_EVENT_PREEDIT_START;
EAPI extern int ECORE_IMF_EVENT_PREEDIT_END;
EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED;
EAPI extern int ECORE_IMF_EVENT_COMMIT;
EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING;
/**
* @typedef Ecore_IMF_Event_Cb
*
* @brief Called when a Ecore_IMF event happens.
*
* @see ecore_imf_context_event_callback_add()
*/
typedef void (*Ecore_IMF_Event_Cb) (void *data, Ecore_IMF_Context *ctx, void *event_info);
/**
* @typedef Ecore_IMF_Callback_Type
*
* Ecore IMF Event callback types.
*
* @see ecore_imf_context_event_callback_add()
*/
typedef enum
{
ECORE_IMF_CALLBACK_PREEDIT_START, /**< "PREEDIT_START" is called when a new preediting sequence starts. @since 1.2 */
ECORE_IMF_CALLBACK_PREEDIT_END, /**< "PREEDIT_END" is called when a preediting sequence has been completed or canceled. @since 1.2 */
ECORE_IMF_CALLBACK_PREEDIT_CHANGED, /**< "PREEDIT_CHANGED" is called whenever the preedit sequence currently being entered has changed. @since 1.2 */
ECORE_IMF_CALLBACK_COMMIT, /**< "COMMIT" is called when a complete input sequence has been entered by the user @since 1.2 */
ECORE_IMF_CALLBACK_DELETE_SURROUNDING, /**< "DELETE_SURROUNDING" is called when the input method needs to delete all or part of the context surrounding the cursor @since 1.2 */
ECORE_IMF_CALLBACK_SELECTION_SET, /**< "SELECTION_SET" is called when the input method needs to set the selection @since 1.9 */
ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, /**< "PRIVATE_COMMAND_SEND" is called when the input method sends a private command @since 1.12 */
ECORE_IMF_CALLBACK_COMMIT_CONTENT, /**< "COMMIT_CONTENT" is called when the input method commits content such as an image @since 1.20 */
ECORE_IMF_CALLBACK_TRANSACTION_START, /**< "TRANSACTION_START" is called when a new transaction sequence starts. @since 1.21 */
ECORE_IMF_CALLBACK_TRANSACTION_END /**< "TRANSACTION_END" is called when a new transaction sequence starts. @since 1.21 */
} Ecore_IMF_Callback_Type;
/**
* @typedef Ecore_IMF_Event_Type
*
* Ecore IMF event types.
*
* @see ecore_imf_context_filter_event()
*/
typedef enum
{
ECORE_IMF_EVENT_MOUSE_DOWN, /**< Mouse Down event */
ECORE_IMF_EVENT_MOUSE_UP, /**< Mouse Up event */
ECORE_IMF_EVENT_MOUSE_IN, /**< Mouse In event */
ECORE_IMF_EVENT_MOUSE_OUT, /**< Mouse Out event */
ECORE_IMF_EVENT_MOUSE_MOVE, /**< Mouse Move event */
ECORE_IMF_EVENT_MOUSE_WHEEL, /**< Mouse Wheel event */
ECORE_IMF_EVENT_KEY_DOWN, /**< Key Down event */
ECORE_IMF_EVENT_KEY_UP /**< Key Up event */
} Ecore_IMF_Event_Type;
/**
* @typedef Ecore_IMF_Keyboard_Modifiers
* Types for Ecore_IMF keyboard modifiers
*/
typedef enum
{
ECORE_IMF_KEYBOARD_MODIFIER_NONE = 0, /**< No active modifiers */
ECORE_IMF_KEYBOARD_MODIFIER_CTRL = 1 << 0, /**< "Control" is pressed */
ECORE_IMF_KEYBOARD_MODIFIER_ALT = 1 << 1, /**< "Alt" is pressed */
ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
ECORE_IMF_KEYBOARD_MODIFIER_WIN = 1 << 3, /**< "Win" (between "Ctrl" and "Alt") is pressed */
ECORE_IMF_KEYBOARD_MODIFIER_ALTGR = 1 << 4 /**< "AltGr" is pressed @since 1.7 */
} Ecore_IMF_Keyboard_Modifiers;
/**
* @typedef Ecore_IMF_Keyboard_Locks
* Types for Ecore_IMF keyboard locks
*/
typedef enum
{
ECORE_IMF_KEYBOARD_LOCK_NONE = 0, /**< No locks are active */
ECORE_IMF_KEYBOARD_LOCK_NUM = 1 << 0, /**< "Num" lock is active */
ECORE_IMF_KEYBOARD_LOCK_CAPS = 1 << 1, /**< "Caps" lock is active */
ECORE_IMF_KEYBOARD_LOCK_SCROLL = 1 << 2 /**< "Scroll" lock is active */
} Ecore_IMF_Keyboard_Locks;
/**
* @typedef Ecore_IMF_Mouse_Flags
* Types for Ecore_IMF mouse flags
*/
typedef enum
{
ECORE_IMF_MOUSE_NONE = 0, /**< A single click */
ECORE_IMF_MOUSE_DOUBLE_CLICK = 1 << 0, /**< A double click */
ECORE_IMF_MOUSE_TRIPLE_CLICK = 1 << 1 /**< A triple click */
} Ecore_IMF_Mouse_Flags;
/**
* @typedef Ecore_IMF_Input_Mode
* Types for Ecore_IMF input mode
*/
typedef enum
{
ECORE_IMF_INPUT_MODE_ALPHA = 1 << 0,
ECORE_IMF_INPUT_MODE_NUMERIC = 1 << 1,
ECORE_IMF_INPUT_MODE_SPECIAL = 1 << 2,
ECORE_IMF_INPUT_MODE_HEXA = 1 << 3,
ECORE_IMF_INPUT_MODE_TELE = 1 << 4,
ECORE_IMF_INPUT_MODE_FULL = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL),
ECORE_IMF_INPUT_MODE_INVISIBLE = 1 << 29,
ECORE_IMF_INPUT_MODE_AUTOCAP = 1 << 30
} Ecore_IMF_Input_Mode;
/**
* @typedef Ecore_IMF_Preedit_Type
*
* Ecore IMF Preedit style types
*
* @see ecore_imf_context_preedit_string_with_attributes_get()
*/
typedef enum
{
ECORE_IMF_PREEDIT_TYPE_NONE, /**< None style @since 1.1 */
ECORE_IMF_PREEDIT_TYPE_SUB1, /**< Substring style 1 @since 1.1 */
ECORE_IMF_PREEDIT_TYPE_SUB2, /**< Substring style 2 @since 1.1 */
ECORE_IMF_PREEDIT_TYPE_SUB3, /**< Substring style 3 @since 1.1 */
ECORE_IMF_PREEDIT_TYPE_SUB4, /**< Substring style 4 @since 1.8 */
ECORE_IMF_PREEDIT_TYPE_SUB5, /**< Substring style 5 @since 1.8 */
ECORE_IMF_PREEDIT_TYPE_SUB6, /**< Substring style 6 @since 1.8 */
ECORE_IMF_PREEDIT_TYPE_SUB7 /**< Substring style 7 @since 1.8 */
} Ecore_IMF_Preedit_Type;
/**
* @typedef Ecore_IMF_Autocapital_Type
*
* Autocapitalization Types.
*
* @see ecore_imf_context_autocapital_type_set()
*/
typedef enum
{
ECORE_IMF_AUTOCAPITAL_TYPE_NONE, /**< No auto-capitalization when typing @since 1.1 */
ECORE_IMF_AUTOCAPITAL_TYPE_WORD, /**< Autocapitalize each word typed @since 1.1 */
ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE, /**< Autocapitalize the start of each sentence @since 1.1 */
ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters @since 1.1 */
} Ecore_IMF_Autocapital_Type;
/**
* @typedef Ecore_IMF_Input_Panel_Layout
*
* Input panel (virtual keyboard) layout types.
*
* @see ecore_imf_context_input_panel_layout_set()
*/
typedef enum
{
ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */
ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */
ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */
ECORE_IMF_INPUT_PANEL_LAYOUT_URL, /**< URL layout */
ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */
ECORE_IMF_INPUT_PANEL_LAYOUT_IP, /**< IP layout */
ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */
ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */
ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID, /**< Never use this */
ECORE_IMF_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout @since 1.2 */
ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout including ESC, Alt, Ctrl key, so on (no auto-correct, no auto-capitalization) @since 1.2 */
ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD, /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */
ECORE_IMF_INPUT_PANEL_LAYOUT_DATETIME, /**< Date and time layout @since 1.8 */
ECORE_IMF_INPUT_PANEL_LAYOUT_EMOTICON, /**< Emoticon layout @since 1.10 */
ECORE_IMF_INPUT_PANEL_LAYOUT_VOICE /**< Voice layout, but if the IME does not support voice layout, then normal layout will be shown @since 1.19 */
} Ecore_IMF_Input_Panel_Layout;
/**
* @typedef Ecore_IMF_Input_Panel_Lang
*
* Input panel (virtual keyboard) language modes.
*
* @see ecore_imf_context_input_panel_language_set()
*/
typedef enum
{
ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic @since 1.2 */
ECORE_IMF_INPUT_PANEL_LANG_ALPHABET /**< Alphabet @since 1.2 */
} Ecore_IMF_Input_Panel_Lang;
/**
* @typedef Ecore_IMF_Input_Panel_Return_Key_Type
*
* "Return" Key types on the input panel (virtual keyboard).
*
* @see ecore_imf_context_input_panel_return_key_type_set()
*/
typedef enum
{
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default @since 1.2 */
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE, /**< Done @since 1.2 */
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO, /**< Go @since 1.2 */
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN, /**< Join @since 1.2 */
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN, /**< Login @since 1.2 */
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT, /**< Next @since 1.2 */
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH, /**< Search or magnifier icon @since 1.2 */
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND, /**< Send @since 1.2 */
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN /**< Sign-in @since 1.8 */
} Ecore_IMF_Input_Panel_Return_Key_Type;
/**
* @typedef Ecore_IMF_Input_Hints
* @brief Enumeration for defining the types of Ecore_IMF Input Hints.
* @since 1.12
*/
typedef enum
{
ECORE_IMF_INPUT_HINT_NONE = 0, /**< No active hints @since 1.12 */
ECORE_IMF_INPUT_HINT_AUTO_COMPLETE = 1 << 0, /**< Suggest word auto completion @since 1.12 */
ECORE_IMF_INPUT_HINT_SENSITIVE_DATA = 1 << 1, /**< Typed text should not be stored. @since 1.12 */
ECORE_IMF_INPUT_HINT_MULTILINE = 1 << 2, /**< Multiline text @since 1.18 */
ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_DATE = 0x100, /**< Autofill hint for a credit card expiration date @deprecated since 1.24 */
ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_DAY = 0x200, /**< Autofill hint for a credit card expiration day @deprecated since 1.24 */
ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_MONTH = 0x300, /**< Autofill hint for a credit card expiration month @deprecated since 1.24 */
ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_YEAR = 0x400, /**< Autofill hint for a credit card expiration year @deprecated since 1.24 */
ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_NUMBER = 0x500, /**< Autofill hint for a credit card number @deprecated since 1.24 */
ECORE_IMF_INPUT_HINT_AUTOFILL_EMAIL_ADDRESS = 0x600, /**< Autofill hint for an email address @deprecated since 1.24 */
ECORE_IMF_INPUT_HINT_AUTOFILL_NAME = 0x700, /**< Autofill hint for a user's real name @deprecated since 1.24 */
ECORE_IMF_INPUT_HINT_AUTOFILL_PHONE = 0x800, /**< Autofill hint for a phone number @deprecated since 1.24 */
ECORE_IMF_INPUT_HINT_AUTOFILL_POSTAL_ADDRESS = 0x900, /**< Autofill hint for a postal address @deprecated since 1.24 */
ECORE_IMF_INPUT_HINT_AUTOFILL_POSTAL_CODE = 0xA00, /**< Autofill hint for a postal code @deprecated since 1.24 */
ECORE_IMF_INPUT_HINT_AUTOFILL_ID = 0xB00 /**< Autofill hint for a user's ID @deprecated since 1.24 */
} Ecore_IMF_Input_Hints;
/**
* @typedef Ecore_IMF_Input_Panel_Layout_Normal_Variation
* @brief Enumeration for defining the types of Ecore_IMF Input Panel layout for normal variation.
* @since 1.12
*/
typedef enum
{
ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_NORMAL, /**< The plain normal layout @since 1.12 */
ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_FILENAME, /**< Filename layout. Symbols such as '/' should be disabled. @since 1.12 */
ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_PERSON_NAME /**< The name of a person. @since 1.12 */
} Ecore_IMF_Input_Panel_Layout_Normal_Variation;
/**
* @typedef Ecore_IMF_Input_Panel_Layout_Numberonly_Variation
* @brief Enumeration for defining the types of Ecore_IMF Input Panel layout for numberonly variation
* @since 1.8
*/
typedef enum
{
ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL, /**< The plain normal number layout @since 1.8 */
ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED, /**< The number layout to allow a positive or negative sign at the start @since 1.8 */
ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL, /**< The number layout to allow decimal point to provide fractional value @since 1.8 */
ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL /**< The number layout to allow decimal point and negative sign @since 1.8 */
} Ecore_IMF_Input_Panel_Layout_Numberonly_Variation;
/**
* @typedef Ecore_IMF_Input_Panel_Layout_Password_Variation
* @brief Enumeration for defining the types of Ecore_IMF Input Panel layout for password variation
* @since 1.12
*/
typedef enum
{
ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NORMAL, /**< The normal password layout @since 1.12 */
ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NUMBERONLY /**< The password layout to allow only number @since 1.12 */
} Ecore_IMF_Input_Panel_Layout_Password_Variation;
/**
* @typedef Ecore_IMF_BiDi_Direction
* @brief Enumeration for defining the types of Ecore_IMF bidirectionality.
* @since 1.12
*/
typedef enum
{
ECORE_IMF_BIDI_DIRECTION_NEUTRAL, /**< The Neutral mode @since 1.12 */
ECORE_IMF_BIDI_DIRECTION_LTR, /**< The Left to Right mode @since 1.12 */
ECORE_IMF_BIDI_DIRECTION_RTL /**< The Right to Left mode @since 1.12 */
} Ecore_IMF_BiDi_Direction;
/**
* @enum _Ecore_IMF_Device_Class
* @brief Enumeration for defining the types of Ecore_IMF_Device_Class
* @since 1.14
*/
typedef enum _Ecore_IMF_Device_Class
{
ECORE_IMF_DEVICE_CLASS_NONE, /**< Not a device @since 1.14 */
ECORE_IMF_DEVICE_CLASS_SEAT, /**< The user/seat (the user themselves) @since 1.14 */
ECORE_IMF_DEVICE_CLASS_KEYBOARD, /**< A regular keyboard, numberpad or attached buttons @since 1.14 */
ECORE_IMF_DEVICE_CLASS_MOUSE, /**< A mouse, trackball or touchpad relative motion device @since 1.14 */
ECORE_IMF_DEVICE_CLASS_TOUCH, /**< A touchscreen with fingers or stylus @since 1.14 */
ECORE_IMF_DEVICE_CLASS_PEN, /**< A special pen device @since 1.14 */
ECORE_IMF_DEVICE_CLASS_POINTER, /**< A laser pointer, wii-style or "minority report" pointing device @since 1.14 */
ECORE_IMF_DEVICE_CLASS_GAMEPAD /**< A gamepad controller or joystick @since 1.14 */
} Ecore_IMF_Device_Class; /**< A general class of device @since 1.14 */
/**
* @enum _Ecore_IMF_Device_Subclass
* @brief Enumeration for defining the types of Ecore_IMF_Device_Subclass
* @since 1.14
*/
typedef enum _Ecore_IMF_Device_Subclass
{
ECORE_IMF_DEVICE_SUBCLASS_NONE, /**< Not a device @since 1.14 */
ECORE_IMF_DEVICE_SUBCLASS_FINGER, /**< The normal flat of your finger @since 1.14 */
ECORE_IMF_DEVICE_SUBCLASS_FINGERNAIL, /**< A fingernail @since 1.14 */
ECORE_IMF_DEVICE_SUBCLASS_KNUCKLE, /**< A Knuckle @since 1.14 */
ECORE_IMF_DEVICE_SUBCLASS_PALM, /**< The palm of a users hand @since 1.14 */
ECORE_IMF_DEVICE_SUBCLASS_HAND_SIZE, /**< The side of your hand @since 1.14 */
ECORE_IMF_DEVICE_SUBCLASS_HAND_FLAT, /**< The flat of your hand @since 1.14 */
ECORE_IMF_DEVICE_SUBCLASS_PEN_TIP, /**< The tip of a pen @since 1.14 */
ECORE_IMF_DEVICE_SUBCLASS_TRACKPAD, /**< A trackpad style mouse @since 1.14 */
ECORE_IMF_DEVICE_SUBCLASS_TRACKPOINT, /**< A trackpoint style mouse @since 1.14 */
ECORE_IMF_DEVICE_SUBCLASS_TRACKBALL, /**< A trackball style mouse @since 1.14 */
} Ecore_IMF_Device_Subclass; /**< A general subclass of device @since 1.14 */
/**
* @struct _Ecore_IMF_Event_Preedit_Start
* @brief The structure type used with the Preedit_Start Input Method event
*/
struct _Ecore_IMF_Event_Preedit_Start
{
Ecore_IMF_Context *ctx;
};
/**
* @struct _Ecore_IMF_Event_Preedit_End
* @brief The structure type used with the Preedit_End Input Method event
*/
struct _Ecore_IMF_Event_Preedit_End
{
Ecore_IMF_Context *ctx;
};
/**
* @struct _Ecore_IMF_Event_Preedit_Changed
* @brief The structure type used with the Preedit_Changed Input Method event
*/
struct _Ecore_IMF_Event_Preedit_Changed
{
Ecore_IMF_Context *ctx;
};
/**
* @struct _Ecore_IMF_Event_Commit
* @brief The structure type used with the Commit Input Method event
*/
struct _Ecore_IMF_Event_Commit
{
Ecore_IMF_Context *ctx;
char *str;
};
/**
* @struct _Ecore_IMF_Event_Delete_Surrounding
* @brief The structure type used with the Delete_Surrounding Input Method event
*/
struct _Ecore_IMF_Event_Delete_Surrounding
{
Ecore_IMF_Context *ctx;
int offset;
int n_chars;
};
/**
* @struct _Ecore_IMF_Event_Selection
* @brief The structure type used with the Selection Input Method event
*/
struct _Ecore_IMF_Event_Selection
{
Ecore_IMF_Context *ctx;
int start;
int end;
};
/**
* @struct _Ecore_IMF_Event_Commit_Content
* @brief The structure type used with the Commit_Content Input Method event
* @since 1.20
*/
struct _Ecore_IMF_Event_Commit_Content
{
Ecore_IMF_Context *ctx; /**< The associated Ecore IMF Context */
const char *content_uri; /**< The content URI */
const char *description; /**< The content description */
const char *mime_types; /**< The content MIME types */
};
/**
* @struct _Ecore_IMF_Event_Mouse_Down
* @brief The structure type used with the Mouse_Down event
*/
struct _Ecore_IMF_Event_Mouse_Down
{
int button; /**< The button which has been pressed */
struct {
int x, y;
} output;
struct {
int x, y;
} canvas;
Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
Ecore_IMF_Mouse_Flags flags; /**< The flags corresponding the mouse click (single, double or triple click) */
unsigned int timestamp; /**< The timestamp when the event occurred */
};
/**
* @struct _Ecore_IMF_Event_Mouse_Up
* @brief The structure type used with the Mouse_Up event
*/
struct _Ecore_IMF_Event_Mouse_Up
{
int button; /**< The button which has been released */
struct {
int x, y;
} output;
struct {
int x, y;
} canvas;
Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
Ecore_IMF_Mouse_Flags flags; /**< The flags corresponding the mouse click (single, double or triple click) */
unsigned int timestamp; /**< The timestamp when the event occurred */
};
/**
* @struct _Ecore_IMF_Event_Mouse_In
* @brief The structure type used with the Mouse_In event
*/
struct _Ecore_IMF_Event_Mouse_In
{
int buttons;
struct {
int x, y;
} output;
struct {
int x, y;
} canvas;
Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
unsigned int timestamp; /**< The timestamp when the event occurred */
};
/**
* @struct _Ecore_IMF_Event_Mouse_Out
* @brief The structure type used with the Mouse_Out event
*/
struct _Ecore_IMF_Event_Mouse_Out
{
int buttons;
struct {
int x, y;
} output;
struct {
int x, y;
} canvas;
Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
unsigned int timestamp; /**< The timestamp when the event occurred */
};
/**
* @struct _Ecore_IMF_Event_Mouse_Move
* @brief The structure type used with the Mouse_Move event
*/
struct _Ecore_IMF_Event_Mouse_Move
{
int buttons;
struct {
struct {
int x, y;
} output;
struct {
int x, y;
} canvas;
} cur, prev;
Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
unsigned int timestamp; /**< The timestamp when the event occurred */
};
/**
* @struct _Ecore_IMF_Event_Mouse_Wheel
* @brief The structure type used with the Mouse_Wheel event
*/
struct _Ecore_IMF_Event_Mouse_Wheel
{
int direction; /* 0 = default up/down wheel */
int z; /* ...,-2,-1 = down, 1,2,... = up */
struct {
int x, y;
} output;
struct {
int x, y;
} canvas;
Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
unsigned int timestamp; /**< The timestamp when the event occurred */
};
/**
* @struct _Ecore_IMF_Event_Key_Down
* @brief The structure type used with the Key_Down event
*/
struct _Ecore_IMF_Event_Key_Down
{
const char *keyname; /**< The string name of the key pressed */
Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
const char *key; /**< The logical key : (eg shift+1 == exclamation) */
const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
unsigned int timestamp; /**< The timestamp when the event occurred */
const char *dev_name; /**< The device name of the key pressed @since 1.14 */
Ecore_IMF_Device_Class dev_class; /**< The device class of the key pressed @since 1.14 */
Ecore_IMF_Device_Subclass dev_subclass; /**< The device subclass of the key pressed @since 1.14 */
unsigned int keycode; /**< Key scan code numeric value @since 1.22 */
};
/**
* @struct _Ecore_IMF_Event_Key_Up
* @brief The structure type used with the Key_Up event
*/
struct _Ecore_IMF_Event_Key_Up
{
const char *keyname; /**< The string name of the key released */
Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
const char *key; /**< The logical key : (eg shift+1 == exclamation) */
const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
unsigned int timestamp; /**< The timestamp when the event occurred */
const char *dev_name; /**< The device name of the key released @since 1.14 */
Ecore_IMF_Device_Class dev_class; /**< The device class of the key released @since 1.14 */
Ecore_IMF_Device_Subclass dev_subclass; /**< The device subclass of the key released @since 1.14 */
unsigned int keycode; /**< Key scan code numeric value @since 1.22 */
};
/**
* @brief A union of IMF events.
*/
union _Ecore_IMF_Event
{
Ecore_IMF_Event_Mouse_Down mouse_down;
Ecore_IMF_Event_Mouse_Up mouse_up;
Ecore_IMF_Event_Mouse_In mouse_in;
Ecore_IMF_Event_Mouse_Out mouse_out;
Ecore_IMF_Event_Mouse_Move mouse_move;
Ecore_IMF_Event_Mouse_Wheel mouse_wheel;
Ecore_IMF_Event_Key_Down key_down;
Ecore_IMF_Event_Key_Up key_up;
};
/**
* @struct _Ecore_IMF_Preedit_Attr
* @brief Structure that contains preedit attribute information.
*/
struct _Ecore_IMF_Preedit_Attr
{
Ecore_IMF_Preedit_Type preedit_type; /**< preedit style type */
unsigned int start_index; /**< start index of the range (in bytes) */
unsigned int end_index; /**< end index of the range (in bytes) */
};
/**
* @struct _Ecore_IMF_Context_Class
* @brief Structure used when creating a new Input Method Context. This
* structure is mainly used by modules implementing the Input Method Context
* interface.
*
*/
struct _Ecore_IMF_Context_Class
{
void (*add) (Ecore_IMF_Context *ctx); /**< Create the Input Method Context */
void (*del) (Ecore_IMF_Context *ctx); /**< Delete the Input Method Context */
void (*client_window_set) (Ecore_IMF_Context *ctx, void *window); /**< Set the client window for the Input Method Context */
void (*client_canvas_set) (Ecore_IMF_Context *ctx, void *canvas); /**< Set the client canvas for the Input Method Context */
void (*show) (Ecore_IMF_Context *ctx); /**< Show the Input Method Context */
void (*hide) (Ecore_IMF_Context *ctx); /**< Hide the Input Method Context */
void (*preedit_string_get) (Ecore_IMF_Context *ctx, char **str, int *cursor_pos); /**< Return current preedit string and cursor position */
void (*focus_in) (Ecore_IMF_Context *ctx); /**< Input Method context widget has gained focus */
void (*focus_out) (Ecore_IMF_Context *ctx); /**< Input Method context widget has lost focus */
void (*reset) (Ecore_IMF_Context *ctx); /**< A change has been made */
void (*cursor_position_set) (Ecore_IMF_Context *ctx, int cursor_pos); /**< Cursor position changed */
void (*use_preedit_set) (Ecore_IMF_Context *ctx, Eina_Bool use_preedit); /**< Use preedit string to display feedback */
void (*input_mode_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode); /**< Set the input mode */
Eina_Bool (*filter_event) (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event); /**< Internally handle an event */
void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos); /**< return current preedit string, attributes, and cursor position */
void (*prediction_allow_set)(Ecore_IMF_Context *ctx, Eina_Bool prediction); /**< Allow text prediction */
void (*autocapital_type_set)(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type); /**< Set auto-capitalization type */
void (*control_panel_show) (Ecore_IMF_Context *ctx); /**< Show the control panel */
void (*control_panel_hide) (Ecore_IMF_Context *ctx); /**< Hide the control panel */
void (*input_panel_layout_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout); /**< Set the layout of the input panel */
Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context *ctx); /**< Return the current layout of the input panel */
void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang); /**< Set the language of the input panel */
Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx); /**< Get the current language of the input panel */
void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h); /**< Set the cursor location */
void (*input_panel_imdata_set)(Ecore_IMF_Context *ctx, const void* data, int len); /**< Set panel-specific data to the input panel */
void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len); /**< Get current panel-specific data from the input panel */
void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type); /**< Set the return key theme of the input panel based on return key type provided */