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 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
368 wd = ELM_NEW(Widget_Data);
369 e = evas_object_evas_get(parent);
371 obj = elm_widget_add(e);
372 ELM_SET_WIDTYPE(widtype, "scrolled_entry");
373 elm_widget_type_set(obj, "scrolled_entry");
374 elm_widget_sub_object_add(parent, obj);
375 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
376 elm_widget_data_set(obj, wd);
377 elm_widget_del_hook_set(obj, _del_hook);
378 elm_widget_disable_hook_set(obj, _disable_hook);
379 elm_widget_can_focus_set(obj, EINA_TRUE);
380 elm_widget_theme_hook_set(obj, _theme_hook);
381 elm_widget_on_focus_region_hook_set(obj, _on_focus_region_hook);
382 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
383 elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
384 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
386 wd->scroller = elm_scroller_add(obj);
387 //elm_scroller_custom_widget_base_theme_set(wd->scroller, "scroller", "entry");
388 elm_widget_resize_object_set(obj, wd->scroller);
389 evas_object_size_hint_weight_set(wd->scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
390 evas_object_size_hint_align_set(wd->scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
391 elm_scroller_bounce_set(wd->scroller, EINA_FALSE, EINA_FALSE);
392 elm_scroller_propagate_events_set(wd->scroller, EINA_TRUE);
393 evas_object_show(wd->scroller);
395 wd->entry = elm_entry_add(obj);
396 evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
397 evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
398 elm_scroller_content_set(wd->scroller, wd->entry);
399 evas_object_show(wd->entry);
401 elm_entry_text_filter_prepend(wd->entry, _text_filter_wrap_cb, obj);
402 elm_entry_item_provider_prepend(wd->entry, _item_provider_wrap_cb, obj);
404 evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj);
405 evas_object_smart_callback_add(wd->entry, "activated", _entry_activated, obj);
406 evas_object_smart_callback_add(wd->entry, "press", _entry_press, obj);
407 evas_object_smart_callback_add(wd->entry, "clicked", _entry_clicked, obj);
408 evas_object_smart_callback_add(wd->entry, "clicked,double", _entry_clicked_double, obj);
409 evas_object_smart_callback_add(wd->entry, "cursor,changed", _entry_cursor_changed, obj);
410 evas_object_smart_callback_add(wd->entry, "anchor,clicked", _entry_anchor_clicked, obj);
411 evas_object_smart_callback_add(wd->entry, "selection,start", _entry_selection_start, obj);
412 evas_object_smart_callback_add(wd->entry, "selection,changed", _entry_selection_changed, obj);
413 evas_object_smart_callback_add(wd->entry, "selection,cleared", _entry_selection_cleared, obj);
414 evas_object_smart_callback_add(wd->entry, "selection,paste", _entry_selection_paste, obj);
415 evas_object_smart_callback_add(wd->entry, "selection,copy", _entry_selection_copy, obj);
416 evas_object_smart_callback_add(wd->entry, "selection,cut", _entry_selection_cut, obj);
417 evas_object_smart_callback_add(wd->entry, "longpressed", _entry_longpressed, obj);
418 evas_object_smart_callback_add(wd->entry, "focused", _entry_focused, obj);
419 evas_object_smart_callback_add(wd->entry, "unfocused", _entry_unfocused, obj);
421 evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
422 _changed_size_hints, NULL);
426 // TODO: convert Elementary to subclassing of Evas_Smart_Class
427 // TODO: and save some bytes, making descriptions per-class and not instance!
428 evas_object_smart_callbacks_descriptions_set(obj, _signals);
433 * This sets a widget to be displayed to the left of a scrolled entry.
435 * @param obj The scrolled entry object
436 * @param icon The widget to display on the left side of the scrolled
439 * @note A previously set widget will be destroyed.
440 * @note If the object being set does not have minimum size hints set,
441 * it won't get properly displayed.
443 * @ingroup Scrolled_Entry
444 * @see elm_scrolled_entry_end_set
447 elm_scrolled_entry_icon_set(Evas_Object *obj, Evas_Object *icon)
449 ELM_CHECK_WIDTYPE(obj, widtype);
450 Widget_Data *wd = elm_widget_data_get(obj);
453 EINA_SAFETY_ON_NULL_RETURN(icon);
454 if (wd->icon == icon) return;
455 if (wd->icon) evas_object_del(wd->icon);
457 edje = _elm_scroller_edje_object_get(wd->scroller);
459 edje_object_part_swallow(edje, "elm.swallow.icon", wd->icon);
460 edje_object_signal_emit(edje, "elm,action,show,icon", "elm");
465 * Gets the leftmost widget of the scrolled entry. This object is
466 * owned by the scrolled entry and should not be modified.
468 * @param obj The scrolled entry object
469 * @return the left widget inside the scroller
471 * @ingroup Scrolled_Entry
474 elm_scrolled_entry_icon_get(const Evas_Object *obj)
476 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
477 Widget_Data *wd = elm_widget_data_get(obj);
478 if (!wd) return NULL;
483 * Unset the leftmost widget of the scrolled entry, unparenting and
486 * @param obj The scrolled entry object
487 * @return the previously set icon sub-object of this entry, on
490 * @see elm_scrolled_entry_icon_set()
492 * @ingroup Scrolled_Entry
495 elm_scrolled_entry_icon_unset(Evas_Object *obj)
497 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
498 Widget_Data *wd = elm_widget_data_get(obj);
499 Evas_Object *ret = NULL;
500 if (!wd) return NULL;
503 Evas_Object *edje = _elm_scroller_edje_object_get(wd->scroller);
504 if (!edje) return NULL;
506 edje_object_part_unswallow(edje, wd->icon);
507 edje_object_signal_emit(edje, "elm,action,hide,icon", "elm");
515 * Sets the visibility of the left-side widget of the scrolled entry,
516 * set by @elm_scrolled_entry_icon_set().
518 * @param obj The scrolled entry object
519 * @param setting EINA_TRUE if the object should be displayed,
522 * @ingroup Scrolled_Entry
525 elm_scrolled_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting)
527 ELM_CHECK_WIDTYPE(obj, widtype);
528 Widget_Data *wd = elm_widget_data_get(obj);
529 if ((!wd) || (!wd->icon)) return;
531 evas_object_hide(wd->icon);
533 evas_object_show(wd->icon);
538 * This sets a widget to be displayed to the end of a scrolled entry.
540 * @param obj The scrolled entry object
541 * @param end The widget to display on the right side of the scrolled
544 * @note A previously set widget will be destroyed.
545 * @note If the object being set does not have minimum size hints set,
546 * it won't get properly displayed.
548 * @ingroup Scrolled_Entry
549 * @see elm_scrolled_entry_icon_set
552 elm_scrolled_entry_end_set(Evas_Object *obj, Evas_Object *end)
554 ELM_CHECK_WIDTYPE(obj, widtype);
555 Widget_Data *wd = elm_widget_data_get(obj);
558 EINA_SAFETY_ON_NULL_RETURN(end);
559 if (wd->end == end) return;
560 if (wd->end) evas_object_del(wd->end);
562 edje = _elm_scroller_edje_object_get(wd->scroller);
564 edje_object_part_swallow(edje, "elm.swallow.end", wd->end);
565 edje_object_signal_emit(edje, "elm,action,show,end", "elm");
570 * Gets the endmost widget of the scrolled entry. This object is owned
571 * by the scrolled entry and should not be modified.
573 * @param obj The scrolled entry object
574 * @return the right widget inside the scroller
576 * @ingroup Scrolled_Entry
579 elm_scrolled_entry_end_get(const Evas_Object *obj)
581 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
582 Widget_Data *wd = elm_widget_data_get(obj);
583 if (!wd) return NULL;
588 * Unset the endmost widget of the scrolled entry, unparenting and
591 * @param obj The scrolled entry object
592 * @return the previously set icon sub-object of this entry, on
595 * @see elm_scrolled_entry_icon_set()
597 * @ingroup Scrolled_Entry
600 elm_scrolled_entry_end_unset(Evas_Object *obj)
602 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
603 Widget_Data *wd = elm_widget_data_get(obj);
604 Evas_Object *ret = NULL;
605 if (!wd) return NULL;
608 Evas_Object *edje = _elm_scroller_edje_object_get(wd->scroller);
609 if (!edje) return NULL;
611 edje_object_part_unswallow(edje, wd->end);
612 edje_object_signal_emit(edje, "elm,action,hide,end", "elm");
620 * Sets the visibility of the end widget of the scrolled entry, set by
621 * @elm_scrolled_entry_end_set().
623 * @param obj The scrolled entry object
624 * @param setting EINA_TRUE if the object should be displayed,
627 * @ingroup Scrolled_Entry
630 elm_scrolled_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting)
632 ELM_CHECK_WIDTYPE(obj, widtype);
633 Widget_Data *wd = elm_widget_data_get(obj);
634 if ((!wd) || (!wd->end)) return;
636 evas_object_hide(wd->end);
638 evas_object_show(wd->end);
643 * This sets the scrolled entry object not to line wrap. All input will
644 * be on a single line, and the entry box will scroll with user input.
646 * @param obj The scrolled entry object
647 * @param single_line If true, the text in the scrolled entry
648 * will be on a single line.
650 * @ingroup Scrolled_Entry
653 elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
655 ELM_CHECK_WIDTYPE(obj, widtype);
656 Widget_Data *wd = elm_widget_data_get(obj);
658 if (wd->single_line == single_line) return;
659 elm_entry_single_line_set(wd->entry, single_line);
660 wd->single_line = single_line;
663 elm_scroller_policy_set(wd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
664 elm_scroller_content_min_limit(wd->scroller, 0, 1);
668 elm_scroller_policy_set(wd->scroller, wd->policy_h, wd->policy_v);
669 elm_scroller_content_min_limit(wd->scroller, 0, 0);
675 * This returns true if the scrolled entry has been set to single line mode.
676 * See also elm_scrolled_entry_single_line_set().
678 * @param obj The scrolled entry object
679 * @return single_line If true, the text in the scrolled entry is set to display
682 * @ingroup Scrolled_Entry
685 elm_scrolled_entry_single_line_get(const Evas_Object *obj)
687 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
688 Widget_Data *wd = elm_widget_data_get(obj);
689 if (!wd) return EINA_FALSE;
690 return elm_entry_single_line_get(wd->entry);
695 * This sets the scrolled entry object to password mode. All text entered
696 * and/or displayed within the widget will be replaced with asterisks (*).
698 * @param obj The scrolled entry object
699 * @param password If true, password mode is enabled.
701 * @ingroup Scrolled_Entry
704 elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password)
706 ELM_CHECK_WIDTYPE(obj, widtype);
707 Widget_Data *wd = elm_widget_data_get(obj);
709 elm_entry_password_set(wd->entry, password);
713 * This returns whether password mode is enabled.
714 * See also elm_scrolled_entry_password_set().
716 * @param obj The scrolled entry object
717 * @return If true, the scrolled entry is set to display all characters
720 * @ingroup Scrolled_Entry
723 elm_scrolled_entry_password_get(const Evas_Object *obj)
725 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
726 Widget_Data *wd = elm_widget_data_get(obj);
727 if (!wd) return EINA_FALSE;
728 return elm_entry_password_get(wd->entry);
733 * This sets the text displayed within the scrolled entry to @p entry.
735 * @param obj The scrolled entry object
736 * @param entry The text to be displayed
738 * @ingroup Scrolled_Entry
741 elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry)
743 ELM_CHECK_WIDTYPE(obj, widtype);
744 Widget_Data *wd = elm_widget_data_get(obj);
746 elm_entry_entry_set(wd->entry, entry);
750 * This returns the text currently shown in object @p entry.
751 * See also elm_scrolled_entry_entry_set().
753 * @param obj The scrolled entry object
754 * @return The currently displayed text or NULL on failure
756 * @ingroup Scrolled_Entry
759 elm_scrolled_entry_entry_get(const Evas_Object *obj)
761 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
762 Widget_Data *wd = elm_widget_data_get(obj);
763 if (!wd) return NULL;
764 return elm_entry_entry_get(wd->entry);
768 * This returns all selected text within the scrolled entry.
770 * @param obj The scrolled entry object
771 * @return The selected text within the scrolled entry or NULL on failure
773 * @ingroup Scrolled_Entry
776 elm_scrolled_entry_selection_get(const Evas_Object *obj)
778 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
779 Widget_Data *wd = elm_widget_data_get(obj);
780 if (!wd) return NULL;
781 return elm_entry_selection_get(wd->entry);
785 * This inserts text in @p entry at the beginning of the scrolled entry
788 * @param obj The scrolled entry object
789 * @param entry The text to insert
791 * @ingroup Scrolled_Entry
794 elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry)
796 ELM_CHECK_WIDTYPE(obj, widtype);
797 Widget_Data *wd = elm_widget_data_get(obj);
799 elm_entry_entry_insert(wd->entry, entry);
803 * This enables word line wrapping in the scrolled entry object. It is the opposite
804 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
805 * character line wrapping.
806 * See also elm_scrolled_entry_line_char_wrap_set().
808 * @param obj The scrolled entry object
809 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
810 * of the object. Wrapping will occur at the end of the word before the end of the
813 * @ingroup Scrolled_Entry
816 elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap)
818 ELM_CHECK_WIDTYPE(obj, widtype);
819 Widget_Data *wd = elm_widget_data_get(obj);
821 elm_entry_line_wrap_set(wd->entry, wrap);
825 * This enables character line wrapping in the scrolled entry object. It is the opposite
826 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
827 * word line wrapping.
828 * See also elm_scrolled_entry_line_wrap_set().
830 * @param obj The scrolled entry object
831 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
832 * of the object. Wrapping will occur immediately upon reaching the end of the object.
834 * @ingroup Scrolled_Entry
837 elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap)
839 ELM_CHECK_WIDTYPE(obj, widtype);
840 Widget_Data *wd = elm_widget_data_get(obj);
842 elm_entry_line_char_wrap_set(wd->entry, wrap);
846 * This sets the editable attribute of the scrolled entry.
848 * @param obj The scrolled entry object
849 * @param editable If true, the scrolled entry will be editable by the user.
850 * If false, it will be set to the disabled state.
852 * @ingroup Scrolled_Entry
855 elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable)
857 ELM_CHECK_WIDTYPE(obj, widtype);
858 Widget_Data *wd = elm_widget_data_get(obj);
860 elm_entry_editable_set(wd->entry, editable);
864 * This gets the editable attribute of the scrolled entry.
865 * See also elm_scrolled_entry_editable_set().
867 * @param obj The scrolled entry object
868 * @return If true, the scrolled entry is editable by the user.
869 * If false, it is not editable by the user
871 * @ingroup Scrolled_Entry
874 elm_scrolled_entry_editable_get(const Evas_Object *obj)
876 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
877 Widget_Data *wd = elm_widget_data_get(obj);
878 if (!wd) return EINA_FALSE;
879 return elm_entry_editable_get(wd->entry);
884 * This drops any existing text selection within the scrolled entry.
886 * @param obj The scrolled entry object
888 * @ingroup Scrolled_Entry
891 elm_scrolled_entry_select_none(Evas_Object *obj)
893 ELM_CHECK_WIDTYPE(obj, widtype);
894 Widget_Data *wd = elm_widget_data_get(obj);
896 elm_entry_select_none(wd->entry);
900 * This selects all text within the scrolled entry.
902 * @param obj The scrolled entry object
904 * @ingroup Scrolled_Entry
907 elm_scrolled_entry_select_all(Evas_Object *obj)
909 ELM_CHECK_WIDTYPE(obj, widtype);
910 Widget_Data *wd = elm_widget_data_get(obj);
912 elm_entry_select_all(wd->entry);
916 * This moves the cursor one place to the right within the entry.
918 * @param obj The scrolled entry object
919 * @return EINA_TRUE upon success, EINA_FALSE upon failure
921 * @ingroup Scrolled_Entry
924 elm_scrolled_entry_cursor_next(Evas_Object *obj)
926 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
927 Widget_Data *wd = elm_widget_data_get(obj);
928 if (!wd) return EINA_FALSE;
929 return elm_entry_cursor_next(wd->entry);
933 * This moves the cursor one place to the left within the entry.
935 * @param obj The scrolled entry object
936 * @return EINA_TRUE upon success, EINA_FALSE upon failure
938 * @ingroup Scrolled_Entry
941 elm_scrolled_entry_cursor_prev(Evas_Object *obj)
943 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
944 Widget_Data *wd = elm_widget_data_get(obj);
945 if (!wd) return EINA_FALSE;
946 return elm_entry_cursor_prev(wd->entry);
950 * This moves the cursor one line up within the entry.
952 * @param obj The scrolled entry object
953 * @return EINA_TRUE upon success, EINA_FALSE upon failure
955 * @ingroup Scrolled_Entry
958 elm_scrolled_entry_cursor_up(Evas_Object *obj)
960 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
961 Widget_Data *wd = elm_widget_data_get(obj);
962 if (!wd) return EINA_FALSE;
963 return elm_entry_cursor_up(wd->entry);
967 * This moves the cursor one line down within the entry.
969 * @param obj The scrolled entry object
970 * @return EINA_TRUE upon success, EINA_FALSE upon failure
972 * @ingroup Scrolled_Entry
975 elm_scrolled_entry_cursor_down(Evas_Object *obj)
977 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
978 Widget_Data *wd = elm_widget_data_get(obj);
979 if (!wd) return EINA_FALSE;
980 return elm_entry_cursor_down(wd->entry);
984 * This moves the cursor to the beginning of the entry.
986 * @param obj The scrolled entry object
988 * @ingroup Scrolled_Entry
991 elm_scrolled_entry_cursor_begin_set(Evas_Object *obj)
993 ELM_CHECK_WIDTYPE(obj, widtype);
994 Widget_Data *wd = elm_widget_data_get(obj);
996 elm_entry_cursor_begin_set(wd->entry);
1000 * This moves the cursor to the end of the entry.
1002 * @param obj The scrolled entry object
1004 * @ingroup Scrolled_Entry
1007 elm_scrolled_entry_cursor_end_set(Evas_Object *obj)
1009 ELM_CHECK_WIDTYPE(obj, widtype);
1010 Widget_Data *wd = elm_widget_data_get(obj);
1012 Evas_Coord x, y, w, h;
1013 elm_entry_cursor_end_set(wd->entry);
1014 elm_widget_show_region_get(wd->entry, &x, &y, &w, &h);
1015 elm_scroller_region_show(wd->scroller, x, y, w, h);
1019 * This moves the cursor to the beginning of the current line.
1021 * @param obj The scrolled entry object
1023 * @ingroup Scrolled_Entry
1026 elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj)
1028 ELM_CHECK_WIDTYPE(obj, widtype);
1029 Widget_Data *wd = elm_widget_data_get(obj);
1031 elm_entry_cursor_line_begin_set(wd->entry);
1035 * This moves the cursor to the end of the current line.
1037 * @param obj The scrolled entry object
1039 * @ingroup Scrolled_Entry
1042 elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj)
1044 ELM_CHECK_WIDTYPE(obj, widtype);
1045 Widget_Data *wd = elm_widget_data_get(obj);
1047 elm_entry_cursor_line_end_set(wd->entry);
1051 * This begins a selection within the scrolled entry as though
1052 * the user were holding down the mouse button to make a selection.
1054 * @param obj The scrolled entry object
1056 * @ingroup Scrolled_Entry
1059 elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj)
1061 ELM_CHECK_WIDTYPE(obj, widtype);
1062 Widget_Data *wd = elm_widget_data_get(obj);
1064 elm_entry_cursor_selection_begin(wd->entry);
1068 * This ends a selection within the scrolled entry as though
1069 * the user had just released the mouse button while making a selection.
1071 * @param obj The scrolled entry object
1073 * @ingroup Scrolled_Entry
1076 elm_scrolled_entry_cursor_selection_end(Evas_Object *obj)
1078 ELM_CHECK_WIDTYPE(obj, widtype);
1079 Widget_Data *wd = elm_widget_data_get(obj);
1081 elm_entry_cursor_selection_end(wd->entry);
1085 * TODO: fill this in
1087 * @param obj The scrolled entry object
1088 * @return TODO: fill this in
1090 * @ingroup Scrolled_Entry
1093 elm_scrolled_entry_cursor_is_format_get(const Evas_Object *obj)
1095 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1096 Widget_Data *wd = elm_widget_data_get(obj);
1097 if (!wd) return EINA_FALSE;
1098 return elm_entry_cursor_is_format_get(wd->entry);
1102 * This returns whether the cursor is visible.
1104 * @param obj The scrolled entry object
1105 * @return If true, the cursor is visible.
1107 * @ingroup Scrolled_Entry
1110 elm_scrolled_entry_cursor_is_visible_format_get(const Evas_Object *obj)
1112 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1113 Widget_Data *wd = elm_widget_data_get(obj);
1114 if (!wd) return EINA_FALSE;
1115 return elm_entry_cursor_is_visible_format_get(wd->entry);
1119 * TODO: fill this in
1121 * @param obj The scrolled entry object
1122 * @return TODO: fill this in
1124 * @ingroup Scrolled_Entry
1127 elm_scrolled_entry_cursor_content_get(const Evas_Object *obj)
1129 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1130 Widget_Data *wd = elm_widget_data_get(obj);
1131 if (!wd) return NULL;
1132 return elm_entry_cursor_content_get(wd->entry);
1136 * This executes a "cut" action on the selected text in the scrolled entry.
1138 * @param obj The scrolled entry object
1140 * @ingroup Scrolled_Entry
1143 elm_scrolled_entry_selection_cut(Evas_Object *obj)
1145 ELM_CHECK_WIDTYPE(obj, widtype);
1146 Widget_Data *wd = elm_widget_data_get(obj);
1148 elm_entry_selection_cut(wd->entry);
1152 * This executes a "copy" action on the selected text in the scrolled entry.
1154 * @param obj The scrolled entry object
1156 * @ingroup Scrolled_Entry
1159 elm_scrolled_entry_selection_copy(Evas_Object *obj)
1161 ELM_CHECK_WIDTYPE(obj, widtype);
1162 Widget_Data *wd = elm_widget_data_get(obj);
1164 elm_entry_selection_copy(wd->entry);
1168 * This executes a "paste" action in the scrolled entry.
1170 * @param obj The scrolled entry object
1172 * @ingroup Scrolled_Entry
1175 elm_scrolled_entry_selection_paste(Evas_Object *obj)
1177 ELM_CHECK_WIDTYPE(obj, widtype);
1178 Widget_Data *wd = elm_widget_data_get(obj);
1180 elm_entry_selection_paste(wd->entry);
1184 * This clears and frees the items in a scrolled entry's contextual (right click) menu.
1186 * @param obj The scrolled entry object
1188 * @ingroup Scrolled_Entry
1191 elm_scrolled_entry_context_menu_clear(Evas_Object *obj)
1193 ELM_CHECK_WIDTYPE(obj, widtype);
1194 Widget_Data *wd = elm_widget_data_get(obj);
1196 elm_entry_context_menu_clear(wd->entry);
1200 * This adds an item to the scrolled entry's contextual menu.
1202 * @param obj The scrolled entry object
1203 * @param label The item's text label
1204 * @param icon_file The item's icon file
1205 * @param icon_type The item's icon type
1206 * @param func The callback to execute when the item is clicked
1207 * @param data The data to associate with the item for related functions
1209 * @ingroup Scrolled_Entry
1212 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)
1214 Elm_Entry_Context_Menu_Item *ci;
1215 ELM_CHECK_WIDTYPE(obj, widtype);
1216 Widget_Data *wd = elm_widget_data_get(obj);
1219 ci = malloc(sizeof(Elm_Entry_Context_Menu_Item));
1222 ci->data = (void *)data;
1224 wd->items = eina_list_append(wd->items, ci);
1225 elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, _context_item_wrap_cb, ci);
1229 * This disables the scrolled entry's contextual (right click) menu.
1231 * @param obj The scrolled entry object
1232 * @param disabled If true, the menu is disabled
1234 * @ingroup Scrolled_Entry
1237 elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
1239 ELM_CHECK_WIDTYPE(obj, widtype);
1240 Widget_Data *wd = elm_widget_data_get(obj);
1242 elm_entry_context_menu_disabled_set(wd->entry, disabled);
1246 * This returns whether the scrolled entry's contextual (right click) menu is disabled.
1248 * @param obj The scrolled entry object
1249 * @return If true, the menu is disabled
1251 * @ingroup Scrolled_Entry
1254 elm_scrolled_entry_context_menu_disabled_get(const Evas_Object *obj)
1256 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1257 Widget_Data *wd = elm_widget_data_get(obj);
1258 if (!wd) return EINA_FALSE;
1259 return elm_entry_context_menu_disabled_get(wd->entry);
1263 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling them).
1265 * @param obj The scrolled entry object
1266 * @param h The horizontal scrollbar policy to apply
1267 * @param v The vertical scrollbar policy to apply
1269 * @ingroup Scrolled_Entry
1272 elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v)
1274 ELM_CHECK_WIDTYPE(obj, widtype);
1275 Widget_Data *wd = elm_widget_data_get(obj);
1279 elm_scroller_policy_set(wd->scroller, h, v);
1283 * This enables/disables bouncing within the entry.
1285 * @param obj The scrolled entry object
1286 * @param h The horizontal bounce state
1287 * @param v The vertical bounce state
1289 * @ingroup Scrolled_Entry
1292 elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
1294 ELM_CHECK_WIDTYPE(obj, widtype);
1295 Widget_Data *wd = elm_widget_data_get(obj);
1297 elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce);
1301 * This set's the maximum bytes that can be added in to scrolled entry.
1303 * @param obj The scrolled entry object
1304 * @param max_no_of_bytes Maximum number of bytes scrolled entry can have.
1306 * @ingroup Scrolled_Entry
1309 elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes)
1311 ELM_CHECK_WIDTYPE(obj, widtype);
1312 Widget_Data *wd = elm_widget_data_get(obj);
1314 elm_entry_maximum_bytes_set(wd->entry,max_no_of_bytes);
1318 * Get the bounce mode
1320 * @param obj The Scrolled_Entry object
1321 * @param h_bounce Allow bounce horizontally
1322 * @param v_bounce Allow bounce vertically
1324 * @ingroup Scrolled_Entry
1327 elm_scrolled_entry_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
1329 ELM_CHECK_WIDTYPE(obj, widtype);
1330 Widget_Data *wd = elm_widget_data_get(obj);
1332 elm_scroller_bounce_get(wd->scroller, h_bounce, v_bounce);
1336 * This appends a custom item provider to the list for that entry
1338 * This appends the given callback. The list is walked from beginning to end
1339 * with each function called given the item href string in the text. If the
1340 * function returns an object handle other than NULL (it should create an
1341 * and object to do this), then this object is used to replace that item. If
1342 * not the next provider is called until one provides an item object, or the
1343 * default provider in entry does.
1345 * @param obj The entry object
1346 * @param func The function called to provide the item object
1347 * @param data The data passed to @p func
1349 * @ingroup Scrolled_Entry
1352 elm_scrolled_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
1354 ELM_CHECK_WIDTYPE(obj, widtype);
1355 Widget_Data *wd = elm_widget_data_get(obj);
1357 EINA_SAFETY_ON_NULL_RETURN(func);
1358 Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
1362 wd->item_providers = eina_list_append(wd->item_providers, ip);
1366 * This prepends a custom item provider to the list for that entry
1368 * This prepends the given callback. See elm_scrolled_entry_item_provider_append() for
1371 * @param obj The entry object
1372 * @param func The function called to provide the item object
1373 * @param data The data passed to @p func
1375 * @ingroup Scrolled_Entry
1378 elm_scrolled_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
1380 ELM_CHECK_WIDTYPE(obj, widtype);
1381 Widget_Data *wd = elm_widget_data_get(obj);
1383 EINA_SAFETY_ON_NULL_RETURN(func);
1384 Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
1388 wd->item_providers = eina_list_prepend(wd->item_providers, ip);
1392 * This removes a custom item provider to the list for that entry
1394 * This removes the given callback. See elm_scrolled_entry_item_provider_append() for
1397 * @param obj The entry object
1398 * @param func The function called to provide the item object
1399 * @param data The data passed to @p func
1401 * @ingroup Scrolled_Entry
1404 elm_scrolled_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
1406 ELM_CHECK_WIDTYPE(obj, widtype);
1407 Widget_Data *wd = elm_widget_data_get(obj);
1409 Elm_Entry_Item_Provider *ip;
1411 EINA_SAFETY_ON_NULL_RETURN(func);
1412 EINA_LIST_FOREACH(wd->item_providers, l, ip)
1414 if ((ip->func == func) && (ip->data == data))
1416 wd->item_providers = eina_list_remove_list(wd->item_providers, l);
1424 * Append a filter function for text inserted in the entry
1426 * Append the given callback to the list. This functions will be called
1427 * whenever any text is inserted into the entry, with the text to be inserted
1428 * as a parameter. The callback function is free to alter the text in any way
1429 * it wants, but it must remember to free the given pointer and update it.
1430 * If the new text is to be discarded, the function can free it and set it text
1431 * parameter to NULL. This will also prevent any following filters from being
1434 * @param obj The entry object
1435 * @param func The function to use as text filter
1436 * @param data User data to pass to @p func
1438 * @ingroup Scrolled_Entry
1441 elm_scrolled_entry_text_filter_append(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data)
1444 Elm_Entry_Text_Filter *tf;
1445 ELM_CHECK_WIDTYPE(obj, widtype);
1447 wd = elm_widget_data_get(obj);
1449 EINA_SAFETY_ON_NULL_RETURN(func);
1451 tf = ELM_NEW(Elm_Entry_Text_Filter);
1455 wd->text_filters = eina_list_append(wd->text_filters, tf);
1459 * Prepend a filter function for text insdrted in the entry
1461 * Prepend the given callback to the list. See elm_scrolled_entry_text_filter_append()
1462 * for more information
1464 * @param obj The entry object
1465 * @param func The function to use as text filter
1466 * @param data User data to pass to @p func
1468 * @ingroup Scrolled_Entry
1471 elm_scrolled_entry_text_filter_prepend(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data)
1474 Elm_Entry_Text_Filter *tf;
1475 ELM_CHECK_WIDTYPE(obj, widtype);
1477 wd = elm_widget_data_get(obj);
1479 EINA_SAFETY_ON_NULL_RETURN(func);
1481 tf = ELM_NEW(Elm_Entry_Text_Filter);
1485 wd->text_filters = eina_list_prepend(wd->text_filters, tf);
1489 * Remove a filter from the list
1491 * Removes the given callback from the filter list. See elm_scrolled_entry_text_filter_append()
1492 * for more information.
1494 * @param obj The entry object
1495 * @param func The filter function to remove
1496 * @param data The user data passed when adding the function
1498 * @ingroup Scrolled_Entry
1501 elm_scrolled_entry_text_filter_remove(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 EINA_LIST_FOREACH(wd->text_filters, l, tf)
1514 if ((tf->func == func) && (tf->data == data))
1516 wd->text_filters = eina_list_remove_list(wd->text_filters, l);
1524 * This sets the file (and implicitly loads it) for the text to display and
1525 * then edit. All changes are written back to the file after a short delay if
1526 * the entry object is set to autosave.
1528 * @param obj The scrolled entry object
1529 * @param file The path to the file to load and save
1530 * @param format The file format
1532 * @ingroup Scrolled_Entry
1535 elm_scrolled_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format)
1537 ELM_CHECK_WIDTYPE(obj, widtype);
1538 Widget_Data *wd = elm_widget_data_get(obj);
1540 elm_entry_file_set(wd->entry, file, format);
1544 * Gets the file to load and save and the file format
1546 * @param obj The scrolled entry object
1547 * @param file The path to the file to load and save
1548 * @param format The file format
1550 * @ingroup Scrolled_Entry
1553 elm_scrolled_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format)
1555 ELM_CHECK_WIDTYPE(obj, widtype);
1556 Widget_Data *wd = elm_widget_data_get(obj);
1558 elm_entry_file_get(wd->entry, file, format);
1562 * This function writes any changes made to the file set with
1563 * elm_scrolled_entry_file_set()
1565 * @param obj The scrolled entry object
1567 * @ingroup Scrolled_Entry
1570 elm_scrolled_entry_file_save(Evas_Object *obj)
1572 ELM_CHECK_WIDTYPE(obj, widtype);
1573 Widget_Data *wd = elm_widget_data_get(obj);
1575 elm_entry_file_save(wd->entry);
1579 * This sets the entry object to 'autosave' the loaded text file or not.
1581 * @param obj The scrolled entry object
1582 * @param autosave Autosave the loaded file or not
1584 * @ingroup Scrolled_Entry
1587 elm_scrolled_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave)
1589 ELM_CHECK_WIDTYPE(obj, widtype);
1590 Widget_Data *wd = elm_widget_data_get(obj);
1592 elm_entry_autosave_set(wd->entry, autosave);
1596 * This gets the entry object's 'autosave' status.
1598 * @param obj The scrolled entry object
1599 * @return Autosave the loaded file or not
1601 * @ingroup Scrolled_Entry
1604 elm_scrolled_entry_autosave_get(const Evas_Object *obj)
1606 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1607 Widget_Data *wd = elm_widget_data_get(obj);
1608 if (!wd) return EINA_FALSE;
1609 return elm_entry_autosave_get(wd->entry);
1613 * Get the input method context in the scrolled entry widget
1615 * @param obj The scrolled entry object
1616 * @return The input method context
1618 * @ingroup Scrolled_Entry
1620 EAPI Ecore_IMF_Context *elm_scrolled_entry_imf_context_get(Evas_Object *obj)
1622 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1623 Widget_Data *wd = elm_widget_data_get(obj);
1624 if (!wd || !wd->entry) return NULL;
1626 return elm_entry_imf_context_get(wd->entry);
1630 * This sets the attribute to show the input panel automatically.
1632 * @param obj The scrolled entry object
1633 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
1635 * @ingroup Scrolled_Entry
1638 elm_scrolled_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
1640 ELM_CHECK_WIDTYPE(obj, widtype);
1641 Widget_Data *wd = elm_widget_data_get(obj);
1642 if (!wd || !wd->entry) return;
1644 elm_entry_input_panel_enabled_set(wd->entry, enabled);
1648 * Set the input panel layout of the scrolled entry
1650 * @param obj The scrolled entry object
1651 * @param layout the layout to set
1653 * @ingroup Scrolled_Entry
1656 elm_scrolled_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout)
1658 ELM_CHECK_WIDTYPE(obj, widtype);
1659 Widget_Data *wd = elm_widget_data_get(obj);
1660 if (!wd || !wd->entry) return;
1662 elm_entry_input_panel_layout_set(wd->entry, layout);
1666 * Set whether scrolled entry should support auto capitalization
1668 * @param obj The entry object
1669 * @param on If true, scrolled entry suports auto capitalization.
1671 * @ingroup Scrolled_Entry
1674 elm_scrolled_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool autocap)
1676 ELM_CHECK_WIDTYPE(obj, widtype);
1677 Widget_Data *wd = elm_widget_data_get(obj);
1678 if (!wd || !wd->entry) return;
1680 elm_entry_autocapitalization_set(wd->entry, autocap);
1684 * Set whether scrolled entry should support auto period
1686 * @param obj The entry object
1687 * @param on If true, scrolled entry suports auto period.
1689 * @ingroup Scrolled_Entry
1692 elm_scrolled_entry_autoperiod_set(Evas_Object *obj, Eina_Bool autoperiod)
1694 ELM_CHECK_WIDTYPE(obj, widtype);
1695 Widget_Data *wd = elm_widget_data_get(obj);
1696 if (!wd || !wd->entry) return;
1698 elm_entry_autoperiod_set(wd->entry, autoperiod);