2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
4 #include <Elementary.h>
8 * @defgroup Scrolled_Entry Scrolled_Entry
11 * A scrolled entry is a convenience widget which shows
12 * a box that the user can enter text into. Unlike an
13 * @ref Entry widget, scrolled entries scroll with user
14 * input so that the window will not expand if the length
15 * of text inside the entry exceeds the initial size of the
18 * Signals that you can add callbacks for are:
19 * - "changed" - The text within the entry was changed
20 * - "activated" - The entry has received focus and the cursor
21 * - "press" - The entry has been clicked
22 * - "longpressed" - The entry has been clicked for a couple seconds
23 * - "clicked" - The entry has been clicked
24 * - "clicked,double" - The entry has been double clicked
25 * - "focused" - The entry has received focus
26 * - "unfocused" - The entry has lost focus
27 * - "selection,paste" - A paste action has occurred
28 * - "selection,copy" - A copy action has occurred
29 * - "selection,cut" - A cut action has occurred
30 * - "selection,start" - A selection has begun
31 * - "selection,changed" - The selection has changed
32 * - "selection,cleared" - The selection has been cleared
33 * - "cursor,changed" - The cursor has changed
34 * - "anchor,clicked" - The anchor has been clicked
37 typedef struct _Widget_Data Widget_Data;
41 Evas_Object *scroller;
43 Elm_Scroller_Policy policy_h, policy_v;
44 Eina_Bool single_line : 1;
47 static const char *widtype = NULL;
49 static const char SIG_CHANGED[] = "changed";
50 static const char SIG_ACTIVATED[] = "activated";
51 static const char SIG_PRESS[] = "press";
52 static const char SIG_LONGPRESSED[] = "longpressed";
53 static const char SIG_CLICKED[] = "clicked";
54 static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
55 static const char SIG_FOCUSED[] = "focused";
56 static const char SIG_UNFOCUSED[] = "unfocused";
57 static const char SIG_SELECTION_PASTE[] = "selection,paste";
58 static const char SIG_SELECTION_COPY[] = "selection,copy";
59 static const char SIG_SELECTION_CUT[] = "selection,cut";
60 static const char SIG_SELECTION_START[] = "selection,start";
61 static const char SIG_SELECTION_CHANGED[] = "selection,changed";
62 static const char SIG_SELECTION_CLEARED[] = "selection,cleared";
63 static const char SIG_CURSOR_CHANGED[] = "cursor,changed";
64 static const char SIG_ANCHOR_CLICKED[] = "anchor,clicked";
65 static const Evas_Smart_Cb_Description _signals[] = {
69 {SIG_LONGPRESSED, ""},
71 {SIG_CLICKED_DOUBLE, ""},
74 {SIG_SELECTION_PASTE, ""},
75 {SIG_SELECTION_COPY, ""},
76 {SIG_SELECTION_CUT, ""},
77 {SIG_SELECTION_START, ""},
78 {SIG_SELECTION_CHANGED, ""},
79 {SIG_SELECTION_CLEARED, ""},
80 {SIG_CURSOR_CHANGED, ""},
81 {SIG_ANCHOR_CLICKED, ""},
86 _del_hook(Evas_Object *obj)
88 Widget_Data *wd = elm_widget_data_get(obj);
94 _theme_hook(Evas_Object *obj)
96 Widget_Data *wd = elm_widget_data_get(obj);
98 elm_object_style_set(wd->entry, elm_widget_style_get(obj));
99 elm_object_style_set(wd->scroller, elm_widget_style_get(obj));
103 _sizing_eval(Evas_Object *obj)
105 Widget_Data *wd = elm_widget_data_get(obj);
106 Evas_Coord minw, minh, minw_scr, minh_scr;
109 evas_object_size_hint_min_get(obj, &minw, &minh);
110 evas_object_size_hint_min_get(wd->scroller, &minw_scr, &minh_scr);
111 if (minw < minw_scr) minw = minw_scr;
112 if (minh < minh_scr) minh = minh_scr;
114 evas_object_size_hint_min_set(obj, minw, minh);
117 evas_object_size_hint_max_set(obj, -1, minh);
119 evas_object_size_hint_max_set(obj, -1, -1);
123 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
125 Widget_Data *wd = elm_widget_data_get(obj);
127 if (elm_widget_focus_get(obj))
128 elm_widget_focus_steal(wd->entry);
132 _disable_hook(Evas_Object *obj)
134 Widget_Data *wd = elm_widget_data_get(obj);
136 elm_object_disabled_set(wd->entry, elm_widget_disabled_get(obj));
140 _entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
143 evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
147 _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
149 evas_object_smart_callback_call(data, SIG_ACTIVATED, NULL);
153 _entry_press(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
155 evas_object_smart_callback_call(data, SIG_PRESS, NULL);
159 _entry_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
161 evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
165 _entry_clicked_double(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
167 evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL);
171 _entry_cursor_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
173 evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, NULL);
177 _entry_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
179 evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, NULL);
183 _entry_selection_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
185 evas_object_smart_callback_call(data, SIG_SELECTION_START, NULL);
189 _entry_selection_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
191 evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, NULL);
195 _entry_selection_cleared(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
197 evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, NULL);
201 _entry_selection_paste(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
203 evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, NULL);
207 _entry_selection_copy(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
209 evas_object_smart_callback_call(data, SIG_SELECTION_COPY, NULL);
213 _entry_selection_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
215 evas_object_smart_callback_call(data, SIG_SELECTION_CUT, NULL);
219 _entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
221 evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL);
225 _entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
227 evas_object_smart_callback_call(data, SIG_FOCUSED, NULL);
231 _entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
233 evas_object_smart_callback_call(data, SIG_UNFOCUSED, NULL);
238 * This adds a scrolled entry to @p parent object.
240 * @param parent The parent object
241 * @return The new object or NULL if it cannot be created
243 * @ingroup Scrolled_Entry
246 elm_scrolled_entry_add(Evas_Object *parent)
252 wd = ELM_NEW(Widget_Data);
253 e = evas_object_evas_get(parent);
254 obj = elm_widget_add(e);
255 ELM_SET_WIDTYPE(widtype, "scrolled_entry");
256 elm_widget_type_set(obj, "scrolled_entry");
257 elm_widget_sub_object_add(parent, obj);
258 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
259 elm_widget_data_set(obj, wd);
260 elm_widget_del_hook_set(obj, _del_hook);
261 elm_widget_disable_hook_set(obj, _disable_hook);
262 elm_widget_can_focus_set(obj, 1);
263 elm_widget_theme_hook_set(obj, _theme_hook);
265 wd->scroller = elm_scroller_add(parent);
266 elm_widget_resize_object_set(obj, wd->scroller);
267 elm_scroller_bounce_set(wd->scroller, 0, 0);
269 wd->entry = elm_entry_add(parent);
270 evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
271 evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
272 elm_scroller_content_set(wd->scroller, wd->entry);
273 evas_object_show(wd->entry);
275 evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj);
276 evas_object_smart_callback_add(wd->entry, "activated", _entry_activated, obj);
277 evas_object_smart_callback_add(wd->entry, "press", _entry_press, obj);
278 evas_object_smart_callback_add(wd->entry, "clicked", _entry_clicked, obj);
279 evas_object_smart_callback_add(wd->entry, "clicked,double", _entry_clicked_double, obj);
280 evas_object_smart_callback_add(wd->entry, "cursor,changed", _entry_cursor_changed, obj);
281 evas_object_smart_callback_add(wd->entry, "anchor,clicked", _entry_anchor_clicked, obj);
282 evas_object_smart_callback_add(wd->entry, "selection,start", _entry_selection_start, obj);
283 evas_object_smart_callback_add(wd->entry, "selection,changed", _entry_selection_changed, obj);
284 evas_object_smart_callback_add(wd->entry, "selection,cleared", _entry_selection_cleared, obj);
285 evas_object_smart_callback_add(wd->entry, "selection,paste", _entry_selection_paste, obj);
286 evas_object_smart_callback_add(wd->entry, "selection,copy", _entry_selection_copy, obj);
287 evas_object_smart_callback_add(wd->entry, "selection,cut", _entry_selection_cut, obj);
288 evas_object_smart_callback_add(wd->entry, "longpressed", _entry_longpressed, obj);
289 evas_object_smart_callback_add(wd->entry, "focused", _entry_focused, obj);
290 evas_object_smart_callback_add(wd->entry, "unfocused", _entry_unfocused, obj);
294 // TODO: convert Elementary to subclassing of Evas_Smart_Class
295 // TODO: and save some bytes, making descriptions per-class and not instance!
296 evas_object_smart_callbacks_descriptions_set(obj, _signals);
301 * This sets the scrolled entry object not to line wrap. All input will
302 * be on a single line, and the entry box will scroll with user input.
304 * @param obj The scrolled entry object
305 * @param single_line If true, the text in the scrolled entry
306 * will be on a single line.
308 * @ingroup Scrolled_Entry
311 elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
313 ELM_CHECK_WIDTYPE(obj, widtype);
314 Widget_Data *wd = elm_widget_data_get(obj);
316 if (wd->single_line == single_line) return;
317 elm_entry_single_line_set(wd->entry, single_line);
318 wd->single_line = single_line;
321 elm_scroller_policy_set(wd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
322 elm_scroller_content_min_limit(wd->scroller, 0, 1);
326 elm_scroller_policy_set(wd->scroller, wd->policy_h, wd->policy_v);
327 elm_scroller_content_min_limit(wd->scroller, 0, 0);
333 * This returns true if the scrolled entry has been set to single line mode.
334 * See also elm_scrolled_entry_single_line_set().
336 * @param obj The scrolled entry object
337 * @return single_line If true, the text in the scrolled entry is set to display
340 * @ingroup Scrolled_Entry
343 elm_scrolled_entry_single_line_get(const Evas_Object *obj)
345 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
346 Widget_Data *wd = elm_widget_data_get(obj);
347 if (!wd) return EINA_FALSE;
348 return elm_entry_single_line_get(wd->entry);
353 * This sets the scrolled entry object to password mode. All text entered
354 * and/or displayed within the widget will be replaced with asterisks (*).
356 * @param obj The scrolled entry object
357 * @param password If true, password mode is enabled.
359 * @ingroup Scrolled_Entry
362 elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password)
364 ELM_CHECK_WIDTYPE(obj, widtype);
365 Widget_Data *wd = elm_widget_data_get(obj);
367 elm_entry_password_set(wd->entry, password);
371 * This returns whether password mode is enabled.
372 * See also elm_scrolled_entry_password_set().
374 * @param obj The scrolled entry object
375 * @return If true, the scrolled entry is set to display all characters
378 * @ingroup Scrolled_Entry
381 elm_scrolled_entry_password_get(const Evas_Object *obj)
383 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
384 Widget_Data *wd = elm_widget_data_get(obj);
385 if (!wd) return EINA_FALSE;
386 return elm_entry_password_get(wd->entry);
391 * This sets the text displayed within the scrolled entry to @p entry.
393 * @param obj The scrolled entry object
394 * @param entry The text to be displayed
396 * @ingroup Scrolled_Entry
399 elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry)
401 ELM_CHECK_WIDTYPE(obj, widtype);
402 Widget_Data *wd = elm_widget_data_get(obj);
404 elm_entry_entry_set(wd->entry, entry);
408 * This returns the text currently shown in object @p entry.
409 * See also elm_scrolled_entry_entry_set().
411 * @param obj The scrolled entry object
412 * @return The currently displayed text or NULL on failure
414 * @ingroup Scrolled_Entry
417 elm_scrolled_entry_entry_get(const Evas_Object *obj)
419 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
420 Widget_Data *wd = elm_widget_data_get(obj);
421 if (!wd) return NULL;
422 return elm_entry_entry_get(wd->entry);
426 * This returns the entry object.
428 * @param obj The scrolled entry object
429 * @return The entry object or NULL on failure
431 * @ingroup Scrolled_Entry
434 elm_scrolled_entry_entry_object_get(const Evas_Object *obj)
436 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
437 Widget_Data *wd = elm_widget_data_get(obj);
438 if (!wd) return NULL;
443 * This returns all selected text within the scrolled entry.
445 * @param obj The scrolled entry object
446 * @return The selected text within the scrolled entry or NULL on failure
448 * @ingroup Scrolled_Entry
451 elm_scrolled_entry_selection_get(const Evas_Object *obj)
453 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
454 Widget_Data *wd = elm_widget_data_get(obj);
455 if (!wd) return NULL;
456 return elm_entry_selection_get(wd->entry);
460 * This inserts text in @p entry at the beginning of the scrolled entry
463 * @param obj The scrolled entry object
464 * @param entry The text to insert
466 * @ingroup Scrolled_Entry
469 elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry)
471 ELM_CHECK_WIDTYPE(obj, widtype);
472 Widget_Data *wd = elm_widget_data_get(obj);
474 elm_entry_entry_insert(wd->entry, entry);
478 * This enables word line wrapping in the scrolled entry object. It is the opposite
479 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
480 * character line wrapping.
481 * See also elm_scrolled_entry_line_char_wrap_set().
483 * @param obj The scrolled entry object
484 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
485 * of the object. Wrapping will occur at the end of the word before the end of the
488 * @ingroup Scrolled_Entry
491 elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap)
493 ELM_CHECK_WIDTYPE(obj, widtype);
494 Widget_Data *wd = elm_widget_data_get(obj);
496 elm_entry_line_wrap_set(wd->entry, wrap);
500 * This enables character line wrapping in the scrolled entry object. It is the opposite
501 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
502 * word line wrapping.
503 * See also elm_scrolled_entry_line_wrap_set().
505 * @param obj The scrolled entry object
506 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
507 * of the object. Wrapping will occur immediately upon reaching the end of the object.
509 * @ingroup Scrolled_Entry
512 elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap)
514 ELM_CHECK_WIDTYPE(obj, widtype);
515 Widget_Data *wd = elm_widget_data_get(obj);
517 elm_entry_line_char_wrap_set(wd->entry, wrap);
521 * This sets the editable attribute of the scrolled entry.
523 * @param obj The scrolled entry object
524 * @param editable If true, the scrolled entry will be editable by the user.
525 * If false, it will be set to the disabled state.
527 * @ingroup Scrolled_Entry
530 elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable)
532 ELM_CHECK_WIDTYPE(obj, widtype);
533 Widget_Data *wd = elm_widget_data_get(obj);
535 elm_entry_editable_set(wd->entry, editable);
539 * This gets the editable attribute of the scrolled entry.
540 * See also elm_scrolled_entry_editable_set().
542 * @param obj The scrolled entry object
543 * @return If true, the scrolled entry is editable by the user.
544 * If false, it is not editable by the user
546 * @ingroup Scrolled_Entry
549 elm_scrolled_entry_editable_get(const Evas_Object *obj)
551 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
552 Widget_Data *wd = elm_widget_data_get(obj);
553 if (!wd) return EINA_FALSE;
554 return elm_entry_editable_get(wd->entry);
559 * This drops any existing text selection within the scrolled entry.
561 * @param obj The scrolled entry object
563 * @ingroup Scrolled_Entry
566 elm_scrolled_entry_select_none(Evas_Object *obj)
568 ELM_CHECK_WIDTYPE(obj, widtype);
569 Widget_Data *wd = elm_widget_data_get(obj);
571 elm_entry_select_none(wd->entry);
575 * This selects all text within the scrolled entry.
577 * @param obj The scrolled entry object
579 * @ingroup Scrolled_Entry
582 elm_scrolled_entry_select_all(Evas_Object *obj)
584 ELM_CHECK_WIDTYPE(obj, widtype);
585 Widget_Data *wd = elm_widget_data_get(obj);
587 elm_entry_select_all(wd->entry);
591 * This moves the cursor one place to the right within the entry.
593 * @param obj The scrolled entry object
594 * @return EINA_TRUE upon success, EINA_FALSE upon failure
596 * @ingroup Scrolled_Entry
599 elm_scrolled_entry_cursor_next(Evas_Object *obj)
601 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
602 Widget_Data *wd = elm_widget_data_get(obj);
603 if (!wd) return EINA_FALSE;
604 return elm_entry_cursor_next(wd->entry);
608 * This moves the cursor one place to the left within the entry.
610 * @param obj The scrolled entry object
611 * @return EINA_TRUE upon success, EINA_FALSE upon failure
613 * @ingroup Scrolled_Entry
616 elm_scrolled_entry_cursor_prev(Evas_Object *obj)
618 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
619 Widget_Data *wd = elm_widget_data_get(obj);
620 if (!wd) return EINA_FALSE;
621 return elm_entry_cursor_prev(wd->entry);
625 * This moves the cursor one line up within the entry.
627 * @param obj The scrolled entry object
628 * @return EINA_TRUE upon success, EINA_FALSE upon failure
630 * @ingroup Scrolled_Entry
633 elm_scrolled_entry_cursor_up(Evas_Object *obj)
635 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
636 Widget_Data *wd = elm_widget_data_get(obj);
637 if (!wd) return EINA_FALSE;
638 return elm_entry_cursor_up(wd->entry);
642 * This moves the cursor one line down within the entry.
644 * @param obj The scrolled entry object
645 * @return EINA_TRUE upon success, EINA_FALSE upon failure
647 * @ingroup Scrolled_Entry
650 elm_scrolled_entry_cursor_down(Evas_Object *obj)
652 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
653 Widget_Data *wd = elm_widget_data_get(obj);
654 if (!wd) return EINA_FALSE;
655 return elm_entry_cursor_down(wd->entry);
659 * This moves the cursor to the beginning of the entry.
661 * @param obj The scrolled entry object
663 * @ingroup Scrolled_Entry
666 elm_scrolled_entry_cursor_begin_set(Evas_Object *obj)
668 ELM_CHECK_WIDTYPE(obj, widtype);
669 Widget_Data *wd = elm_widget_data_get(obj);
671 elm_entry_cursor_begin_set(wd->entry);
675 * This moves the cursor to the end of the entry.
677 * @param obj The scrolled entry object
679 * @ingroup Scrolled_Entry
682 elm_scrolled_entry_cursor_end_set(Evas_Object *obj)
684 ELM_CHECK_WIDTYPE(obj, widtype);
685 Widget_Data *wd = elm_widget_data_get(obj);
687 elm_entry_cursor_end_set(wd->entry);
691 * This moves the cursor to the beginning of the current line.
693 * @param obj The scrolled entry object
695 * @ingroup Scrolled_Entry
698 elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj)
700 ELM_CHECK_WIDTYPE(obj, widtype);
701 Widget_Data *wd = elm_widget_data_get(obj);
703 elm_entry_cursor_line_begin_set(wd->entry);
707 * This moves the cursor to the end of the current line.
709 * @param obj The scrolled entry object
711 * @ingroup Scrolled_Entry
714 elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj)
716 ELM_CHECK_WIDTYPE(obj, widtype);
717 Widget_Data *wd = elm_widget_data_get(obj);
719 elm_entry_cursor_line_end_set(wd->entry);
723 * This begins a selection within the scrolled entry as though
724 * the user were holding down the mouse button to make a selection.
726 * @param obj The scrolled entry object
728 * @ingroup Scrolled_Entry
731 elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj)
733 ELM_CHECK_WIDTYPE(obj, widtype);
734 Widget_Data *wd = elm_widget_data_get(obj);
736 elm_entry_cursor_selection_begin(wd->entry);
740 * This ends a selection within the scrolled entry as though
741 * the user had just released the mouse button while making a selection.
743 * @param obj The scrolled entry object
745 * @ingroup Scrolled_Entry
748 elm_scrolled_entry_cursor_selection_end(Evas_Object *obj)
750 ELM_CHECK_WIDTYPE(obj, widtype);
751 Widget_Data *wd = elm_widget_data_get(obj);
753 elm_entry_cursor_selection_end(wd->entry);
759 * @param obj The scrolled entry object
760 * @return TODO: fill this in
762 * @ingroup Scrolled_Entry
765 elm_scrolled_entry_cursor_is_format_get(const Evas_Object *obj)
767 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
768 Widget_Data *wd = elm_widget_data_get(obj);
769 if (!wd) return EINA_FALSE;
770 return elm_entry_cursor_is_format_get(wd->entry);
774 * This returns whether the cursor is visible.
776 * @param obj The scrolled entry object
777 * @return If true, the cursor is visible.
779 * @ingroup Scrolled_Entry
782 elm_scrolled_entry_cursor_is_visible_format_get(const Evas_Object *obj)
784 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
785 Widget_Data *wd = elm_widget_data_get(obj);
786 if (!wd) return EINA_FALSE;
787 return elm_entry_cursor_is_visible_format_get(wd->entry);
793 * @param obj The scrolled entry object
794 * @return TODO: fill this in
796 * @ingroup Scrolled_Entry
799 elm_scrolled_entry_cursor_content_get(const Evas_Object *obj)
801 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
802 Widget_Data *wd = elm_widget_data_get(obj);
803 if (!wd) return NULL;
804 return elm_entry_cursor_content_get(wd->entry);
808 * This executes a "cut" action on the selected text in the scrolled entry.
810 * @param obj The scrolled entry object
812 * @ingroup Scrolled_Entry
815 elm_scrolled_entry_selection_cut(Evas_Object *obj)
817 ELM_CHECK_WIDTYPE(obj, widtype);
818 Widget_Data *wd = elm_widget_data_get(obj);
820 elm_entry_selection_cut(wd->entry);
824 * This executes a "copy" action on the selected text in the scrolled entry.
826 * @param obj The scrolled entry object
828 * @ingroup Scrolled_Entry
831 elm_scrolled_entry_selection_copy(Evas_Object *obj)
833 ELM_CHECK_WIDTYPE(obj, widtype);
834 Widget_Data *wd = elm_widget_data_get(obj);
836 elm_entry_selection_copy(wd->entry);
840 * This executes a "paste" action in the scrolled entry.
842 * @param obj The scrolled entry object
844 * @ingroup Scrolled_Entry
847 elm_scrolled_entry_selection_paste(Evas_Object *obj)
849 ELM_CHECK_WIDTYPE(obj, widtype);
850 Widget_Data *wd = elm_widget_data_get(obj);
852 elm_entry_selection_paste(wd->entry);
856 * This clears and frees the items in a scrolled entry's contextual (right click) menu.
858 * @param obj The scrolled entry object
860 * @ingroup Scrolled_Entry
863 elm_scrolled_entry_context_menu_clear(Evas_Object *obj)
865 ELM_CHECK_WIDTYPE(obj, widtype);
866 Widget_Data *wd = elm_widget_data_get(obj);
868 elm_entry_context_menu_clear(wd->entry);
872 * This adds an item to the scrolled entry's contextual menu.
874 * @param obj The scrolled entry object
875 * @param label The item's text label
876 * @param icon_file The item's icon file
877 * @param icon_type The item's icon type
878 * @param func The callback to execute when the item is clicked
879 * @param data The data to associate with the item for related functions
881 * @ingroup Scrolled_Entry
884 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)
886 ELM_CHECK_WIDTYPE(obj, widtype);
887 Widget_Data *wd = elm_widget_data_get(obj);
889 elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, func, data);
893 * This disables the scrolled entry's contextual (right click) menu.
895 * @param obj The scrolled entry object
896 * @param disabled If true, the menu is disabled
898 * @ingroup Scrolled_Entry
901 elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
903 ELM_CHECK_WIDTYPE(obj, widtype);
904 Widget_Data *wd = elm_widget_data_get(obj);
906 elm_entry_context_menu_disabled_set(wd->entry, disabled);
910 * This returns whether the scrolled entry's contextual (right click) menu is disabled.
912 * @param obj The scrolled entry object
913 * @return If true, the menu is disabled
915 * @ingroup Scrolled_Entry
918 elm_scrolled_entry_context_menu_disabled_get(const Evas_Object *obj)
920 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
921 Widget_Data *wd = elm_widget_data_get(obj);
922 if (!wd) return EINA_FALSE;
923 return elm_entry_context_menu_disabled_get(wd->entry);
927 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling them).
929 * @param obj The scrolled entry object
930 * @param h The horizontal scrollbar policy to apply
931 * @param v The vertical scrollbar policy to apply
933 * @ingroup Scrolled_Entry
936 elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v)
938 ELM_CHECK_WIDTYPE(obj, widtype);
939 Widget_Data *wd = elm_widget_data_get(obj);
943 elm_scroller_policy_set(wd->scroller, h, v);
947 * This enables/disables bouncing within the entry.
949 * @param obj The scrolled entry object
950 * @param h The horizontal bounce state
951 * @param v The vertical bounce state
953 * @ingroup Scrolled_Entry
956 elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
958 ELM_CHECK_WIDTYPE(obj, widtype);
959 Widget_Data *wd = elm_widget_data_get(obj);
961 elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce);
964 * This set's the maximum bytes that can be added in to scrolled entry.
966 * @param obj The scrolled entry object
967 * @param max_no_of_bytes Maximum number of bytes scrolled entry can have.
969 * @ingroup Scrolled_Entry
972 elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes)
974 ELM_CHECK_WIDTYPE(obj, widtype);
975 Widget_Data *wd = elm_widget_data_get(obj);
977 elm_entry_maximum_bytes_set(wd->entry,max_no_of_bytes);
981 * This set's the scrolled entry in password mode with out masking the last character entered by user,
982 * and later masking the character after 2 seconds.
984 * @param obj The scrolled entry object
985 * @param show_last_character The show_last_character flag (1 for "password mode along with showing last character"
988 * @ingroup Scrolled_Entry
991 elm_scrolled_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character)
993 ELM_CHECK_WIDTYPE(obj, widtype);
994 Widget_Data *wd = elm_widget_data_get(obj);
996 elm_entry_password_show_last_character_set(wd->entry, show_last_character);
1000 * Get the input method context in the scrolled entry widget
1002 * @param obj The scrolled entry object
1003 * @return The input method context
1005 * @ingroup Scrolled_Entry
1007 EAPI Ecore_IMF_Context *elm_scrolled_entry_imf_context_get(Evas_Object *obj)
1009 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1010 Widget_Data *wd = elm_widget_data_get(obj);
1011 if (!wd || !wd->entry) return NULL;
1013 return elm_entry_imf_context_get(wd->entry);
1017 * This sets the attribute to show the input panel automatically.
1019 * @param obj The scrolled entry object
1020 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
1022 * @ingroup Scrolled_Entry
1025 elm_scrolled_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
1027 ELM_CHECK_WIDTYPE(obj, widtype);
1028 Widget_Data *wd = elm_widget_data_get(obj);
1029 if (!wd || !wd->entry) return;
1031 elm_entry_input_panel_enabled_set(wd->entry, enabled);
1035 * Set the input panel layout of the scrolled entry
1037 * @param obj The scrolled entry object
1038 * @param layout the layout to set
1040 * @ingroup Scrolled_Entry
1043 elm_scrolled_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout)
1045 ELM_CHECK_WIDTYPE(obj, widtype);
1046 Widget_Data *wd = elm_widget_data_get(obj);
1047 if (!wd || !wd->entry) return;
1049 elm_entry_input_panel_layout_set(wd->entry, layout);