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;
37 Evas_Object *scroller;
39 Elm_Scroller_Policy policy_h, policy_v;
40 Eina_Bool single_line : 1;
43 static const char *widtype = NULL;
45 static const char SIG_CHANGED[] = "changed";
46 static const char SIG_ACTIVATED[] = "activated";
47 static const char SIG_PRESS[] = "press";
48 static const char SIG_LONGPRESSED[] = "longpressed";
49 static const char SIG_CLICKED[] = "clicked";
50 static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
51 static const char SIG_FOCUSED[] = "focused";
52 static const char SIG_UNFOCUSED[] = "unfocused";
53 static const char SIG_SELECTION_PASTE[] = "selection,paste";
54 static const char SIG_SELECTION_COPY[] = "selection,copy";
55 static const char SIG_SELECTION_CUT[] = "selection,cut";
56 static const char SIG_SELECTION_START[] = "selection,start";
57 static const char SIG_SELECTION_CHANGED[] = "selection,changed";
58 static const char SIG_SELECTION_CLEARED[] = "selection,cleared";
59 static const char SIG_CURSOR_CHANGED[] = "cursor,changed";
60 static const char SIG_ANCHOR_CLICKED[] = "anchor,clicked";
61 static const Evas_Smart_Cb_Description _signals[] = {
65 {SIG_LONGPRESSED, ""},
67 {SIG_CLICKED_DOUBLE, ""},
70 {SIG_SELECTION_PASTE, ""},
71 {SIG_SELECTION_COPY, ""},
72 {SIG_SELECTION_CUT, ""},
73 {SIG_SELECTION_START, ""},
74 {SIG_SELECTION_CHANGED, ""},
75 {SIG_SELECTION_CLEARED, ""},
76 {SIG_CURSOR_CHANGED, ""},
77 {SIG_ANCHOR_CLICKED, ""},
82 _del_hook(Evas_Object *obj)
84 Widget_Data *wd = elm_widget_data_get(obj);
90 _theme_hook(Evas_Object *obj)
92 Widget_Data *wd = elm_widget_data_get(obj);
94 elm_object_style_set(wd->entry, elm_widget_style_get(obj));
95 elm_object_style_set(wd->scroller, elm_widget_style_get(obj));
99 _sizing_eval(Evas_Object *obj)
101 Widget_Data *wd = elm_widget_data_get(obj);
102 Evas_Coord minw, minh;
104 evas_object_size_hint_min_get(wd->scroller, &minw, &minh);
105 evas_object_size_hint_min_set(obj, minw, minh);
107 evas_object_size_hint_max_set(obj, -1, minh);
109 evas_object_size_hint_max_set(obj, -1, -1);
113 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
115 Widget_Data *wd = elm_widget_data_get(obj);
117 if (elm_widget_focus_get(obj))
118 elm_widget_focus_steal(wd->entry);
122 _disable_hook(Evas_Object *obj)
124 Widget_Data *wd = elm_widget_data_get(obj);
126 elm_object_disabled_set(wd->entry, elm_widget_disabled_get(obj));
130 _entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
133 evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
137 _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
139 evas_object_smart_callback_call(data, SIG_ACTIVATED, NULL);
143 _entry_press(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
145 evas_object_smart_callback_call(data, SIG_PRESS, NULL);
149 _entry_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
151 evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
155 _entry_clicked_double(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
157 evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL);
161 _entry_cursor_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
163 evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, NULL);
167 _entry_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
169 evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, NULL);
173 _entry_selection_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
175 evas_object_smart_callback_call(data, SIG_SELECTION_START, NULL);
179 _entry_selection_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
181 evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, NULL);
185 _entry_selection_cleared(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
187 evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, NULL);
191 _entry_selection_paste(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
193 evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, NULL);
197 _entry_selection_copy(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
199 evas_object_smart_callback_call(data, SIG_SELECTION_COPY, NULL);
203 _entry_selection_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
205 evas_object_smart_callback_call(data, SIG_SELECTION_CUT, NULL);
209 _entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
211 evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL);
215 _entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
217 evas_object_smart_callback_call(data, SIG_FOCUSED, NULL);
221 _entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
223 evas_object_smart_callback_call(data, SIG_UNFOCUSED, NULL);
228 * This adds a scrolled entry to @p parent object.
230 * @param parent The parent object
231 * @return The new object or NULL if it cannot be created
233 * @ingroup Scrolled_Entry
236 elm_scrolled_entry_add(Evas_Object *parent)
242 wd = ELM_NEW(Widget_Data);
243 e = evas_object_evas_get(parent);
244 obj = elm_widget_add(e);
245 ELM_SET_WIDTYPE(widtype, "scrolled_entry");
246 elm_widget_type_set(obj, "scrolled_entry");
247 elm_widget_sub_object_add(parent, obj);
248 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
249 elm_widget_data_set(obj, wd);
250 elm_widget_del_hook_set(obj, _del_hook);
251 elm_widget_disable_hook_set(obj, _disable_hook);
252 elm_widget_can_focus_set(obj, 1);
253 elm_widget_theme_hook_set(obj, _theme_hook);
255 wd->scroller = elm_scroller_add(parent);
256 elm_widget_resize_object_set(obj, wd->scroller);
257 elm_scroller_bounce_set(wd->scroller, 0, 0);
259 wd->entry = elm_entry_add(parent);
260 evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
261 evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
262 elm_scroller_content_set(wd->scroller, wd->entry);
263 evas_object_show(wd->entry);
265 evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj);
266 evas_object_smart_callback_add(wd->entry, "activated", _entry_activated, obj);
267 evas_object_smart_callback_add(wd->entry, "press", _entry_press, obj);
268 evas_object_smart_callback_add(wd->entry, "clicked", _entry_clicked, obj);
269 evas_object_smart_callback_add(wd->entry, "clicked,double", _entry_clicked_double, obj);
270 evas_object_smart_callback_add(wd->entry, "cursor,changed", _entry_cursor_changed, obj);
271 evas_object_smart_callback_add(wd->entry, "anchor,clicked", _entry_anchor_clicked, obj);
272 evas_object_smart_callback_add(wd->entry, "selection,start", _entry_selection_start, obj);
273 evas_object_smart_callback_add(wd->entry, "selection,changed", _entry_selection_changed, obj);
274 evas_object_smart_callback_add(wd->entry, "selection,cleared", _entry_selection_cleared, obj);
275 evas_object_smart_callback_add(wd->entry, "selection,paste", _entry_selection_paste, obj);
276 evas_object_smart_callback_add(wd->entry, "selection,copy", _entry_selection_copy, obj);
277 evas_object_smart_callback_add(wd->entry, "selection,cut", _entry_selection_cut, obj);
278 evas_object_smart_callback_add(wd->entry, "longpressed", _entry_longpressed, obj);
279 evas_object_smart_callback_add(wd->entry, "focused", _entry_focused, obj);
280 evas_object_smart_callback_add(wd->entry, "unfocused", _entry_unfocused, obj);
284 // TODO: convert Elementary to subclassing of Evas_Smart_Class
285 // TODO: and save some bytes, making descriptions per-class and not instance!
286 evas_object_smart_callbacks_descriptions_set(obj, _signals);
291 * This sets the scrolled entry object not to line wrap. All input will
292 * be on a single line, and the entry box will scroll with user input.
294 * @param obj The scrolled entry object
295 * @param single_line If true, the text in the scrolled entry
296 * will be on a single line.
298 * @ingroup Scrolled_Entry
301 elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
303 ELM_CHECK_WIDTYPE(obj, widtype);
304 Widget_Data *wd = elm_widget_data_get(obj);
306 if (wd->single_line == single_line) return;
307 elm_entry_single_line_set(wd->entry, single_line);
308 wd->single_line = single_line;
311 elm_scroller_policy_set(wd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
312 elm_scroller_content_min_limit(wd->scroller, 0, 1);
316 elm_scroller_policy_set(wd->scroller, wd->policy_h, wd->policy_v);
317 elm_scroller_content_min_limit(wd->scroller, 0, 0);
323 * This returns true if the scrolled entry has been set to single line mode.
324 * See also elm_scrolled_entry_single_line_set().
326 * @param obj The scrolled entry object
327 * @return single_line If true, the text in the scrolled entry is set to display
330 * @ingroup Scrolled_Entry
333 elm_scrolled_entry_single_line_get(const Evas_Object *obj)
335 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
336 Widget_Data *wd = elm_widget_data_get(obj);
337 if (!wd) return EINA_FALSE;
338 return elm_entry_single_line_get(wd->entry);
343 * This sets the scrolled entry object to password mode. All text entered
344 * and/or displayed within the widget will be replaced with asterisks (*).
346 * @param obj The scrolled entry object
347 * @param password If true, password mode is enabled.
349 * @ingroup Scrolled_Entry
352 elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password)
354 ELM_CHECK_WIDTYPE(obj, widtype);
355 Widget_Data *wd = elm_widget_data_get(obj);
357 elm_entry_password_set(wd->entry, password);
361 * This returns whether password mode is enabled.
362 * See also elm_scrolled_entry_password_set().
364 * @param obj The scrolled entry object
365 * @return If true, the scrolled entry is set to display all characters
368 * @ingroup Scrolled_Entry
371 elm_scrolled_entry_password_get(const Evas_Object *obj)
373 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
374 Widget_Data *wd = elm_widget_data_get(obj);
375 if (!wd) return EINA_FALSE;
376 return elm_entry_password_get(wd->entry);
381 * This sets the text displayed within the scrolled entry to @p entry.
383 * @param obj The scrolled entry object
384 * @param entry The text to be displayed
386 * @ingroup Scrolled_Entry
389 elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry)
391 ELM_CHECK_WIDTYPE(obj, widtype);
392 Widget_Data *wd = elm_widget_data_get(obj);
394 elm_entry_entry_set(wd->entry, entry);
398 * This returns the text currently shown in object @p entry.
399 * See also elm_scrolled_entry_entry_set().
401 * @param obj The scrolled entry object
402 * @return The currently displayed text or NULL on failure
404 * @ingroup Scrolled_Entry
407 elm_scrolled_entry_entry_get(const Evas_Object *obj)
409 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
410 Widget_Data *wd = elm_widget_data_get(obj);
411 if (!wd) return NULL;
412 return elm_entry_entry_get(wd->entry);
416 * This returns all selected text within the scrolled entry.
418 * @param obj The scrolled entry object
419 * @return The selected text within the scrolled entry or NULL on failure
421 * @ingroup Scrolled_Entry
424 elm_scrolled_entry_selection_get(const Evas_Object *obj)
426 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
427 Widget_Data *wd = elm_widget_data_get(obj);
428 if (!wd) return NULL;
429 return elm_entry_selection_get(wd->entry);
433 * This inserts text in @p entry at the beginning of the scrolled entry
436 * @param obj The scrolled entry object
437 * @param entry The text to insert
439 * @ingroup Scrolled_Entry
442 elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry)
444 ELM_CHECK_WIDTYPE(obj, widtype);
445 Widget_Data *wd = elm_widget_data_get(obj);
447 elm_entry_entry_insert(wd->entry, entry);
451 * This enables word line wrapping in the scrolled entry object. It is the opposite
452 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
453 * character line wrapping.
454 * See also elm_scrolled_entry_line_char_wrap_set().
456 * @param obj The scrolled entry object
457 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
458 * of the object. Wrapping will occur at the end of the word before the end of the
461 * @ingroup Scrolled_Entry
464 elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap)
466 ELM_CHECK_WIDTYPE(obj, widtype);
467 Widget_Data *wd = elm_widget_data_get(obj);
469 elm_entry_line_wrap_set(wd->entry, wrap);
473 * This enables character line wrapping in the scrolled entry object. It is the opposite
474 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
475 * word line wrapping.
476 * See also elm_scrolled_entry_line_wrap_set().
478 * @param obj The scrolled entry object
479 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
480 * of the object. Wrapping will occur immediately upon reaching the end of the object.
482 * @ingroup Scrolled_Entry
485 elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap)
487 ELM_CHECK_WIDTYPE(obj, widtype);
488 Widget_Data *wd = elm_widget_data_get(obj);
490 elm_entry_line_char_wrap_set(wd->entry, wrap);
494 * This sets the editable attribute of the scrolled entry.
496 * @param obj The scrolled entry object
497 * @param editable If true, the scrolled entry will be editable by the user.
498 * If false, it will be set to the disabled state.
500 * @ingroup Scrolled_Entry
503 elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable)
505 ELM_CHECK_WIDTYPE(obj, widtype);
506 Widget_Data *wd = elm_widget_data_get(obj);
508 elm_entry_editable_set(wd->entry, editable);
512 * This gets the editable attribute of the scrolled entry.
513 * See also elm_scrolled_entry_editable_set().
515 * @param obj The scrolled entry object
516 * @return If true, the scrolled entry is editable by the user.
517 * If false, it is not editable by the user
519 * @ingroup Scrolled_Entry
522 elm_scrolled_entry_editable_get(const Evas_Object *obj)
524 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
525 Widget_Data *wd = elm_widget_data_get(obj);
526 if (!wd) return EINA_FALSE;
527 return elm_entry_editable_get(wd->entry);
532 * This drops any existing text selection within the scrolled entry.
534 * @param obj The scrolled entry object
536 * @ingroup Scrolled_Entry
539 elm_scrolled_entry_select_none(Evas_Object *obj)
541 ELM_CHECK_WIDTYPE(obj, widtype);
542 Widget_Data *wd = elm_widget_data_get(obj);
544 elm_entry_select_none(wd->entry);
548 * This selects all text within the scrolled entry.
550 * @param obj The scrolled entry object
552 * @ingroup Scrolled_Entry
555 elm_scrolled_entry_select_all(Evas_Object *obj)
557 ELM_CHECK_WIDTYPE(obj, widtype);
558 Widget_Data *wd = elm_widget_data_get(obj);
560 elm_entry_select_all(wd->entry);
564 * This moves the cursor one place to the right within the entry.
566 * @param obj The scrolled entry object
567 * @return EINA_TRUE upon success, EINA_FALSE upon failure
569 * @ingroup Scrolled_Entry
572 elm_scrolled_entry_cursor_next(Evas_Object *obj)
574 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
575 Widget_Data *wd = elm_widget_data_get(obj);
576 if (!wd) return EINA_FALSE;
577 return elm_entry_cursor_next(wd->entry);
581 * This moves the cursor one place to the left within the entry.
583 * @param obj The scrolled entry object
584 * @return EINA_TRUE upon success, EINA_FALSE upon failure
586 * @ingroup Scrolled_Entry
589 elm_scrolled_entry_cursor_prev(Evas_Object *obj)
591 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
592 Widget_Data *wd = elm_widget_data_get(obj);
593 if (!wd) return EINA_FALSE;
594 return elm_entry_cursor_prev(wd->entry);
598 * This moves the cursor one line up within the entry.
600 * @param obj The scrolled entry object
601 * @return EINA_TRUE upon success, EINA_FALSE upon failure
603 * @ingroup Scrolled_Entry
606 elm_scrolled_entry_cursor_up(Evas_Object *obj)
608 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
609 Widget_Data *wd = elm_widget_data_get(obj);
610 if (!wd) return EINA_FALSE;
611 return elm_entry_cursor_up(wd->entry);
615 * This moves the cursor one line down within the entry.
617 * @param obj The scrolled entry object
618 * @return EINA_TRUE upon success, EINA_FALSE upon failure
620 * @ingroup Scrolled_Entry
623 elm_scrolled_entry_cursor_down(Evas_Object *obj)
625 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
626 Widget_Data *wd = elm_widget_data_get(obj);
627 if (!wd) return EINA_FALSE;
628 return elm_entry_cursor_down(wd->entry);
632 * This moves the cursor to the beginning of the entry.
634 * @param obj The scrolled entry object
636 * @ingroup Scrolled_Entry
639 elm_scrolled_entry_cursor_begin_set(Evas_Object *obj)
641 ELM_CHECK_WIDTYPE(obj, widtype);
642 Widget_Data *wd = elm_widget_data_get(obj);
644 elm_entry_cursor_begin_set(wd->entry);
648 * This moves the cursor to the end of the entry.
650 * @param obj The scrolled entry object
652 * @ingroup Scrolled_Entry
655 elm_scrolled_entry_cursor_end_set(Evas_Object *obj)
657 ELM_CHECK_WIDTYPE(obj, widtype);
658 Widget_Data *wd = elm_widget_data_get(obj);
660 elm_entry_cursor_end_set(wd->entry);
664 * This moves the cursor to the beginning of the current line.
666 * @param obj The scrolled entry object
668 * @ingroup Scrolled_Entry
671 elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj)
673 ELM_CHECK_WIDTYPE(obj, widtype);
674 Widget_Data *wd = elm_widget_data_get(obj);
676 elm_entry_cursor_line_begin_set(wd->entry);
680 * This moves the cursor to the end of the current line.
682 * @param obj The scrolled entry object
684 * @ingroup Scrolled_Entry
687 elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj)
689 ELM_CHECK_WIDTYPE(obj, widtype);
690 Widget_Data *wd = elm_widget_data_get(obj);
692 elm_entry_cursor_line_end_set(wd->entry);
696 * This begins a selection within the scrolled entry as though
697 * the user were holding down the mouse button to make a selection.
699 * @param obj The scrolled entry object
701 * @ingroup Scrolled_Entry
704 elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj)
706 ELM_CHECK_WIDTYPE(obj, widtype);
707 Widget_Data *wd = elm_widget_data_get(obj);
709 elm_entry_cursor_selection_begin(wd->entry);
713 * This ends a selection within the scrolled entry as though
714 * the user had just released the mouse button while making a selection.
716 * @param obj The scrolled entry object
718 * @ingroup Scrolled_Entry
721 elm_scrolled_entry_cursor_selection_end(Evas_Object *obj)
723 ELM_CHECK_WIDTYPE(obj, widtype);
724 Widget_Data *wd = elm_widget_data_get(obj);
726 elm_entry_cursor_selection_end(wd->entry);
732 * @param obj The scrolled entry object
733 * @return TODO: fill this in
735 * @ingroup Scrolled_Entry
738 elm_scrolled_entry_cursor_is_format_get(const Evas_Object *obj)
740 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
741 Widget_Data *wd = elm_widget_data_get(obj);
742 if (!wd) return EINA_FALSE;
743 return elm_entry_cursor_is_format_get(wd->entry);
747 * This returns whether the cursor is visible.
749 * @param obj The scrolled entry object
750 * @return If true, the cursor is visible.
752 * @ingroup Scrolled_Entry
755 elm_scrolled_entry_cursor_is_visible_format_get(const Evas_Object *obj)
757 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
758 Widget_Data *wd = elm_widget_data_get(obj);
759 if (!wd) return EINA_FALSE;
760 return elm_entry_cursor_is_visible_format_get(wd->entry);
766 * @param obj The scrolled entry object
767 * @return TODO: fill this in
769 * @ingroup Scrolled_Entry
772 elm_scrolled_entry_cursor_content_get(const Evas_Object *obj)
774 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
775 Widget_Data *wd = elm_widget_data_get(obj);
776 if (!wd) return NULL;
777 return elm_entry_cursor_content_get(wd->entry);
781 * This executes a "cut" action on the selected text in the scrolled entry.
783 * @param obj The scrolled entry object
785 * @ingroup Scrolled_Entry
788 elm_scrolled_entry_selection_cut(Evas_Object *obj)
790 ELM_CHECK_WIDTYPE(obj, widtype);
791 Widget_Data *wd = elm_widget_data_get(obj);
793 elm_entry_selection_cut(wd->entry);
797 * This executes a "copy" action on the selected text in the scrolled entry.
799 * @param obj The scrolled entry object
801 * @ingroup Scrolled_Entry
804 elm_scrolled_entry_selection_copy(Evas_Object *obj)
806 ELM_CHECK_WIDTYPE(obj, widtype);
807 Widget_Data *wd = elm_widget_data_get(obj);
809 elm_entry_selection_copy(wd->entry);
813 * This executes a "paste" action in the scrolled entry.
815 * @param obj The scrolled entry object
817 * @ingroup Scrolled_Entry
820 elm_scrolled_entry_selection_paste(Evas_Object *obj)
822 ELM_CHECK_WIDTYPE(obj, widtype);
823 Widget_Data *wd = elm_widget_data_get(obj);
825 elm_entry_selection_paste(wd->entry);
829 * This clears and frees the items in a scrolled entry's contextual (right click) menu.
831 * @param obj The scrolled entry object
833 * @ingroup Scrolled_Entry
836 elm_scrolled_entry_context_menu_clear(Evas_Object *obj)
838 ELM_CHECK_WIDTYPE(obj, widtype);
839 Widget_Data *wd = elm_widget_data_get(obj);
841 elm_entry_context_menu_clear(wd->entry);
845 * This adds an item to the scrolled entry's contextual menu.
847 * @param obj The scrolled entry object
848 * @param label The item's text label
849 * @param icon_file The item's icon file
850 * @param icon_type The item's icon type
851 * @param func The callback to execute when the item is clicked
852 * @param data The data to associate with the item for related functions
854 * @ingroup Scrolled_Entry
857 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)
859 ELM_CHECK_WIDTYPE(obj, widtype);
860 Widget_Data *wd = elm_widget_data_get(obj);
862 elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, func, data);
866 * This disables the scrolled entry's contextual (right click) menu.
868 * @param obj The scrolled entry object
869 * @param disabled If true, the menu is disabled
871 * @ingroup Scrolled_Entry
874 elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
876 ELM_CHECK_WIDTYPE(obj, widtype);
877 Widget_Data *wd = elm_widget_data_get(obj);
879 elm_entry_context_menu_disabled_set(wd->entry, disabled);
883 * This returns whether the scrolled entry's contextual (right click) menu is disabled.
885 * @param obj The scrolled entry object
886 * @return If true, the menu is disabled
888 * @ingroup Scrolled_Entry
891 elm_scrolled_entry_context_menu_disabled_get(const Evas_Object *obj)
893 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
894 Widget_Data *wd = elm_widget_data_get(obj);
895 if (!wd) return EINA_FALSE;
896 return elm_entry_context_menu_disabled_get(wd->entry);
900 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling them).
902 * @param obj The scrolled entry object
903 * @param h The horizontal scrollbar policy to apply
904 * @param v The vertical scrollbar policy to apply
906 * @ingroup Scrolled_Entry
909 elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v)
911 ELM_CHECK_WIDTYPE(obj, widtype);
912 Widget_Data *wd = elm_widget_data_get(obj);
916 elm_scroller_policy_set(wd->scroller, h, v);
920 * This enables/disables bouncing within the entry.
922 * @param obj The scrolled entry object
923 * @param h The horizontal bounce state
924 * @param v The vertical bounce state
926 * @ingroup Scrolled_Entry
929 elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
931 ELM_CHECK_WIDTYPE(obj, widtype);
932 Widget_Data *wd = elm_widget_data_get(obj);
934 elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce);
937 * This set's the maximum bytes that can be added in entry.
939 * @param obj The entry object
940 * @param max_no_of_bytes Maximum number of bytes entry can have
942 * @ingroup Scrolled_Entry
945 elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes)
947 ELM_CHECK_WIDTYPE(obj, widtype);
948 Widget_Data *wd = elm_widget_data_get(obj);
950 elm_entry_maximum_bytes_set(wd->entry,max_no_of_bytes);
954 * Whether the character to use when masking entry contents (in "password mode").
955 * shows last character to user while password is being typed.
956 * @param obj The entry object
957 * @param password The password flag (1 for "password mode" to show the user
958 * how many characters have been typed, 0 for default)
960 * @ingroup Scrolled_Entry
963 elm_scrolled_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character)
965 ELM_CHECK_WIDTYPE(obj, widtype);
966 Widget_Data *wd = elm_widget_data_get(obj);
968 elm_entry_password_show_last_character_set(wd->entry, show_last_character);