edje: Add edje_object_part_text_input_panel_layout_variation_set/get API

This commit is contained in:
Jihoon Kim 2013-03-27 17:28:53 +09:00
parent fec755aef6
commit 8dda0883c1
6 changed files with 107 additions and 0 deletions

View File

@ -1,6 +1,7 @@
2013-03-27 Jihoon Kim
* Add ecore_imf_context_input_panel_variation_set/get API.
* Add edje_object_part_text_input_panel_layout_variation_set/get API.
2013-03-25 Cedric Bail

1
NEWS
View File

@ -82,6 +82,7 @@ Additions:
* Ecore_Con: Add systemd socket activation support (ECORE_CON_SOCKET_ACTIVATE).
* Ecore: notify systemd that we are ready as soon as the main loop is running.
* ecore_imf: Add ecore_imf_context_input_panel_layout_variation_set/get API
* Add edje_object_part_text_input_panel_layout_variation_set/get API
Deprecations:
* ecore_x:

View File

@ -5227,6 +5227,14 @@ typedef enum _Edje_Input_Panel_Layout
EDJE_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */
} Edje_Input_Panel_Layout;
enum
{
EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL,
EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED,
EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL,
EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL
};
typedef void (*Edje_Text_Filter_Cb) (void *data, Evas_Object *obj, const char *part, Edje_Text_Filter_Type type, char **text);
typedef void (*Edje_Markup_Filter_Cb) (void *data, Evas_Object *obj, const char *part, char **text);
typedef Evas_Object *(*Edje_Item_Provider_Cb) (void *data, Evas_Object *obj, const char *part, const char *item);
@ -5345,6 +5353,34 @@ EAPI void edje_object_part_text_input_panel_layout_set (Evas_Ob
*/
EAPI Edje_Input_Panel_Layout edje_object_part_text_input_panel_layout_get (const Evas_Object *obj, const char *part);
/**
* @brief Set the layout variation of the input panel.
*
* The layout variation of the input 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 variation layout variation type
* @since 1.8
*/
EAPI void edje_object_part_text_input_panel_layout_variation_set(Evas_Object *obj, const char *part, int variation);
/**
* @brief Get the layout variation of the input panel.
*
* @param obj A valid Evas_Object handle
* @param part The part name
*
* @return Layout variation type of the input panel
*
* @see edje_object_part_text_input_panel_layout_variation_set
* @since 1.8
*/
EAPI int edje_object_part_text_input_panel_layout_variation_get(const Evas_Object *obj, const char *part);
/**
* @brief Set the autocapitalization type on the immodule.
*

View File

@ -3594,6 +3594,40 @@ _edje_entry_input_panel_layout_get(Edje_Real_Part *rp)
#endif
}
void
_edje_entry_input_panel_layout_variation_set(Edje_Real_Part *rp, int variation)
{
Entry *en;
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
(!rp->typedata.text)) return;
en = rp->typedata.text->entry_data;
if (!en) return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
ecore_imf_context_input_panel_layout_variation_set(en->imf_context, variation);
#else
(void) variation;
#endif
}
int
_edje_entry_input_panel_layout_variation_get(Edje_Real_Part *rp)
{
Entry *en;
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
(!rp->typedata.text)) return 0;
en = rp->typedata.text->entry_data;
if (!en) return 0;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
return ecore_imf_context_input_panel_layout_variation_get(en->imf_context);
#endif
return 0;
}
void
_edje_entry_imf_context_reset(Edje_Real_Part *rp)
{

View File

@ -2271,6 +2271,8 @@ int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur);
void _edje_entry_imf_context_reset(Edje_Real_Part *rp);
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_entry_input_panel_layout_variation_set(Edje_Real_Part *rp, int variation);
int _edje_entry_input_panel_layout_variation_get(Edje_Real_Part *rp);
void _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type);
Edje_Text_Autocapital_Type _edje_entry_autocapital_type_get(Edje_Real_Part *rp);
void _edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction);

View File

@ -2721,6 +2721,39 @@ _part_text_input_panel_layout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
}
}
EAPI void
edje_object_part_text_input_panel_layout_variation_set(Evas_Object *obj, const char *part, int variation)
{
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_layout_variation_set(rp, variation);
}
}
EAPI int
edje_object_part_text_input_panel_layout_variation_get(const Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return 0;
rp = _edje_real_part_recursive_get(ed, part);
if (!rp) return 0;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
{
return _edje_entry_input_panel_layout_variation_get(rp);
}
return 0;
}
EAPI void
edje_object_part_text_autocapital_type_set(Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type)
{