From 1bd490980e30f96c197e8041ed0111e01daf9df4 Mon Sep 17 00:00:00 2001 From: jihoon Date: Wed, 15 Feb 2012 11:50:06 +0000 Subject: [PATCH] elm_entry: add 'const' in some getter functions Change-Id: Iaba1d2dee9413bdae72741468c3c38e1a5be4689 git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@67979 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/elm_entry.c | 27 ++++++++++++++++++++++++--- src/lib/elm_entry.h | 22 +++++++++++++++++++--- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index a40539a..b182ec3 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -4346,7 +4346,7 @@ elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout } EAPI Elm_Input_Panel_Layout -elm_entry_input_panel_layout_get(Evas_Object *obj) +elm_entry_input_panel_layout_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) ELM_INPUT_PANEL_LAYOUT_INVALID; Widget_Data *wd = elm_widget_data_get(obj); @@ -4367,7 +4367,7 @@ elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapita } EAPI Elm_Autocapital_Type -elm_entry_autocapital_type_get(Evas_Object *obj) +elm_entry_autocapital_type_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) ELM_AUTOCAPITAL_TYPE_NONE; Widget_Data *wd = elm_widget_data_get(obj); @@ -4377,6 +4377,27 @@ elm_entry_autocapital_type_get(Evas_Object *obj) } EAPI void +elm_entry_prediction_allow_set(Evas_Object *obj, Eina_Bool prediction) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + wd->prediction_allow = prediction; + edje_object_part_text_prediction_allow_set(wd->ent, "elm.text", prediction); +} + +EAPI Eina_Bool +elm_entry_prediction_allow_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_TRUE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_TRUE; + + return wd->prediction_allow; +} + +EAPI void elm_entry_imf_context_reset(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype); @@ -4398,7 +4419,7 @@ elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled) } EAPI Eina_Bool -elm_entry_input_panel_enabled_get(Evas_Object *obj) +elm_entry_input_panel_enabled_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_TRUE; Widget_Data *wd = elm_widget_data_get(obj); diff --git a/src/lib/elm_entry.h b/src/lib/elm_entry.h index 6eb677e..7b7ccf8 100644 --- a/src/lib/elm_entry.h +++ b/src/lib/elm_entry.h @@ -1165,7 +1165,7 @@ EAPI void elm_entry_input_panel_layout_set(Evas_Object *obj, E * * @see elm_entry_input_panel_layout_set */ -EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(Evas_Object *obj); +EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(const Evas_Object *obj); /** * Set the autocapitalization type on the immodule. @@ -1181,7 +1181,7 @@ EAPI void elm_entry_autocapital_type_set(Evas_Object *obj, Elm * @param obj The entry object * @return autocapitalization type */ -EAPI Elm_Autocapital_Type elm_entry_autocapital_type_get(Evas_Object *obj); +EAPI Elm_Autocapital_Type elm_entry_autocapital_type_get(const Evas_Object *obj); /** * Sets the attribute to show the input panel automatically. @@ -1197,7 +1197,7 @@ EAPI void elm_entry_input_panel_enabled_set(Evas_Object *obj, * @param obj The entry object * @return EINA_TRUE if input panel will be appeared when the entry is clicked or has a focus, EINA_FALSE otherwise */ -EAPI Eina_Bool elm_entry_input_panel_enabled_get(Evas_Object *obj); +EAPI Eina_Bool elm_entry_input_panel_enabled_get(const Evas_Object *obj); /** * Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on. @@ -1308,6 +1308,22 @@ EAPI Eina_Bool elm_entry_input_panel_return_key_disabled_get(const */ EAPI void elm_entry_imf_context_reset(Evas_Object *obj); +/** + * Set whether the entry should allow to use the text prediction. + * + * @param obj The entry object + * @param prediction Whether the entry should allow to use the text prediction. + */ +EAPI void elm_entry_prediction_allow_set(Evas_Object *obj, Eina_Bool prediction); + +/** + * Get whether the entry should allow to use the text prediction. + * + * @param obj The entry object + * @return EINA_TRUE if it allows to use the text prediction, otherwise EINA_FALSE. + */ +EAPI Eina_Bool elm_entry_prediction_allow_get(const Evas_Object *obj); + /* pre-made filters for entries */ /** -- 2.7.4