add edje_object_part_text_prediction_allow_set/get.

These APIs can be used to set whether prediction feature is allowed or not.


SVN revision: 67889
This commit is contained in:
Jihoon Kim 2012-02-14 02:34:50 +00:00
parent 75839f61a5
commit 1e350bd45a
5 changed files with 85 additions and 2 deletions

View File

@ -336,6 +336,11 @@
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
These APIs can be used in input panel manual control mode.
* add edje_object_part_text_imf_context_reset that will use
for reseting the input method context
for reseting the input method context.
2012-02-14 Jihoon Kim
* add edje_object_part_text_prediction_allow_set/get.
These APIs can be used to set whether prediction feature is allowed or not.

View File

@ -2899,6 +2899,26 @@ EAPI void edje_object_part_text_autocapital_type_set (const Evas_
*/
EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get (const Evas_Object *obj, const char *part);
/**
* @brief Set whether the prediction is allowed or not.
*
* @param obj A valid Evas_Object handle
* @param part The part name
* @param prediction If true, the prediction feature is allowed.
* @since 1.2.0
*/
EAPI void edje_object_part_text_prediction_allow_set (const Evas_Object *obj, const char *part, Eina_Bool prediction);
/**
* @brief Get whether the prediction is allowed or not.
*
* @param obj A valid Evas_Object handle
* @param part The part name
* @return EINA_TRUE if prediction feature is allowed.
* @since 1.2.0
*/
EAPI Eina_Bool edje_object_part_text_prediction_allow_get (const Evas_Object *obj, const char *part);
/**
* @brief Sets the attribute to show the input panel automatically.
*

View File

@ -35,6 +35,7 @@ struct _Entry
Eina_Bool select_mod_end : 1;
Eina_Bool had_sel : 1;
Eina_Bool input_panel_enable : 1;
Eina_Bool prediction_allow : 1;
#ifdef HAVE_ECORE_IMF
Eina_Bool have_preedit : 1;
@ -2577,6 +2578,28 @@ _edje_entry_autocapital_type_get(Edje_Real_Part *rp)
return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
}
void
_edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction)
{
Entry *en = rp->entry_data;
if (!en) return;
en->prediction_allow = prediction;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
ecore_imf_context_prediction_allow_set(en->imf_context, prediction);
#endif
}
Eina_Bool
_edje_entry_prediction_allow_get(Edje_Real_Part *rp)
{
Entry *en = rp->entry_data;
if (!en) return EINA_FALSE;
return en->prediction_allow;
}
void
_edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled)
{

View File

@ -1944,6 +1944,8 @@ void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Lay
Edje_Input_Panel_Layout _edje_entry_input_panel_layout_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);
Eina_Bool _edje_entry_prediction_allow_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);

View File

@ -1859,6 +1859,39 @@ edje_object_part_text_autocapital_type_get(const Evas_Object *obj, const char *p
return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
}
EAPI void
edje_object_part_text_prediction_allow_set(const Evas_Object *obj, const char *part, Eina_Bool prediction)
{
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_prediction_allow_set(rp, prediction);
}
}
EAPI Eina_Bool
edje_object_part_text_prediction_allow_get(const Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
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_prediction_allow_get(rp);
}
return EINA_FALSE;
}
EAPI void
edje_object_part_text_input_panel_enabled_set(const Evas_Object *obj, const char *part, Eina_Bool enabled)
{