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 _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
142 Widget_Data *wd = elm_widget_data_get(obj);
144 elm_object_signal_emit(wd->entry, emission, source);
145 elm_object_signal_emit(wd->scroller, emission, source);
150 _entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
153 evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
157 _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
159 evas_object_smart_callback_call(data, SIG_ACTIVATED, NULL);
163 _entry_press(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
165 evas_object_smart_callback_call(data, SIG_PRESS, NULL);
169 _entry_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
171 evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
175 _entry_clicked_double(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
177 evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL);
181 _entry_cursor_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
183 evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, NULL);
187 _entry_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
189 evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, NULL);
193 _entry_selection_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
195 evas_object_smart_callback_call(data, SIG_SELECTION_START, NULL);
199 _entry_selection_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
201 evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, NULL);
205 _entry_selection_cleared(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
207 evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, NULL);
211 _entry_selection_paste(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
213 evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, NULL);
217 _entry_selection_copy(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
219 evas_object_smart_callback_call(data, SIG_SELECTION_COPY, NULL);
223 _entry_selection_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
225 evas_object_smart_callback_call(data, SIG_SELECTION_CUT, NULL);
229 _entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
231 evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL);
235 _entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
237 evas_object_smart_callback_call(data, SIG_FOCUSED, NULL);
241 _entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
243 evas_object_smart_callback_call(data, SIG_UNFOCUSED, NULL);
247 _entry_maxlength_reached(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
249 evas_object_smart_callback_call(data, "maxlength,reached", NULL);
254 * This adds a scrolled entry to @p parent object.
256 * @param parent The parent object
257 * @return The new object or NULL if it cannot be created
259 * @ingroup Scrolled_Entry
262 elm_scrolled_entry_add(Evas_Object *parent)
268 wd = ELM_NEW(Widget_Data);
269 e = evas_object_evas_get(parent);
270 obj = elm_widget_add(e);
271 ELM_SET_WIDTYPE(widtype, "scrolled_entry");
272 elm_widget_type_set(obj, "scrolled_entry");
273 elm_widget_sub_object_add(parent, obj);
274 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
275 elm_widget_data_set(obj, wd);
276 elm_widget_del_hook_set(obj, _del_hook);
277 elm_widget_disable_hook_set(obj, _disable_hook);
278 elm_widget_can_focus_set(obj, 1);
279 elm_widget_theme_hook_set(obj, _theme_hook);
280 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
282 wd->scroller = elm_scroller_add(parent);
283 elm_widget_resize_object_set(obj, wd->scroller);
284 elm_scroller_bounce_set(wd->scroller, 0, 0);
285 elm_scroller_propagate_events_set(wd->scroller, 1);
287 wd->entry = elm_entry_add(parent);
288 evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
289 evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
290 elm_scroller_content_set(wd->scroller, wd->entry);
291 evas_object_show(wd->entry);
293 evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj);
294 evas_object_smart_callback_add(wd->entry, "activated", _entry_activated, obj);
295 evas_object_smart_callback_add(wd->entry, "press", _entry_press, obj);
296 evas_object_smart_callback_add(wd->entry, "clicked", _entry_clicked, obj);
297 evas_object_smart_callback_add(wd->entry, "clicked,double", _entry_clicked_double, obj);
298 evas_object_smart_callback_add(wd->entry, "cursor,changed", _entry_cursor_changed, obj);
299 evas_object_smart_callback_add(wd->entry, "anchor,clicked", _entry_anchor_clicked, obj);
300 evas_object_smart_callback_add(wd->entry, "selection,start", _entry_selection_start, obj);
301 evas_object_smart_callback_add(wd->entry, "selection,changed", _entry_selection_changed, obj);
302 evas_object_smart_callback_add(wd->entry, "selection,cleared", _entry_selection_cleared, obj);
303 evas_object_smart_callback_add(wd->entry, "selection,paste", _entry_selection_paste, obj);
304 evas_object_smart_callback_add(wd->entry, "selection,copy", _entry_selection_copy, obj);
305 evas_object_smart_callback_add(wd->entry, "selection,cut", _entry_selection_cut, obj);
306 evas_object_smart_callback_add(wd->entry, "longpressed", _entry_longpressed, obj);
307 evas_object_smart_callback_add(wd->entry, "focused", _entry_focused, obj);
308 evas_object_smart_callback_add(wd->entry, "unfocused", _entry_unfocused, obj);
309 evas_object_smart_callback_add(wd->entry, "maxlength,reached", _entry_maxlength_reached, obj);
313 // TODO: convert Elementary to subclassing of Evas_Smart_Class
314 // TODO: and save some bytes, making descriptions per-class and not instance!
315 evas_object_smart_callbacks_descriptions_set(obj, _signals);
320 * This sets the scrolled entry object not to line wrap. All input will
321 * be on a single line, and the entry box will scroll with user input.
323 * @param obj The scrolled entry object
324 * @param single_line If true, the text in the scrolled entry
325 * will be on a single line.
327 * @ingroup Scrolled_Entry
330 elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
332 ELM_CHECK_WIDTYPE(obj, widtype);
333 Widget_Data *wd = elm_widget_data_get(obj);
335 if (wd->single_line == single_line) return;
336 elm_entry_single_line_set(wd->entry, single_line);
337 wd->single_line = single_line;
340 elm_scroller_policy_set(wd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
341 elm_scroller_content_min_limit(wd->scroller, 0, 1);
345 elm_scroller_policy_set(wd->scroller, wd->policy_h, wd->policy_v);
346 elm_scroller_content_min_limit(wd->scroller, 0, 0);
352 * This returns true if the scrolled entry has been set to single line mode.
353 * See also elm_scrolled_entry_single_line_set().
355 * @param obj The scrolled entry object
356 * @return single_line If true, the text in the scrolled entry is set to display
359 * @ingroup Scrolled_Entry
362 elm_scrolled_entry_single_line_get(const Evas_Object *obj)
364 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
365 Widget_Data *wd = elm_widget_data_get(obj);
366 if (!wd) return EINA_FALSE;
367 return elm_entry_single_line_get(wd->entry);
372 * This sets the scrolled entry object to password mode. All text entered
373 * and/or displayed within the widget will be replaced with asterisks (*).
375 * @param obj The scrolled entry object
376 * @param password If true, password mode is enabled.
378 * @ingroup Scrolled_Entry
381 elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password)
383 ELM_CHECK_WIDTYPE(obj, widtype);
384 Widget_Data *wd = elm_widget_data_get(obj);
386 elm_entry_password_set(wd->entry, password);
390 * This returns whether password mode is enabled.
391 * See also elm_scrolled_entry_password_set().
393 * @param obj The scrolled entry object
394 * @return If true, the scrolled entry is set to display all characters
397 * @ingroup Scrolled_Entry
400 elm_scrolled_entry_password_get(const Evas_Object *obj)
402 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
403 Widget_Data *wd = elm_widget_data_get(obj);
404 if (!wd) return EINA_FALSE;
405 return elm_entry_password_get(wd->entry);
410 * This sets the text displayed within the scrolled entry to @p entry.
412 * @param obj The scrolled entry object
413 * @param entry The text to be displayed
415 * @ingroup Scrolled_Entry
418 elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry)
420 ELM_CHECK_WIDTYPE(obj, widtype);
421 Widget_Data *wd = elm_widget_data_get(obj);
423 elm_entry_entry_set(wd->entry, entry);
427 * This returns the text currently shown in object @p entry.
428 * See also elm_scrolled_entry_entry_set().
430 * @param obj The scrolled entry object
431 * @return The currently displayed text or NULL on failure
433 * @ingroup Scrolled_Entry
436 elm_scrolled_entry_entry_get(const Evas_Object *obj)
438 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
439 Widget_Data *wd = elm_widget_data_get(obj);
440 if (!wd) return NULL;
441 return elm_entry_entry_get(wd->entry);
445 * This returns all selected text within the scrolled entry.
447 * @param obj The scrolled entry object
448 * @return The selected text within the scrolled entry or NULL on failure
450 * @ingroup Scrolled_Entry
453 elm_scrolled_entry_selection_get(const Evas_Object *obj)
455 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
456 Widget_Data *wd = elm_widget_data_get(obj);
457 if (!wd) return NULL;
458 return elm_entry_selection_get(wd->entry);
462 * This inserts text in @p entry at the beginning of the scrolled entry
465 * @param obj The scrolled entry object
466 * @param entry The text to insert
468 * @ingroup Scrolled_Entry
471 elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry)
473 ELM_CHECK_WIDTYPE(obj, widtype);
474 Widget_Data *wd = elm_widget_data_get(obj);
476 elm_entry_entry_insert(wd->entry, entry);
480 * This enables word line wrapping in the scrolled entry object. It is the opposite
481 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
482 * character line wrapping.
483 * See also elm_scrolled_entry_line_char_wrap_set().
485 * @param obj The scrolled entry object
486 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
487 * of the object. Wrapping will occur at the end of the word before the end of the
490 * @ingroup Scrolled_Entry
493 elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap)
495 ELM_CHECK_WIDTYPE(obj, widtype);
496 Widget_Data *wd = elm_widget_data_get(obj);
498 elm_entry_line_wrap_set(wd->entry, wrap);
502 * This enables character line wrapping in the scrolled entry object. It is the opposite
503 * of elm_scrolled_entry_single_line_set(). Additionally, setting this disables
504 * word line wrapping.
505 * See also elm_scrolled_entry_line_wrap_set().
507 * @param obj The scrolled entry object
508 * @param wrap If true, the scrolled entry will be wrapped once it reaches the end
509 * of the object. Wrapping will occur immediately upon reaching the end of the object.
511 * @ingroup Scrolled_Entry
514 elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap)
516 ELM_CHECK_WIDTYPE(obj, widtype);
517 Widget_Data *wd = elm_widget_data_get(obj);
519 elm_entry_line_char_wrap_set(wd->entry, wrap);
523 * This sets the editable attribute of the scrolled entry.
525 * @param obj The scrolled entry object
526 * @param editable If true, the scrolled entry will be editable by the user.
527 * If false, it will be set to the disabled state.
529 * @ingroup Scrolled_Entry
532 elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable)
534 ELM_CHECK_WIDTYPE(obj, widtype);
535 Widget_Data *wd = elm_widget_data_get(obj);
537 elm_entry_editable_set(wd->entry, editable);
541 * This gets the editable attribute of the scrolled entry.
542 * See also elm_scrolled_entry_editable_set().
544 * @param obj The scrolled entry object
545 * @return If true, the scrolled entry is editable by the user.
546 * If false, it is not editable by the user
548 * @ingroup Scrolled_Entry
551 elm_scrolled_entry_editable_get(const Evas_Object *obj)
553 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
554 Widget_Data *wd = elm_widget_data_get(obj);
555 if (!wd) return EINA_FALSE;
556 return elm_entry_editable_get(wd->entry);
561 * This drops any existing text selection within the scrolled entry.
563 * @param obj The scrolled entry object
565 * @ingroup Scrolled_Entry
568 elm_scrolled_entry_select_none(Evas_Object *obj)
570 ELM_CHECK_WIDTYPE(obj, widtype);
571 Widget_Data *wd = elm_widget_data_get(obj);
573 elm_entry_select_none(wd->entry);
577 * This selects all text within the scrolled entry.
579 * @param obj The scrolled entry object
581 * @ingroup Scrolled_Entry
584 elm_scrolled_entry_select_all(Evas_Object *obj)
586 ELM_CHECK_WIDTYPE(obj, widtype);
587 Widget_Data *wd = elm_widget_data_get(obj);
589 elm_entry_select_all(wd->entry);
593 * This moves the cursor one place to the right within the entry.
595 * @param obj The scrolled entry object
596 * @return EINA_TRUE upon success, EINA_FALSE upon failure
598 * @ingroup Scrolled_Entry
601 elm_scrolled_entry_cursor_next(Evas_Object *obj)
603 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
604 Widget_Data *wd = elm_widget_data_get(obj);
605 if (!wd) return EINA_FALSE;
606 return elm_entry_cursor_next(wd->entry);
610 * This moves the cursor one place to the left within the entry.
612 * @param obj The scrolled entry object
613 * @return EINA_TRUE upon success, EINA_FALSE upon failure
615 * @ingroup Scrolled_Entry
618 elm_scrolled_entry_cursor_prev(Evas_Object *obj)
620 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
621 Widget_Data *wd = elm_widget_data_get(obj);
622 if (!wd) return EINA_FALSE;
623 return elm_entry_cursor_prev(wd->entry);
627 * This moves the cursor one line up within the entry.
629 * @param obj The scrolled entry object
630 * @return EINA_TRUE upon success, EINA_FALSE upon failure
632 * @ingroup Scrolled_Entry
635 elm_scrolled_entry_cursor_up(Evas_Object *obj)
637 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
638 Widget_Data *wd = elm_widget_data_get(obj);
639 if (!wd) return EINA_FALSE;
640 return elm_entry_cursor_up(wd->entry);
644 * This moves the cursor one line down within the entry.
646 * @param obj The scrolled entry object
647 * @return EINA_TRUE upon success, EINA_FALSE upon failure
649 * @ingroup Scrolled_Entry
652 elm_scrolled_entry_cursor_down(Evas_Object *obj)
654 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
655 Widget_Data *wd = elm_widget_data_get(obj);
656 if (!wd) return EINA_FALSE;
657 return elm_entry_cursor_down(wd->entry);
661 * This moves the cursor to the beginning of the entry.
663 * @param obj The scrolled entry object
665 * @ingroup Scrolled_Entry
668 elm_scrolled_entry_cursor_begin_set(Evas_Object *obj)
670 ELM_CHECK_WIDTYPE(obj, widtype);
671 Widget_Data *wd = elm_widget_data_get(obj);
673 elm_entry_cursor_begin_set(wd->entry);
677 * This moves the cursor to the end of the entry.
679 * @param obj The scrolled entry object
681 * @ingroup Scrolled_Entry
684 elm_scrolled_entry_cursor_end_set(Evas_Object *obj)
686 ELM_CHECK_WIDTYPE(obj, widtype);
687 Widget_Data *wd = elm_widget_data_get(obj);
690 elm_scroller_region_get(wd->scroller, &x, &y, &w, &h);
691 elm_entry_cursor_end_set(wd->entry);
692 elm_scroller_region_show(wd->scroller, x, y, w, h);
696 * This moves the cursor to the beginning of the current line.
698 * @param obj The scrolled entry object
700 * @ingroup Scrolled_Entry
703 elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj)
705 ELM_CHECK_WIDTYPE(obj, widtype);
706 Widget_Data *wd = elm_widget_data_get(obj);
708 elm_entry_cursor_line_begin_set(wd->entry);
712 * This moves the cursor to the end of the current line.
714 * @param obj The scrolled entry object
716 * @ingroup Scrolled_Entry
719 elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj)
721 ELM_CHECK_WIDTYPE(obj, widtype);
722 Widget_Data *wd = elm_widget_data_get(obj);
724 elm_entry_cursor_line_end_set(wd->entry);
728 * This begins a selection within the scrolled entry as though
729 * the user were holding down the mouse button to make a selection.
731 * @param obj The scrolled entry object
733 * @ingroup Scrolled_Entry
736 elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj)
738 ELM_CHECK_WIDTYPE(obj, widtype);
739 Widget_Data *wd = elm_widget_data_get(obj);
741 elm_entry_cursor_selection_begin(wd->entry);
745 * This ends a selection within the scrolled entry as though
746 * the user had just released the mouse button while making a selection.
748 * @param obj The scrolled entry object
750 * @ingroup Scrolled_Entry
753 elm_scrolled_entry_cursor_selection_end(Evas_Object *obj)
755 ELM_CHECK_WIDTYPE(obj, widtype);
756 Widget_Data *wd = elm_widget_data_get(obj);
758 elm_entry_cursor_selection_end(wd->entry);
764 * @param obj The scrolled entry object
765 * @return TODO: fill this in
767 * @ingroup Scrolled_Entry
770 elm_scrolled_entry_cursor_is_format_get(const Evas_Object *obj)
772 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
773 Widget_Data *wd = elm_widget_data_get(obj);
774 if (!wd) return EINA_FALSE;
775 return elm_entry_cursor_is_format_get(wd->entry);
779 * This returns whether the cursor is visible.
781 * @param obj The scrolled entry object
782 * @return If true, the cursor is visible.
784 * @ingroup Scrolled_Entry
787 elm_scrolled_entry_cursor_is_visible_format_get(const Evas_Object *obj)
789 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
790 Widget_Data *wd = elm_widget_data_get(obj);
791 if (!wd) return EINA_FALSE;
792 return elm_entry_cursor_is_visible_format_get(wd->entry);
798 * @param obj The scrolled entry object
799 * @return TODO: fill this in
801 * @ingroup Scrolled_Entry
804 elm_scrolled_entry_cursor_content_get(const Evas_Object *obj)
806 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
807 Widget_Data *wd = elm_widget_data_get(obj);
808 if (!wd) return NULL;
809 return elm_entry_cursor_content_get(wd->entry);
813 * This executes a "cut" action on the selected text in the scrolled entry.
815 * @param obj The scrolled entry object
817 * @ingroup Scrolled_Entry
820 elm_scrolled_entry_selection_cut(Evas_Object *obj)
822 ELM_CHECK_WIDTYPE(obj, widtype);
823 Widget_Data *wd = elm_widget_data_get(obj);
825 elm_entry_selection_cut(wd->entry);
829 * This executes a "copy" action on the selected text in the scrolled entry.
831 * @param obj The scrolled entry object
833 * @ingroup Scrolled_Entry
836 elm_scrolled_entry_selection_copy(Evas_Object *obj)
838 ELM_CHECK_WIDTYPE(obj, widtype);
839 Widget_Data *wd = elm_widget_data_get(obj);
841 elm_entry_selection_copy(wd->entry);
845 * This executes a "paste" action in the scrolled entry.
847 * @param obj The scrolled entry object
849 * @ingroup Scrolled_Entry
852 elm_scrolled_entry_selection_paste(Evas_Object *obj)
854 ELM_CHECK_WIDTYPE(obj, widtype);
855 Widget_Data *wd = elm_widget_data_get(obj);
857 elm_entry_selection_paste(wd->entry);
861 * This clears and frees the items in a scrolled entry's contextual (right click) menu.
863 * @param obj The scrolled entry object
865 * @ingroup Scrolled_Entry
868 elm_scrolled_entry_context_menu_clear(Evas_Object *obj)
870 ELM_CHECK_WIDTYPE(obj, widtype);
871 Widget_Data *wd = elm_widget_data_get(obj);
873 elm_entry_context_menu_clear(wd->entry);
877 * This adds an item to the scrolled entry's contextual menu.
879 * @param obj The scrolled entry object
880 * @param label The item's text label
881 * @param icon_file The item's icon file
882 * @param icon_type The item's icon type
883 * @param func The callback to execute when the item is clicked
884 * @param data The data to associate with the item for related functions
886 * @ingroup Scrolled_Entry
889 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)
891 ELM_CHECK_WIDTYPE(obj, widtype);
892 Widget_Data *wd = elm_widget_data_get(obj);
894 elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, func, data);
898 * This disables the scrolled entry's contextual (right click) menu.
900 * @param obj The scrolled entry object
901 * @param disabled If true, the menu is disabled
903 * @ingroup Scrolled_Entry
906 elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
908 ELM_CHECK_WIDTYPE(obj, widtype);
909 Widget_Data *wd = elm_widget_data_get(obj);
911 elm_entry_context_menu_disabled_set(wd->entry, disabled);
915 * This returns whether the scrolled entry's contextual (right click) menu is disabled.
917 * @param obj The scrolled entry object
918 * @return If true, the menu is disabled
920 * @ingroup Scrolled_Entry
923 elm_scrolled_entry_context_menu_disabled_get(const Evas_Object *obj)
925 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
926 Widget_Data *wd = elm_widget_data_get(obj);
927 if (!wd) return EINA_FALSE;
928 return elm_entry_context_menu_disabled_get(wd->entry);
932 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling them).
934 * @param obj The scrolled entry object
935 * @param h The horizontal scrollbar policy to apply
936 * @param v The vertical scrollbar policy to apply
938 * @ingroup Scrolled_Entry
941 elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v)
943 ELM_CHECK_WIDTYPE(obj, widtype);
944 Widget_Data *wd = elm_widget_data_get(obj);
948 elm_scroller_policy_set(wd->scroller, h, v);
952 * This enables/disables bouncing within the entry.
954 * @param obj The scrolled entry object
955 * @param h The horizontal bounce state
956 * @param v The vertical bounce state
958 * @ingroup Scrolled_Entry
961 elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
963 ELM_CHECK_WIDTYPE(obj, widtype);
964 Widget_Data *wd = elm_widget_data_get(obj);
966 elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce);
969 * This set's the maximum bytes that can be added in to scrolled entry.
971 * @param obj The scrolled entry object
972 * @param max_no_of_bytes Maximum number of bytes scrolled entry can have.
974 * @ingroup Scrolled_Entry
977 elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes)
979 ELM_CHECK_WIDTYPE(obj, widtype);
980 Widget_Data *wd = elm_widget_data_get(obj);
982 elm_entry_maximum_bytes_set(wd->entry,max_no_of_bytes);
986 * This set's the scrolled entry in password mode with out masking the last character entered by user,
987 * and later masking the character after 2 seconds.
989 * @param obj The scrolled entry object
990 * @param show_last_character The show_last_character flag (1 for "password mode along with showing last character"
993 * @ingroup Scrolled_Entry
996 elm_scrolled_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character)
998 ELM_CHECK_WIDTYPE(obj, widtype);
999 Widget_Data *wd = elm_widget_data_get(obj);
1001 elm_entry_password_show_last_character_set(wd->entry, show_last_character);
1005 * Get the input method context in the scrolled entry widget
1007 * @param obj The scrolled entry object
1008 * @return The input method context
1010 * @ingroup Scrolled_Entry
1012 EAPI Ecore_IMF_Context *elm_scrolled_entry_imf_context_get(Evas_Object *obj)
1014 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1015 Widget_Data *wd = elm_widget_data_get(obj);
1016 if (!wd || !wd->entry) return NULL;
1018 return elm_entry_imf_context_get(wd->entry);
1022 * This sets the attribute to show the input panel automatically.
1024 * @param obj The scrolled entry object
1025 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
1027 * @ingroup Scrolled_Entry
1030 elm_scrolled_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
1032 ELM_CHECK_WIDTYPE(obj, widtype);
1033 Widget_Data *wd = elm_widget_data_get(obj);
1034 if (!wd || !wd->entry) return;
1036 elm_entry_input_panel_enabled_set(wd->entry, enabled);
1040 * Set the input panel layout of the scrolled entry
1042 * @param obj The scrolled entry object
1043 * @param layout the layout to set
1045 * @ingroup Scrolled_Entry
1048 elm_scrolled_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout)
1050 ELM_CHECK_WIDTYPE(obj, widtype);
1051 Widget_Data *wd = elm_widget_data_get(obj);
1052 if (!wd || !wd->entry) return;
1054 elm_entry_input_panel_layout_set(wd->entry, layout);