summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2014-09-01 19:04:05 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2014-09-01 19:04:05 +0900
commita488da49ac277a8caf4a34782a17627ad7e8511d (patch)
treea2c93cc3821c10506929e31103818c6b36f19714 /src/lib
parent46d256feee21f0d96789265be3f04a51ff8b7124 (diff)
Add elm_entry_input_hint_set/get API
Sets or get the input hint which allows input methods to fine-tune their behavior.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elm_entry.c25
-rw-r--r--src/lib/elm_entry.eo21
-rw-r--r--src/lib/elm_entry_common.h12
-rw-r--r--src/lib/elm_widget_entry.h1
4 files changed, 59 insertions, 0 deletions
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index b772e5264..ed5c7feae 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -736,6 +736,8 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
736 (sd->entry_edje, "elm.text", (Edje_Text_Autocapital_Type)sd->autocapital_type); 736 (sd->entry_edje, "elm.text", (Edje_Text_Autocapital_Type)sd->autocapital_type);
737 edje_object_part_text_prediction_allow_set 737 edje_object_part_text_prediction_allow_set
738 (sd->entry_edje, "elm.text", sd->prediction_allow); 738 (sd->entry_edje, "elm.text", sd->prediction_allow);
739 edje_object_part_text_input_hint_set
740 (sd->entry_edje, "elm.text", sd->input_hints);
739 edje_object_part_text_input_panel_enabled_set 741 edje_object_part_text_input_panel_enabled_set
740 (sd->entry_edje, "elm.text", sd->input_panel_enable); 742 (sd->entry_edje, "elm.text", sd->input_panel_enable);
741 edje_object_part_text_input_panel_imdata_set 743 edje_object_part_text_input_panel_imdata_set
@@ -3447,6 +3449,7 @@ _elm_entry_evas_object_smart_add(Eo *obj, Elm_Entry_Data *priv)
3447 elm_entry_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL); 3449 elm_entry_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL);
3448 elm_entry_input_panel_enabled_set(obj, EINA_TRUE); 3450 elm_entry_input_panel_enabled_set(obj, EINA_TRUE);
3449 elm_entry_prediction_allow_set(obj, EINA_TRUE); 3451 elm_entry_prediction_allow_set(obj, EINA_TRUE);
3452 elm_entry_input_hint_set(obj, ELM_INPUT_HINT_AUTO_COMPLETE);
3450 3453
3451 priv->autocapital_type = (Elm_Autocapital_Type)edje_object_part_text_autocapital_type_get 3454 priv->autocapital_type = (Elm_Autocapital_Type)edje_object_part_text_autocapital_type_get
3452 (priv->entry_edje, "elm.text"); 3455 (priv->entry_edje, "elm.text");
@@ -3738,6 +3741,7 @@ _elm_entry_password_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool password)
3738 { 3741 {
3739 sd->single_line = EINA_TRUE; 3742 sd->single_line = EINA_TRUE;
3740 sd->line_wrap = ELM_WRAP_NONE; 3743 sd->line_wrap = ELM_WRAP_NONE;
3744 elm_entry_input_hint_set(obj, ((sd->input_hints & ~ELM_INPUT_HINT_AUTO_COMPLETE) | ELM_INPUT_HINT_SENSITIVE_DATA));
3741 _entry_selection_callbacks_unregister(obj); 3745 _entry_selection_callbacks_unregister(obj);
3742 } 3746 }
3743 else 3747 else
@@ -3749,6 +3753,7 @@ _elm_entry_password_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool password)
3749 NULL, NULL, 3753 NULL, NULL,
3750 _drag_drop_cb, NULL); 3754 _drag_drop_cb, NULL);
3751 3755
3756 elm_entry_input_hint_set(obj, ((sd->input_hints | ELM_INPUT_HINT_AUTO_COMPLETE) & ~ELM_INPUT_HINT_SENSITIVE_DATA));
3752 _entry_selection_callbacks_register(obj); 3757 _entry_selection_callbacks_register(obj);
3753 } 3758 }
3754 3759
@@ -4733,6 +4738,11 @@ _elm_entry_input_panel_layout_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Elm_I
4733 4738
4734 edje_object_part_text_input_panel_layout_set 4739 edje_object_part_text_input_panel_layout_set
4735 (sd->entry_edje, "elm.text", (Edje_Input_Panel_Layout)layout); 4740 (sd->entry_edje, "elm.text", (Edje_Input_Panel_Layout)layout);
4741
4742 if (layout == ELM_INPUT_PANEL_LAYOUT_PASSWORD)
4743 elm_entry_input_hint_set(obj, ((sd->input_hints & ~ELM_INPUT_HINT_AUTO_COMPLETE) | ELM_INPUT_HINT_SENSITIVE_DATA));
4744 else if (layout == ELM_INPUT_PANEL_LAYOUT_TERMINAL)
4745 elm_entry_input_hint_set(obj, (sd->input_hints & ~ELM_INPUT_HINT_AUTO_COMPLETE));
4736} 4746}
4737 4747
4738EOLIAN static Elm_Input_Panel_Layout 4748EOLIAN static Elm_Input_Panel_Layout
@@ -4785,6 +4795,21 @@ _elm_entry_prediction_allow_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
4785} 4795}
4786 4796
4787EOLIAN static void 4797EOLIAN static void
4798_elm_entry_input_hint_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Elm_Input_Hints hints)
4799{
4800 sd->input_hints = hints;
4801
4802 edje_object_part_text_input_hint_set
4803 (sd->entry_edje, "elm.text", hints);
4804}
4805
4806EOLIAN static Elm_Input_Hints
4807_elm_entry_input_hint_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
4808{
4809 return sd->input_hints;
4810}
4811
4812EOLIAN static void
4788_elm_entry_imf_context_reset(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd) 4813_elm_entry_imf_context_reset(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
4789{ 4814{
4790 edje_object_part_text_imf_context_reset(sd->entry_edje, "elm.text"); 4815 edje_object_part_text_imf_context_reset(sd->entry_edje, "elm.text");
diff --git a/src/lib/elm_entry.eo b/src/lib/elm_entry.eo
index 46bfed317..c28e95547 100644
--- a/src/lib/elm_entry.eo
+++ b/src/lib/elm_entry.eo
@@ -414,6 +414,27 @@ class Elm_Entry (Elm_Layout, Elm_Interface_Scrollable, Evas.Clickable_Interface,
414 bool prediction; /*@ Whether the entry should allow to use the text prediction. */ 414 bool prediction; /*@ Whether the entry should allow to use the text prediction. */
415 } 415 }
416 } 416 }
417 input_hint {
418 set {
419 /*@
420 Sets the input hint which allows input methods to fine-tune their behavior.
421
422 @ingroup Entry */
423 }
424 get {
425 /*@
426 Gets the value of input hint.
427
428 @return the value of input hint.
429
430 @see elm_entry_input_hint_set
431
432 @ingroup Entry */
433 }
434 values {
435 Elm_Input_Hints hints; /*@ input hint. */
436 }
437 }
417 input_panel_layout { 438 input_panel_layout {
418 set { 439 set {
419 /*@ 440 /*@
diff --git a/src/lib/elm_entry_common.h b/src/lib/elm_entry_common.h
index 12a581b7c..f5187454d 100644
--- a/src/lib/elm_entry_common.h
+++ b/src/lib/elm_entry_common.h
@@ -109,6 +109,18 @@ typedef enum
109} Elm_Input_Panel_Return_Key_Type; 109} Elm_Input_Panel_Return_Key_Type;
110 110
111/** 111/**
112 * @typedef Elm_Input_Hints
113 * @brief Enumeration that defines the types of Input Hints.
114 * @since 1.12
115 */
116typedef enum
117{
118 ELM_INPUT_HINT_NONE = 0, /**< No active hints @since 1.12 */
119 ELM_INPUT_HINT_AUTO_COMPLETE = 1 << 0, /**< suggest word auto completion @since 1.12 */
120 ELM_INPUT_HINT_SENSITIVE_DATA = 1 << 1, /**< typed text should not be stored. @since 1.12 */
121} Elm_Input_Hints;
122
123/**
112 * @typedef Elm_Entry_Anchor_Info 124 * @typedef Elm_Entry_Anchor_Info
113 * 125 *
114 * The info sent in the callback for the "anchor,clicked" signals emitted 126 * The info sent in the callback for the "anchor,clicked" signals emitted
diff --git a/src/lib/elm_widget_entry.h b/src/lib/elm_widget_entry.h
index 06b4dda69..c29275b05 100644
--- a/src/lib/elm_widget_entry.h
+++ b/src/lib/elm_widget_entry.h
@@ -67,6 +67,7 @@ struct _Elm_Entry_Data
67 Elm_Autocapital_Type autocapital_type; 67 Elm_Autocapital_Type autocapital_type;
68 Elm_Input_Panel_Lang input_panel_lang; 68 Elm_Input_Panel_Lang input_panel_lang;
69 Elm_Input_Panel_Return_Key_Type input_panel_return_key_type; 69 Elm_Input_Panel_Return_Key_Type input_panel_return_key_type;
70 Elm_Input_Hints input_hints;
70 Edje_Cursor sel_handler_cursor; 71 Edje_Cursor sel_handler_cursor;
71 void *input_panel_imdata; 72 void *input_panel_imdata;
72 int input_panel_imdata_len; 73 int input_panel_imdata_len;