summaryrefslogtreecommitdiff
path: root/src/lib/ecore_imf
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2014-08-30 12:45:38 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2014-08-30 12:45:44 +0900
commit44326f9ed8030647fca283e0f7fc00443f12102d (patch)
tree1c16b685c0386e5ef31355503790de0cb1ecf7b9 /src/lib/ecore_imf
parent39cb5207186665959cf6101854e9e973dafb93f4 (diff)
ecore_imf: Add ecore_imf_context_input_hint_set API
Diffstat (limited to 'src/lib/ecore_imf')
-rw-r--r--src/lib/ecore_imf/Ecore_IMF.h34
-rw-r--r--src/lib/ecore_imf/ecore_imf_context.c35
-rw-r--r--src/lib/ecore_imf/ecore_imf_private.h1
3 files changed, 70 insertions, 0 deletions
diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h
index 0cfd9bad0e..c1a255c21d 100644
--- a/src/lib/ecore_imf/Ecore_IMF.h
+++ b/src/lib/ecore_imf/Ecore_IMF.h
@@ -312,6 +312,18 @@ typedef enum
312 ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN /**< Sign-in @since 1.8 */ 312 ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN /**< Sign-in @since 1.8 */
313} Ecore_IMF_Input_Panel_Return_Key_Type; 313} Ecore_IMF_Input_Panel_Return_Key_Type;
314 314
315/**
316 * @typedef Ecore_IMF_Input_Hints
317 * @brief Enumeration that defines the types of Ecore_IMF Input Hints.
318 * @since 1.12
319 */
320typedef enum
321{
322 ECORE_IMF_INPUT_HINT_NONE = 0, /**< No active hints @since 1.12 */
323 ECORE_IMF_INPUT_HINT_AUTO_COMPLETE = 1 << 0, /**< Suggest word auto completion @since 1.12 */
324 ECORE_IMF_INPUT_HINT_SENSITIVE_DATA = 1 << 1, /**< Typed text should not be stored. @since 1.12 */
325} Ecore_IMF_Input_Hints;
326
315enum 327enum
316{ 328{
317 ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL, /**< The plain normal number layout @since 1.8 */ 329 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
522 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)); 534 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));
523 void (*input_panel_language_locale_get) (Ecore_IMF_Context *ctx, char **lang); 535 void (*input_panel_language_locale_get) (Ecore_IMF_Context *ctx, char **lang);
524 void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); 536 void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
537 void (*input_hint_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints input_hints);
525}; 538};
526 539
527struct _Ecore_IMF_Context_Info 540struct _Ecore_IMF_Context_Info
@@ -1272,6 +1285,27 @@ EAPI void ecore_imf_context_autocapital_type_set(Ecore_
1272EAPI Ecore_IMF_Autocapital_Type ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx); 1285EAPI Ecore_IMF_Autocapital_Type ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
1273 1286
1274/** 1287/**
1288 * @brief Sets the input hint which allows input methods to fine-tune their behavior.
1289 *
1290 * @param ctx An #Ecore_IMF_Context
1291 * @param hints input hint
1292 * @note The default input hint is @c ECORE_IMF_INPUT_HINT_AUTO_COMPLETE.
1293 * @ingroup Ecore_IMF_Context_Group
1294 * @since 1.12
1295 */
1296EAPI void ecore_imf_context_input_hint_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints hints);
1297
1298/**
1299 * @brief Gets the value of input hint.
1300 *
1301 * @param ctx An #Ecore_IMF_Context
1302 * @return The value of input hint
1303 * @ingroup Ecore_IMF_Context_Group
1304 * @since 1.12
1305 */
1306EAPI Ecore_IMF_Input_Hints ecore_imf_context_input_hint_get(Ecore_IMF_Context *ctx);
1307
1308/**
1275 * Ask the Input Method Context to show the control panel of using Input Method. 1309 * Ask the Input Method Context to show the control panel of using Input Method.
1276 * 1310 *
1277 * @param ctx An #Ecore_IMF_Context. 1311 * @param ctx An #Ecore_IMF_Context.
diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c
index 65154bc78d..b301f3457e 100644
--- a/src/lib/ecore_imf/ecore_imf_context.c
+++ b/src/lib/ecore_imf/ecore_imf_context.c
@@ -153,6 +153,9 @@ ecore_imf_context_add(const char *id)
153 * set on the immodule */ 153 * set on the immodule */
154 ecore_imf_context_autocapital_type_set(ctx, ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE); 154 ecore_imf_context_autocapital_type_set(ctx, ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE);
155 155
156 /* default input hint */
157 ecore_imf_context_input_hint_set(ctx, ECORE_IMF_INPUT_HINT_AUTO_COMPLETE);
158
156 /* default input panel enabled status is EINA_TRUE, so let's make sure it's 159 /* default input panel enabled status is EINA_TRUE, so let's make sure it's
157 * set on the immodule */ 160 * set on the immodule */
158 ecore_imf_context_input_panel_enabled_set(ctx, EINA_TRUE); 161 ecore_imf_context_input_panel_enabled_set(ctx, EINA_TRUE);
@@ -830,6 +833,38 @@ ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx)
830} 833}
831 834
832EAPI void 835EAPI void
836ecore_imf_context_input_hint_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints input_hints)
837{
838 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
839 {
840 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
841 "ecore_imf_context_input_hint_set");
842 return;
843 }
844
845 if (ctx->input_hints != input_hints)
846 {
847 if (ctx->klass->input_hint_set)
848 ctx->klass->input_hint_set(ctx, input_hints);
849
850 ctx->input_hints = input_hints;
851 }
852}
853
854EAPI Ecore_IMF_Input_Hints
855ecore_imf_context_input_hint_get(Ecore_IMF_Context *ctx)
856{
857 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
858 {
859 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
860 "ecore_imf_context_input_hint_get");
861 return ECORE_IMF_INPUT_HINT_NONE;
862 }
863
864 return ctx->input_hints;
865}
866
867EAPI void
833ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx) 868ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
834{ 869{
835 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) 870 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
diff --git a/src/lib/ecore_imf/ecore_imf_private.h b/src/lib/ecore_imf/ecore_imf_private.h
index d6bf257efc..b61d6b7b87 100644
--- a/src/lib/ecore_imf/ecore_imf_private.h
+++ b/src/lib/ecore_imf/ecore_imf_private.h
@@ -55,6 +55,7 @@ struct _Ecore_IMF_Context
55 Ecore_IMF_Input_Panel_Layout input_panel_layout; 55 Ecore_IMF_Input_Panel_Layout input_panel_layout;
56 Ecore_IMF_Input_Panel_Lang input_panel_lang; 56 Ecore_IMF_Input_Panel_Lang input_panel_lang;
57 Ecore_IMF_Input_Panel_Return_Key_Type input_panel_return_key_type; 57 Ecore_IMF_Input_Panel_Return_Key_Type input_panel_return_key_type;
58 Ecore_IMF_Input_Hints input_hints;
58 int input_panel_layout_variation; 59 int input_panel_layout_variation;
59 Eina_Bool (*retrieve_selection_func)(void *data, Ecore_IMF_Context *ctx, char **text); 60 Eina_Bool (*retrieve_selection_func)(void *data, Ecore_IMF_Context *ctx, char **text);
60 void *retrieve_selection_data; 61 void *retrieve_selection_data;