From: Jihoon Kim <jihoon48.kim@samsung.com>

Subject: [E-devel] [PATCH] add elm_entry_input_panel_layout_set API

elm_entry_input_panel_layout_set API is high level API to call
ecore_imf_context_input_panel_layout_set (through edje).
This API will be used to set layout of input panel (such as URL, Email,
Number layout...) by application programmer.

Would you please review this patch?
Please let me know if I have to do more.



SVN revision: 62782
This commit is contained in:
Jihoon Kim 2011-08-25 07:25:37 +00:00 committed by Carsten Haitzler
parent f3d21a04d0
commit 94561e19eb
4 changed files with 100 additions and 1 deletions

View File

@ -775,6 +775,18 @@ typedef enum _Edje_External_Param_Flags
EDJE_EXTERNAL_PARAM_FLAGS_STATE) /**< Convenience flag that sets property as GET, SET and STATE. */
} Edje_External_Param_Flags;
typedef enum
{
EDJE_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */
EDJE_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */
EDJE_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */
EDJE_INPUT_PANEL_LAYOUT_URL, /**< URL layout */
EDJE_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */
EDJE_INPUT_PANEL_LAYOUT_IP, /**< IP layout */
EDJE_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */
EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */
EDJE_INPUT_PANEL_LAYOUT_INVALID
} Edje_Input_Panel_Layout;
/**
* @brief Converts type identifier to string nicer representation.
@ -2741,6 +2753,34 @@ EAPI void edje_object_part_text_cursor_pos_set (Evas_Ob
*/
EAPI int edje_object_part_text_cursor_pos_get (const Evas_Object *obj, const char *part, Edje_Cursor cur);
/**
* @brief Set the layout of the input panel.
*
* The layout of the inptu panel or virtual keyboard can make it easier or
* harder to enter content. This allows you to hint what kind of input you
* are expecting to enter and thus have the input panel automatically
* come up with the right mode.
*
* @param obj A valid Evas_Object handle
* @param part The part name
* @param layout layout type
* @since 1.1
*/
EAPI void edje_object_part_text_input_panel_layout_set (const Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout);
/**
* @brief Get the layout of the input panel.
*
* @param obj A valid Evas_Object handle
* @param part The part name
*
* @return Layout type of the input panel
*
* @see edje_object_part_text_input_panel_layout_set
* @since 1.1
*/
EAPI Edje_Input_Panel_Layout edje_object_part_text_input_panel_layout_get (const Evas_Object *obj, const char *part);
/**
* Add a filter function for newly inserted text.
*

View File

@ -2646,6 +2646,30 @@ _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur)
return evas_textblock_cursor_pos_get(c);
}
void
_edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout)
{
Entry *en = rp->entry_data;
if (!en) return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
ecore_imf_context_input_panel_layout_set(en->imf_context, layout);
#endif
}
Edje_Input_Panel_Layout
_edje_entry_input_panel_layout_get(Edje_Real_Part *rp)
{
Entry *en = rp->entry_data;
if ((!en) || (!en->imf_context)) return EDJE_INPUT_PANEL_LAYOUT_INVALID;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
return ecore_imf_context_input_panel_layout_get(en->imf_context);
#endif
return EDJE_INPUT_PANEL_LAYOUT_INVALID;
}
static void
_edje_entry_imf_context_reset(Entry *en)
{

View File

@ -1834,7 +1834,9 @@ Eina_Bool _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Curs
const char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur);
void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos);
int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur);
void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout);
Edje_Input_Panel_Layout _edje_entry_input_panel_layout_get(Edje_Real_Part *rp);
void _edje_external_init();
void _edje_external_shutdown();
Evas_Object *_edje_external_type_add(const char *type_name, Evas *evas, Evas_Object *parent, const Eina_List *params, const char *part_name);

View File

@ -1723,6 +1723,39 @@ edje_object_part_text_cursor_pos_get(const Evas_Object *obj, const char *part, E
return 0;
}
EAPI void
edje_object_part_text_input_panel_layout_set(const Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout)
{
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)
{
return _edje_entry_input_panel_layout_set(rp, layout);
}
}
EAPI Edje_Input_Panel_Layout
edje_object_part_text_input_panel_layout_get(const Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EDJE_INPUT_PANEL_LAYOUT_INVALID;
rp = _edje_real_part_recursive_get(ed, part);
if (!rp) return EINA_FALSE;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
{
return _edje_entry_input_panel_layout_get(rp);
}
return EDJE_INPUT_PANEL_LAYOUT_INVALID;
}
EAPI void
edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data)
{