1 #include <Elementary.h>
5 * @defgroup Scrolled_Entry Scrolled_Entry
8 * A scrolled entry is a convenience widget which shows
9 * a box that the user can enter text into. Unlike an
10 * @ref Entry widget, scrolled entries scroll with user
11 * input so that the window will not expand if the length
12 * of text inside the entry exceeds the initial size of the
15 * 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;
38 Evas_Object *scroller;
40 Elm_Scroller_Policy policy_h, policy_v;
41 Eina_Bool single_line : 1;
44 static const char *widtype = NULL;
46 static const char SIG_CHANGED[] = "changed";
47 static const char SIG_ACTIVATED[] = "activated";
48 static const char SIG_PRESS[] = "press";
49 static const char SIG_LONGPRESSED[] = "longpressed";
50 static const char SIG_CLICKED[] = "clicked";
51 static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
52 static const char SIG_FOCUSED[] = "focused";
53 static const char SIG_UNFOCUSED[] = "unfocused";
54 static const char SIG_SELECTION_PASTE[] = "selection,paste";
55 static const char SIG_SELECTION_COPY[] = "selection,copy";
56 static const char SIG_SELECTION_CUT[] = "selection,cut";
57 static const char SIG_SELECTION_START[] = "selection,start";
58 static const char SIG_SELECTION_CHANGED[] = "selection,changed";
59 static const char SIG_SELECTION_CLEARED[] = "selection,cleared";
60 static const char SIG_CURSOR_CHANGED[] = "cursor,changed";
61 static const char SIG_ANCHOR_CLICKED[] = "anchor,clicked";
62 static const Evas_Smart_Cb_Description _signals[] = {
66 {SIG_LONGPRESSED, ""},
68 {SIG_CLICKED_DOUBLE, ""},
71 {SIG_SELECTION_PASTE, ""},
72 {SIG_SELECTION_COPY, ""},
73 {SIG_SELECTION_CUT, ""},
74 {SIG_SELECTION_START, ""},
75 {SIG_SELECTION_CHANGED, ""},
76 {SIG_SELECTION_CLEARED, ""},
77 {SIG_CURSOR_CHANGED, ""},
78 {SIG_ANCHOR_CLICKED, ""},
83 _del_hook(Evas_Object *obj)
85 Widget_Data *wd = elm_widget_data_get(obj);
91 _theme_hook(Evas_Object *obj)
93 Widget_Data *wd = elm_widget_data_get(obj);
95 elm_object_style_set(wd->entry, elm_widget_style_get(obj));
96 elm_object_style_set(wd->scroller, elm_widget_style_get(obj));
100 _sizing_eval(Evas_Object *obj)
102 Widget_Data *wd = elm_widget_data_get(obj);
103 Evas_Coord minw, minh;
105 evas_object_size_hint_min_get(wd->scroller, &minw, &minh);
106 evas_object_size_hint_min_set(obj, minw, minh);
108 evas_object_size_hint_max_set(obj, -1, minh);
110 evas_object_size_hint_max_set(obj, -1, -1);
114 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
116 Widget_Data *wd = elm_widget_data_get(obj);
118 if (elm_widget_focus_get(obj))
119 elm_widget_focus_steal(wd->entry);
123 _disable_hook(Evas_Object *obj)
125 Widget_Data *wd = elm_widget_data_get(obj);
127 elm_object_disabled_set(wd->entry, elm_widget_disabled_get(obj));
131 _entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
134 evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
138 _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
140 evas_object_smart_callback_call(data, SIG_ACTIVATED, NULL);
144 _entry_press(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
146 evas_object_smart_callback_call(data, SIG_PRESS, NULL);
150 _entry_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
152 evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
156 _entry_clicked_double(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
158 evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL);
162 _entry_cursor_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
164 evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, NULL);
168 _entry_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
170 evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, NULL);
174 _entry_selection_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
176 evas_object_smart_callback_call(data, SIG_SELECTION_START, NULL);
180 _entry_selection_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
182 evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, NULL);
186 _entry_selection_cleared(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
188 evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, NULL);
192 _entry_selection_paste(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
194 evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, NULL);
198 _entry_selection_copy(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
200 evas_object_smart_callback_call(data, SIG_SELECTION_COPY, NULL);
204 _entry_selection_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
206 evas_object_smart_callback_call(data, SIG_SELECTION_CUT, NULL);
210 _entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
212 evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL);
216 _entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
218 evas_object_smart_callback_call(data, SIG_FOCUSED, NULL);
222 _entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
224 evas_object_smart_callback_call(data, SIG_UNFOCUSED, NULL);
229 * This adds a scrolled entry to @p parent object.
231 * @param parent The parent object
232 * @return The new object or NULL if it cannot be created
234 * @ingroup Scrolled_Entry
237 elm_scrolled_entry_add(Evas_Object *parent)
243 wd = ELM_NEW(Widget_Data);
244 e = evas_object_evas_get(parent);
245 obj = elm_widget_add(e);
246 ELM_SET_WIDTYPE(widtype, "scrolled_entry");
247 elm_widget_type_set(obj, "scrolled_entry");
248 elm_widget_sub_object_add(parent, obj);
249 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
250 elm_widget_data_set(obj, wd);
251 elm_widget_del_hook_set(obj, _del_hook);
252 elm_widget_disable_hook_set(obj, _disable_hook);
253 elm_widget_can_focus_set(obj, 1);
254 elm_widget_theme_hook_set(obj, _theme_hook);
256 wd->scroller = elm_scroller_add(parent);
257 elm_widget_resize_object_set(obj, wd->scroller);
258 elm_scroller_bounce_set(wd->scroller, 0, 0);
260 wd->entry = elm_entry_add(parent);
261 evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
262 evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
263 elm_scroller_content_set(wd->scroller, wd->entry);
264 evas_object_show(wd->entry);
266 evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj);
267 evas_object_smart_callback_add(wd->entry, "activated", _entry_activated, obj);
268 evas_object_smart_callback_add(wd->entry, "press", _entry_press, obj);
269 evas_object_smart_callback_add(wd->entry, "clicked", _entry_clicked, obj);
270 evas_object_smart_callback_add(wd->entry, "clicked,double", _entry_clicked_double, obj);
271 evas_object_smart_callback_add(wd->entry, "cursor,changed", _entry_cursor_changed, obj);
272 evas_object_smart_callback_add(wd->entry, "anchor,clicked", _entry_anchor_clicked, obj);
273 evas_object_smart_callback_add(wd->entry, "selection,start", _entry_selection_start, obj);
274 evas_object_smart_callback_add(wd->entry, "selection,changed", _entry_selection_changed, obj);
275 evas_object_smart_callback_add(wd->entry, "selection,cleared", _entry_selection_cleared, obj);
276 evas_object_smart_callback_add(wd->entry, "selection,paste", _entry_selection_paste, obj);
277 evas_object_smart_callback_add(wd->entry, "selection,copy", _entry_selection_copy, obj);
278 evas_object_smart_callback_add(wd->entry, "selection,cut", _entry_selection_cut, obj);
279 evas_object_smart_callback_add(wd->entry, "longpressed", _entry_longpressed, obj);
280 evas_object_smart_callback_add(wd->entry, "focused", _entry_focused, obj);
281 evas_object_smart_callback_add(wd->entry, "unfocused", _entry_unfocused, obj);
285 // TODO: convert Elementary to subclassing of Evas_Smart_Class
286 // TODO: and save some bytes, making descriptions per-class and not instance!
287 evas_object_smart_callbacks_descriptions_set(obj, _signals);
292 * This sets the scrolled entry object not to line wrap. All input will
293 * be on a single line, and the entry box will scroll with user input.
295 * @param obj The scrolled entry object
296 * @param single_line If true, the text in the scrolled entry
297 * will be on a single line.
299 * @ingroup Scrolled_Entry
302 elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
304 ELM_CHECK_WIDTYPE(obj, widtype);
305 Widget_Data *wd = elm_widget_data_get(obj);
307 if (wd->single_line == single_line) return;
308 elm_entry_single_line_set(wd->entry, single_line);
309 wd->single_line = single_line;
312 elm_scroller_policy_set(wd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
313 elm_scroller_content_min_limit(wd->scroller, 0, 1);
317 elm_scroller_policy_set(wd->scroller, wd->policy_h, wd->policy_v);
318 elm_scroller_content_min_limit(wd->scroller, 0, 0);
324 * This returns true if the scrolled entry has been set to single line mode.
325 * See also elm_scrolled_entry_single_line_set().
327 * @param obj The scrolled entry object
328 * @return single_line If true, the text in the scrolled entry is set to display
331 * @ingroup Scrolled_Entry
334 elm_scrolled_entry_single_line_get(const Evas_Object *obj)
336 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
337 Widget_Data *wd = elm_widget_data_get(obj);
338 if (!wd) return EINA_FALSE;
339 return elm_entry_single_line_get(wd->entry);
344 * This sets the scrolled entry object to password mode. All text entered
345 * and/or displayed within the widget will be replaced with asterisks (*).
347 * @param obj The scrolled entry object
348 * @param password If true, password mode is enabled.
350 * @ingroup Scrolled_Entry
353 elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password)
355 ELM_CHECK_WIDTYPE(obj, widtype);
356 Widget_Data *wd = elm_widget_data_get(obj);
358 elm_entry_password_set(wd->entry, password);
362 * This returns whether password mode is enabled.
363 * See also elm_scrolled_entry_password_set().
365 * @param obj The scrolled entry object
366 * @return If true, the scrolled entry is set to display all characters
369 * @ingroup Scrolled_Entry
372 elm_scrolled_entry_password_get(const Evas_Object *obj)
374 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
375 Widget_Data *wd = elm_widget_data_get(obj);
376 if (!wd) return EINA_FALSE;
377 return elm_entry_password_get(wd->entry);
382 * This sets the text displayed within the scrolled entry to @p entry.
384 * @param obj The scrolled entry object
385 * @param entry The text to be displayed
387 * @ingroup Scrolled_Entry
390 elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry)
392 ELM_CHECK_WIDTYPE(obj, widtype);
393 Widget_Data *wd = elm_widget_data_get(obj);
395 elm_entry_entry_set(wd->entry, entry);
399 * This returns the text currently shown in object @p entry.
400 * See also elm_scrolled_entry_entry_set().
402 * @param obj The scrolled entry object
403 * @return The currently displayed text or NULL on failure
405 * @ingroup Scrolled_Entry
408 elm_scrolled_entry_entry_get(const Evas_Object *obj)
410 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
411 Widget_Data *wd = elm_widget_data_get(obj);
412 if (!wd) return NULL;
413 return elm_entry_entry_get(wd->entry);
417 * This returns all selected text within the scrolled entry.
419 * @param obj The scrolled entry object
420 * @return The selected text within the scrolled entry or NULL on failure
422 * @ingroup Scrolled_Entry
425 elm_scrolled_entry_selection_get(const Evas_Object *obj)
427 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
428 Widget_Data *wd = elm_widget_data_get(obj);
429 if (!wd) return NULL;
430 return elm_entry_selection_get(wd->entry);
434 * This inserts text in @p entry at the beginning of the scrolled entry
437 * @param obj The scrolled entry object
438 * @param entry The text to insert
440 * @ingroup Scrolled_Entry
443 elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry)
445 ELM_CHECK_WIDTYPE(obj, widtype);
446 Widget_Data *wd = elm_widget_data_get(obj);
448 elm_entry_entry_insert(wd->entry, entry);
452 * This enables word line wrapping in the scrolled entry object. It is the opposite
453 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
454 * character line wrapping.
455 * See also elm_scrolled_entry_line_char_wrap_set().
457 * @param obj The scrolled entry object
458 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
459 * of the object. Wrapping will occur at the end of the word before the end of the
462 * @ingroup Scrolled_Entry
465 elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap)
467 ELM_CHECK_WIDTYPE(obj, widtype);
468 Widget_Data *wd = elm_widget_data_get(obj);
470 elm_entry_line_wrap_set(wd->entry, wrap);
474 * This enables character line wrapping in the scrolled entry object. It is the opposite
475 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
476 * word line wrapping.
477 * See also elm_scrolled_entry_line_wrap_set().
479 * @param obj The scrolled entry object
480 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
481 * of the object. Wrapping will occur immediately upon reaching the end of the object.
483 * @ingroup Scrolled_Entry
486 elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap)
488 ELM_CHECK_WIDTYPE(obj, widtype);
489 Widget_Data *wd = elm_widget_data_get(obj);
491 elm_entry_line_char_wrap_set(wd->entry, wrap);
495 * This sets the editable attribute of the scrolled entry.
497 * @param obj The scrolled entry object
498 * @param editable If true, the scrolled entry will be editable by the user.
499 * If false, it will be set to the disabled state.
501 * @ingroup Scrolled_Entry
504 elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable)
506 ELM_CHECK_WIDTYPE(obj, widtype);
507 Widget_Data *wd = elm_widget_data_get(obj);
509 elm_entry_editable_set(wd->entry, editable);
513 * This gets the editable attribute of the scrolled entry.
514 * See also elm_scrolled_entry_editable_set().
516 * @param obj The scrolled entry object
517 * @return If true, the scrolled entry is editable by the user.
518 * If false, it is not editable by the user
520 * @ingroup Scrolled_Entry
523 elm_scrolled_entry_editable_get(const Evas_Object *obj)
525 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
526 Widget_Data *wd = elm_widget_data_get(obj);
527 if (!wd) return EINA_FALSE;
528 return elm_entry_editable_get(wd->entry);
533 * This drops any existing text selection within the scrolled entry.
535 * @param obj The scrolled entry object
537 * @ingroup Scrolled_Entry
540 elm_scrolled_entry_select_none(Evas_Object *obj)
542 ELM_CHECK_WIDTYPE(obj, widtype);
543 Widget_Data *wd = elm_widget_data_get(obj);
545 elm_entry_select_none(wd->entry);
549 * This selects all text within the scrolled entry.
551 * @param obj The scrolled entry object
553 * @ingroup Scrolled_Entry
556 elm_scrolled_entry_select_all(Evas_Object *obj)
558 ELM_CHECK_WIDTYPE(obj, widtype);
559 Widget_Data *wd = elm_widget_data_get(obj);
561 elm_entry_select_all(wd->entry);
565 * This moves the cursor one place to the right within the entry.
567 * @param obj The scrolled entry object
568 * @return EINA_TRUE upon success, EINA_FALSE upon failure
570 * @ingroup Scrolled_Entry
573 elm_scrolled_entry_cursor_next(Evas_Object *obj)
575 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
576 Widget_Data *wd = elm_widget_data_get(obj);
577 if (!wd) return EINA_FALSE;
578 return elm_entry_cursor_next(wd->entry);
582 * This moves the cursor one place to the left within the entry.
584 * @param obj The scrolled entry object
585 * @return EINA_TRUE upon success, EINA_FALSE upon failure
587 * @ingroup Scrolled_Entry
590 elm_scrolled_entry_cursor_prev(Evas_Object *obj)
592 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
593 Widget_Data *wd = elm_widget_data_get(obj);
594 if (!wd) return EINA_FALSE;
595 return elm_entry_cursor_prev(wd->entry);
599 * This moves the cursor one line up within the entry.
601 * @param obj The scrolled entry object
602 * @return EINA_TRUE upon success, EINA_FALSE upon failure
604 * @ingroup Scrolled_Entry
607 elm_scrolled_entry_cursor_up(Evas_Object *obj)
609 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
610 Widget_Data *wd = elm_widget_data_get(obj);
611 if (!wd) return EINA_FALSE;
612 return elm_entry_cursor_up(wd->entry);
616 * This moves the cursor one line down within the entry.
618 * @param obj The scrolled entry object
619 * @return EINA_TRUE upon success, EINA_FALSE upon failure
621 * @ingroup Scrolled_Entry
624 elm_scrolled_entry_cursor_down(Evas_Object *obj)
626 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
627 Widget_Data *wd = elm_widget_data_get(obj);
628 if (!wd) return EINA_FALSE;
629 return elm_entry_cursor_down(wd->entry);
633 * This moves the cursor to the beginning of the entry.
635 * @param obj The scrolled entry object
637 * @ingroup Scrolled_Entry
640 elm_scrolled_entry_cursor_begin_set(Evas_Object *obj)
642 ELM_CHECK_WIDTYPE(obj, widtype);
643 Widget_Data *wd = elm_widget_data_get(obj);
645 elm_entry_cursor_begin_set(wd->entry);
649 * This moves the cursor to the end of the entry.
651 * @param obj The scrolled entry object
653 * @ingroup Scrolled_Entry
656 elm_scrolled_entry_cursor_end_set(Evas_Object *obj)
658 ELM_CHECK_WIDTYPE(obj, widtype);
659 Widget_Data *wd = elm_widget_data_get(obj);
661 elm_entry_cursor_end_set(wd->entry);
665 * This moves the cursor to the beginning of the current line.
667 * @param obj The scrolled entry object
669 * @ingroup Scrolled_Entry
672 elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj)
674 ELM_CHECK_WIDTYPE(obj, widtype);
675 Widget_Data *wd = elm_widget_data_get(obj);
677 elm_entry_cursor_line_begin_set(wd->entry);
681 * This moves the cursor to the end of the current line.
683 * @param obj The scrolled entry object
685 * @ingroup Scrolled_Entry
688 elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj)
690 ELM_CHECK_WIDTYPE(obj, widtype);
691 Widget_Data *wd = elm_widget_data_get(obj);
693 elm_entry_cursor_line_end_set(wd->entry);
697 * This begins a selection within the scrolled entry as though
698 * the user were holding down the mouse button to make a selection.
700 * @param obj The scrolled entry object
702 * @ingroup Scrolled_Entry
705 elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj)
707 ELM_CHECK_WIDTYPE(obj, widtype);
708 Widget_Data *wd = elm_widget_data_get(obj);
710 elm_entry_cursor_selection_begin(wd->entry);
714 * This ends a selection within the scrolled entry as though
715 * the user had just released the mouse button while making a selection.
717 * @param obj The scrolled entry object
719 * @ingroup Scrolled_Entry
722 elm_scrolled_entry_cursor_selection_end(Evas_Object *obj)
724 ELM_CHECK_WIDTYPE(obj, widtype);
725 Widget_Data *wd = elm_widget_data_get(obj);
727 elm_entry_cursor_selection_end(wd->entry);
733 * @param obj The scrolled entry object
734 * @return TODO: fill this in
736 * @ingroup Scrolled_Entry
739 elm_scrolled_entry_cursor_is_format_get(const Evas_Object *obj)
741 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
742 Widget_Data *wd = elm_widget_data_get(obj);
743 if (!wd) return EINA_FALSE;
744 return elm_entry_cursor_is_format_get(wd->entry);
748 * This returns whether the cursor is visible.
750 * @param obj The scrolled entry object
751 * @return If true, the cursor is visible.
753 * @ingroup Scrolled_Entry
756 elm_scrolled_entry_cursor_is_visible_format_get(const Evas_Object *obj)
758 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
759 Widget_Data *wd = elm_widget_data_get(obj);
760 if (!wd) return EINA_FALSE;
761 return elm_entry_cursor_is_visible_format_get(wd->entry);
767 * @param obj The scrolled entry object
768 * @return TODO: fill this in
770 * @ingroup Scrolled_Entry
773 elm_scrolled_entry_cursor_content_get(const Evas_Object *obj)
775 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
776 Widget_Data *wd = elm_widget_data_get(obj);
777 if (!wd) return NULL;
778 return elm_entry_cursor_content_get(wd->entry);
782 * This executes a "cut" action on the selected text in the scrolled entry.
784 * @param obj The scrolled entry object
786 * @ingroup Scrolled_Entry
789 elm_scrolled_entry_selection_cut(Evas_Object *obj)
791 ELM_CHECK_WIDTYPE(obj, widtype);
792 Widget_Data *wd = elm_widget_data_get(obj);
794 elm_entry_selection_cut(wd->entry);
798 * This executes a "copy" action on the selected text in the scrolled entry.
800 * @param obj The scrolled entry object
802 * @ingroup Scrolled_Entry
805 elm_scrolled_entry_selection_copy(Evas_Object *obj)
807 ELM_CHECK_WIDTYPE(obj, widtype);
808 Widget_Data *wd = elm_widget_data_get(obj);
810 elm_entry_selection_copy(wd->entry);
814 * This executes a "paste" action in the scrolled entry.
816 * @param obj The scrolled entry object
818 * @ingroup Scrolled_Entry
821 elm_scrolled_entry_selection_paste(Evas_Object *obj)
823 ELM_CHECK_WIDTYPE(obj, widtype);
824 Widget_Data *wd = elm_widget_data_get(obj);
826 elm_entry_selection_paste(wd->entry);
830 * This clears and frees the items in a scrolled entry's contextual (right click) menu.
832 * @param obj The scrolled entry object
834 * @ingroup Scrolled_Entry
837 elm_scrolled_entry_context_menu_clear(Evas_Object *obj)
839 ELM_CHECK_WIDTYPE(obj, widtype);
840 Widget_Data *wd = elm_widget_data_get(obj);
842 elm_entry_context_menu_clear(wd->entry);
846 * This adds an item to the scrolled entry's contextual menu.
848 * @param obj The scrolled entry object
849 * @param label The item's text label
850 * @param icon_file The item's icon file
851 * @param icon_type The item's icon type
852 * @param func The callback to execute when the item is clicked
853 * @param data The data to associate with the item for related functions
855 * @ingroup Scrolled_Entry
858 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)
860 ELM_CHECK_WIDTYPE(obj, widtype);
861 Widget_Data *wd = elm_widget_data_get(obj);
863 elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, func, data);
867 * This disables the scrolled entry's contextual (right click) menu.
869 * @param obj The scrolled entry object
870 * @param disabled If true, the menu is disabled
872 * @ingroup Scrolled_Entry
875 elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
877 ELM_CHECK_WIDTYPE(obj, widtype);
878 Widget_Data *wd = elm_widget_data_get(obj);
880 elm_entry_context_menu_disabled_set(wd->entry, disabled);
884 * This returns whether the scrolled entry's contextual (right click) menu is disabled.
886 * @param obj The scrolled entry object
887 * @return If true, the menu is disabled
889 * @ingroup Scrolled_Entry
892 elm_scrolled_entry_context_menu_disabled_get(const Evas_Object *obj)
894 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
895 Widget_Data *wd = elm_widget_data_get(obj);
896 if (!wd) return EINA_FALSE;
897 return elm_entry_context_menu_disabled_get(wd->entry);
901 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling them).
903 * @param obj The scrolled entry object
904 * @param h The horizontal scrollbar policy to apply
905 * @param v The vertical scrollbar policy to apply
907 * @ingroup Scrolled_Entry
910 elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v)
912 ELM_CHECK_WIDTYPE(obj, widtype);
913 Widget_Data *wd = elm_widget_data_get(obj);
917 elm_scroller_policy_set(wd->scroller, h, v);
921 * This enables/disables bouncing within the entry.
923 * @param obj The scrolled entry object
924 * @param h The horizontal bounce state
925 * @param v The vertical bounce state
927 * @ingroup Scrolled_Entry
930 elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
932 ELM_CHECK_WIDTYPE(obj, widtype);
933 Widget_Data *wd = elm_widget_data_get(obj);
935 elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce);
938 * This set's the maximum bytes that can be added in to scrolled entry.
940 * @param obj The scrolled entry object
941 * @param max_no_of_bytes Maximum number of bytes scrolled entry can have.
943 * @ingroup Scrolled_Entry
946 elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes)
948 ELM_CHECK_WIDTYPE(obj, widtype);
949 Widget_Data *wd = elm_widget_data_get(obj);
951 elm_entry_maximum_bytes_set(wd->entry,max_no_of_bytes);
955 * This set's the scrolled entry in password mode with out masking the last character entered by user,
956 * and later masking the character after 2 seconds.
958 * @param obj The scrolled entry object
959 * @param show_last_character The show_last_character flag (1 for "password mode along with showing last character"
962 * @ingroup Scrolled_Entry
965 elm_scrolled_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character)
967 ELM_CHECK_WIDTYPE(obj, widtype);
968 Widget_Data *wd = elm_widget_data_get(obj);
970 elm_entry_password_show_last_character_set(wd->entry, show_last_character);
973 EAPI Ecore_IMF_Context *elm_scrolled_entry_imf_context_get(Evas_Object *obj)
975 ELM_CHECK_WIDTYPE(obj, widtype);
976 Widget_Data *wd = elm_widget_data_get(obj);
977 if (!wd || !wd->entry) return NULL;
979 return elm_entry_imf_context_get(wd->entry);
983 * enable to show the input panel automatically.
985 * @param obj The scrolled entry object
986 * @param enabled If true, the input panel is enabled
991 elm_scrolled_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
993 ELM_CHECK_WIDTYPE(obj, widtype);
994 Widget_Data *wd = elm_widget_data_get(obj);
995 if (!wd || !wd->entry) return;
997 elm_entry_input_panel_enabled_set(wd->entry, enabled);
1001 * Set the input panel layout of the scrolled entry
1003 * @param obj The scrolled entry object
1004 * @param layout the layout to set
1009 elm_scrolled_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout)
1011 ELM_CHECK_WIDTYPE(obj, widtype);
1012 Widget_Data *wd = elm_widget_data_get(obj);
1013 if (!wd || !wd->entry) return;
1015 elm_entry_input_panel_layout_set(wd->entry, layout);