summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2011-10-27 05:43:08 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-10-27 05:43:08 +0000
commit0ff8c40ad0d3a17a103fc09263ed7c1719f8fbac (patch)
treeb7f23a625d39e5ba35a4e5fb753560a08599ae8f /legacy
parent4b77b69c22173a0efa404be0c94a691bba302f3f (diff)
From: Jihoon Kim <jihoon48.kim@samsung.com>
elm_entry_autocapital_type_set API is high level API to call ecore_imf_context_autocapital_type_set. Application programmer can choose the type of autocapitalization such as WORD, SENTENCE, ALLCHARACTER through this API. elm_entry_input_panel_enabled_set API is for setting whether input panel (virtual keyboard) should be appeared when entry has a focus or pressed. It can be used by dialer or calculator application programmer because those application prefer to use its keypad NOT virtual keyboard supported by system. They want to use entry to show the cursor for providing the cursor handling method but don't want to appear system keyboard. SVN revision: 64424
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/Elementary.h.in37
-rw-r--r--legacy/elementary/src/lib/elm_entry.c46
2 files changed, 81 insertions, 2 deletions
diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in
index 9292a14f0c..9b3f86a9e2 100644
--- a/legacy/elementary/src/lib/Elementary.h.in
+++ b/legacy/elementary/src/lib/Elementary.h.in
@@ -571,6 +571,14 @@ extern "C" {
571 ELM_INPUT_PANEL_LAYOUT_INVALID 571 ELM_INPUT_PANEL_LAYOUT_INVALID
572 } Elm_Input_Panel_Layout; 572 } Elm_Input_Panel_Layout;
573 573
574 typedef enum
575 {
576 ELM_AUTOCAPITAL_TYPE_NONE,
577 ELM_AUTOCAPITAL_TYPE_WORD,
578 ELM_AUTOCAPITAL_TYPE_SENTENCE,
579 ELM_AUTOCAPITAL_TYPE_ALLCHARACTER,
580 } Elm_Autocapital_Type;
581
574 /** 582 /**
575 * @typedef Elm_Object_Item 583 * @typedef Elm_Object_Item
576 * An Elementary Object item handle. 584 * An Elementary Object item handle.
@@ -11785,6 +11793,35 @@ extern "C" {
11785 */ 11793 */
11786 EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(Evas_Object *obj) EINA_ARG_NONNULL(1); 11794 EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
11787 /** 11795 /**
11796 * Set the autocapitalization type on the immodule.
11797 *
11798 * @param obj The entry object
11799 * @param autocapital_type The type of autocapitalization
11800 */
11801 EAPI void elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapital_type) EINA_ARG_NONNULL(1);
11802 /**
11803 * Retrieve the autocapitalization type on the immodule.
11804 *
11805 * @param obj The entry object
11806 * @return autocapitalization type
11807 */
11808 EAPI Elm_Autocapital_Type elm_entry_autocapital_type_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
11809 /**
11810 * Sets the attribute to show the input panel automatically.
11811 *
11812 * @param obj The entry object
11813 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
11814 */
11815 EAPI void elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled) EINA_ARG_NONNULL(1);
11816 /**
11817 * Retrieve the attribute to show the input panel automatically.
11818 *
11819 * @param obj The entry object
11820 * @return EINA_TRUE if input panel will be appeared when the entry is clicked or has a focus, EINA_FALSE otherwise
11821 */
11822 EAPI Eina_Bool elm_entry_input_panel_enabled_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
11823
11824 /**
11788 * @} 11825 * @}
11789 */ 11826 */
11790 11827
diff --git a/legacy/elementary/src/lib/elm_entry.c b/legacy/elementary/src/lib/elm_entry.c
index 0d0fea09b6..75395d85fa 100644
--- a/legacy/elementary/src/lib/elm_entry.c
+++ b/legacy/elementary/src/lib/elm_entry.c
@@ -47,6 +47,7 @@ struct _Widget_Data
47 Elm_Scroller_Policy policy_h, policy_v; 47 Elm_Scroller_Policy policy_h, policy_v;
48 Elm_Wrap_Type linewrap; 48 Elm_Wrap_Type linewrap;
49 Elm_Input_Panel_Layout input_panel_layout; 49 Elm_Input_Panel_Layout input_panel_layout;
50 Elm_Autocapital_Type autocapital_type;
50 Eina_Bool changed : 1; 51 Eina_Bool changed : 1;
51 Eina_Bool single_line : 1; 52 Eina_Bool single_line : 1;
52 Eina_Bool password : 1; 53 Eina_Bool password : 1;
@@ -64,6 +65,7 @@ struct _Widget_Data
64 Eina_Bool textonly : 1; 65 Eina_Bool textonly : 1;
65 Eina_Bool usedown : 1; 66 Eina_Bool usedown : 1;
66 Eina_Bool scroll : 1; 67 Eina_Bool scroll : 1;
68 Eina_Bool input_panel_enable : 1;
67}; 69};
68 70
69struct _Elm_Entry_Context_Menu_Item 71struct _Elm_Entry_Context_Menu_Item
@@ -518,6 +520,8 @@ _theme_hook(Evas_Object *obj)
518 if (elm_widget_disabled_get(obj)) 520 if (elm_widget_disabled_get(obj))
519 edje_object_signal_emit(wd->ent, "elm,state,disabled", "elm"); 521 edje_object_signal_emit(wd->ent, "elm,state,disabled", "elm");
520 edje_object_part_text_input_panel_layout_set(wd->ent, "elm.text", wd->input_panel_layout); 522 edje_object_part_text_input_panel_layout_set(wd->ent, "elm.text", wd->input_panel_layout);
523 edje_object_part_text_autocapital_type_set(wd->ent, "elm.text", wd->autocapital_type);
524 edje_object_part_text_input_panel_enabled_set(wd->ent, "elm.text", wd->input_panel_enable);
521 elm_entry_cursor_pos_set(obj, wd->cursor_pos); 525 elm_entry_cursor_pos_set(obj, wd->cursor_pos);
522 if (elm_widget_focus_get(obj)) 526 if (elm_widget_focus_get(obj))
523 edje_object_signal_emit(wd->ent, "elm,action,focus", "elm"); 527 edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
@@ -761,14 +765,16 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
761 { 765 {
762 evas_object_focus_set(wd->ent, EINA_TRUE); 766 evas_object_focus_set(wd->ent, EINA_TRUE);
763 edje_object_signal_emit(wd->ent, "elm,action,focus", "elm"); 767 edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
764 if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON); 768 if (top && wd->input_panel_enable)
769 elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
765 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL); 770 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
766 } 771 }
767 else 772 else
768 { 773 {
769 edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm"); 774 edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm");
770 evas_object_focus_set(wd->ent, EINA_FALSE); 775 evas_object_focus_set(wd->ent, EINA_FALSE);
771 if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF); 776 if (top && wd->input_panel_enable)
777 elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
772 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL); 778 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
773 } 779 }
774} 780}
@@ -2259,6 +2265,9 @@ elm_entry_add(Evas_Object *parent)
2259 2265
2260 elm_entry_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL); 2266 elm_entry_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL);
2261 2267
2268 wd->input_panel_enable = edje_object_part_text_input_panel_enabled_get(wd->ent, "elm.text");
2269 wd->autocapital_type = edje_object_part_text_autocapital_type_get(wd->ent, "elm.text");
2270
2262#ifdef HAVE_ELEMENTARY_X 2271#ifdef HAVE_ELEMENTARY_X
2263 top = elm_widget_top_get(obj); 2272 top = elm_widget_top_get(obj);
2264 if ((top) && (elm_win_xwindow_get(top))) 2273 if ((top) && (elm_win_xwindow_get(top)))
@@ -3255,3 +3264,36 @@ elm_entry_input_panel_layout_get(Evas_Object *obj)
3255 3264
3256 return wd->input_panel_layout; 3265 return wd->input_panel_layout;
3257} 3266}
3267
3268EAPI void
3269elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapital_type)
3270{
3271 ELM_CHECK_WIDTYPE(obj, widtype);
3272 Widget_Data *wd = elm_widget_data_get(obj);
3273 if (!wd) return;
3274
3275 wd->autocapital_type = autocapital_type;
3276 edje_object_part_text_autocapital_type_set(wd->ent, "elm.text", autocapital_type);
3277}
3278
3279EAPI Elm_Autocapital_Type
3280elm_entry_autocapital_type_get(Evas_Object *obj)
3281{
3282 ELM_CHECK_WIDTYPE(obj, widtype) ELM_AUTOCAPITAL_TYPE_NONE;
3283 Widget_Data *wd = elm_widget_data_get(obj);
3284 if (!wd) return ELM_AUTOCAPITAL_TYPE_NONE;
3285
3286 return wd->autocapital_type;
3287}
3288
3289EAPI void
3290elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
3291{
3292 ELM_CHECK_WIDTYPE(obj, widtype);
3293 Widget_Data *wd = elm_widget_data_get(obj);
3294 if (!wd) return;
3295
3296 wd->input_panel_enable = enabled;
3297 edje_object_part_text_input_panel_enabled_set(wd->ent, "elm.text", enabled);
3298}
3299