1 #include <Elementary.h>
5 * @defgroup Scrolled_Entry Scrolled_Entry
7 * A scrolled entry is a convenience widget which shows
8 * a box that the user can enter text into. Unlike an
9 * @ref Entry widget, scrolled entries scroll with user
10 * input so that the window will not expand if the length
11 * of text inside the entry exceeds the initial size of the
14 * Signals that you can add callbacks for are:
15 * - "changed" - The text within the entry was changed
16 * - "activated" - The entry has received focus and the cursor
17 * - "press" - The entry has been clicked
18 * - "longpressed" - The entry has been clicked for a couple seconds
19 * - "clicked" - The entry has been clicked
20 * - "clicked,double" - The entry has been double clicked
21 * - "focused" - The entry has received focus
22 * - "unfocused" - The entry has lost focus
23 * - "selection,paste" - A paste action has occurred
24 * - "selection,copy" - A copy action has occurred
25 * - "selection,cut" - A cut action has occurred
26 * - "selection,start" - A selection has begun
27 * - "selection,changed" - The selection has changed
28 * - "selection,cleared" - The selection has been cleared
29 * - "cursor,changed" - The cursor has changed
30 * - "anchor,clicked" - The anchor has been clicked
33 typedef struct _Widget_Data Widget_Data;
34 typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item;
35 typedef struct _Elm_Entry_Item_Provider Elm_Entry_Item_Provider;
36 typedef struct _Elm_Entry_Text_Filter Elm_Entry_Text_Filter;
40 Evas_Object *scroller;
44 Elm_Scroller_Policy policy_h, policy_v;
46 Eina_List *item_providers;
47 Eina_List *text_filters;
48 Eina_Bool single_line : 1;
51 struct _Elm_Entry_Context_Menu_Item
58 struct _Elm_Entry_Item_Provider
60 Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item);
64 struct _Elm_Entry_Text_Filter
66 void (*func) (void *data, Evas_Object *entry, char **text);
70 static const char *widtype = NULL;
72 static const char SIG_CHANGED[] = "changed";
73 static const char SIG_ACTIVATED[] = "activated";
74 static const char SIG_PRESS[] = "press";
75 static const char SIG_LONGPRESSED[] = "longpressed";
76 static const char SIG_CLICKED[] = "clicked";
77 static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
78 static const char SIG_FOCUSED[] = "focused";
79 static const char SIG_UNFOCUSED[] = "unfocused";
80 static const char SIG_SELECTION_PASTE[] = "selection,paste";
81 static const char SIG_SELECTION_COPY[] = "selection,copy";
82 static const char SIG_SELECTION_CUT[] = "selection,cut";
83 static const char SIG_SELECTION_START[] = "selection,start";
84 static const char SIG_SELECTION_CHANGED[] = "selection,changed";
85 static const char SIG_SELECTION_CLEARED[] = "selection,cleared";
86 static const char SIG_CURSOR_CHANGED[] = "cursor,changed";
87 static const char SIG_ANCHOR_CLICKED[] = "anchor,clicked";
88 static const Evas_Smart_Cb_Description _signals[] = {
92 {SIG_LONGPRESSED, ""},
94 {SIG_CLICKED_DOUBLE, ""},
97 {SIG_SELECTION_PASTE, ""},
98 {SIG_SELECTION_COPY, ""},
99 {SIG_SELECTION_CUT, ""},
100 {SIG_SELECTION_START, ""},
101 {SIG_SELECTION_CHANGED, ""},
102 {SIG_SELECTION_CLEARED, ""},
103 {SIG_CURSOR_CHANGED, ""},
104 {SIG_ANCHOR_CLICKED, ""},
109 _del_hook(Evas_Object *obj)
111 Elm_Entry_Context_Menu_Item *ci;
112 Elm_Entry_Item_Provider *ip;
113 Elm_Entry_Text_Filter *tf;
115 Widget_Data *wd = elm_widget_data_get(obj);
117 EINA_LIST_FREE(wd->items, ci)
119 EINA_LIST_FREE(wd->item_providers, ip)
121 EINA_LIST_FREE(wd->text_filters, tf)
129 _sizing_eval(Evas_Object *obj)
132 Evas_Coord minw, minh, minw_scr, minh_scr;
133 wd = elm_widget_data_get(obj);
136 evas_object_size_hint_min_get(obj, &minw, &minh);
137 evas_object_size_hint_min_get(wd->scroller, &minw_scr, &minh_scr);
138 if (minw < minw_scr) minw = minw_scr;
139 if (minh < minh_scr) minh = minh_scr;
141 evas_object_size_hint_min_set(obj, minw, minh);
143 evas_object_size_hint_max_set(obj, -1, minh);
145 evas_object_size_hint_max_set(obj, -1, -1);
149 _theme_hook(Evas_Object *obj)
151 Widget_Data *wd = elm_widget_data_get(obj);
153 elm_object_style_set(wd->entry, elm_widget_style_get(obj));
154 elm_object_style_set(wd->scroller, elm_widget_style_get(obj));
155 elm_object_disabled_set(wd->entry, elm_widget_disabled_get(obj));
156 elm_object_disabled_set(wd->scroller, elm_widget_disabled_get(obj));
161 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
163 Widget_Data *wd = elm_widget_data_get(obj);
165 if (elm_widget_focus_get(obj))
166 elm_widget_focus_steal(wd->entry);
170 _disable_hook(Evas_Object *obj)
172 Widget_Data *wd = elm_widget_data_get(obj);
174 elm_object_disabled_set(wd->entry, elm_widget_disabled_get(obj));
178 _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
180 Widget_Data *wd = elm_widget_data_get(obj);
182 elm_object_signal_emit(wd->entry, emission, source);
183 elm_object_signal_emit(wd->scroller, emission, source);
187 _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data)
189 Widget_Data *wd = elm_widget_data_get(obj);
191 elm_object_signal_callback_add(wd->entry, emission, source, func_cb, data);
192 elm_object_signal_callback_add(wd->scroller, emission, source, func_cb,
197 _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data __UNUSED__)
199 Widget_Data *wd = elm_widget_data_get(obj);
200 elm_object_signal_callback_del(wd->entry, emission, source, func_cb);
201 elm_object_signal_callback_del(wd->scroller, emission, source, func_cb);
205 _on_focus_region_hook(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
207 Widget_Data *wd = elm_widget_data_get(obj);
208 elm_widget_focus_region_get(wd->entry, x, y, w, h);
212 _changed_size_hints(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
218 _entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info)
221 evas_object_smart_callback_call(data, SIG_CHANGED, event_info);
225 _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info)
227 evas_object_smart_callback_call(data, SIG_ACTIVATED, event_info);
231 _entry_press(void *data, Evas_Object *obj __UNUSED__, void *event_info)
233 evas_object_smart_callback_call(data, SIG_PRESS, event_info);
237 _entry_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info)
239 evas_object_smart_callback_call(data, SIG_CLICKED, event_info);
243 _entry_clicked_double(void *data, Evas_Object *obj __UNUSED__, void *event_info)
245 evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, event_info);
249 _entry_cursor_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info)
251 evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, event_info);
255 _entry_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info)
257 evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, event_info);
261 _entry_selection_start(void *data, Evas_Object *obj __UNUSED__, void *event_info)
263 evas_object_smart_callback_call(data, SIG_SELECTION_START, event_info);
267 _entry_selection_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info)
269 evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, event_info);
273 _entry_selection_cleared(void *data, Evas_Object *obj __UNUSED__, void *event_info)
275 evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, event_info);
279 _entry_selection_paste(void *data, Evas_Object *obj __UNUSED__, void *event_info)
281 evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, event_info);
285 _entry_selection_copy(void *data, Evas_Object *obj __UNUSED__, void *event_info)
287 evas_object_smart_callback_call(data, SIG_SELECTION_COPY, event_info);
291 _entry_selection_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info)
293 evas_object_smart_callback_call(data, SIG_SELECTION_CUT, event_info);
297 _entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info)
299 evas_object_smart_callback_call(data, SIG_LONGPRESSED, event_info);
303 _entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info)
305 evas_object_smart_callback_call(data, SIG_FOCUSED, event_info);
309 _entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info)
311 evas_object_smart_callback_call(data, SIG_UNFOCUSED, event_info);
315 _context_item_wrap_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info)
317 Elm_Entry_Context_Menu_Item *ci = data;
318 ci->func(ci->data, ci->obj, event_info);
322 _item_provider_wrap_cb(void *data, Evas_Object *obj __UNUSED__, const char *item)
324 Widget_Data *wd = elm_widget_data_get(data);
326 Elm_Entry_Item_Provider *ip;
328 EINA_LIST_FOREACH(wd->item_providers, l, ip)
331 o = ip->func(ip->data, data, item);
338 _text_filter_wrap_cb(void *data, Evas_Object *obj __UNUSED__, char **text)
340 Widget_Data *wd = elm_widget_data_get(data);
342 Elm_Entry_Text_Filter *tf;
344 EINA_LIST_FOREACH(wd->text_filters, l, tf)
346 tf->func(tf->data, data, text);
352 * This adds a scrolled entry to @p parent object.
354 * @param parent The parent object
355 * @return The new object or NULL if it cannot be created
357 * @ingroup Scrolled_Entry
360 elm_scrolled_entry_add(Evas_Object *parent)
366 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
368 ELM_SET_WIDTYPE(widtype, "scrolled_entry");
369 elm_widget_type_set(obj, "scrolled_entry");
370 elm_widget_sub_object_add(parent, obj);
371 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
372 elm_widget_data_set(obj, wd);
373 elm_widget_del_hook_set(obj, _del_hook);
374 elm_widget_disable_hook_set(obj, _disable_hook);
375 elm_widget_can_focus_set(obj, EINA_TRUE);
376 elm_widget_theme_hook_set(obj, _theme_hook);
377 elm_widget_on_focus_region_hook_set(obj, _on_focus_region_hook);
378 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
379 elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
380 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
382 wd->scroller = elm_scroller_add(obj);
383 elm_scroller_custom_widget_base_theme_set(wd->scroller, "scroller", "entry");
384 elm_widget_resize_object_set(obj, wd->scroller);
385 evas_object_size_hint_weight_set(wd->scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
386 evas_object_size_hint_align_set(wd->scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
387 elm_scroller_bounce_set(wd->scroller, EINA_FALSE, EINA_FALSE);
388 elm_scroller_propagate_events_set(wd->scroller, EINA_TRUE);
389 evas_object_show(wd->scroller);
391 wd->entry = elm_entry_add(obj);
392 evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
393 evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
394 elm_scroller_content_set(wd->scroller, wd->entry);
395 evas_object_show(wd->entry);
397 elm_entry_text_filter_prepend(wd->entry, _text_filter_wrap_cb, obj);
398 elm_entry_item_provider_prepend(wd->entry, _item_provider_wrap_cb, obj);
400 evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj);
401 evas_object_smart_callback_add(wd->entry, "activated", _entry_activated, obj);
402 evas_object_smart_callback_add(wd->entry, "press", _entry_press, obj);
403 evas_object_smart_callback_add(wd->entry, "clicked", _entry_clicked, obj);
404 evas_object_smart_callback_add(wd->entry, "clicked,double", _entry_clicked_double, obj);
405 evas_object_smart_callback_add(wd->entry, "cursor,changed", _entry_cursor_changed, obj);
406 evas_object_smart_callback_add(wd->entry, "anchor,clicked", _entry_anchor_clicked, obj);
407 evas_object_smart_callback_add(wd->entry, "selection,start", _entry_selection_start, obj);
408 evas_object_smart_callback_add(wd->entry, "selection,changed", _entry_selection_changed, obj);
409 evas_object_smart_callback_add(wd->entry, "selection,cleared", _entry_selection_cleared, obj);
410 evas_object_smart_callback_add(wd->entry, "selection,paste", _entry_selection_paste, obj);
411 evas_object_smart_callback_add(wd->entry, "selection,copy", _entry_selection_copy, obj);
412 evas_object_smart_callback_add(wd->entry, "selection,cut", _entry_selection_cut, obj);
413 evas_object_smart_callback_add(wd->entry, "longpressed", _entry_longpressed, obj);
414 evas_object_smart_callback_add(wd->entry, "focused", _entry_focused, obj);
415 evas_object_smart_callback_add(wd->entry, "unfocused", _entry_unfocused, obj);
417 evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
418 _changed_size_hints, NULL);
422 // TODO: convert Elementary to subclassing of Evas_Smart_Class
423 // TODO: and save some bytes, making descriptions per-class and not instance!
424 evas_object_smart_callbacks_descriptions_set(obj, _signals);
429 * This sets a widget to be displayed to the left of a scrolled entry.
431 * @param obj The scrolled entry object
432 * @param icon The widget to display on the left side of the scrolled
435 * @note A previously set widget will be destroyed.
436 * @note If the object being set does not have minimum size hints set,
437 * it won't get properly displayed.
439 * @ingroup Scrolled_Entry
440 * @see elm_scrolled_entry_end_set
443 elm_scrolled_entry_icon_set(Evas_Object *obj, Evas_Object *icon)
445 ELM_CHECK_WIDTYPE(obj, widtype);
446 Widget_Data *wd = elm_widget_data_get(obj);
449 EINA_SAFETY_ON_NULL_RETURN(icon);
450 if (wd->icon == icon) return;
451 if (wd->icon) evas_object_del(wd->icon);
453 edje = _elm_scroller_edje_object_get(wd->scroller);
455 edje_object_part_swallow(edje, "elm.swallow.icon", wd->icon);
456 edje_object_signal_emit(edje, "elm,action,show,icon", "elm");
461 * Gets the leftmost widget of the scrolled entry. This object is
462 * owned by the scrolled entry and should not be modified.
464 * @param obj The scrolled entry object
465 * @return the left widget inside the scroller
467 * @ingroup Scrolled_Entry
470 elm_scrolled_entry_icon_get(const Evas_Object *obj)
472 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
473 Widget_Data *wd = elm_widget_data_get(obj);
474 if (!wd) return NULL;
479 * Unset the leftmost widget of the scrolled entry, unparenting and
482 * @param obj The scrolled entry object
483 * @return the previously set icon sub-object of this entry, on
486 * @see elm_scrolled_entry_icon_set()
488 * @ingroup Scrolled_Entry
491 elm_scrolled_entry_icon_unset(Evas_Object *obj)
493 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
494 Widget_Data *wd = elm_widget_data_get(obj);
495 Evas_Object *ret = NULL;
496 if (!wd) return NULL;
499 Evas_Object *edje = _elm_scroller_edje_object_get(wd->scroller);
500 if (!edje) return NULL;
502 edje_object_part_unswallow(edje, wd->icon);
503 edje_object_signal_emit(edje, "elm,action,hide,icon", "elm");
511 * Sets the visibility of the left-side widget of the scrolled entry,
512 * set by @elm_scrolled_entry_icon_set().
514 * @param obj The scrolled entry object
515 * @param setting EINA_TRUE if the object should be displayed,
518 * @ingroup Scrolled_Entry
521 elm_scrolled_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting)
523 ELM_CHECK_WIDTYPE(obj, widtype);
524 Widget_Data *wd = elm_widget_data_get(obj);
525 if ((!wd) || (!wd->icon)) return;
527 evas_object_hide(wd->icon);
529 evas_object_show(wd->icon);
534 * This sets a widget to be displayed to the end of a scrolled entry.
536 * @param obj The scrolled entry object
537 * @param end The widget to display on the right side of the scrolled
540 * @note A previously set widget will be destroyed.
541 * @note If the object being set does not have minimum size hints set,
542 * it won't get properly displayed.
544 * @ingroup Scrolled_Entry
545 * @see elm_scrolled_entry_icon_set
548 elm_scrolled_entry_end_set(Evas_Object *obj, Evas_Object *end)
550 ELM_CHECK_WIDTYPE(obj, widtype);
551 Widget_Data *wd = elm_widget_data_get(obj);
554 EINA_SAFETY_ON_NULL_RETURN(end);
555 if (wd->end == end) return;
556 if (wd->end) evas_object_del(wd->end);
558 edje = _elm_scroller_edje_object_get(wd->scroller);
560 edje_object_part_swallow(edje, "elm.swallow.end", wd->end);
561 edje_object_signal_emit(edje, "elm,action,show,end", "elm");
566 * Gets the endmost widget of the scrolled entry. This object is owned
567 * by the scrolled entry and should not be modified.
569 * @param obj The scrolled entry object
570 * @return the right widget inside the scroller
572 * @ingroup Scrolled_Entry
575 elm_scrolled_entry_end_get(const Evas_Object *obj)
577 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
578 Widget_Data *wd = elm_widget_data_get(obj);
579 if (!wd) return NULL;
584 * Unset the endmost widget of the scrolled entry, unparenting and
587 * @param obj The scrolled entry object
588 * @return the previously set icon sub-object of this entry, on
591 * @see elm_scrolled_entry_icon_set()
593 * @ingroup Scrolled_Entry
596 elm_scrolled_entry_end_unset(Evas_Object *obj)
598 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
599 Widget_Data *wd = elm_widget_data_get(obj);
600 Evas_Object *ret = NULL;
601 if (!wd) return NULL;
604 Evas_Object *edje = _elm_scroller_edje_object_get(wd->scroller);
605 if (!edje) return NULL;
607 edje_object_part_unswallow(edje, wd->end);
608 edje_object_signal_emit(edje, "elm,action,hide,end", "elm");
616 * Sets the visibility of the end widget of the scrolled entry, set by
617 * @elm_scrolled_entry_end_set().
619 * @param obj The scrolled entry object
620 * @param setting EINA_TRUE if the object should be displayed,
623 * @ingroup Scrolled_Entry
626 elm_scrolled_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting)
628 ELM_CHECK_WIDTYPE(obj, widtype);
629 Widget_Data *wd = elm_widget_data_get(obj);
630 if ((!wd) || (!wd->end)) return;
632 evas_object_hide(wd->end);
634 evas_object_show(wd->end);
639 * This sets the scrolled entry object not to line wrap. All input will
640 * be on a single line, and the entry box will scroll with user input.
642 * @param obj The scrolled entry object
643 * @param single_line If true, the text in the scrolled entry
644 * will be on a single line.
646 * @ingroup Scrolled_Entry
649 elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
651 ELM_CHECK_WIDTYPE(obj, widtype);
652 Widget_Data *wd = elm_widget_data_get(obj);
654 if (wd->single_line == single_line) return;
655 elm_entry_single_line_set(wd->entry, single_line);
656 wd->single_line = single_line;
659 elm_scroller_policy_set(wd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
660 elm_scroller_content_min_limit(wd->scroller, 0, 1);
664 elm_scroller_policy_set(wd->scroller, wd->policy_h, wd->policy_v);
665 elm_scroller_content_min_limit(wd->scroller, 0, 0);
671 * This returns true if the scrolled entry has been set to single line mode.
672 * See also elm_scrolled_entry_single_line_set().
674 * @param obj The scrolled entry object
675 * @return single_line If true, the text in the scrolled entry is set to display
678 * @ingroup Scrolled_Entry
681 elm_scrolled_entry_single_line_get(const Evas_Object *obj)
683 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
684 Widget_Data *wd = elm_widget_data_get(obj);
685 if (!wd) return EINA_FALSE;
686 return elm_entry_single_line_get(wd->entry);
691 * This sets the scrolled entry object to password mode. All text entered
692 * and/or displayed within the widget will be replaced with asterisks (*).
694 * @param obj The scrolled entry object
695 * @param password If true, password mode is enabled.
697 * @ingroup Scrolled_Entry
700 elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password)
702 ELM_CHECK_WIDTYPE(obj, widtype);
703 Widget_Data *wd = elm_widget_data_get(obj);
705 elm_entry_password_set(wd->entry, password);
709 * This returns whether password mode is enabled.
710 * See also elm_scrolled_entry_password_set().
712 * @param obj The scrolled entry object
713 * @return If true, the scrolled entry is set to display all characters
716 * @ingroup Scrolled_Entry
719 elm_scrolled_entry_password_get(const Evas_Object *obj)
721 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
722 Widget_Data *wd = elm_widget_data_get(obj);
723 if (!wd) return EINA_FALSE;
724 return elm_entry_password_get(wd->entry);
729 * This sets the text displayed within the scrolled entry to @p entry.
731 * @param obj The scrolled entry object
732 * @param entry The text to be displayed
734 * @ingroup Scrolled_Entry
737 elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry)
739 ELM_CHECK_WIDTYPE(obj, widtype);
740 Widget_Data *wd = elm_widget_data_get(obj);
742 elm_entry_entry_set(wd->entry, entry);
746 * This returns the text currently shown in object @p entry.
747 * See also elm_scrolled_entry_entry_set().
749 * @param obj The scrolled entry object
750 * @return The currently displayed text or NULL on failure
752 * @ingroup Scrolled_Entry
755 elm_scrolled_entry_entry_get(const Evas_Object *obj)
757 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
758 Widget_Data *wd = elm_widget_data_get(obj);
759 if (!wd) return NULL;
760 return elm_entry_entry_get(wd->entry);
764 * This returns EINA_TRUE if the entry is empty/there was an error
765 * and EINA_FALSE if it is not empty.
767 * @param obj The entry object
768 * @return If the entry is empty or not.
773 elm_scrolled_entry_is_empty(const Evas_Object *obj)
775 ELM_CHECK_WIDTYPE(obj, widtype) EINA_TRUE;
776 Widget_Data *wd = elm_widget_data_get(obj);
777 if (!wd) return EINA_TRUE;
778 return elm_entry_is_empty(wd->entry);
782 * This returns all selected text within the scrolled entry.
784 * @param obj The scrolled entry object
785 * @return The selected text within the scrolled entry or NULL on failure
787 * @ingroup Scrolled_Entry
790 elm_scrolled_entry_selection_get(const Evas_Object *obj)
792 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
793 Widget_Data *wd = elm_widget_data_get(obj);
794 if (!wd) return NULL;
795 return elm_entry_selection_get(wd->entry);
799 * This inserts text in @p entry at the beginning of the scrolled entry
802 * @param obj The scrolled entry object
803 * @param entry The text to insert
805 * @ingroup Scrolled_Entry
808 elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry)
810 ELM_CHECK_WIDTYPE(obj, widtype);
811 Widget_Data *wd = elm_widget_data_get(obj);
813 elm_entry_entry_insert(wd->entry, entry);
817 * This enables word line wrapping in the scrolled entry object. It is the opposite
818 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
819 * character line wrapping.
820 * See also elm_scrolled_entry_line_char_wrap_set().
822 * @param obj The scrolled entry object
823 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
824 * of the object. Wrapping will occur at the end of the word before the end of the
827 * @ingroup Scrolled_Entry
830 elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap)
832 ELM_CHECK_WIDTYPE(obj, widtype);
833 Widget_Data *wd = elm_widget_data_get(obj);
835 elm_entry_line_wrap_set(wd->entry, wrap);
839 * This enables character line wrapping in the scrolled entry object. It is the opposite
840 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
841 * word line wrapping.
842 * See also elm_scrolled_entry_line_wrap_set().
844 * @param obj The scrolled entry object
845 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
846 * of the object. Wrapping will occur immediately upon reaching the end of the object.
848 * @ingroup Scrolled_Entry
851 elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap)
853 ELM_CHECK_WIDTYPE(obj, widtype);
854 Widget_Data *wd = elm_widget_data_get(obj);
856 elm_entry_line_char_wrap_set(wd->entry, wrap);
860 * This sets the editable attribute of the scrolled entry.
862 * @param obj The scrolled entry object
863 * @param editable If true, the scrolled entry will be editable by the user.
864 * If false, it will be set to the disabled state.
866 * @ingroup Scrolled_Entry
869 elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable)
871 ELM_CHECK_WIDTYPE(obj, widtype);
872 Widget_Data *wd = elm_widget_data_get(obj);
874 elm_entry_editable_set(wd->entry, editable);
878 * This gets the editable attribute of the scrolled entry.
879 * See also elm_scrolled_entry_editable_set().
881 * @param obj The scrolled entry object
882 * @return If true, the scrolled entry is editable by the user.
883 * If false, it is not editable by the user
885 * @ingroup Scrolled_Entry
888 elm_scrolled_entry_editable_get(const Evas_Object *obj)
890 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
891 Widget_Data *wd = elm_widget_data_get(obj);
892 if (!wd) return EINA_FALSE;
893 return elm_entry_editable_get(wd->entry);
898 * This drops any existing text selection within the scrolled entry.
900 * @param obj The scrolled entry object
902 * @ingroup Scrolled_Entry
905 elm_scrolled_entry_select_none(Evas_Object *obj)
907 ELM_CHECK_WIDTYPE(obj, widtype);
908 Widget_Data *wd = elm_widget_data_get(obj);
910 elm_entry_select_none(wd->entry);
914 * This selects all text within the scrolled entry.
916 * @param obj The scrolled entry object
918 * @ingroup Scrolled_Entry
921 elm_scrolled_entry_select_all(Evas_Object *obj)
923 ELM_CHECK_WIDTYPE(obj, widtype);
924 Widget_Data *wd = elm_widget_data_get(obj);
926 elm_entry_select_all(wd->entry);
930 * This moves the cursor one place to the right within the entry.
932 * @param obj The scrolled entry object
933 * @return EINA_TRUE upon success, EINA_FALSE upon failure
935 * @ingroup Scrolled_Entry
938 elm_scrolled_entry_cursor_next(Evas_Object *obj)
940 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
941 Widget_Data *wd = elm_widget_data_get(obj);
942 if (!wd) return EINA_FALSE;
943 return elm_entry_cursor_next(wd->entry);
947 * This moves the cursor one place to the left within the entry.
949 * @param obj The scrolled entry object
950 * @return EINA_TRUE upon success, EINA_FALSE upon failure
952 * @ingroup Scrolled_Entry
955 elm_scrolled_entry_cursor_prev(Evas_Object *obj)
957 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
958 Widget_Data *wd = elm_widget_data_get(obj);
959 if (!wd) return EINA_FALSE;
960 return elm_entry_cursor_prev(wd->entry);
964 * This moves the cursor one line up within the entry.
966 * @param obj The scrolled entry object
967 * @return EINA_TRUE upon success, EINA_FALSE upon failure
969 * @ingroup Scrolled_Entry
972 elm_scrolled_entry_cursor_up(Evas_Object *obj)
974 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
975 Widget_Data *wd = elm_widget_data_get(obj);
976 if (!wd) return EINA_FALSE;
977 return elm_entry_cursor_up(wd->entry);
981 * This moves the cursor one line down within the entry.
983 * @param obj The scrolled entry object
984 * @return EINA_TRUE upon success, EINA_FALSE upon failure
986 * @ingroup Scrolled_Entry
989 elm_scrolled_entry_cursor_down(Evas_Object *obj)
991 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
992 Widget_Data *wd = elm_widget_data_get(obj);
993 if (!wd) return EINA_FALSE;
994 return elm_entry_cursor_down(wd->entry);
998 * This moves the cursor to the beginning of the entry.
1000 * @param obj The scrolled entry object
1002 * @ingroup Scrolled_Entry
1005 elm_scrolled_entry_cursor_begin_set(Evas_Object *obj)
1007 ELM_CHECK_WIDTYPE(obj, widtype);
1008 Widget_Data *wd = elm_widget_data_get(obj);
1010 elm_entry_cursor_begin_set(wd->entry);
1014 * This moves the cursor to the end of the entry.
1016 * @param obj The scrolled entry object
1018 * @ingroup Scrolled_Entry
1021 elm_scrolled_entry_cursor_end_set(Evas_Object *obj)
1023 ELM_CHECK_WIDTYPE(obj, widtype);
1024 Widget_Data *wd = elm_widget_data_get(obj);
1027 elm_entry_cursor_end_set(wd->entry);
1028 elm_widget_show_region_get(wd->entry, &x, &y, &w, &h);
1029 elm_scroller_region_show(wd->scroller, x, y, w, h);
1033 * This moves the cursor to the beginning of the current line.
1035 * @param obj The scrolled entry object
1037 * @ingroup Scrolled_Entry
1040 elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj)
1042 ELM_CHECK_WIDTYPE(obj, widtype);
1043 Widget_Data *wd = elm_widget_data_get(obj);
1045 elm_entry_cursor_line_begin_set(wd->entry);
1049 * This moves the cursor to the end of the current line.
1051 * @param obj The scrolled entry object
1053 * @ingroup Scrolled_Entry
1056 elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj)
1058 ELM_CHECK_WIDTYPE(obj, widtype);
1059 Widget_Data *wd = elm_widget_data_get(obj);
1061 elm_entry_cursor_line_end_set(wd->entry);
1065 * This begins a selection within the scrolled entry as though
1066 * the user were holding down the mouse button to make a selection.
1068 * @param obj The scrolled entry object
1070 * @ingroup Scrolled_Entry
1073 elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj)
1075 ELM_CHECK_WIDTYPE(obj, widtype);
1076 Widget_Data *wd = elm_widget_data_get(obj);
1078 elm_entry_cursor_selection_begin(wd->entry);
1082 * This ends a selection within the scrolled entry as though
1083 * the user had just released the mouse button while making a selection.
1085 * @param obj The scrolled entry object
1087 * @ingroup Scrolled_Entry
1090 elm_scrolled_entry_cursor_selection_end(Evas_Object *obj)
1092 ELM_CHECK_WIDTYPE(obj, widtype);
1093 Widget_Data *wd = elm_widget_data_get(obj);
1095 elm_entry_cursor_selection_end(wd->entry);
1099 * TODO: fill this in
1101 * @param obj The scrolled entry object
1102 * @return TODO: fill this in
1104 * @ingroup Scrolled_Entry
1107 elm_scrolled_entry_cursor_is_format_get(const Evas_Object *obj)
1109 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1110 Widget_Data *wd = elm_widget_data_get(obj);
1111 if (!wd) return EINA_FALSE;
1112 return elm_entry_cursor_is_format_get(wd->entry);
1116 * This returns whether the cursor is visible.
1118 * @param obj The scrolled entry object
1119 * @return If true, the cursor is visible.
1121 * @ingroup Scrolled_Entry
1124 elm_scrolled_entry_cursor_is_visible_format_get(const Evas_Object *obj)
1126 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1127 Widget_Data *wd = elm_widget_data_get(obj);
1128 if (!wd) return EINA_FALSE;
1129 return elm_entry_cursor_is_visible_format_get(wd->entry);
1133 * TODO: fill this in
1135 * @param obj The scrolled entry object
1136 * @return TODO: fill this in
1138 * @ingroup Scrolled_Entry
1141 elm_scrolled_entry_cursor_content_get(const Evas_Object *obj)
1143 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1144 Widget_Data *wd = elm_widget_data_get(obj);
1145 if (!wd) return NULL;
1146 return elm_entry_cursor_content_get(wd->entry);
1150 * Sets the cursor position in the scrolled entry to the given value
1152 * @param obj The scrolled entry object
1153 * @param pos the position of the cursor
1155 * @ingroup Scrolled_Entry
1158 elm_scrolled_entry_cursor_pos_set(Evas_Object *obj, int pos)
1160 ELM_CHECK_WIDTYPE(obj, widtype);
1161 Widget_Data *wd = elm_widget_data_get(obj);
1163 elm_entry_cursor_pos_set(wd->entry, pos);
1167 * Retrieves the current position of the cursor in the scrolled entry
1169 * @param obj The entry object
1170 * @return the cursor position
1172 * @ingroup Scrolled_Entry
1175 elm_scrolled_entry_cursor_pos_get(const Evas_Object *obj)
1177 ELM_CHECK_WIDTYPE(obj, widtype) 0;
1178 Widget_Data *wd = elm_widget_data_get(obj);
1180 return elm_entry_cursor_pos_get(wd->entry);
1184 * This executes a "cut" action on the selected text in the scrolled entry.
1186 * @param obj The scrolled entry object
1188 * @ingroup Scrolled_Entry
1191 elm_scrolled_entry_selection_cut(Evas_Object *obj)
1193 ELM_CHECK_WIDTYPE(obj, widtype);
1194 Widget_Data *wd = elm_widget_data_get(obj);
1196 elm_entry_selection_cut(wd->entry);
1200 * This executes a "copy" action on the selected text in the scrolled entry.
1202 * @param obj The scrolled entry object
1204 * @ingroup Scrolled_Entry
1207 elm_scrolled_entry_selection_copy(Evas_Object *obj)
1209 ELM_CHECK_WIDTYPE(obj, widtype);
1210 Widget_Data *wd = elm_widget_data_get(obj);
1212 elm_entry_selection_copy(wd->entry);
1216 * This executes a "paste" action in the scrolled entry.
1218 * @param obj The scrolled entry object
1220 * @ingroup Scrolled_Entry
1223 elm_scrolled_entry_selection_paste(Evas_Object *obj)
1225 ELM_CHECK_WIDTYPE(obj, widtype);
1226 Widget_Data *wd = elm_widget_data_get(obj);
1228 elm_entry_selection_paste(wd->entry);
1232 * This clears and frees the items in a scrolled entry's contextual (right click) menu.
1234 * @param obj The scrolled entry object
1236 * @ingroup Scrolled_Entry
1239 elm_scrolled_entry_context_menu_clear(Evas_Object *obj)
1241 ELM_CHECK_WIDTYPE(obj, widtype);
1242 Widget_Data *wd = elm_widget_data_get(obj);
1244 elm_entry_context_menu_clear(wd->entry);
1248 * This adds an item to the scrolled entry's contextual menu.
1250 * @param obj The scrolled entry object
1251 * @param label The item's text label
1252 * @param icon_file The item's icon file
1253 * @param icon_type The item's icon type
1254 * @param func The callback to execute when the item is clicked
1255 * @param data The data to associate with the item for related functions
1257 * @ingroup Scrolled_Entry
1260 elm_scrolled_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data)
1262 Elm_Entry_Context_Menu_Item *ci;
1263 ELM_CHECK_WIDTYPE(obj, widtype);
1264 Widget_Data *wd = elm_widget_data_get(obj);
1267 ci = malloc(sizeof(Elm_Entry_Context_Menu_Item));
1270 ci->data = (void *)data;
1272 wd->items = eina_list_append(wd->items, ci);
1273 elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, _context_item_wrap_cb, ci);
1277 * This disables the scrolled entry's contextual (right click) menu.
1279 * @param obj The scrolled entry object
1280 * @param disabled If true, the menu is disabled
1282 * @ingroup Scrolled_Entry
1285 elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
1287 ELM_CHECK_WIDTYPE(obj, widtype);
1288 Widget_Data *wd = elm_widget_data_get(obj);
1290 elm_entry_context_menu_disabled_set(wd->entry, disabled);
1294 * This returns whether the scrolled entry's contextual (right click) menu is disabled.
1296 * @param obj The scrolled entry object
1297 * @return If true, the menu is disabled
1299 * @ingroup Scrolled_Entry
1302 elm_scrolled_entry_context_menu_disabled_get(const Evas_Object *obj)
1304 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1305 Widget_Data *wd = elm_widget_data_get(obj);
1306 if (!wd) return EINA_FALSE;
1307 return elm_entry_context_menu_disabled_get(wd->entry);
1311 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling them).
1313 * @param obj The scrolled entry object
1314 * @param h The horizontal scrollbar policy to apply
1315 * @param v The vertical scrollbar policy to apply
1317 * @ingroup Scrolled_Entry
1320 elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v)
1322 ELM_CHECK_WIDTYPE(obj, widtype);
1323 Widget_Data *wd = elm_widget_data_get(obj);
1327 elm_scroller_policy_set(wd->scroller, h, v);
1331 * This enables/disables bouncing within the entry.
1333 * @param obj The scrolled entry object
1334 * @param h The horizontal bounce state
1335 * @param v The vertical bounce state
1337 * @ingroup Scrolled_Entry
1340 elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
1342 ELM_CHECK_WIDTYPE(obj, widtype);
1343 Widget_Data *wd = elm_widget_data_get(obj);
1345 elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce);
1349 * Get the bounce mode
1351 * @param obj The Scrolled_Entry object
1352 * @param h_bounce Allow bounce horizontally
1353 * @param v_bounce Allow bounce vertically
1355 * @ingroup Scrolled_Entry
1358 elm_scrolled_entry_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
1360 ELM_CHECK_WIDTYPE(obj, widtype);
1361 Widget_Data *wd = elm_widget_data_get(obj);
1363 elm_scroller_bounce_get(wd->scroller, h_bounce, v_bounce);
1367 * This appends a custom item provider to the list for that entry
1369 * This appends the given callback. The list is walked from beginning to end
1370 * with each function called given the item href string in the text. If the
1371 * function returns an object handle other than NULL (it should create an
1372 * and object to do this), then this object is used to replace that item. If
1373 * not the next provider is called until one provides an item object, or the
1374 * default provider in entry does.
1376 * @param obj The entry object
1377 * @param func The function called to provide the item object
1378 * @param data The data passed to @p func
1380 * @ingroup Scrolled_Entry
1383 elm_scrolled_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
1385 ELM_CHECK_WIDTYPE(obj, widtype);
1386 Widget_Data *wd = elm_widget_data_get(obj);
1388 EINA_SAFETY_ON_NULL_RETURN(func);
1389 Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
1393 wd->item_providers = eina_list_append(wd->item_providers, ip);
1397 * This prepends a custom item provider to the list for that entry
1399 * This prepends the given callback. See elm_scrolled_entry_item_provider_append() for
1402 * @param obj The entry object
1403 * @param func The function called to provide the item object
1404 * @param data The data passed to @p func
1406 * @ingroup Scrolled_Entry
1409 elm_scrolled_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
1411 ELM_CHECK_WIDTYPE(obj, widtype);
1412 Widget_Data *wd = elm_widget_data_get(obj);
1414 EINA_SAFETY_ON_NULL_RETURN(func);
1415 Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
1419 wd->item_providers = eina_list_prepend(wd->item_providers, ip);
1423 * This removes a custom item provider to the list for that entry
1425 * This removes the given callback. See elm_scrolled_entry_item_provider_append() for
1428 * @param obj The entry object
1429 * @param func The function called to provide the item object
1430 * @param data The data passed to @p func
1432 * @ingroup Scrolled_Entry
1435 elm_scrolled_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
1437 ELM_CHECK_WIDTYPE(obj, widtype);
1438 Widget_Data *wd = elm_widget_data_get(obj);
1440 Elm_Entry_Item_Provider *ip;
1442 EINA_SAFETY_ON_NULL_RETURN(func);
1443 EINA_LIST_FOREACH(wd->item_providers, l, ip)
1445 if ((ip->func == func) && (ip->data == data))
1447 wd->item_providers = eina_list_remove_list(wd->item_providers, l);
1455 * Append a filter function for text inserted in the entry
1457 * Append the given callback to the list. This functions will be called
1458 * whenever any text is inserted into the entry, with the text to be inserted
1459 * as a parameter. The callback function is free to alter the text in any way
1460 * it wants, but it must remember to free the given pointer and update it.
1461 * If the new text is to be discarded, the function can free it and set it text
1462 * parameter to NULL. This will also prevent any following filters from being
1465 * @param obj The entry object
1466 * @param func The function to use as text filter
1467 * @param data User data to pass to @p func
1469 * @ingroup Scrolled_Entry
1472 elm_scrolled_entry_text_filter_append(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data)
1475 Elm_Entry_Text_Filter *tf;
1476 ELM_CHECK_WIDTYPE(obj, widtype);
1478 wd = elm_widget_data_get(obj);
1480 EINA_SAFETY_ON_NULL_RETURN(func);
1482 tf = ELM_NEW(Elm_Entry_Text_Filter);
1486 wd->text_filters = eina_list_append(wd->text_filters, tf);
1490 * Prepend a filter function for text insdrted in the entry
1492 * Prepend the given callback to the list. See elm_scrolled_entry_text_filter_append()
1493 * for more information
1495 * @param obj The entry object
1496 * @param func The function to use as text filter
1497 * @param data User data to pass to @p func
1499 * @ingroup Scrolled_Entry
1502 elm_scrolled_entry_text_filter_prepend(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data)
1505 Elm_Entry_Text_Filter *tf;
1506 ELM_CHECK_WIDTYPE(obj, widtype);
1508 wd = elm_widget_data_get(obj);
1510 EINA_SAFETY_ON_NULL_RETURN(func);
1512 tf = ELM_NEW(Elm_Entry_Text_Filter);
1516 wd->text_filters = eina_list_prepend(wd->text_filters, tf);
1520 * Remove a filter from the list
1522 * Removes the given callback from the filter list. See elm_scrolled_entry_text_filter_append()
1523 * for more information.
1525 * @param obj The entry object
1526 * @param func The filter function to remove
1527 * @param data The user data passed when adding the function
1529 * @ingroup Scrolled_Entry
1532 elm_scrolled_entry_text_filter_remove(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data)
1536 Elm_Entry_Text_Filter *tf;
1537 ELM_CHECK_WIDTYPE(obj, widtype);
1539 wd = elm_widget_data_get(obj);
1541 EINA_SAFETY_ON_NULL_RETURN(func);
1543 EINA_LIST_FOREACH(wd->text_filters, l, tf)
1545 if ((tf->func == func) && (tf->data == data))
1547 wd->text_filters = eina_list_remove_list(wd->text_filters, l);
1555 * This sets the file (and implicitly loads it) for the text to display and
1556 * then edit. All changes are written back to the file after a short delay if
1557 * the entry object is set to autosave.
1559 * @param obj The scrolled entry object
1560 * @param file The path to the file to load and save
1561 * @param format The file format
1563 * @ingroup Scrolled_Entry
1566 elm_scrolled_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format)
1568 ELM_CHECK_WIDTYPE(obj, widtype);
1569 Widget_Data *wd = elm_widget_data_get(obj);
1571 elm_entry_file_set(wd->entry, file, format);
1575 * Gets the file to load and save and the file format
1577 * @param obj The scrolled entry object
1578 * @param file The path to the file to load and save
1579 * @param format The file format
1581 * @ingroup Scrolled_Entry
1584 elm_scrolled_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format)
1586 ELM_CHECK_WIDTYPE(obj, widtype);
1587 Widget_Data *wd = elm_widget_data_get(obj);
1589 elm_entry_file_get(wd->entry, file, format);
1593 * This function writes any changes made to the file set with
1594 * elm_scrolled_entry_file_set()
1596 * @param obj The scrolled entry object
1598 * @ingroup Scrolled_Entry
1601 elm_scrolled_entry_file_save(Evas_Object *obj)
1603 ELM_CHECK_WIDTYPE(obj, widtype);
1604 Widget_Data *wd = elm_widget_data_get(obj);
1606 elm_entry_file_save(wd->entry);
1610 * This sets the entry object to 'autosave' the loaded text file or not.
1612 * @param obj The scrolled entry object
1613 * @param autosave Autosave the loaded file or not
1615 * @ingroup Scrolled_Entry
1618 elm_scrolled_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave)
1620 ELM_CHECK_WIDTYPE(obj, widtype);
1621 Widget_Data *wd = elm_widget_data_get(obj);
1623 elm_entry_autosave_set(wd->entry, autosave);
1627 * This gets the entry object's 'autosave' status.
1629 * @param obj The scrolled entry object
1630 * @return Autosave the loaded file or not
1632 * @ingroup Scrolled_Entry
1635 elm_scrolled_entry_autosave_get(const Evas_Object *obj)
1637 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1638 Widget_Data *wd = elm_widget_data_get(obj);
1639 if (!wd) return EINA_FALSE;
1640 return elm_entry_autosave_get(wd->entry);
1644 * Control pasting of text and images for the widget.
1646 * Normally the scrolled entry allows both text and images to be pasted.
1647 * By setting textonly to be true, this prevents images from being pasted.
1649 * Note this only changes the behaviour of text.
1651 * @param obj The scrolled entry object
1652 * @param textonly paste mode - EINA_TRUE is text only, EINA_FALSE is text+image+other.
1654 * @see elm_entry_cnp_textonly_set
1655 * @ingroup Scrolled_Entry
1658 elm_scrolled_entry_cnp_textonly_set(Evas_Object *obj, Eina_Bool textonly)
1660 ELM_CHECK_WIDTYPE(obj, widtype);
1661 Widget_Data *wd = elm_widget_data_get(obj);
1663 elm_entry_cnp_textonly_set(wd->entry, textonly);
1667 * Getting elm_scrolled_entry text paste/drop mode.
1669 * In textonly mode, only text may be pasted or dropped into the widget.
1671 * @param obj The scrolled entry object
1672 * @return If the widget only accepts text from pastes.
1674 * @see elm_entry_cnp_textonly_get
1675 * @ingroup Scrolled_Entry
1678 elm_scrolled_entry_cnp_textonly_get(Evas_Object *obj)
1680 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1681 Widget_Data *wd = elm_widget_data_get(obj);
1682 if (!wd) return EINA_FALSE;
1683 return elm_entry_cnp_textonly_get(wd->entry);