[elm_scrolled_entry] add cnp textmode set/get function
authorHyoyoung Chang <hyoyoung.chang@samsung.com>
Thu, 3 Mar 2011 05:51:01 +0000 (14:51 +0900)
committerHyoyoung Chang <hyoyoung.chang@samsung.com>
Thu, 3 Mar 2011 05:51:01 +0000 (14:51 +0900)
src/lib/Elementary.h.in
src/lib/elc_scrolled_entry.c

index 169ca1c..5914d9b 100644 (file)
@@ -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);
index 4cd076b..40f52d9 100644 (file)
@@ -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