From: Hyoyoung Chang Date: Thu, 3 Mar 2011 05:51:01 +0000 (+0900) Subject: [elm_scrolled_entry] add cnp textmode set/get function X-Git-Tag: REL_I9200_20110603-1~311^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a4dadaa33080b6ed7fb4d9367ec383bd1ba5248;p=framework%2Fuifw%2Felementary.git [elm_scrolled_entry] add cnp textmode set/get function --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 169ca1c..5914d9b 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -2381,6 +2381,8 @@ extern "C" { EAPI void elm_scrolled_entry_file_save(Evas_Object *obj) EINA_ARG_NONNULL(1); EAPI void elm_scrolled_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave) EINA_ARG_NONNULL(1); EAPI Eina_Bool elm_scrolled_entry_autosave_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI void elm_scrolled_entry_cnp_textonly_set(Evas_Object *obj, Eina_Bool textonly) EINA_ARG_NONNULL(1); + EAPI Eina_Bool elm_scrolled_entry_cnp_textonly_get(Evas_Object *obj) EINA_ARG_NONNULL(1); EAPI void elm_scrolled_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled); EAPI void elm_scrolled_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout); EAPI Ecore_IMF_Context *elm_scrolled_entry_imf_context_get(Evas_Object *obj); diff --git a/src/lib/elc_scrolled_entry.c b/src/lib/elc_scrolled_entry.c index 4cd076b..40f52d9 100644 --- a/src/lib/elc_scrolled_entry.c +++ b/src/lib/elc_scrolled_entry.c @@ -1593,6 +1593,49 @@ elm_scrolled_entry_autosave_get(const Evas_Object *obj) } /** + * Control pasting of text and images for the widget. + * + * Normally the scrolled entry allows both text and images to be pasted. + * By setting textonly to be true, this prevents images from being pasted. + * + * Note this only changes the behaviour of text. + * + * @param obj The scrolled entry object + * @param textonly paste mode - EINA_TRUE is text only, EINA_FALSE is text+image+other. + * + * @see elm_entry_cnp_textonly_set + * @ingroup Scrolled_Entry + */ +EAPI void +elm_scrolled_entry_cnp_textonly_set(Evas_Object *obj, Eina_Bool textonly) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + elm_entry_cnp_textonly_set(wd->entry, textonly); +} + +/** + * Getting elm_scrolled_entry text paste/drop mode. + * + * In textonly mode, only text may be pasted or dropped into the widget. + * + * @param obj The scrolled entry object + * @return If the widget only accepts text from pastes. + * + * @see elm_entry_cnp_textonly_get + * @ingroup Scrolled_Entry + */ +EAPI Eina_Bool +elm_scrolled_entry_cnp_textonly_get(Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return elm_entry_cnp_textonly_get(wd->entry); +} + +/** * Get the input method context in the scrolled entry widget * * @param obj The scrolled entry object