From f7ac08317c5c89a968a467b980c8681179feb93c Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 13 Feb 2012 06:34:47 +0000 Subject: [PATCH] Add edje_object_part_text_input_panel_show/hide. These APIs can be used in input panel manual control mode. SVN revision: 67873 --- legacy/edje/ChangeLog | 4 ++++ legacy/edje/src/lib/Edje.h | 25 +++++++++++++++++++++++++ legacy/edje/src/lib/edje_entry.c | 24 ++++++++++++++++++++++++ legacy/edje/src/lib/edje_private.h | 2 ++ legacy/edje/src/lib/edje_util.c | 28 ++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+) diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog index bcc55470de..bfa444848a 100644 --- a/legacy/edje/ChangeLog +++ b/legacy/edje/ChangeLog @@ -333,3 +333,7 @@ * Prevent propagation of signal, when there is a matching target with edje GROUP. +2012-02-13 Jihoon Kim + + * add edje_object_part_text_input_panel_show/hide. + These APIs can be used in input panel manual control mode diff --git a/legacy/edje/src/lib/Edje.h b/legacy/edje/src/lib/Edje.h index 97d1a61966..788fa9fcde 100644 --- a/legacy/edje/src/lib/Edje.h +++ b/legacy/edje/src/lib/Edje.h @@ -2909,6 +2909,31 @@ EAPI void edje_object_part_text_input_panel_enabled_set (const Evas_ */ EAPI Eina_Bool edje_object_part_text_input_panel_enabled_get (const Evas_Object *obj, const char *part); +/** + * @brief Show the input panel (virtual keyboard) based on the input panel property such as layout, autocapital types, and so on. + * + * Note that input panel is shown or hidden automatically according to the focus state. + * This API can be used in the case of manually controling by using edje_object_part_text_input_panel_enabled_set. + * + * @param obj A valid Evas_Object handle + * @param part The part name + * @since 1.2.0 + */ +EAPI void edje_object_part_text_input_panel_show(const Evas_Object *obj, const char *part); + +/** + * @brief Hide the input panel (virtual keyboard). + * @see edje_object_part_text_input_panel_show + * + * Note that input panel is shown or hidden automatically according to the focus state. + * This API can be used in the case of manually controling by using edje_object_part_text_input_panel_enabled_set. + * + * @param obj A valid Evas_Object handle + * @param part The part name + * @since 1.2.0 + */ +EAPI void edje_object_part_text_input_panel_hide(const Evas_Object *obj, const char *part); + /** * Add a filter function for newly inserted text. * diff --git a/legacy/edje/src/lib/edje_entry.c b/legacy/edje/src/lib/edje_entry.c index 2effafdb1a..7966253f80 100644 --- a/legacy/edje/src/lib/edje_entry.c +++ b/legacy/edje/src/lib/edje_entry.c @@ -2600,6 +2600,30 @@ _edje_entry_input_panel_enabled_get(Edje_Real_Part *rp) return en->input_panel_enable; } +void +_edje_entry_input_panel_show(Edje_Real_Part *rp) +{ + Entry *en = rp->entry_data; + + if (!en) return; +#ifdef HAVE_ECORE_IMF + if (en->imf_context) + ecore_imf_context_input_panel_show(en->imf_context); +#endif +} + +void +_edje_entry_input_panel_hide(Edje_Real_Part *rp) +{ + Entry *en = rp->entry_data; + + if (!en) return; +#ifdef HAVE_ECORE_IMF + if (en->imf_context) + ecore_imf_context_input_panel_hide(en->imf_context); +#endif +} + static Evas_Textblock_Cursor * _cursor_get(Edje_Real_Part *rp, Edje_Cursor cur) { diff --git a/legacy/edje/src/lib/edje_private.h b/legacy/edje/src/lib/edje_private.h index cff28534df..f1bb106bea 100644 --- a/legacy/edje/src/lib/edje_private.h +++ b/legacy/edje/src/lib/edje_private.h @@ -1945,6 +1945,8 @@ void _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_ Edje_Text_Autocapital_Type _edje_entry_autocapital_type_get(Edje_Real_Part *rp); void _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled); Eina_Bool _edje_entry_input_panel_enabled_get(Edje_Real_Part *rp); +void _edje_entry_input_panel_show(Edje_Real_Part *rp); +void _edje_entry_input_panel_hide(Edje_Real_Part *rp); void _edje_external_init(); void _edje_external_shutdown(); diff --git a/legacy/edje/src/lib/edje_util.c b/legacy/edje/src/lib/edje_util.c index ddd078569d..5cedae7359 100644 --- a/legacy/edje/src/lib/edje_util.c +++ b/legacy/edje/src/lib/edje_util.c @@ -1876,6 +1876,34 @@ edje_object_part_text_input_panel_enabled_get(const Evas_Object *obj, const char return EINA_FALSE; } +EAPI void +edje_object_part_text_input_panel_show(const Evas_Object *obj, const char *part) +{ + Edje *ed; + Edje_Real_Part *rp; + + ed = _edje_fetch(obj); + if ((!ed) || (!part)) return; + rp = _edje_real_part_recursive_get(ed, part); + if (!rp) return; + if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) + _edje_entry_input_panel_show(rp); +} + +EAPI void +edje_object_part_text_input_panel_hide(const Evas_Object *obj, const char *part) +{ + Edje *ed; + Edje_Real_Part *rp; + + ed = _edje_fetch(obj); + if ((!ed) || (!part)) return; + rp = _edje_real_part_recursive_get(ed, part); + if (!rp) return; + if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) + _edje_entry_input_panel_hide(rp); +} + EAPI void edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data) {