From 92e0ab7e7a188ac5e2c37f43c6006e963bd85696 Mon Sep 17 00:00:00 2001 From: Haifeng Deng Date: Sun, 24 Jan 2016 16:04:06 +0800 Subject: [PATCH] Support input panel layout variation Change-Id: I701d23a3c29cc5cdc67e81cafd96c4b9ce60067f --- ism/extras/efl_wsc/isf_wsc_context.cpp | 47 +++++++++++++++++++++++++++++++ ism/extras/efl_wsc/isf_wsc_context.h | 1 + ism/extras/efl_wsc/isf_wsc_control_ui.cpp | 2 +- 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/ism/extras/efl_wsc/isf_wsc_context.cpp b/ism/extras/efl_wsc/isf_wsc_context.cpp index a4dd2d5..42f807c 100644 --- a/ism/extras/efl_wsc/isf_wsc_context.cpp +++ b/ism/extras/efl_wsc/isf_wsc_context.cpp @@ -1433,6 +1433,9 @@ Ecore_IMF_Input_Panel_Layout wsc_context_input_panel_layout_get (weescim *ctx) switch (ctx->content_purpose) { case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS: + case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS_SIGNED: + case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS_DECIMAL: + case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS_SIGNEDDECIMAL: layout = ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY; break; case WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER: @@ -1453,6 +1456,7 @@ Ecore_IMF_Input_Panel_Layout wsc_context_input_panel_layout_get (weescim *ctx) layout = ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL; break; case WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD: + case WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD_DIGITS: layout = ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD; break; case WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL: @@ -1472,6 +1476,49 @@ Ecore_IMF_Input_Panel_Layout wsc_context_input_panel_layout_get (weescim *ctx) return layout; } +int wsc_context_input_panel_layout_variation_get (weescim *ctx) +{ + int layout_variation = 0; + + if (!ctx) + return layout_variation; + + switch (ctx->content_purpose) { + case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS: + layout_variation = ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL; + break; + case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS_SIGNED: + layout_variation = ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED; + break; + case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS_DECIMAL: + layout_variation = ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL; + break; + case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS_SIGNEDDECIMAL: + layout_variation = ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL; + break; + case WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD: + layout_variation = ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NORMAL; + break; + case WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD_DIGITS: + layout_variation = ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NUMBERONLY; + break; + case WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL: + layout_variation = ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_NORMAL; + break; + case WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL_FILENAME: + layout_variation = ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_FILENAME; + break; + case WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL_PERSONNAME: + layout_variation = ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_PERSON_NAME; + break; + default: + layout_variation = 0; + break; + } + + return layout_variation; +} + Ecore_IMF_Autocapital_Type wsc_context_autocapital_type_get (weescim *ctx) { Ecore_IMF_Autocapital_Type autocapital_type = ECORE_IMF_AUTOCAPITAL_TYPE_NONE; diff --git a/ism/extras/efl_wsc/isf_wsc_context.h b/ism/extras/efl_wsc/isf_wsc_context.h index 7fc1d14..b8d5a10 100644 --- a/ism/extras/efl_wsc/isf_wsc_context.h +++ b/ism/extras/efl_wsc/isf_wsc_context.h @@ -122,6 +122,7 @@ void isf_wsc_context_shutdown (void); bool wsc_context_surrounding_get (weescim *ctx, char **text, int *cursor_pos); Ecore_IMF_Input_Panel_Layout wsc_context_input_panel_layout_get(weescim *ctx); +int wsc_context_input_panel_layout_variation_get (weescim *ctx); bool wsc_context_input_panel_caps_lock_mode_get(weescim *ctx); void wsc_context_delete_surrounding (weescim *ctx, int offset, int len); Ecore_IMF_Autocapital_Type wsc_context_autocapital_type_get (weescim *ctx); diff --git a/ism/extras/efl_wsc/isf_wsc_control_ui.cpp b/ism/extras/efl_wsc/isf_wsc_control_ui.cpp index 8cddf16..815f6e4 100644 --- a/ism/extras/efl_wsc/isf_wsc_control_ui.cpp +++ b/ism/extras/efl_wsc/isf_wsc_control_ui.cpp @@ -101,7 +101,7 @@ void isf_wsc_context_input_panel_show (WSCContextISF* ctx) iseContext.layout = wsc_context_input_panel_layout_get (ctx->ctx); /* set layout variation in ise context info */ - iseContext.layout_variation = 0; + iseContext.layout_variation = wsc_context_input_panel_layout_variation_get (ctx->ctx); /* set prediction allow */ iseContext.prediction_allow = wsc_context_prediction_allow_get (ctx->ctx); -- 2.7.4