forked from enlightenment/efl
ecore_imf: Add ecore_imf_context_input_hint_set API
This commit is contained in:
parent
39cb520718
commit
44326f9ed8
|
@ -312,6 +312,18 @@ typedef enum
|
||||||
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN /**< Sign-in @since 1.8 */
|
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN /**< Sign-in @since 1.8 */
|
||||||
} Ecore_IMF_Input_Panel_Return_Key_Type;
|
} Ecore_IMF_Input_Panel_Return_Key_Type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_IMF_Input_Hints
|
||||||
|
* @brief Enumeration that defines 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_Hints;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL, /**< The plain normal number layout @since 1.8 */
|
ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL, /**< The plain normal number layout @since 1.8 */
|
||||||
|
@ -522,6 +534,7 @@ struct _Ecore_IMF_Context_Class
|
||||||
void (*input_panel_event_callback_del) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value));
|
void (*input_panel_event_callback_del) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value));
|
||||||
void (*input_panel_language_locale_get) (Ecore_IMF_Context *ctx, char **lang);
|
void (*input_panel_language_locale_get) (Ecore_IMF_Context *ctx, char **lang);
|
||||||
void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
|
void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
|
||||||
|
void (*input_hint_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints input_hints);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Ecore_IMF_Context_Info
|
struct _Ecore_IMF_Context_Info
|
||||||
|
@ -1271,6 +1284,27 @@ EAPI void ecore_imf_context_autocapital_type_set(Ecore_
|
||||||
*/
|
*/
|
||||||
EAPI Ecore_IMF_Autocapital_Type ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
|
EAPI Ecore_IMF_Autocapital_Type ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the input hint which allows input methods to fine-tune their behavior.
|
||||||
|
*
|
||||||
|
* @param ctx An #Ecore_IMF_Context
|
||||||
|
* @param hints input hint
|
||||||
|
* @note The default input hint is @c ECORE_IMF_INPUT_HINT_AUTO_COMPLETE.
|
||||||
|
* @ingroup Ecore_IMF_Context_Group
|
||||||
|
* @since 1.12
|
||||||
|
*/
|
||||||
|
EAPI void ecore_imf_context_input_hint_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints hints);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the value of input hint.
|
||||||
|
*
|
||||||
|
* @param ctx An #Ecore_IMF_Context
|
||||||
|
* @return The value of input hint
|
||||||
|
* @ingroup Ecore_IMF_Context_Group
|
||||||
|
* @since 1.12
|
||||||
|
*/
|
||||||
|
EAPI Ecore_IMF_Input_Hints ecore_imf_context_input_hint_get(Ecore_IMF_Context *ctx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ask the Input Method Context to show the control panel of using Input Method.
|
* Ask the Input Method Context to show the control panel of using Input Method.
|
||||||
*
|
*
|
||||||
|
|
|
@ -153,6 +153,9 @@ ecore_imf_context_add(const char *id)
|
||||||
* set on the immodule */
|
* set on the immodule */
|
||||||
ecore_imf_context_autocapital_type_set(ctx, ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE);
|
ecore_imf_context_autocapital_type_set(ctx, ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE);
|
||||||
|
|
||||||
|
/* default input hint */
|
||||||
|
ecore_imf_context_input_hint_set(ctx, ECORE_IMF_INPUT_HINT_AUTO_COMPLETE);
|
||||||
|
|
||||||
/* default input panel enabled status is EINA_TRUE, so let's make sure it's
|
/* default input panel enabled status is EINA_TRUE, so let's make sure it's
|
||||||
* set on the immodule */
|
* set on the immodule */
|
||||||
ecore_imf_context_input_panel_enabled_set(ctx, EINA_TRUE);
|
ecore_imf_context_input_panel_enabled_set(ctx, EINA_TRUE);
|
||||||
|
@ -829,6 +832,38 @@ ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx)
|
||||||
if (ctx->klass->control_panel_hide) ctx->klass->control_panel_hide(ctx);
|
if (ctx->klass->control_panel_hide) ctx->klass->control_panel_hide(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_imf_context_input_hint_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints input_hints)
|
||||||
|
{
|
||||||
|
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
|
||||||
|
{
|
||||||
|
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
|
||||||
|
"ecore_imf_context_input_hint_set");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ctx->input_hints != input_hints)
|
||||||
|
{
|
||||||
|
if (ctx->klass->input_hint_set)
|
||||||
|
ctx->klass->input_hint_set(ctx, input_hints);
|
||||||
|
|
||||||
|
ctx->input_hints = input_hints;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_IMF_Input_Hints
|
||||||
|
ecore_imf_context_input_hint_get(Ecore_IMF_Context *ctx)
|
||||||
|
{
|
||||||
|
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
|
||||||
|
{
|
||||||
|
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
|
||||||
|
"ecore_imf_context_input_hint_get");
|
||||||
|
return ECORE_IMF_INPUT_HINT_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx->input_hints;
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
|
ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,6 +55,7 @@ struct _Ecore_IMF_Context
|
||||||
Ecore_IMF_Input_Panel_Layout input_panel_layout;
|
Ecore_IMF_Input_Panel_Layout input_panel_layout;
|
||||||
Ecore_IMF_Input_Panel_Lang input_panel_lang;
|
Ecore_IMF_Input_Panel_Lang input_panel_lang;
|
||||||
Ecore_IMF_Input_Panel_Return_Key_Type input_panel_return_key_type;
|
Ecore_IMF_Input_Panel_Return_Key_Type input_panel_return_key_type;
|
||||||
|
Ecore_IMF_Input_Hints input_hints;
|
||||||
int input_panel_layout_variation;
|
int input_panel_layout_variation;
|
||||||
Eina_Bool (*retrieve_selection_func)(void *data, Ecore_IMF_Context *ctx, char **text);
|
Eina_Bool (*retrieve_selection_func)(void *data, Ecore_IMF_Context *ctx, char **text);
|
||||||
void *retrieve_selection_data;
|
void *retrieve_selection_data;
|
||||||
|
|
Loading…
Reference in New Issue