Support input panel layout variation 03/57803/2
authorHaifeng Deng <haifeng.deng@samsung.com>
Sun, 24 Jan 2016 08:04:06 +0000 (16:04 +0800)
committerHaifeng Deng <haifeng.deng@samsung.com>
Mon, 25 Jan 2016 09:29:19 +0000 (17:29 +0800)
Change-Id: I701d23a3c29cc5cdc67e81cafd96c4b9ce60067f

ism/extras/efl_wsc/isf_wsc_context.cpp
ism/extras/efl_wsc/isf_wsc_context.h
ism/extras/efl_wsc/isf_wsc_control_ui.cpp

index a4dd2d5..42f807c 100644 (file)
@@ -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;
index 7fc1d14..b8d5a10 100644 (file)
@@ -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);
index 8cddf16..815f6e4 100644 (file)
@@ -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);