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);
237 _entry_maxlength_reached(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
239 evas_object_smart_callback_call(data, "maxlength,reached", NULL);
244 * This adds a scrolled entry to @p parent object.
246 * @param parent The parent object
247 * @return The new object or NULL if it cannot be created
249 * @ingroup Scrolled_Entry
252 elm_scrolled_entry_add(Evas_Object *parent)
258 wd = ELM_NEW(Widget_Data);
259 e = evas_object_evas_get(parent);
260 obj = elm_widget_add(e);
261 ELM_SET_WIDTYPE(widtype, "scrolled_entry");
262 elm_widget_type_set(obj, "scrolled_entry");
263 elm_widget_sub_object_add(parent, obj);
264 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
265 elm_widget_data_set(obj, wd);
266 elm_widget_del_hook_set(obj, _del_hook);
267 elm_widget_disable_hook_set(obj, _disable_hook);
268 elm_widget_can_focus_set(obj, 1);
269 elm_widget_theme_hook_set(obj, _theme_hook);
271 wd->scroller = elm_scroller_add(parent);
272 elm_widget_resize_object_set(obj, wd->scroller);
273 elm_scroller_bounce_set(wd->scroller, 0, 0);
274 elm_scroller_propagate_events_set(wd->scroller, 1);
276 wd->entry = elm_entry_add(parent);
277 evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
278 evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
279 elm_scroller_content_set(wd->scroller, wd->entry);
280 evas_object_show(wd->entry);
282 evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj);
283 evas_object_smart_callback_add(wd->entry, "activated", _entry_activated, obj);
284 evas_object_smart_callback_add(wd->entry, "press", _entry_press, obj);
285 evas_object_smart_callback_add(wd->entry, "clicked", _entry_clicked, obj);
286 evas_object_smart_callback_add(wd->entry, "clicked,double", _entry_clicked_double, obj);
287 evas_object_smart_callback_add(wd->entry, "cursor,changed", _entry_cursor_changed, obj);
288 evas_object_smart_callback_add(wd->entry, "anchor,clicked", _entry_anchor_clicked, obj);
289 evas_object_smart_callback_add(wd->entry, "selection,start", _entry_selection_start, obj);
290 evas_object_smart_callback_add(wd->entry, "selection,changed", _entry_selection_changed, obj);
291 evas_object_smart_callback_add(wd->entry, "selection,cleared", _entry_selection_cleared, obj);
292 evas_object_smart_callback_add(wd->entry, "selection,paste", _entry_selection_paste, obj);
293 evas_object_smart_callback_add(wd->entry, "selection,copy", _entry_selection_copy, obj);
294 evas_object_smart_callback_add(wd->entry, "selection,cut", _entry_selection_cut, obj);
295 evas_object_smart_callback_add(wd->entry, "longpressed", _entry_longpressed, obj);
296 evas_object_smart_callback_add(wd->entry, "focused", _entry_focused, obj);
297 evas_object_smart_callback_add(wd->entry, "unfocused", _entry_unfocused, obj);
298 evas_object_smart_callback_add(wd->entry, "maxlength,reached", _entry_maxlength_reached, obj);
302 // TODO: convert Elementary to subclassing of Evas_Smart_Class
303 // TODO: and save some bytes, making descriptions per-class and not instance!
304 evas_object_smart_callbacks_descriptions_set(obj, _signals);
309 * This sets the scrolled entry object not to line wrap. All input will
310 * be on a single line, and the entry box will scroll with user input.
312 * @param obj The scrolled entry object
313 * @param single_line If true, the text in the scrolled entry
314 * will be on a single line.
316 * @ingroup Scrolled_Entry
319 elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
321 ELM_CHECK_WIDTYPE(obj, widtype);
322 Widget_Data *wd = elm_widget_data_get(obj);
324 if (wd->single_line == single_line) return;
325 elm_entry_single_line_set(wd->entry, single_line);
326 wd->single_line = single_line;
329 elm_scroller_policy_set(wd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
330 elm_scroller_content_min_limit(wd->scroller, 0, 1);
334 elm_scroller_policy_set(wd->scroller, wd->policy_h, wd->policy_v);
335 elm_scroller_content_min_limit(wd->scroller, 0, 0);
341 * This returns true if the scrolled entry has been set to single line mode.
342 * See also elm_scrolled_entry_single_line_set().
344 * @param obj The scrolled entry object
345 * @return single_line If true, the text in the scrolled entry is set to display
348 * @ingroup Scrolled_Entry
351 elm_scrolled_entry_single_line_get(const Evas_Object *obj)
353 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
354 Widget_Data *wd = elm_widget_data_get(obj);
355 if (!wd) return EINA_FALSE;
356 return elm_entry_single_line_get(wd->entry);
361 * This sets the scrolled entry object to password mode. All text entered
362 * and/or displayed within the widget will be replaced with asterisks (*).
364 * @param obj The scrolled entry object
365 * @param password If true, password mode is enabled.
367 * @ingroup Scrolled_Entry
370 elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password)
372 ELM_CHECK_WIDTYPE(obj, widtype);
373 Widget_Data *wd = elm_widget_data_get(obj);
375 elm_entry_password_set(wd->entry, password);
379 * This returns whether password mode is enabled.
380 * See also elm_scrolled_entry_password_set().
382 * @param obj The scrolled entry object
383 * @return If true, the scrolled entry is set to display all characters
386 * @ingroup Scrolled_Entry
389 elm_scrolled_entry_password_get(const Evas_Object *obj)
391 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
392 Widget_Data *wd = elm_widget_data_get(obj);
393 if (!wd) return EINA_FALSE;
394 return elm_entry_password_get(wd->entry);
399 * This sets the text displayed within the scrolled entry to @p entry.
401 * @param obj The scrolled entry object
402 * @param entry The text to be displayed
404 * @ingroup Scrolled_Entry
407 elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry)
409 ELM_CHECK_WIDTYPE(obj, widtype);
410 Widget_Data *wd = elm_widget_data_get(obj);
412 elm_entry_entry_set(wd->entry, entry);
416 * This returns the text currently shown in object @p entry.
417 * See also elm_scrolled_entry_entry_set().
419 * @param obj The scrolled entry object
420 * @return The currently displayed text or NULL on failure
422 * @ingroup Scrolled_Entry
425 elm_scrolled_entry_entry_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_entry_get(wd->entry);
434 * This returns all selected text within the scrolled entry.
436 * @param obj The scrolled entry object
437 * @return The selected text within the scrolled entry or NULL on failure
439 * @ingroup Scrolled_Entry
442 elm_scrolled_entry_selection_get(const Evas_Object *obj)
444 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
445 Widget_Data *wd = elm_widget_data_get(obj);
446 if (!wd) return NULL;
447 return elm_entry_selection_get(wd->entry);
451 * This inserts text in @p entry at the beginning of the scrolled entry
454 * @param obj The scrolled entry object
455 * @param entry The text to insert
457 * @ingroup Scrolled_Entry
460 elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry)
462 ELM_CHECK_WIDTYPE(obj, widtype);
463 Widget_Data *wd = elm_widget_data_get(obj);
465 elm_entry_entry_insert(wd->entry, entry);
469 * This enables word line wrapping in the scrolled entry object. It is the opposite
470 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
471 * character line wrapping.
472 * See also elm_scrolled_entry_line_char_wrap_set().
474 * @param obj The scrolled entry object
475 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
476 * of the object. Wrapping will occur at the end of the word before the end of the
479 * @ingroup Scrolled_Entry
482 elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap)
484 ELM_CHECK_WIDTYPE(obj, widtype);
485 Widget_Data *wd = elm_widget_data_get(obj);
487 elm_entry_line_wrap_set(wd->entry, wrap);
491 * This enables character line wrapping in the scrolled entry object. It is the opposite
492 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
493 * word line wrapping.
494 * See also elm_scrolled_entry_line_wrap_set().
496 * @param obj The scrolled entry object
497 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
498 * of the object. Wrapping will occur immediately upon reaching the end of the object.
500 * @ingroup Scrolled_Entry
503 elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap)
505 ELM_CHECK_WIDTYPE(obj, widtype);
506 Widget_Data *wd = elm_widget_data_get(obj);
508 elm_entry_line_char_wrap_set(wd->entry, wrap);
512 * This sets the editable attribute of the scrolled entry.
514 * @param obj The scrolled entry object
515 * @param editable If true, the scrolled entry will be editable by the user.
516 * If false, it will be set to the disabled state.
518 * @ingroup Scrolled_Entry
521 elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable)
523 ELM_CHECK_WIDTYPE(obj, widtype);
524 Widget_Data *wd = elm_widget_data_get(obj);
526 elm_entry_editable_set(wd->entry, editable);
530 * This gets the editable attribute of the scrolled entry.
531 * See also elm_scrolled_entry_editable_set().
533 * @param obj The scrolled entry object
534 * @return If true, the scrolled entry is editable by the user.
535 * If false, it is not editable by the user
537 * @ingroup Scrolled_Entry
540 elm_scrolled_entry_editable_get(const Evas_Object *obj)
542 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
543 Widget_Data *wd = elm_widget_data_get(obj);
544 if (!wd) return EINA_FALSE;
545 return elm_entry_editable_get(wd->entry);
550 * This drops any existing text selection within the scrolled entry.
552 * @param obj The scrolled entry object
554 * @ingroup Scrolled_Entry
557 elm_scrolled_entry_select_none(Evas_Object *obj)
559 ELM_CHECK_WIDTYPE(obj, widtype);
560 Widget_Data *wd = elm_widget_data_get(obj);
562 elm_entry_select_none(wd->entry);
566 * This selects all text within the scrolled entry.
568 * @param obj The scrolled entry object
570 * @ingroup Scrolled_Entry
573 elm_scrolled_entry_select_all(Evas_Object *obj)
575 ELM_CHECK_WIDTYPE(obj, widtype);
576 Widget_Data *wd = elm_widget_data_get(obj);
578 elm_entry_select_all(wd->entry);
582 * This moves the cursor one place to the right 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_next(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_next(wd->entry);
599 * This moves the cursor one place to the left 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_prev(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_prev(wd->entry);
616 * This moves the cursor one line up 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_up(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_up(wd->entry);
633 * This moves the cursor one line down within the entry.
635 * @param obj The scrolled entry object
636 * @return EINA_TRUE upon success, EINA_FALSE upon failure
638 * @ingroup Scrolled_Entry
641 elm_scrolled_entry_cursor_down(Evas_Object *obj)
643 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
644 Widget_Data *wd = elm_widget_data_get(obj);
645 if (!wd) return EINA_FALSE;
646 return elm_entry_cursor_down(wd->entry);
650 * This moves the cursor to the beginning of the entry.
652 * @param obj The scrolled entry object
654 * @ingroup Scrolled_Entry
657 elm_scrolled_entry_cursor_begin_set(Evas_Object *obj)
659 ELM_CHECK_WIDTYPE(obj, widtype);
660 Widget_Data *wd = elm_widget_data_get(obj);
662 elm_entry_cursor_begin_set(wd->entry);
666 * This moves the cursor to the end of the entry.
668 * @param obj The scrolled entry object
670 * @ingroup Scrolled_Entry
673 elm_scrolled_entry_cursor_end_set(Evas_Object *obj)
675 ELM_CHECK_WIDTYPE(obj, widtype);
676 Widget_Data *wd = elm_widget_data_get(obj);
678 elm_entry_cursor_end_set(wd->entry);
682 * This moves the cursor to the beginning of the current line.
684 * @param obj The scrolled entry object
686 * @ingroup Scrolled_Entry
689 elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj)
691 ELM_CHECK_WIDTYPE(obj, widtype);
692 Widget_Data *wd = elm_widget_data_get(obj);
694 elm_entry_cursor_line_begin_set(wd->entry);
698 * This moves the cursor to the end of the current line.
700 * @param obj The scrolled entry object
702 * @ingroup Scrolled_Entry
705 elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj)
707 ELM_CHECK_WIDTYPE(obj, widtype);
708 Widget_Data *wd = elm_widget_data_get(obj);
710 elm_entry_cursor_line_end_set(wd->entry);
714 * This begins a selection within the scrolled entry as though
715 * the user were holding down the mouse button to make a selection.
717 * @param obj The scrolled entry object
719 * @ingroup Scrolled_Entry
722 elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj)
724 ELM_CHECK_WIDTYPE(obj, widtype);
725 Widget_Data *wd = elm_widget_data_get(obj);
727 elm_entry_cursor_selection_begin(wd->entry);
731 * This ends a selection within the scrolled entry as though
732 * the user had just released the mouse button while making a selection.
734 * @param obj The scrolled entry object
736 * @ingroup Scrolled_Entry
739 elm_scrolled_entry_cursor_selection_end(Evas_Object *obj)
741 ELM_CHECK_WIDTYPE(obj, widtype);
742 Widget_Data *wd = elm_widget_data_get(obj);
744 elm_entry_cursor_selection_end(wd->entry);
750 * @param obj The scrolled entry object
751 * @return TODO: fill this in
753 * @ingroup Scrolled_Entry
756 elm_scrolled_entry_cursor_is_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_format_get(wd->entry);
765 * This returns whether the cursor is visible.
767 * @param obj The scrolled entry object
768 * @return If true, the cursor is visible.
770 * @ingroup Scrolled_Entry
773 elm_scrolled_entry_cursor_is_visible_format_get(const Evas_Object *obj)
775 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
776 Widget_Data *wd = elm_widget_data_get(obj);
777 if (!wd) return EINA_FALSE;
778 return elm_entry_cursor_is_visible_format_get(wd->entry);
784 * @param obj The scrolled entry object
785 * @return TODO: fill this in
787 * @ingroup Scrolled_Entry
790 elm_scrolled_entry_cursor_content_get(const Evas_Object *obj)
792 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
793 Widget_Data *wd = elm_widget_data_get(obj);
794 if (!wd) return NULL;
795 return elm_entry_cursor_content_get(wd->entry);
799 * This executes a "cut" action on the selected text in the scrolled entry.
801 * @param obj The scrolled entry object
803 * @ingroup Scrolled_Entry
806 elm_scrolled_entry_selection_cut(Evas_Object *obj)
808 ELM_CHECK_WIDTYPE(obj, widtype);
809 Widget_Data *wd = elm_widget_data_get(obj);
811 elm_entry_selection_cut(wd->entry);
815 * This executes a "copy" action on the selected text in the scrolled entry.
817 * @param obj The scrolled entry object
819 * @ingroup Scrolled_Entry
822 elm_scrolled_entry_selection_copy(Evas_Object *obj)
824 ELM_CHECK_WIDTYPE(obj, widtype);
825 Widget_Data *wd = elm_widget_data_get(obj);
827 elm_entry_selection_copy(wd->entry);
831 * This executes a "paste" action in the scrolled entry.
833 * @param obj The scrolled entry object
835 * @ingroup Scrolled_Entry
838 elm_scrolled_entry_selection_paste(Evas_Object *obj)
840 ELM_CHECK_WIDTYPE(obj, widtype);
841 Widget_Data *wd = elm_widget_data_get(obj);
843 elm_entry_selection_paste(wd->entry);
847 * This clears and frees the items in a scrolled entry's contextual (right click) menu.
849 * @param obj The scrolled entry object
851 * @ingroup Scrolled_Entry
854 elm_scrolled_entry_context_menu_clear(Evas_Object *obj)
856 ELM_CHECK_WIDTYPE(obj, widtype);
857 Widget_Data *wd = elm_widget_data_get(obj);
859 elm_entry_context_menu_clear(wd->entry);
863 * This adds an item to the scrolled entry's contextual menu.
865 * @param obj The scrolled entry object
866 * @param label The item's text label
867 * @param icon_file The item's icon file
868 * @param icon_type The item's icon type
869 * @param func The callback to execute when the item is clicked
870 * @param data The data to associate with the item for related functions
872 * @ingroup Scrolled_Entry
875 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)
877 ELM_CHECK_WIDTYPE(obj, widtype);
878 Widget_Data *wd = elm_widget_data_get(obj);
880 elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, func, data);
884 * This disables the scrolled entry's contextual (right click) menu.
886 * @param obj The scrolled entry object
887 * @param disabled If true, the menu is disabled
889 * @ingroup Scrolled_Entry
892 elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
894 ELM_CHECK_WIDTYPE(obj, widtype);
895 Widget_Data *wd = elm_widget_data_get(obj);
897 elm_entry_context_menu_disabled_set(wd->entry, disabled);
901 * This returns whether the scrolled entry's contextual (right click) menu is disabled.
903 * @param obj The scrolled entry object
904 * @return If true, the menu is disabled
906 * @ingroup Scrolled_Entry
909 elm_scrolled_entry_context_menu_disabled_get(const Evas_Object *obj)
911 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
912 Widget_Data *wd = elm_widget_data_get(obj);
913 if (!wd) return EINA_FALSE;
914 return elm_entry_context_menu_disabled_get(wd->entry);
918 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling them).
920 * @param obj The scrolled entry object
921 * @param h The horizontal scrollbar policy to apply
922 * @param v The vertical scrollbar policy to apply
924 * @ingroup Scrolled_Entry
927 elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v)
929 ELM_CHECK_WIDTYPE(obj, widtype);
930 Widget_Data *wd = elm_widget_data_get(obj);
934 elm_scroller_policy_set(wd->scroller, h, v);
938 * This enables/disables bouncing within the entry.
940 * @param obj The scrolled entry object
941 * @param h The horizontal bounce state
942 * @param v The vertical bounce state
944 * @ingroup Scrolled_Entry
947 elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
949 ELM_CHECK_WIDTYPE(obj, widtype);
950 Widget_Data *wd = elm_widget_data_get(obj);
952 elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce);
955 * This set's the maximum bytes that can be added in to scrolled entry.
957 * @param obj The scrolled entry object
958 * @param max_no_of_bytes Maximum number of bytes scrolled entry can have.
960 * @ingroup Scrolled_Entry
963 elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes)
965 ELM_CHECK_WIDTYPE(obj, widtype);
966 Widget_Data *wd = elm_widget_data_get(obj);
968 elm_entry_maximum_bytes_set(wd->entry,max_no_of_bytes);
972 * This set's the scrolled entry in password mode with out masking the last character entered by user,
973 * and later masking the character after 2 seconds.
975 * @param obj The scrolled entry object
976 * @param show_last_character The show_last_character flag (1 for "password mode along with showing last character"
979 * @ingroup Scrolled_Entry
982 elm_scrolled_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character)
984 ELM_CHECK_WIDTYPE(obj, widtype);
985 Widget_Data *wd = elm_widget_data_get(obj);
987 elm_entry_password_show_last_character_set(wd->entry, show_last_character);
991 * Get the input method context in the scrolled entry widget
993 * @param obj The scrolled entry object
994 * @return The input method context
996 * @ingroup Scrolled_Entry
998 EAPI Ecore_IMF_Context *elm_scrolled_entry_imf_context_get(Evas_Object *obj)
1000 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1001 Widget_Data *wd = elm_widget_data_get(obj);
1002 if (!wd || !wd->entry) return NULL;
1004 return elm_entry_imf_context_get(wd->entry);
1008 * This sets the attribute to show the input panel automatically.
1010 * @param obj The scrolled entry object
1011 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
1013 * @ingroup Scrolled_Entry
1016 elm_scrolled_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
1018 ELM_CHECK_WIDTYPE(obj, widtype);
1019 Widget_Data *wd = elm_widget_data_get(obj);
1020 if (!wd || !wd->entry) return;
1022 elm_entry_input_panel_enabled_set(wd->entry, enabled);
1026 * Set the input panel layout of the scrolled entry
1028 * @param obj The scrolled entry object
1029 * @param layout the layout to set
1031 * @ingroup Scrolled_Entry
1034 elm_scrolled_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout)
1036 ELM_CHECK_WIDTYPE(obj, widtype);
1037 Widget_Data *wd = elm_widget_data_get(obj);
1038 if (!wd || !wd->entry) return;
1040 elm_entry_input_panel_layout_set(wd->entry, layout);