From 1b8ad509fcbc33116654f7da61c26a202efd068a Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 27 Mar 2013 17:34:19 +0900 Subject: [PATCH] Add APIs - elm_entry_input_panel_layout_variation_set/get --- legacy/elementary/ChangeLog | 4 ++ legacy/elementary/NEWS | 1 + legacy/elementary/src/lib/elm_entry.c | 45 +++++++++++++++ legacy/elementary/src/lib/elm_entry.h | 59 ++++++++++++++++++++ legacy/elementary/src/lib/elm_widget_entry.h | 1 + 5 files changed, 110 insertions(+) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 583036d624..1b7f8d5f7c 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -1178,3 +1178,7 @@ * Add four more focus directions. ELM_FOCUS_UP/DOWN/RIGHT/LEFT. * Add elm_object_focus_next_object_get/set. * Add elm_object_focused_object_get. + +2013-03-27 Jihoon Kim + + * Add elm_entry_input_panel_layout_variation_set/get API diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 2a2fc15e7a..33454ca7a3 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -53,6 +53,7 @@ Additions: * Add four more focus diretions. ELM_FOCUS_UP, ELM_FOCUS_DOWN, ELM_FOCUS_RIGHT, ELM_FOCUS_LEFT. * Add APIs - elm_object_focus_next_object_get, elm_object_focus_next_object_set. * Add API - elm_object_focused_object_get. + * Add APIs - elm_entry_input_panel_layout_variation_set/get Improvements: diff --git a/legacy/elementary/src/lib/elm_entry.c b/legacy/elementary/src/lib/elm_entry.c index c7a9af9984..5e5d4208f4 100644 --- a/legacy/elementary/src/lib/elm_entry.c +++ b/legacy/elementary/src/lib/elm_entry.c @@ -519,6 +519,8 @@ _elm_entry_smart_theme(Eo *obj, void *_pd, va_list *list) edje_object_part_text_input_panel_layout_set (sd->entry_edje, "elm.text", sd->input_panel_layout); + edje_object_part_text_input_panel_layout_variation_set + (sd->entry_edje, "elm.text", sd->input_panel_layout_variation); edje_object_part_text_autocapital_type_set (sd->entry_edje, "elm.text", sd->autocapital_type); edje_object_part_text_prediction_allow_set @@ -4715,6 +4717,45 @@ _input_panel_layout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) *ret = sd->input_panel_layout; } +EAPI void +elm_entry_input_panel_layout_variation_set(Evas_Object *obj, + int variation) +{ + ELM_ENTRY_CHECK(obj); + eo_do(obj, elm_obj_entry_input_panel_layout_variation_set(variation)); +} + +static void +_input_panel_layout_variation_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list) +{ + int variation = va_arg(*list, int); + Elm_Entry_Smart_Data *sd = _pd; + + sd->input_panel_layout_variation = variation; + + edje_object_part_text_input_panel_layout_variation_set + (sd->entry_edje, "elm.text", variation); +} + +EAPI int +elm_entry_input_panel_layout_variation_get(const Evas_Object *obj) +{ + ELM_ENTRY_CHECK(obj) 0; + int ret = 0; + eo_do((Eo *) obj, elm_obj_entry_input_panel_layout_variation_get(&ret)); + + return ret; +} + +static void +_input_panel_layout_variation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) +{ + int *ret = va_arg(*list, int *); + Elm_Entry_Smart_Data *sd = _pd; + + *ret = sd->input_panel_layout_variation; +} + EAPI void elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapital_type) @@ -5314,6 +5355,8 @@ _class_constructor(Eo_Class *klass) EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET), _anchor_hover_style_set), EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET), _anchor_hover_style_get), EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END), _anchor_hover_end), + EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_SET), _input_panel_layout_variation_set), + EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_GET), _input_panel_layout_variation_get), EO_OP_FUNC_SENTINEL }; eo_class_funcs_set(klass, func_desc); @@ -5407,6 +5450,8 @@ static const Eo_Op_Description op_desc[] = { EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET, "Set the style that the hover should use."), EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET, "Get the style that the hover should use."), EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END, "Ends the hover popup in the entry."), + EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_SET, "Set the input panel layout variation of the entry."), + EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_GET, "Get the input panel layout variation of the entry."), EO_OP_DESCRIPTION_SENTINEL }; diff --git a/legacy/elementary/src/lib/elm_entry.h b/legacy/elementary/src/lib/elm_entry.h index 866eefb720..eae1fb757c 100644 --- a/legacy/elementary/src/lib/elm_entry.h +++ b/legacy/elementary/src/lib/elm_entry.h @@ -320,6 +320,14 @@ typedef enum ELM_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. */ } Elm_Input_Panel_Layout; /**< Type of input panel (virtual keyboard) to use - this is a hint and may not provide exactly what is desired. */ +enum +{ + ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL, + ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED, + ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL, + ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL +}; + /** * @typedef Elm_Input_Panel_Lang * @@ -1333,6 +1341,31 @@ EAPI void elm_entry_input_panel_layout_set(Evas_Object *obj, E */ EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(const Evas_Object *obj); +/** + * Set the input panel layout variation of the entry + * + * @param obj The entry object + * @param variation layout variation type + * + * @ingroup Entry + * @since 1.8 + */ +EAPI void elm_entry_input_panel_layout_variation_set(Evas_Object *obj, int variation); + +/** + * Get the input panel layout variation of the entry + * + * @param obj The entry object + * @return layout variation type + * + * @see elm_entry_input_panel_layout_variation_set + * + * @ingroup Entry + * @since 1.8 + */ +EAPI int elm_entry_input_panel_layout_variation_get(const Evas_Object *obj); + + /** * Set the autocapitalization type on the immodule. * @@ -1881,6 +1914,8 @@ enum ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET, ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET, ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_SET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_GET, ELM_OBJ_ENTRY_SUB_ID_LAST }; @@ -2626,6 +2661,30 @@ enum */ #define elm_obj_entry_input_panel_layout_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET), EO_TYPECHECK(Elm_Input_Panel_Layout *, ret) +/** + * @def elm_obj_entry_input_panel_layout_variation_set + * @since 1.8 + * + * Set the input panel layout variation of the entry + * + * @param[in] layout variation + * + * @see elm_entry_input_panel_layout_variation_set + */ +#define elm_obj_entry_input_panel_layout_variation_set(variation) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_SET), EO_TYPECHECK(int, variation) + +/** + * @def elm_obj_entry_input_panel_layout_variation_get + * @since 1.8 + * + * Get the input panel layout variation of the entry + * + * @param[out] ret + * + * @see elm_entry_input_panel_layout_variation_get + */ +#define elm_obj_entry_input_panel_layout_variation_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_GET), EO_TYPECHECK(int *, ret) + /** * @def elm_obj_entry_autocapital_type_set * @since 1.8 diff --git a/legacy/elementary/src/lib/elm_widget_entry.h b/legacy/elementary/src/lib/elm_widget_entry.h index 7460111722..7d881c71ff 100644 --- a/legacy/elementary/src/lib/elm_widget_entry.h +++ b/legacy/elementary/src/lib/elm_widget_entry.h @@ -57,6 +57,7 @@ struct _Elm_Entry_Smart_Data Elm_Input_Panel_Return_Key_Type input_panel_return_key_type; void *input_panel_imdata; int input_panel_imdata_len; + int input_panel_layout_variation; struct { Evas_Object *hover_parent;