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:
16 * "changed" - The text within the entry was changed
17 * "activated" - The entry has received focus and the cursor
18 * "press" - The entry has been clicked
19 * "longpressed" - The entry has been clicked for a couple seconds
20 * "clicked" - The entry has been clicked
21 * "clicked,double" - The entry has been double clicked
22 * "focused" - The entry has received focus
23 * "unfocused" - The entry has lost focus
24 * "selection,paste" - A paste action has occurred
25 * "selection,copy" - A copy action has occurred
26 * "selection,cut" - A cut action has occurred
27 * "selection,start" - A selection has begun
28 * "selection,changed" - The selection has changed
29 * "selection,cleared" - The selection has been cleared
30 * "cursor,changed" - The cursor has changed
31 * "anchor,clicked" - The anchor has been clicked
34 typedef struct _Widget_Data Widget_Data;
35 typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item;
36 typedef struct _Elm_Entry_Item_Provider Elm_Entry_Item_Provider;
37 typedef struct _Elm_Entry_Text_Filter Elm_Entry_Text_Filter;
41 Evas_Object *scroller;
45 Elm_Scroller_Policy policy_h, policy_v;
47 Eina_List *item_providers;
48 Eina_List *text_filters;
49 Eina_Bool single_line : 1;
52 struct _Elm_Entry_Context_Menu_Item
59 struct _Elm_Entry_Item_Provider
61 Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item);
65 struct _Elm_Entry_Text_Filter
67 void (*func) (void *data, Evas_Object *entry, char **text);
71 static const char *widtype = NULL;
73 static const char SIG_CHANGED[] = "changed";
74 static const char SIG_ACTIVATED[] = "activated";
75 static const char SIG_PRESS[] = "press";
76 static const char SIG_LONGPRESSED[] = "longpressed";
77 static const char SIG_CLICKED[] = "clicked";
78 static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
79 static const char SIG_FOCUSED[] = "focused";
80 static const char SIG_UNFOCUSED[] = "unfocused";
81 static const char SIG_SELECTION_PASTE[] = "selection,paste";
82 static const char SIG_SELECTION_COPY[] = "selection,copy";
83 static const char SIG_SELECTION_CUT[] = "selection,cut";
84 static const char SIG_SELECTION_START[] = "selection,start";
85 static const char SIG_SELECTION_CHANGED[] = "selection,changed";
86 static const char SIG_SELECTION_CLEARED[] = "selection,cleared";
87 static const char SIG_CURSOR_CHANGED[] = "cursor,changed";
88 static const char SIG_ANCHOR_CLICKED[] = "anchor,clicked";
89 static const Evas_Smart_Cb_Description _signals[] = {
93 {SIG_LONGPRESSED, ""},
95 {SIG_CLICKED_DOUBLE, ""},
98 {SIG_SELECTION_PASTE, ""},
99 {SIG_SELECTION_COPY, ""},
100 {SIG_SELECTION_CUT, ""},
101 {SIG_SELECTION_START, ""},
102 {SIG_SELECTION_CHANGED, ""},
103 {SIG_SELECTION_CLEARED, ""},
104 {SIG_CURSOR_CHANGED, ""},
105 {SIG_ANCHOR_CLICKED, ""},
110 _del_hook(Evas_Object *obj)
112 Elm_Entry_Context_Menu_Item *ci;
113 Elm_Entry_Item_Provider *ip;
114 Elm_Entry_Text_Filter *tf;
116 Widget_Data *wd = elm_widget_data_get(obj);
118 EINA_LIST_FREE(wd->items, ci)
120 EINA_LIST_FREE(wd->item_providers, ip)
122 EINA_LIST_FREE(wd->text_filters, tf)
130 _sizing_eval(Evas_Object *obj)
133 Evas_Coord minw, minh, minw_scr, minh_scr;
134 wd = elm_widget_data_get(obj);
137 evas_object_size_hint_min_get(obj, &minw, &minh);
138 evas_object_size_hint_min_get(wd->scroller, &minw_scr, &minh_scr);
139 if (minw < minw_scr) minw = minw_scr;
140 if (minh < minh_scr) minh = minh_scr;
142 evas_object_size_hint_min_set(obj, minw, minh);
144 evas_object_size_hint_max_set(obj, -1, minh);
146 evas_object_size_hint_max_set(obj, -1, -1);
150 _theme_hook(Evas_Object *obj)
152 Widget_Data *wd = elm_widget_data_get(obj);
154 elm_object_style_set(wd->entry, elm_widget_style_get(obj));
155 elm_object_style_set(wd->scroller, elm_widget_style_get(obj));
156 elm_object_disabled_set(wd->entry, elm_widget_disabled_get(obj));
157 elm_object_disabled_set(wd->scroller, elm_widget_disabled_get(obj));
162 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
164 Widget_Data *wd = elm_widget_data_get(obj);
166 if (elm_widget_focus_get(obj))
167 elm_widget_focus_steal(wd->entry);
171 _disable_hook(Evas_Object *obj)
173 Widget_Data *wd = elm_widget_data_get(obj);
175 elm_object_disabled_set(wd->entry, elm_widget_disabled_get(obj));
179 _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
181 Widget_Data *wd = elm_widget_data_get(obj);
183 elm_object_signal_emit(wd->entry, emission, source);
184 elm_object_signal_emit(wd->scroller, emission, source);
188 _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
190 Widget_Data *wd = elm_widget_data_get(obj);
192 elm_object_signal_callback_add(wd->entry, emission, source, func_cb, data);
193 elm_object_signal_callback_add(wd->scroller, emission, source, func_cb,
198 _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data __UNUSED__)
200 Widget_Data *wd = elm_widget_data_get(obj);
201 elm_object_signal_callback_del(wd->entry, emission, source, func_cb);
202 elm_object_signal_callback_del(wd->scroller, emission, source, func_cb);
206 _on_focus_region_hook(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
208 Widget_Data *wd = elm_widget_data_get(obj);
209 elm_widget_focus_region_get(wd->entry, x, y, w, h);
213 _changed_size_hints(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
219 _entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info)
222 evas_object_smart_callback_call(data, SIG_CHANGED, event_info);
226 _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info)
228 evas_object_smart_callback_call(data, SIG_ACTIVATED, event_info);
232 _entry_press(void *data, Evas_Object *obj __UNUSED__, void *event_info)
234 evas_object_smart_callback_call(data, SIG_PRESS, event_info);
238 _entry_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info)
240 evas_object_smart_callback_call(data, SIG_CLICKED, event_info);
244 _entry_clicked_double(void *data, Evas_Object *obj __UNUSED__, void *event_info)
246 evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, event_info);
250 _entry_cursor_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info)
252 evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, event_info);
256 _entry_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info)
258 evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, event_info);
262 _entry_selection_start(void *data, Evas_Object *obj __UNUSED__, void *event_info)
264 evas_object_smart_callback_call(data, SIG_SELECTION_START, event_info);
268 _entry_selection_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info)
270 evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, event_info);
274 _entry_selection_cleared(void *data, Evas_Object *obj __UNUSED__, void *event_info)
276 evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, event_info);
280 _entry_selection_paste(void *data, Evas_Object *obj __UNUSED__, void *event_info)
282 evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, event_info);
286 _entry_selection_copy(void *data, Evas_Object *obj __UNUSED__, void *event_info)
288 evas_object_smart_callback_call(data, SIG_SELECTION_COPY, event_info);
292 _entry_selection_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info)
294 evas_object_smart_callback_call(data, SIG_SELECTION_CUT, event_info);
298 _entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info)
300 evas_object_smart_callback_call(data, SIG_LONGPRESSED, event_info);
304 _entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info)
306 evas_object_smart_callback_call(data, SIG_FOCUSED, event_info);
310 _entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info)
312 evas_object_smart_callback_call(data, SIG_UNFOCUSED, event_info);
316 _context_item_wrap_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info)
318 Elm_Entry_Context_Menu_Item *ci = data;
319 ci->func(ci->data, ci->obj, event_info);
323 _item_provider_wrap_cb(void *data, Evas_Object *obj __UNUSED__, const char *item)
325 Widget_Data *wd = elm_widget_data_get(data);
327 Elm_Entry_Item_Provider *ip;
329 EINA_LIST_FOREACH(wd->item_providers, l, ip)
332 o = ip->func(ip->data, data, item);
339 _text_filter_wrap_cb(void *data, Evas_Object *obj __UNUSED__, char **text)
341 Widget_Data *wd = elm_widget_data_get(data);
343 Elm_Entry_Text_Filter *tf;
345 EINA_LIST_FOREACH(wd->text_filters, l, tf)
347 tf->func(tf->data, data, text);
353 * This adds a scrolled entry to @p parent object.
355 * @param parent The parent object
356 * @return The new object or NULL if it cannot be created
358 * @ingroup Scrolled_Entry
361 elm_scrolled_entry_add(Evas_Object *parent)
367 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
369 ELM_SET_WIDTYPE(widtype, "scrolled_entry");
370 elm_widget_type_set(obj, "scrolled_entry");
371 elm_widget_sub_object_add(parent, obj);
372 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
373 elm_widget_data_set(obj, wd);
374 elm_widget_del_hook_set(obj, _del_hook);
375 elm_widget_disable_hook_set(obj, _disable_hook);
376 elm_widget_can_focus_set(obj, EINA_TRUE);
377 elm_widget_theme_hook_set(obj, _theme_hook);
378 elm_widget_on_focus_region_hook_set(obj, _on_focus_region_hook);
379 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
380 elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
381 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
383 wd->scroller = elm_scroller_add(obj);
384 //elm_scroller_custom_widget_base_theme_set(wd->scroller, "scroller", "entry");
385 elm_widget_resize_object_set(obj, wd->scroller);
386 evas_object_size_hint_weight_set(wd->scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
387 evas_object_size_hint_align_set(wd->scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
388 elm_scroller_bounce_set(wd->scroller, EINA_FALSE, EINA_FALSE);
389 elm_scroller_propagate_events_set(wd->scroller, EINA_TRUE);
390 evas_object_show(wd->scroller);
392 wd->entry = elm_entry_add(obj);
393 evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
394 evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
395 elm_scroller_content_set(wd->scroller, wd->entry);
396 evas_object_show(wd->entry);
398 elm_entry_text_filter_prepend(wd->entry, _text_filter_wrap_cb, obj);
399 elm_entry_item_provider_prepend(wd->entry, _item_provider_wrap_cb, obj);
401 evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj);
402 evas_object_smart_callback_add(wd->entry, "activated", _entry_activated, obj);
403 evas_object_smart_callback_add(wd->entry, "press", _entry_press, obj);
404 evas_object_smart_callback_add(wd->entry, "clicked", _entry_clicked, obj);
405 evas_object_smart_callback_add(wd->entry, "clicked,double", _entry_clicked_double, obj);
406 evas_object_smart_callback_add(wd->entry, "cursor,changed", _entry_cursor_changed, obj);
407 evas_object_smart_callback_add(wd->entry, "anchor,clicked", _entry_anchor_clicked, obj);
408 evas_object_smart_callback_add(wd->entry, "selection,start", _entry_selection_start, obj);
409 evas_object_smart_callback_add(wd->entry, "selection,changed", _entry_selection_changed, obj);
410 evas_object_smart_callback_add(wd->entry, "selection,cleared", _entry_selection_cleared, obj);
411 evas_object_smart_callback_add(wd->entry, "selection,paste", _entry_selection_paste, obj);
412 evas_object_smart_callback_add(wd->entry, "selection,copy", _entry_selection_copy, obj);
413 evas_object_smart_callback_add(wd->entry, "selection,cut", _entry_selection_cut, obj);
414 evas_object_smart_callback_add(wd->entry, "longpressed", _entry_longpressed, obj);
415 evas_object_smart_callback_add(wd->entry, "focused", _entry_focused, obj);
416 evas_object_smart_callback_add(wd->entry, "unfocused", _entry_unfocused, obj);
418 evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
419 _changed_size_hints, NULL);
423 // TODO: convert Elementary to subclassing of Evas_Smart_Class
424 // TODO: and save some bytes, making descriptions per-class and not instance!
425 evas_object_smart_callbacks_descriptions_set(obj, _signals);
430 * This sets a widget to be displayed to the left of a scrolled entry.
432 * @param obj The scrolled entry object
433 * @param icon The widget to display on the left side of the scrolled
436 * @note A previously set widget will be destroyed.
437 * @note If the object being set does not have minimum size hints set,
438 * it won't get properly displayed.
440 * @ingroup Scrolled_Entry
441 * @see elm_scrolled_entry_end_set
444 elm_scrolled_entry_icon_set(Evas_Object *obj, Evas_Object *icon)
446 ELM_CHECK_WIDTYPE(obj, widtype);
447 Widget_Data *wd = elm_widget_data_get(obj);
450 EINA_SAFETY_ON_NULL_RETURN(icon);
451 if (wd->icon == icon) return;
452 if (wd->icon) evas_object_del(wd->icon);
454 edje = _elm_scroller_edje_object_get(wd->scroller);
456 edje_object_part_swallow(edje, "elm.swallow.icon", wd->icon);
457 edje_object_signal_emit(edje, "elm,action,show,icon", "elm");
462 * Gets the leftmost widget of the scrolled entry. This object is
463 * owned by the scrolled entry and should not be modified.
465 * @param obj The scrolled entry object
466 * @return the left widget inside the scroller
468 * @ingroup Scrolled_Entry
471 elm_scrolled_entry_icon_get(const Evas_Object *obj)
473 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
474 Widget_Data *wd = elm_widget_data_get(obj);
475 if (!wd) return NULL;
480 * Unset the leftmost widget of the scrolled entry, unparenting and
483 * @param obj The scrolled entry object
484 * @return the previously set icon sub-object of this entry, on
487 * @see elm_scrolled_entry_icon_set()
489 * @ingroup Scrolled_Entry
492 elm_scrolled_entry_icon_unset(Evas_Object *obj)
494 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
495 Widget_Data *wd = elm_widget_data_get(obj);
496 Evas_Object *ret = NULL;
497 if (!wd) return NULL;
500 Evas_Object *edje = _elm_scroller_edje_object_get(wd->scroller);
501 if (!edje) return NULL;
503 edje_object_part_unswallow(edje, wd->icon);
504 edje_object_signal_emit(edje, "elm,action,hide,icon", "elm");
512 * Sets the visibility of the left-side widget of the scrolled entry,
513 * set by @elm_scrolled_entry_icon_set().
515 * @param obj The scrolled entry object
516 * @param setting EINA_TRUE if the object should be displayed,
519 * @ingroup Scrolled_Entry
522 elm_scrolled_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting)
524 ELM_CHECK_WIDTYPE(obj, widtype);
525 Widget_Data *wd = elm_widget_data_get(obj);
526 if ((!wd) || (!wd->icon)) return;
528 evas_object_hide(wd->icon);
530 evas_object_show(wd->icon);
535 * This sets a widget to be displayed to the end of a scrolled entry.
537 * @param obj The scrolled entry object
538 * @param end The widget to display on the right side of the scrolled
541 * @note A previously set widget will be destroyed.
542 * @note If the object being set does not have minimum size hints set,
543 * it won't get properly displayed.
545 * @ingroup Scrolled_Entry
546 * @see elm_scrolled_entry_icon_set
549 elm_scrolled_entry_end_set(Evas_Object *obj, Evas_Object *end)
551 ELM_CHECK_WIDTYPE(obj, widtype);
552 Widget_Data *wd = elm_widget_data_get(obj);
555 EINA_SAFETY_ON_NULL_RETURN(end);
556 if (wd->end == end) return;
557 if (wd->end) evas_object_del(wd->end);
559 edje = _elm_scroller_edje_object_get(wd->scroller);
561 edje_object_part_swallow(edje, "elm.swallow.end", wd->end);
562 edje_object_signal_emit(edje, "elm,action,show,end", "elm");
567 * Gets the endmost widget of the scrolled entry. This object is owned
568 * by the scrolled entry and should not be modified.
570 * @param obj The scrolled entry object
571 * @return the right widget inside the scroller
573 * @ingroup Scrolled_Entry
576 elm_scrolled_entry_end_get(const Evas_Object *obj)
578 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
579 Widget_Data *wd = elm_widget_data_get(obj);
580 if (!wd) return NULL;
585 * Unset the endmost widget of the scrolled entry, unparenting and
588 * @param obj The scrolled entry object
589 * @return the previously set icon sub-object of this entry, on
592 * @see elm_scrolled_entry_icon_set()
594 * @ingroup Scrolled_Entry
597 elm_scrolled_entry_end_unset(Evas_Object *obj)
599 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
600 Widget_Data *wd = elm_widget_data_get(obj);
601 Evas_Object *ret = NULL;
602 if (!wd) return NULL;
605 Evas_Object *edje = _elm_scroller_edje_object_get(wd->scroller);
606 if (!edje) return NULL;
608 edje_object_part_unswallow(edje, wd->end);
609 edje_object_signal_emit(edje, "elm,action,hide,end", "elm");
617 * Sets the visibility of the end widget of the scrolled entry, set by
618 * @elm_scrolled_entry_end_set().
620 * @param obj The scrolled entry object
621 * @param setting EINA_TRUE if the object should be displayed,
624 * @ingroup Scrolled_Entry
627 elm_scrolled_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting)
629 ELM_CHECK_WIDTYPE(obj, widtype);
630 Widget_Data *wd = elm_widget_data_get(obj);
631 if ((!wd) || (!wd->end)) return;
633 evas_object_hide(wd->end);
635 evas_object_show(wd->end);
640 * This sets the scrolled entry object not to line wrap. All input will
641 * be on a single line, and the entry box will scroll with user input.
643 * @param obj The scrolled entry object
644 * @param single_line If true, the text in the scrolled entry
645 * will be on a single line.
647 * @ingroup Scrolled_Entry
650 elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
652 ELM_CHECK_WIDTYPE(obj, widtype);
653 Widget_Data *wd = elm_widget_data_get(obj);
655 if (wd->single_line == single_line) return;
656 elm_entry_single_line_set(wd->entry, single_line);
657 wd->single_line = single_line;
660 elm_scroller_policy_set(wd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
661 elm_scroller_content_min_limit(wd->scroller, 0, 1);
665 elm_scroller_policy_set(wd->scroller, wd->policy_h, wd->policy_v);
666 elm_scroller_content_min_limit(wd->scroller, 0, 0);
672 * This returns true if the scrolled entry has been set to single line mode.
673 * See also elm_scrolled_entry_single_line_set().
675 * @param obj The scrolled entry object
676 * @return single_line If true, the text in the scrolled entry is set to display
679 * @ingroup Scrolled_Entry
682 elm_scrolled_entry_single_line_get(const Evas_Object *obj)
684 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
685 Widget_Data *wd = elm_widget_data_get(obj);
686 if (!wd) return EINA_FALSE;
687 return elm_entry_single_line_get(wd->entry);
692 * This sets the scrolled entry object to password mode. All text entered
693 * and/or displayed within the widget will be replaced with asterisks (*).
695 * @param obj The scrolled entry object
696 * @param password If true, password mode is enabled.
698 * @ingroup Scrolled_Entry
701 elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password)
703 ELM_CHECK_WIDTYPE(obj, widtype);
704 Widget_Data *wd = elm_widget_data_get(obj);
706 elm_entry_password_set(wd->entry, password);
710 * This returns whether password mode is enabled.
711 * See also elm_scrolled_entry_password_set().
713 * @param obj The scrolled entry object
714 * @return If true, the scrolled entry is set to display all characters
717 * @ingroup Scrolled_Entry
720 elm_scrolled_entry_password_get(const Evas_Object *obj)
722 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
723 Widget_Data *wd = elm_widget_data_get(obj);
724 if (!wd) return EINA_FALSE;
725 return elm_entry_password_get(wd->entry);
730 * This sets the text displayed within the scrolled entry to @p entry.
732 * @param obj The scrolled entry object
733 * @param entry The text to be displayed
735 * @ingroup Scrolled_Entry
738 elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry)
740 ELM_CHECK_WIDTYPE(obj, widtype);
741 Widget_Data *wd = elm_widget_data_get(obj);
743 elm_entry_entry_set(wd->entry, entry);
747 * This returns the text currently shown in object @p entry.
748 * See also elm_scrolled_entry_entry_set().
750 * @param obj The scrolled entry object
751 * @return The currently displayed text or NULL on failure
753 * @ingroup Scrolled_Entry
756 elm_scrolled_entry_entry_get(const Evas_Object *obj)
758 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
759 Widget_Data *wd = elm_widget_data_get(obj);
760 if (!wd) return NULL;
761 return elm_entry_entry_get(wd->entry);
765 * This returns EINA_TRUE if the entry is empty/there was an error
766 * and EINA_FALSE if it is not empty.
768 * @param obj The entry object
769 * @return If the entry is empty or not.
774 elm_scrolled_entry_is_empty(const Evas_Object *obj)
776 ELM_CHECK_WIDTYPE(obj, widtype) EINA_TRUE;
777 Widget_Data *wd = elm_widget_data_get(obj);
778 if (!wd) return EINA_TRUE;
779 return elm_entry_is_empty(wd->entry);
783 * This returns all selected text within the scrolled entry.
785 * @param obj The scrolled entry object
786 * @return The selected text within the scrolled entry or NULL on failure
788 * @ingroup Scrolled_Entry
791 elm_scrolled_entry_selection_get(const Evas_Object *obj)
793 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
794 Widget_Data *wd = elm_widget_data_get(obj);
795 if (!wd) return NULL;
796 return elm_entry_selection_get(wd->entry);
800 * This inserts text in @p entry at the beginning of the scrolled entry
803 * @param obj The scrolled entry object
804 * @param entry The text to insert
806 * @ingroup Scrolled_Entry
809 elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry)
811 ELM_CHECK_WIDTYPE(obj, widtype);
812 Widget_Data *wd = elm_widget_data_get(obj);
814 elm_entry_entry_insert(wd->entry, entry);
818 * This enables word line wrapping in the scrolled entry object. It is the opposite
819 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
820 * character line wrapping.
821 * See also elm_scrolled_entry_line_char_wrap_set().
823 * @param obj The scrolled entry object
824 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
825 * of the object. Wrapping will occur at the end of the word before the end of the
828 * @ingroup Scrolled_Entry
831 elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap)
833 ELM_CHECK_WIDTYPE(obj, widtype);
834 Widget_Data *wd = elm_widget_data_get(obj);
836 elm_entry_line_wrap_set(wd->entry, wrap);
840 * This enables character line wrapping in the scrolled entry object. It is the opposite
841 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
842 * word line wrapping.
843 * See also elm_scrolled_entry_line_wrap_set().
845 * @param obj The scrolled entry object
846 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
847 * of the object. Wrapping will occur immediately upon reaching the end of the object.
849 * @ingroup Scrolled_Entry
852 elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap)
854 ELM_CHECK_WIDTYPE(obj, widtype);
855 Widget_Data *wd = elm_widget_data_get(obj);
857 elm_entry_line_char_wrap_set(wd->entry, wrap);
861 * This sets the editable attribute of the scrolled entry.
863 * @param obj The scrolled entry object
864 * @param editable If true, the scrolled entry will be editable by the user.
865 * If false, it will be set to the disabled state.
867 * @ingroup Scrolled_Entry
870 elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable)
872 ELM_CHECK_WIDTYPE(obj, widtype);
873 Widget_Data *wd = elm_widget_data_get(obj);
875 elm_entry_editable_set(wd->entry, editable);
879 * This gets the editable attribute of the scrolled entry.
880 * See also elm_scrolled_entry_editable_set().
882 * @param obj The scrolled entry object
883 * @return If true, the scrolled entry is editable by the user.
884 * If false, it is not editable by the user
886 * @ingroup Scrolled_Entry
889 elm_scrolled_entry_editable_get(const Evas_Object *obj)
891 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
892 Widget_Data *wd = elm_widget_data_get(obj);
893 if (!wd) return EINA_FALSE;
894 return elm_entry_editable_get(wd->entry);
899 * This drops any existing text selection within the scrolled entry.
901 * @param obj The scrolled entry object
903 * @ingroup Scrolled_Entry
906 elm_scrolled_entry_select_none(Evas_Object *obj)
908 ELM_CHECK_WIDTYPE(obj, widtype);
909 Widget_Data *wd = elm_widget_data_get(obj);
911 elm_entry_select_none(wd->entry);
915 * This selects all text within the scrolled entry.
917 * @param obj The scrolled entry object
919 * @ingroup Scrolled_Entry
922 elm_scrolled_entry_select_all(Evas_Object *obj)
924 ELM_CHECK_WIDTYPE(obj, widtype);
925 Widget_Data *wd = elm_widget_data_get(obj);
927 elm_entry_select_all(wd->entry);
931 * This moves the cursor one place to the right within the entry.
933 * @param obj The scrolled entry object
934 * @return EINA_TRUE upon success, EINA_FALSE upon failure
936 * @ingroup Scrolled_Entry
939 elm_scrolled_entry_cursor_next(Evas_Object *obj)
941 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
942 Widget_Data *wd = elm_widget_data_get(obj);
943 if (!wd) return EINA_FALSE;
944 return elm_entry_cursor_next(wd->entry);
948 * This moves the cursor one place to the left within the entry.
950 * @param obj The scrolled entry object
951 * @return EINA_TRUE upon success, EINA_FALSE upon failure
953 * @ingroup Scrolled_Entry
956 elm_scrolled_entry_cursor_prev(Evas_Object *obj)
958 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
959 Widget_Data *wd = elm_widget_data_get(obj);
960 if (!wd) return EINA_FALSE;
961 return elm_entry_cursor_prev(wd->entry);
965 * This moves the cursor one line up within the entry.
967 * @param obj The scrolled entry object
968 * @return EINA_TRUE upon success, EINA_FALSE upon failure
970 * @ingroup Scrolled_Entry
973 elm_scrolled_entry_cursor_up(Evas_Object *obj)
975 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
976 Widget_Data *wd = elm_widget_data_get(obj);
977 if (!wd) return EINA_FALSE;
978 return elm_entry_cursor_up(wd->entry);
982 * This moves the cursor one line down within the entry.
984 * @param obj The scrolled entry object
985 * @return EINA_TRUE upon success, EINA_FALSE upon failure
987 * @ingroup Scrolled_Entry
990 elm_scrolled_entry_cursor_down(Evas_Object *obj)
992 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
993 Widget_Data *wd = elm_widget_data_get(obj);
994 if (!wd) return EINA_FALSE;
995 return elm_entry_cursor_down(wd->entry);
999 * This moves the cursor to the beginning of the entry.
1001 * @param obj The scrolled entry object
1003 * @ingroup Scrolled_Entry
1006 elm_scrolled_entry_cursor_begin_set(Evas_Object *obj)
1008 ELM_CHECK_WIDTYPE(obj, widtype);
1009 Widget_Data *wd = elm_widget_data_get(obj);
1011 elm_entry_cursor_begin_set(wd->entry);
1015 * This moves the cursor to the end of the entry.
1017 * @param obj The scrolled entry object
1019 * @ingroup Scrolled_Entry
1022 elm_scrolled_entry_cursor_end_set(Evas_Object *obj)
1024 ELM_CHECK_WIDTYPE(obj, widtype);
1025 Widget_Data *wd = elm_widget_data_get(obj);
1027 Evas_Coord x, y, w, h;
1028 elm_entry_cursor_end_set(wd->entry);
1029 elm_widget_show_region_get(wd->entry, &x, &y, &w, &h);
1030 elm_scroller_region_show(wd->scroller, x, y, w, h);
1034 * This moves the cursor to the beginning of the current line.
1036 * @param obj The scrolled entry object
1038 * @ingroup Scrolled_Entry
1041 elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj)
1043 ELM_CHECK_WIDTYPE(obj, widtype);
1044 Widget_Data *wd = elm_widget_data_get(obj);
1046 elm_entry_cursor_line_begin_set(wd->entry);
1050 * This moves the cursor to the end of the current line.
1052 * @param obj The scrolled entry object
1054 * @ingroup Scrolled_Entry
1057 elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj)
1059 ELM_CHECK_WIDTYPE(obj, widtype);
1060 Widget_Data *wd = elm_widget_data_get(obj);
1062 elm_entry_cursor_line_end_set(wd->entry);
1066 * This begins a selection within the scrolled entry as though
1067 * the user were holding down the mouse button to make a selection.
1069 * @param obj The scrolled entry object
1071 * @ingroup Scrolled_Entry
1074 elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj)
1076 ELM_CHECK_WIDTYPE(obj, widtype);
1077 Widget_Data *wd = elm_widget_data_get(obj);
1079 elm_entry_cursor_selection_begin(wd->entry);
1083 * This ends a selection within the scrolled entry as though
1084 * the user had just released the mouse button while making a selection.
1086 * @param obj The scrolled entry object
1088 * @ingroup Scrolled_Entry
1091 elm_scrolled_entry_cursor_selection_end(Evas_Object *obj)
1093 ELM_CHECK_WIDTYPE(obj, widtype);
1094 Widget_Data *wd = elm_widget_data_get(obj);
1096 elm_entry_cursor_selection_end(wd->entry);
1100 * TODO: fill this in
1102 * @param obj The scrolled entry object
1103 * @return TODO: fill this in
1105 * @ingroup Scrolled_Entry
1108 elm_scrolled_entry_cursor_is_format_get(const Evas_Object *obj)
1110 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1111 Widget_Data *wd = elm_widget_data_get(obj);
1112 if (!wd) return EINA_FALSE;
1113 return elm_entry_cursor_is_format_get(wd->entry);
1117 * This returns whether the cursor is visible.
1119 * @param obj The scrolled entry object
1120 * @return If true, the cursor is visible.
1122 * @ingroup Scrolled_Entry
1125 elm_scrolled_entry_cursor_is_visible_format_get(const Evas_Object *obj)
1127 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1128 Widget_Data *wd = elm_widget_data_get(obj);
1129 if (!wd) return EINA_FALSE;
1130 return elm_entry_cursor_is_visible_format_get(wd->entry);
1134 * TODO: fill this in
1136 * @param obj The scrolled entry object
1137 * @return TODO: fill this in
1139 * @ingroup Scrolled_Entry
1142 elm_scrolled_entry_cursor_content_get(const Evas_Object *obj)
1144 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1145 Widget_Data *wd = elm_widget_data_get(obj);
1146 if (!wd) return NULL;
1147 return elm_entry_cursor_content_get(wd->entry);
1151 * Sets the cursor position in the scrolled entry to the given value
1153 * @param obj The scrolled entry object
1154 * @param pos the position of the cursor
1156 * @ingroup Scrolled_Entry
1159 elm_scrolled_entry_cursor_pos_set(Evas_Object *obj, int pos)
1161 ELM_CHECK_WIDTYPE(obj, widtype);
1162 Widget_Data *wd = elm_widget_data_get(obj);
1164 elm_entry_cursor_pos_set(wd->entry, pos);
1168 * Retrieves the current position of the cursor in the scrolled entry
1170 * @param obj The entry object
1171 * @return the cursor position
1173 * @ingroup Scrolled_Entry
1176 elm_scrolled_entry_cursor_pos_get(const Evas_Object *obj)
1178 ELM_CHECK_WIDTYPE(obj, widtype) 0;
1179 Widget_Data *wd = elm_widget_data_get(obj);
1181 return elm_entry_cursor_pos_get(wd->entry);
1185 * This executes a "cut" action on the selected text in the scrolled entry.
1187 * @param obj The scrolled entry object
1189 * @ingroup Scrolled_Entry
1192 elm_scrolled_entry_selection_cut(Evas_Object *obj)
1194 ELM_CHECK_WIDTYPE(obj, widtype);
1195 Widget_Data *wd = elm_widget_data_get(obj);
1197 elm_entry_selection_cut(wd->entry);
1201 * This executes a "copy" action on the selected text in the scrolled entry.
1203 * @param obj The scrolled entry object
1205 * @ingroup Scrolled_Entry
1208 elm_scrolled_entry_selection_copy(Evas_Object *obj)
1210 ELM_CHECK_WIDTYPE(obj, widtype);
1211 Widget_Data *wd = elm_widget_data_get(obj);
1213 elm_entry_selection_copy(wd->entry);
1217 * This executes a "paste" action in the scrolled entry.
1219 * @param obj The scrolled entry object
1221 * @ingroup Scrolled_Entry
1224 elm_scrolled_entry_selection_paste(Evas_Object *obj)
1226 ELM_CHECK_WIDTYPE(obj, widtype);
1227 Widget_Data *wd = elm_widget_data_get(obj);
1229 elm_entry_selection_paste(wd->entry);
1233 * This clears and frees the items in a scrolled entry's contextual (right click) menu.
1235 * @param obj The scrolled entry object
1237 * @ingroup Scrolled_Entry
1240 elm_scrolled_entry_context_menu_clear(Evas_Object *obj)
1242 ELM_CHECK_WIDTYPE(obj, widtype);
1243 Widget_Data *wd = elm_widget_data_get(obj);
1245 elm_entry_context_menu_clear(wd->entry);
1249 * This adds an item to the scrolled entry's contextual menu.
1251 * @param obj The scrolled entry object
1252 * @param label The item's text label
1253 * @param icon_file The item's icon file
1254 * @param icon_type The item's icon type
1255 * @param func The callback to execute when the item is clicked
1256 * @param data The data to associate with the item for related functions
1258 * @ingroup Scrolled_Entry
1261 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)
1263 Elm_Entry_Context_Menu_Item *ci;
1264 ELM_CHECK_WIDTYPE(obj, widtype);
1265 Widget_Data *wd = elm_widget_data_get(obj);
1268 ci = malloc(sizeof(Elm_Entry_Context_Menu_Item));
1271 ci->data = (void *)data;
1273 wd->items = eina_list_append(wd->items, ci);
1274 elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, _context_item_wrap_cb, ci);
1278 * This disables the scrolled entry's contextual (right click) menu.
1280 * @param obj The scrolled entry object
1281 * @param disabled If true, the menu is disabled
1283 * @ingroup Scrolled_Entry
1286 elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
1288 ELM_CHECK_WIDTYPE(obj, widtype);
1289 Widget_Data *wd = elm_widget_data_get(obj);
1291 elm_entry_context_menu_disabled_set(wd->entry, disabled);
1295 * This returns whether the scrolled entry's contextual (right click) menu is disabled.
1297 * @param obj The scrolled entry object
1298 * @return If true, the menu is disabled
1300 * @ingroup Scrolled_Entry
1303 elm_scrolled_entry_context_menu_disabled_get(const Evas_Object *obj)
1305 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1306 Widget_Data *wd = elm_widget_data_get(obj);
1307 if (!wd) return EINA_FALSE;
1308 return elm_entry_context_menu_disabled_get(wd->entry);
1312 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling them).
1314 * @param obj The scrolled entry object
1315 * @param h The horizontal scrollbar policy to apply
1316 * @param v The vertical scrollbar policy to apply
1318 * @ingroup Scrolled_Entry
1321 elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v)
1323 ELM_CHECK_WIDTYPE(obj, widtype);
1324 Widget_Data *wd = elm_widget_data_get(obj);
1328 elm_scroller_policy_set(wd->scroller, h, v);
1332 * This enables/disables bouncing within the entry.
1334 * @param obj The scrolled entry object
1335 * @param h The horizontal bounce state
1336 * @param v The vertical bounce state
1338 * @ingroup Scrolled_Entry
1341 elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
1343 ELM_CHECK_WIDTYPE(obj, widtype);
1344 Widget_Data *wd = elm_widget_data_get(obj);
1346 elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce);
1350 * Get the bounce mode
1352 * @param obj The Scrolled_Entry object
1353 * @param h_bounce Allow bounce horizontally
1354 * @param v_bounce Allow bounce vertically
1356 * @ingroup Scrolled_Entry
1359 elm_scrolled_entry_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
1361 ELM_CHECK_WIDTYPE(obj, widtype);
1362 Widget_Data *wd = elm_widget_data_get(obj);
1364 elm_scroller_bounce_get(wd->scroller, h_bounce, v_bounce);
1368 * This appends a custom item provider to the list for that entry
1370 * This appends the given callback. The list is walked from beginning to end
1371 * with each function called given the item href string in the text. If the
1372 * function returns an object handle other than NULL (it should create an
1373 * and object to do this), then this object is used to replace that item. If
1374 * not the next provider is called until one provides an item object, or the
1375 * default provider in entry does.
1377 * @param obj The entry object
1378 * @param func The function called to provide the item object
1379 * @param data The data passed to @p func
1381 * @ingroup Scrolled_Entry
1384 elm_scrolled_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
1386 ELM_CHECK_WIDTYPE(obj, widtype);
1387 Widget_Data *wd = elm_widget_data_get(obj);
1389 EINA_SAFETY_ON_NULL_RETURN(func);
1390 Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
1394 wd->item_providers = eina_list_append(wd->item_providers, ip);
1398 * This prepends a custom item provider to the list for that entry
1400 * This prepends the given callback. See elm_scrolled_entry_item_provider_append() for
1403 * @param obj The entry object
1404 * @param func The function called to provide the item object
1405 * @param data The data passed to @p func
1407 * @ingroup Scrolled_Entry
1410 elm_scrolled_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
1412 ELM_CHECK_WIDTYPE(obj, widtype);
1413 Widget_Data *wd = elm_widget_data_get(obj);
1415 EINA_SAFETY_ON_NULL_RETURN(func);
1416 Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
1420 wd->item_providers = eina_list_prepend(wd->item_providers, ip);
1424 * This removes a custom item provider to the list for that entry
1426 * This removes the given callback. See elm_scrolled_entry_item_provider_append() for
1429 * @param obj The entry object
1430 * @param func The function called to provide the item object
1431 * @param data The data passed to @p func
1433 * @ingroup Scrolled_Entry
1436 elm_scrolled_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
1438 ELM_CHECK_WIDTYPE(obj, widtype);
1439 Widget_Data *wd = elm_widget_data_get(obj);
1441 Elm_Entry_Item_Provider *ip;
1443 EINA_SAFETY_ON_NULL_RETURN(func);
1444 EINA_LIST_FOREACH(wd->item_providers, l, ip)
1446 if ((ip->func == func) && (ip->data == data))
1448 wd->item_providers = eina_list_remove_list(wd->item_providers, l);
1456 * Append a filter function for text inserted in the entry
1458 * Append the given callback to the list. This functions will be called
1459 * whenever any text is inserted into the entry, with the text to be inserted
1460 * as a parameter. The callback function is free to alter the text in any way
1461 * it wants, but it must remember to free the given pointer and update it.
1462 * If the new text is to be discarded, the function can free it and set it text
1463 * parameter to NULL. This will also prevent any following filters from being
1466 * @param obj The entry object
1467 * @param func The function to use as text filter
1468 * @param data User data to pass to @p func
1470 * @ingroup Scrolled_Entry
1473 elm_scrolled_entry_text_filter_append(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data)
1476 Elm_Entry_Text_Filter *tf;
1477 ELM_CHECK_WIDTYPE(obj, widtype);
1479 wd = elm_widget_data_get(obj);
1481 EINA_SAFETY_ON_NULL_RETURN(func);
1483 tf = ELM_NEW(Elm_Entry_Text_Filter);
1487 wd->text_filters = eina_list_append(wd->text_filters, tf);
1491 * Prepend a filter function for text insdrted in the entry
1493 * Prepend the given callback to the list. See elm_scrolled_entry_text_filter_append()
1494 * for more information
1496 * @param obj The entry object
1497 * @param func The function to use as text filter
1498 * @param data User data to pass to @p func
1500 * @ingroup Scrolled_Entry
1503 elm_scrolled_entry_text_filter_prepend(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data)
1506 Elm_Entry_Text_Filter *tf;
1507 ELM_CHECK_WIDTYPE(obj, widtype);
1509 wd = elm_widget_data_get(obj);
1511 EINA_SAFETY_ON_NULL_RETURN(func);
1513 tf = ELM_NEW(Elm_Entry_Text_Filter);
1517 wd->text_filters = eina_list_prepend(wd->text_filters, tf);
1521 * Remove a filter from the list
1523 * Removes the given callback from the filter list. See elm_scrolled_entry_text_filter_append()
1524 * for more information.
1526 * @param obj The entry object
1527 * @param func The filter function to remove
1528 * @param data The user data passed when adding the function
1530 * @ingroup Scrolled_Entry
1533 elm_scrolled_entry_text_filter_remove(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data)
1537 Elm_Entry_Text_Filter *tf;
1538 ELM_CHECK_WIDTYPE(obj, widtype);
1540 wd = elm_widget_data_get(obj);
1542 EINA_SAFETY_ON_NULL_RETURN(func);
1544 EINA_LIST_FOREACH(wd->text_filters, l, tf)
1546 if ((tf->func == func) && (tf->data == data))
1548 wd->text_filters = eina_list_remove_list(wd->text_filters, l);
1556 * This sets the file (and implicitly loads it) for the text to display and
1557 * then edit. All changes are written back to the file after a short delay if
1558 * the entry object is set to autosave.
1560 * @param obj The scrolled entry object
1561 * @param file The path to the file to load and save
1562 * @param format The file format
1564 * @ingroup Scrolled_Entry
1567 elm_scrolled_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format)
1569 ELM_CHECK_WIDTYPE(obj, widtype);
1570 Widget_Data *wd = elm_widget_data_get(obj);
1572 elm_entry_file_set(wd->entry, file, format);
1576 * Gets the file to load and save and the file format
1578 * @param obj The scrolled entry object
1579 * @param file The path to the file to load and save
1580 * @param format The file format
1582 * @ingroup Scrolled_Entry
1585 elm_scrolled_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format)
1587 ELM_CHECK_WIDTYPE(obj, widtype);
1588 Widget_Data *wd = elm_widget_data_get(obj);
1590 elm_entry_file_get(wd->entry, file, format);
1594 * This function writes any changes made to the file set with
1595 * elm_scrolled_entry_file_set()
1597 * @param obj The scrolled entry object
1599 * @ingroup Scrolled_Entry
1602 elm_scrolled_entry_file_save(Evas_Object *obj)
1604 ELM_CHECK_WIDTYPE(obj, widtype);
1605 Widget_Data *wd = elm_widget_data_get(obj);
1607 elm_entry_file_save(wd->entry);
1611 * This sets the entry object to 'autosave' the loaded text file or not.
1613 * @param obj The scrolled entry object
1614 * @param autosave Autosave the loaded file or not
1616 * @ingroup Scrolled_Entry
1619 elm_scrolled_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave)
1621 ELM_CHECK_WIDTYPE(obj, widtype);
1622 Widget_Data *wd = elm_widget_data_get(obj);
1624 elm_entry_autosave_set(wd->entry, autosave);
1628 * This gets the entry object's 'autosave' status.
1630 * @param obj The scrolled entry object
1631 * @return Autosave the loaded file or not
1633 * @ingroup Scrolled_Entry
1636 elm_scrolled_entry_autosave_get(const Evas_Object *obj)
1638 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1639 Widget_Data *wd = elm_widget_data_get(obj);
1640 if (!wd) return EINA_FALSE;
1641 return elm_entry_autosave_get(wd->entry);
1645 * Control pasting of text and images for the widget.
1647 * Normally the scrolled entry allows both text and images to be pasted.
1648 * By setting textonly to be true, this prevents images from being pasted.
1650 * Note this only changes the behaviour of text.
1652 * @param obj The scrolled entry object
1653 * @param textonly paste mode - EINA_TRUE is text only, EINA_FALSE is text+image+other.
1655 * @see elm_entry_cnp_textonly_set
1656 * @ingroup Scrolled_Entry
1659 elm_scrolled_entry_cnp_textonly_set(Evas_Object *obj, Eina_Bool textonly)
1661 ELM_CHECK_WIDTYPE(obj, widtype);
1662 Widget_Data *wd = elm_widget_data_get(obj);
1664 elm_entry_cnp_textonly_set(wd->entry, textonly);
1668 * Getting elm_scrolled_entry text paste/drop mode.
1670 * In textonly mode, only text may be pasted or dropped into the widget.
1672 * @param obj The scrolled entry object
1673 * @return If the widget only accepts text from pastes.
1675 * @see elm_entry_cnp_textonly_get
1676 * @ingroup Scrolled_Entry
1679 elm_scrolled_entry_cnp_textonly_get(Evas_Object *obj)
1681 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1682 Widget_Data *wd = elm_widget_data_get(obj);
1683 if (!wd) return EINA_FALSE;
1684 return elm_entry_cnp_textonly_get(wd->entry);
1688 * Get the input method context in the scrolled entry widget
1690 * @param obj The scrolled entry object
1691 * @return The input method context
1693 * @ingroup Scrolled_Entry
1695 EAPI Ecore_IMF_Context *elm_scrolled_entry_imf_context_get(Evas_Object *obj)
1697 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1698 Widget_Data *wd = elm_widget_data_get(obj);
1699 if (!wd || !wd->entry) return NULL;
1701 return elm_entry_imf_context_get(wd->entry);
1705 * This sets the attribute to show the input panel automatically.
1707 * @param obj The scrolled entry object
1708 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
1710 * @ingroup Scrolled_Entry
1713 elm_scrolled_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
1715 ELM_CHECK_WIDTYPE(obj, widtype);
1716 Widget_Data *wd = elm_widget_data_get(obj);
1717 if (!wd || !wd->entry) return;
1719 elm_entry_input_panel_enabled_set(wd->entry, enabled);
1723 * Set the input panel layout of the scrolled entry
1725 * @param obj The scrolled entry object
1726 * @param layout the layout to set
1728 * @ingroup Scrolled_Entry
1731 elm_scrolled_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout)
1733 ELM_CHECK_WIDTYPE(obj, widtype);
1734 Widget_Data *wd = elm_widget_data_get(obj);
1735 if (!wd || !wd->entry) return;
1737 elm_entry_input_panel_layout_set(wd->entry, layout);
1741 * Set whether scrolled entry should support auto capitalization
1743 * @param obj The entry object
1744 * @param on If true, scrolled entry suports auto capitalization.
1746 * @ingroup Scrolled_Entry
1749 elm_scrolled_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool autocap)
1751 ELM_CHECK_WIDTYPE(obj, widtype);
1752 Widget_Data *wd = elm_widget_data_get(obj);
1753 if (!wd || !wd->entry) return;
1755 elm_entry_autocapitalization_set(wd->entry, autocap);
1759 * Set whether scrolled entry should support auto period
1761 * @param obj The entry object
1762 * @param on If true, scrolled entry suports auto period.
1764 * @ingroup Scrolled_Entry
1767 elm_scrolled_entry_autoperiod_set(Evas_Object *obj, Eina_Bool autoperiod)
1769 ELM_CHECK_WIDTYPE(obj, widtype);
1770 Widget_Data *wd = elm_widget_data_get(obj);
1771 if (!wd || !wd->entry) return;
1773 elm_entry_autoperiod_set(wd->entry, autoperiod);