1 typedef enum _Elm_Text_Format
3 ELM_TEXT_FORMAT_PLAIN_UTF8,
4 ELM_TEXT_FORMAT_MARKUP_UTF8
10 typedef enum _Elm_Wrap_Type
12 ELM_WRAP_NONE = 0, /**< No wrap - value is zero */
13 ELM_WRAP_CHAR, /**< Char wrap - wrap between characters */
14 ELM_WRAP_WORD, /**< Word wrap - wrap in allowed wrapping points (as defined in the unicode standard) */
15 ELM_WRAP_MIXED, /**< Mixed wrap - Word wrap, and if that fails, char wrap. */
21 ELM_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */
22 ELM_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */
23 ELM_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */
24 ELM_INPUT_PANEL_LAYOUT_URL, /**< URL layout */
25 ELM_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */
26 ELM_INPUT_PANEL_LAYOUT_IP, /**< IP layout */
27 ELM_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */
28 ELM_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */
29 ELM_INPUT_PANEL_LAYOUT_INVALID // XXX: remove this so we can expand
30 } Elm_Input_Panel_Layout;
34 ELM_AUTOCAPITAL_TYPE_NONE,
35 ELM_AUTOCAPITAL_TYPE_WORD,
36 ELM_AUTOCAPITAL_TYPE_SENTENCE,
37 ELM_AUTOCAPITAL_TYPE_ALLCHARACTER,
38 } Elm_Autocapital_Type;
41 * @defgroup Entry Entry
43 * @image html img/widget/entry/preview-00.png
44 * @image latex img/widget/entry/preview-00.eps width=\textwidth
45 * @image html img/widget/entry/preview-01.png
46 * @image latex img/widget/entry/preview-01.eps width=\textwidth
47 * @image html img/widget/entry/preview-02.png
48 * @image latex img/widget/entry/preview-02.eps width=\textwidth
49 * @image html img/widget/entry/preview-03.png
50 * @image latex img/widget/entry/preview-03.eps width=\textwidth
52 * An entry is a convenience widget which shows a box that the user can
53 * enter text into. Entries by default don't scroll, so they grow to
54 * accomodate the entire text, resizing the parent window as needed. This
55 * can be changed with the elm_entry_scrollable_set() function.
57 * They can also be single line or multi line (the default) and when set
58 * to multi line mode they support text wrapping in any of the modes
59 * indicated by #Elm_Wrap_Type.
61 * Other features include password mode, filtering of inserted text with
62 * elm_entry_text_filter_append() and related functions, inline "items" and
63 * formatted markup text.
65 * @section entry-markup Formatted text
67 * The markup tags supported by the Entry are defined by the theme, but
68 * even when writing new themes or extensions it's a good idea to stick to
69 * a sane default, to maintain coherency and avoid application breakages.
70 * Currently defined by the default theme are the following tags:
71 * @li \<br\>: Inserts a line break.
72 * @li \<ps\>: Inserts a paragraph separator. This is preferred over line
74 * @li \<tab\>: Inserts a tab.
75 * @li \<em\>...\</em\>: Emphasis. Sets the @em oblique style for the
77 * @li \<b\>...\</b\>: Sets the @b bold style for the enclosed text.
78 * @li \<link\>...\</link\>: Underlines the enclosed text.
79 * @li \<hilight\>...\</hilight\>: Hilights the enclosed text.
81 * @section entry-special Special markups
83 * Besides those used to format text, entries support two special markup
84 * tags used to insert clickable portions of text or items inlined within
87 * @subsection entry-anchors Anchors
89 * Anchors are similar to HTML anchors. Text can be surrounded by \<a\> and
90 * \</a\> tags and an event will be generated when this text is clicked,
94 * This text is outside <a href=anc-01>but this one is an anchor</a>
97 * The @c href attribute in the opening tag gives the name that will be
98 * used to identify the anchor and it can be any valid utf8 string.
100 * When an anchor is clicked, an @c "anchor,clicked" signal is emitted with
101 * an #Elm_Entry_Anchor_Info in the @c event_info parameter for the
102 * callback function. The same applies for "anchor,in" (mouse in), "anchor,out"
103 * (mouse out), "anchor,down" (mouse down), and "anchor,up" (mouse up) events on
106 * @subsection entry-items Items
108 * Inlined in the text, any other @c Evas_Object can be inserted by using
109 * \<item\> tags this way:
112 * <item size=16x16 vsize=full href=emoticon/haha></item>
115 * Just like with anchors, the @c href identifies each item, but these need,
116 * in addition, to indicate their size, which is done using any one of
117 * @c size, @c absize or @c relsize attributes. These attributes take their
118 * value in the WxH format, where W is the width and H the height of the
121 * @li absize: Absolute pixel size for the item. Whatever value is set will
122 * be the item's size regardless of any scale value the object may have
123 * been set to. The final line height will be adjusted to fit larger items.
124 * @li size: Similar to @c absize, but it's adjusted to the scale value set
126 * @li relsize: Size is adjusted for the item to fit within the current
129 * Besides their size, items are specificed a @c vsize value that affects
130 * how their final size and position are calculated. The possible values
132 * @li ascent: Item will be placed within the line's baseline and its
133 * ascent. That is, the height between the line where all characters are
134 * positioned and the highest point in the line. For @c size and @c absize
135 * items, the descent value will be added to the total line height to make
136 * them fit. @c relsize items will be adjusted to fit within this space.
137 * @li full: Items will be placed between the descent and ascent, or the
138 * lowest point in the line and its highest.
140 * The next image shows different configurations of items and how
141 * the previously mentioned options affect their sizes. In all cases,
142 * the green line indicates the ascent, blue for the baseline and red for
145 * @image html entry_item.png
146 * @image latex entry_item.eps width=\textwidth
148 * And another one to show how size differs from absize. In the first one,
149 * the scale value is set to 1.0, while the second one is using one of 2.0.
151 * @image html entry_item_scale.png
152 * @image latex entry_item_scale.eps width=\textwidth
154 * After the size for an item is calculated, the entry will request an
155 * object to place in its space. For this, the functions set with
156 * elm_entry_item_provider_append() and related functions will be called
157 * in order until one of them returns a @c non-NULL value. If no providers
158 * are available, or all of them return @c NULL, then the entry falls back
159 * to one of the internal defaults, provided the name matches with one of
162 * All of the following are currently supported:
165 * - emoticon/angry-shout
166 * - emoticon/crazy-laugh
167 * - emoticon/evil-laugh
169 * - emoticon/goggle-smile
171 * - emoticon/grumpy-smile
173 * - emoticon/guilty-smile
175 * - emoticon/half-smile
176 * - emoticon/happy-panting
178 * - emoticon/indifferent
180 * - emoticon/knowing-grin
182 * - emoticon/little-bit-sorry
183 * - emoticon/love-lots
185 * - emoticon/minimal-smile
186 * - emoticon/not-happy
187 * - emoticon/not-impressed
189 * - emoticon/opensmile
192 * - emoticon/squint-laugh
193 * - emoticon/surprised
194 * - emoticon/suspicious
195 * - emoticon/tongue-dangling
196 * - emoticon/tongue-poke
199 * - emoticon/very-sorry
205 * Alternatively, an item may reference an image by its path, using
206 * the URI form @c file:///path/to/an/image.png and the entry will then
207 * use that image for the item.
209 * @section entry-files Loading and saving files
211 * Entries have convinience functions to load text from a file and save
212 * changes back to it after a short delay. The automatic saving is enabled
213 * by default, but can be disabled with elm_entry_autosave_set() and files
214 * can be loaded directly as plain text or have any markup in them
215 * recognized. See elm_entry_file_set() for more details.
217 * @section entry-signals Emitted signals
219 * This widget emits the following signals:
221 * @li "changed": The text within the entry was changed.
222 * @li "changed,user": The text within the entry was changed because of user interaction.
223 * @li "activated": The enter key was pressed on a single line entry.
224 * @li "press": A mouse button has been pressed on the entry.
225 * @li "longpressed": A mouse button has been pressed and held for a couple
227 * @li "clicked": The entry has been clicked (mouse press and release).
228 * @li "clicked,double": The entry has been double clicked.
229 * @li "clicked,triple": The entry has been triple clicked.
230 * @li "focused": The entry has received focus.
231 * @li "unfocused": The entry has lost focus.
232 * @li "selection,paste": A paste of the clipboard contents was requested.
233 * @li "selection,copy": A copy of the selected text into the clipboard was
235 * @li "selection,cut": A cut of the selected text into the clipboard was
237 * @li "selection,start": A selection has begun and no previous selection
239 * @li "selection,changed": The current selection has changed.
240 * @li "selection,cleared": The current selection has been cleared.
241 * @li "cursor,changed": The cursor has changed position.
242 * @li "anchor,clicked": An anchor has been clicked. The event_info
243 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
244 * @li "anchor,in": Mouse cursor has moved into an anchor. The event_info
245 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
246 * @li "anchor,out": Mouse cursor has moved out of an anchor. The event_info
247 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
248 * @li "anchor,up": Mouse button has been unpressed on an anchor. The event_info
249 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
250 * @li "anchor,down": Mouse button has been pressed on an anchor. The event_info
251 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
252 * @li "preedit,changed": The preedit string has changed.
253 * @li "language,changed": Program language changed.
255 * @section entry-examples
257 * An overview of the Entry API can be seen in @ref entry_example_01
263 * @typedef Elm_Entry_Anchor_Info
265 * The info sent in the callback for the "anchor,clicked" signals emitted
268 typedef struct _Elm_Entry_Anchor_Info Elm_Entry_Anchor_Info;
271 * @struct _Elm_Entry_Anchor_Info
273 * The info sent in the callback for the "anchor,clicked" signals emitted
276 struct _Elm_Entry_Anchor_Info
278 const char *name; /**< The name of the anchor, as stated in its href */
279 int button; /**< The mouse button used to click on it */
280 Evas_Coord x, /**< Anchor geometry, relative to canvas */
281 y, /**< Anchor geometry, relative to canvas */
282 w, /**< Anchor geometry, relative to canvas */
283 h; /**< Anchor geometry, relative to canvas */
287 * @typedef Elm_Entry_Filter_Cb
288 * This callback type is used by entry filters to modify text.
289 * @param data The data specified as the last param when adding the filter
290 * @param entry The entry object
291 * @param text A pointer to the location of the text being filtered. This data can be modified,
292 * but any additional allocations must be managed by the user.
293 * @see elm_entry_text_filter_append
294 * @see elm_entry_text_filter_prepend
296 typedef void (*Elm_Entry_Filter_Cb)(void *data, Evas_Object *entry, char **text);
299 * @typedef Elm_Entry_Change_Info
300 * This corresponds to Edje_Entry_Change_Info. Includes information about
301 * a change in the entry.
303 typedef Edje_Entry_Change_Info Elm_Entry_Change_Info;
306 * This adds an entry to @p parent object.
308 * By default, entries are:
312 * @li autosave is enabled
314 * @param parent The parent object
315 * @return The new object or NULL if it cannot be created
318 elm_entry_add(Evas_Object *parent)
322 * Sets the entry to single line mode.
324 * In single line mode, entries don't ever wrap when the text reaches the
325 * edge, and instead they keep growing horizontally. Pressing the @c Enter
326 * key will generate an @c "activate" event instead of adding a new line.
328 * When @p single_line is @c EINA_FALSE, line wrapping takes effect again
329 * and pressing enter will break the text into a different line
330 * without generating any events.
332 * @param obj The entry object
333 * @param single_line If true, the text in the entry
334 * will be on a single line.
336 EAPI void elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line) EINA_ARG_NONNULL(1);
339 * Gets whether the entry is set to be single line.
341 * @param obj The entry object
342 * @return single_line If true, the text in the entry is set to display
345 * @see elm_entry_single_line_set()
347 EAPI Eina_Bool elm_entry_single_line_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
350 * Sets the entry to password mode.
352 * In password mode, entries are implicitly single line and the display of
353 * any text in them is replaced with asterisks (*).
355 * @param obj The entry object
356 * @param password If true, password mode is enabled.
358 EAPI void elm_entry_password_set(Evas_Object *obj, Eina_Bool password) EINA_ARG_NONNULL(1);
361 * Gets whether the entry is set to password mode.
363 * @param obj The entry object
364 * @return If true, the entry is set to display all characters
367 * @see elm_entry_password_set()
369 EAPI Eina_Bool elm_entry_password_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
372 * This sets the text displayed within the entry to @p entry.
374 * @param obj The entry object
375 * @param entry The text to be displayed
377 * @deprecated Use elm_object_text_set() instead.
378 * @note Using this function bypasses text filters
380 EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1);
383 * This returns the text currently shown in object @p entry.
384 * See also elm_entry_entry_set().
386 * @param obj The entry object
387 * @return The currently displayed text or NULL on failure
389 * @deprecated Use elm_object_text_get() instead.
391 EAPI const char *elm_entry_entry_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
394 * Appends @p entry to the text of the entry.
396 * Adds the text in @p entry to the end of any text already present in the
399 * The appended text is subject to any filters set for the widget.
401 * @param obj The entry object
402 * @param entry The text to be displayed
404 * @see elm_entry_text_filter_append()
406 EAPI void elm_entry_entry_append(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1);
409 * Gets whether the entry is empty.
411 * Empty means no text at all. If there are any markup tags, like an item
412 * tag for which no provider finds anything, and no text is displayed, this
413 * function still returns EINA_FALSE.
415 * @param obj The entry object
416 * @return EINA_TRUE if the entry is empty, EINA_FALSE otherwise.
418 EAPI Eina_Bool elm_entry_is_empty(const Evas_Object *obj) EINA_ARG_NONNULL(1);
421 * Gets any selected text within the entry.
423 * If there's any selected text in the entry, this function returns it as
424 * a string in markup format. NULL is returned if no selection exists or
425 * if an error occurred.
427 * The returned value points to an internal string and should not be freed
428 * or modified in any way. If the @p entry object is deleted or its
429 * contents are changed, the returned pointer should be considered invalid.
431 * @param obj The entry object
432 * @return The selected text within the entry or NULL on failure
434 EAPI const char *elm_entry_selection_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
437 * Returns the actual textblock object of the entry.
439 * This function exposes the internal textblock object that actually
440 * contains and draws the text. This should be used for low-level
441 * manipulations that are otherwise not possible.
443 * Changing the textblock directly from here will not notify edje/elm to
444 * recalculate the textblock size automatically, so any modifications
445 * done to the textblock returned by this function should be followed by
446 * a call to elm_entry_calc_force().
448 * The return value is marked as const as an additional warning.
449 * One should not use the returned object with any of the generic evas
450 * functions (geometry_get/resize/move and etc), but only with the textblock
451 * functions; The former will either not work at all, or break the correct
454 * IMPORTANT: Many functions may change (i.e delete and create a new one)
455 * the internal textblock object. Do NOT cache the returned object, and try
456 * not to mix calls on this object with regular elm_entry calls (which may
457 * change the internal textblock object). This applies to all cursors
458 * returned from textblock calls, and all the other derivative values.
460 * @param obj The entry object
461 * @return The textblock object.
463 EAPI const Evas_Object *elm_entry_textblock_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
466 * Forces calculation of the entry size and text layouting.
468 * This should be used after modifying the textblock object directly. See
469 * elm_entry_textblock_get() for more information.
471 * @param obj The entry object
473 * @see elm_entry_textblock_get()
475 EAPI void elm_entry_calc_force(const Evas_Object *obj) EINA_ARG_NONNULL(1);
478 * Inserts the given text into the entry at the current cursor position.
480 * This inserts text at the cursor position as if it was typed
481 * by the user (note that this also allows markup which a user
482 * can't just "type" as it would be converted to escaped text, so this
483 * call can be used to insert things like emoticon items or bold push/pop
484 * tags, other font and color change tags etc.)
486 * If any selection exists, it will be replaced by the inserted text.
488 * The inserted text is subject to any filters set for the widget.
490 * @param obj The entry object
491 * @param entry The text to insert
493 * @see elm_entry_text_filter_append()
495 EAPI void elm_entry_entry_insert(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1);
498 * Set the line wrap type to use on multi-line entries.
500 * Sets the wrap type used by the entry to any of the specified in
501 * #Elm_Wrap_Type. This tells how the text will be implicitly cut into a new
502 * line (without inserting a line break or paragraph separator) when it
503 * reaches the far edge of the widget.
505 * Note that this only makes sense for multi-line entries. A widget set
506 * to be single line will never wrap.
508 * @param obj The entry object
509 * @param wrap The wrap mode to use. See #Elm_Wrap_Type for details on them
511 EAPI void elm_entry_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap) EINA_ARG_NONNULL(1);
514 * Gets the wrap mode the entry was set to use.
516 * @param obj The entry object
519 * @see also elm_entry_line_wrap_set()
521 EAPI Elm_Wrap_Type elm_entry_line_wrap_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
524 * Sets if the entry is to be editable or not.
526 * By default, entries are editable and when focused, any text input by the
527 * user will be inserted at the current cursor position. But calling this
528 * function with @p editable as EINA_FALSE will prevent the user from
529 * inputting text into the entry.
531 * The only way to change the text of a non-editable entry is to use
532 * elm_object_text_set(), elm_entry_entry_insert() and other related
535 * @param obj The entry object
536 * @param editable If EINA_TRUE, user input will be inserted in the entry,
537 * if not, the entry is read-only and no user input is allowed.
539 EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable) EINA_ARG_NONNULL(1);
542 * Gets whether the entry is editable or not.
544 * @param obj The entry object
545 * @return If true, the entry is editable by the user.
546 * If false, it is not editable by the user
548 * @see elm_entry_editable_set()
550 EAPI Eina_Bool elm_entry_editable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
553 * This drops any existing text selection within the entry.
555 * @param obj The entry object
557 EAPI void elm_entry_select_none(Evas_Object *obj) EINA_ARG_NONNULL(1);
560 * This selects all text within the entry.
562 * @param obj The entry object
564 EAPI void elm_entry_select_all(Evas_Object *obj) EINA_ARG_NONNULL(1);
567 * This moves the cursor one place to the right within the entry.
569 * @param obj The entry object
570 * @return EINA_TRUE upon success, EINA_FALSE upon failure
572 EAPI Eina_Bool elm_entry_cursor_next(Evas_Object *obj) EINA_ARG_NONNULL(1);
575 * This moves the cursor one place to the left within the entry.
577 * @param obj The entry object
578 * @return EINA_TRUE upon success, EINA_FALSE upon failure
580 EAPI Eina_Bool elm_entry_cursor_prev(Evas_Object *obj) EINA_ARG_NONNULL(1);
583 * This moves the cursor one line up within the entry.
585 * @param obj The entry object
586 * @return EINA_TRUE upon success, EINA_FALSE upon failure
588 EAPI Eina_Bool elm_entry_cursor_up(Evas_Object *obj) EINA_ARG_NONNULL(1);
591 * This moves the cursor one line down within the entry.
593 * @param obj The entry object
594 * @return EINA_TRUE upon success, EINA_FALSE upon failure
596 EAPI Eina_Bool elm_entry_cursor_down(Evas_Object *obj) EINA_ARG_NONNULL(1);
599 * This moves the cursor to the beginning of the entry.
601 * @param obj The entry object
603 EAPI void elm_entry_cursor_begin_set(Evas_Object *obj) EINA_ARG_NONNULL(1);
606 * This moves the cursor to the end of the entry.
608 * @param obj The entry object
610 EAPI void elm_entry_cursor_end_set(Evas_Object *obj) EINA_ARG_NONNULL(1);
613 * This moves the cursor to the beginning of the current line.
615 * @param obj The entry object
617 EAPI void elm_entry_cursor_line_begin_set(Evas_Object *obj) EINA_ARG_NONNULL(1);
620 * This moves the cursor to the end of the current line.
622 * @param obj The entry object
624 EAPI void elm_entry_cursor_line_end_set(Evas_Object *obj) EINA_ARG_NONNULL(1);
627 * This begins a selection within the entry as though
628 * the user were holding down the mouse button to make a selection.
630 * @param obj The entry object
632 EAPI void elm_entry_cursor_selection_begin(Evas_Object *obj) EINA_ARG_NONNULL(1);
635 * This ends a selection within the entry as though
636 * the user had just released the mouse button while making a selection.
638 * @param obj The entry object
640 EAPI void elm_entry_cursor_selection_end(Evas_Object *obj) EINA_ARG_NONNULL(1);
643 * Gets whether a format node exists at the current cursor position.
645 * A format node is anything that defines how the text is rendered. It can
646 * be a visible format node, such as a line break or a paragraph separator,
647 * or an invisible one, such as bold begin or end tag.
648 * This function returns whether any format node exists at the current
651 * @param obj The entry object
652 * @return EINA_TRUE if the current cursor position contains a format node,
653 * EINA_FALSE otherwise.
655 * @see elm_entry_cursor_is_visible_format_get()
657 EAPI Eina_Bool elm_entry_cursor_is_format_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
660 * Gets if the current cursor position holds a visible format node.
662 * @param obj The entry object
663 * @return EINA_TRUE if the current cursor is a visible format, EINA_FALSE
664 * if it's an invisible one or no format exists.
666 * @see elm_entry_cursor_is_format_get()
668 EAPI Eina_Bool elm_entry_cursor_is_visible_format_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
671 * Gets the character pointed by the cursor at its current position.
673 * This function returns a string with the utf8 character stored at the
674 * current cursor position.
675 * Only the text is returned, any format that may exist will not be part
676 * of the return value.
678 * @param obj The entry object
679 * @return The text pointed by the cursors.
681 EAPI const char *elm_entry_cursor_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
684 * This function returns the geometry of the cursor.
686 * It's useful if you want to draw something on the cursor (or where it is),
687 * or for example in the case of scrolled entry where you want to show the
690 * @param obj The entry object
691 * @param x returned geometry
692 * @param y returned geometry
693 * @param w returned geometry
694 * @param h returned geometry
695 * @return EINA_TRUE upon success, EINA_FALSE upon failure
697 EAPI Eina_Bool elm_entry_cursor_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
700 * Sets the cursor position in the entry to the given value
702 * The value in @p pos is the index of the character position within the
703 * contents of the string as returned by elm_entry_cursor_pos_get().
705 * @param obj The entry object
706 * @param pos The position of the cursor
708 EAPI void elm_entry_cursor_pos_set(Evas_Object *obj, int pos) EINA_ARG_NONNULL(1);
711 * Retrieves the current position of the cursor in the entry
713 * @param obj The entry object
714 * @return The cursor position
716 EAPI int elm_entry_cursor_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
719 * This executes a "cut" action on the selected text in the entry.
721 * @param obj The entry object
723 EAPI void elm_entry_selection_cut(Evas_Object *obj) EINA_ARG_NONNULL(1);
726 * This executes a "copy" action on the selected text in the entry.
728 * @param obj The entry object
730 EAPI void elm_entry_selection_copy(Evas_Object *obj) EINA_ARG_NONNULL(1);
733 * This executes a "paste" action in the entry.
735 * @param obj The entry object
737 EAPI void elm_entry_selection_paste(Evas_Object *obj) EINA_ARG_NONNULL(1);
740 * This clears and frees the items in a entry's contextual (longpress)
743 * @param obj The entry object
745 * @see elm_entry_context_menu_item_add()
747 EAPI void elm_entry_context_menu_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
750 * This adds an item to the entry's contextual menu.
752 * A longpress on an entry will make the contextual menu show up, if this
753 * hasn't been disabled with elm_entry_context_menu_disabled_set().
754 * By default, this menu provides a few options like enabling selection mode,
755 * which is useful on embedded devices that need to be explicit about it,
756 * and when a selection exists it also shows the copy and cut actions.
758 * With this function, developers can add other options to this menu to
759 * perform any action they deem necessary.
761 * @param obj The entry object
762 * @param label The item's text label
763 * @param icon_file The item's icon file
764 * @param icon_type The item's icon type
765 * @param func The callback to execute when the item is clicked
766 * @param data The data to associate with the item for related functions
768 EAPI void elm_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) EINA_ARG_NONNULL(1);
771 * This disables the entry's contextual (longpress) menu.
773 * @param obj The entry object
774 * @param disabled If true, the menu is disabled
776 EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled) EINA_ARG_NONNULL(1);
779 * This returns whether the entry's contextual (longpress) menu is
782 * @param obj The entry object
783 * @return If true, the menu is disabled
785 EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
788 * This appends a custom item provider to the list for that entry
790 * This appends the given callback. The list is walked from beginning to end
791 * with each function called given the item href string in the text. If the
792 * function returns an object handle other than NULL (it should create an
793 * object to do this), then this object is used to replace that item. If
794 * not the next provider is called until one provides an item object, or the
795 * default provider in entry does.
797 * @param obj The entry object
798 * @param func The function called to provide the item object
799 * @param data The data passed to @p func
801 * @see @ref entry-items
803 EAPI void elm_entry_item_provider_append(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data) EINA_ARG_NONNULL(1, 2);
806 * This prepends a custom item provider to the list for that entry
808 * This prepends the given callback. See elm_entry_item_provider_append() for
811 * @param obj The entry object
812 * @param func The function called to provide the item object
813 * @param data The data passed to @p func
815 EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data) EINA_ARG_NONNULL(1, 2);
818 * This removes a custom item provider to the list for that entry
820 * This removes the given callback. See elm_entry_item_provider_append() for
823 * @param obj The entry object
824 * @param func The function called to provide the item object
825 * @param data The data passed to @p func
827 EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data) EINA_ARG_NONNULL(1, 2);
830 * Append a filter function for text inserted in the entry
832 * Append the given callback to the list. This functions will be called
833 * whenever any text is inserted into the entry, with the text to be inserted
834 * as a parameter. The callback function is free to alter the text in any way
835 * it wants, but it must remember to free the given pointer and update it.
836 * If the new text is to be discarded, the function can free it and set its
837 * text parameter to NULL. This will also prevent any following filters from
840 * @param obj The entry object
841 * @param func The function to use as text filter
842 * @param data User data to pass to @p func
844 EAPI void elm_entry_text_filter_append(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data) EINA_ARG_NONNULL(1, 2);
847 * Prepend a filter function for text insdrted in the entry
849 * Prepend the given callback to the list. See elm_entry_text_filter_append()
850 * for more information
852 * @param obj The entry object
853 * @param func The function to use as text filter
854 * @param data User data to pass to @p func
856 EAPI void elm_entry_text_filter_prepend(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data) EINA_ARG_NONNULL(1, 2);
859 * Remove a filter from the list
861 * Removes the given callback from the filter list. See
862 * elm_entry_text_filter_append() for more information.
864 * @param obj The entry object
865 * @param func The filter function to remove
866 * @param data The user data passed when adding the function
868 EAPI void elm_entry_text_filter_remove(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data) EINA_ARG_NONNULL(1, 2);
871 * This converts a markup (HTML-like) string into UTF-8.
873 * The returned string is a malloc'ed buffer and it should be freed when
874 * not needed anymore.
876 * @param s The string (in markup) to be converted
877 * @return The converted string (in UTF-8). It should be freed.
879 EAPI char *elm_entry_markup_to_utf8(const char *s)
880 EINA_MALLOC EINA_WARN_UNUSED_RESULT;
883 * This converts a UTF-8 string into markup (HTML-like).
885 * The returned string is a malloc'ed buffer and it should be freed when
886 * not needed anymore.
888 * @param s The string (in UTF-8) to be converted
889 * @return The converted string (in markup). It should be freed.
891 EAPI char *elm_entry_utf8_to_markup(const char *s)
892 EINA_MALLOC EINA_WARN_UNUSED_RESULT;
895 * This sets the file (and implicitly loads it) for the text to display and
896 * then edit. All changes are written back to the file after a short delay if
897 * the entry object is set to autosave (which is the default).
899 * If the entry had any other file set previously, any changes made to it
900 * will be saved if the autosave feature is enabled, otherwise, the file
901 * will be silently discarded and any non-saved changes will be lost.
903 * @param obj The entry object
904 * @param file The path to the file to load and save
905 * @param format The file format
907 EAPI void elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format) EINA_ARG_NONNULL(1);
910 * Gets the file being edited by the entry.
912 * This function can be used to retrieve any file set on the entry for
913 * edition, along with the format used to load and save it.
915 * @param obj The entry object
916 * @param file The path to the file to load and save
917 * @param format The file format
919 EAPI void elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format) EINA_ARG_NONNULL(1);
922 * This function writes any changes made to the file set with
923 * elm_entry_file_set()
925 * @param obj The entry object
927 EAPI void elm_entry_file_save(Evas_Object *obj) EINA_ARG_NONNULL(1);
930 * This sets the entry object to 'autosave' the loaded text file or not.
932 * @param obj The entry object
933 * @param autosave Autosave the loaded file or not
935 * @see elm_entry_file_set()
937 EAPI void elm_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave) EINA_ARG_NONNULL(1);
940 * This gets the entry object's 'autosave' status.
942 * @param obj The entry object
943 * @return Autosave the loaded file or not
945 * @see elm_entry_file_set()
947 EAPI Eina_Bool elm_entry_autosave_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
950 * Control pasting of text and images for the widget.
952 * Normally the entry allows both text and images to be pasted. By setting
953 * textonly to be true, this prevents images from being pasted.
955 * Note this only changes the behaviour of text.
957 * @param obj The entry object
958 * @param textonly paste mode - EINA_TRUE is text only, EINA_FALSE is
961 EAPI void elm_entry_cnp_textonly_set(Evas_Object *obj, Eina_Bool textonly) EINA_ARG_NONNULL(1);
964 * Getting elm_entry text paste/drop mode.
966 * In textonly mode, only text may be pasted or dropped into the widget.
968 * @param obj The entry object
969 * @return If the widget only accepts text from pastes.
971 EAPI Eina_Bool elm_entry_cnp_textonly_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
974 * Enable or disable scrolling in entry
976 * Normally the entry is not scrollable unless you enable it with this call.
978 * @param obj The entry object
979 * @param scroll EINA_TRUE if it is to be scrollable, EINA_FALSE otherwise
981 EAPI void elm_entry_scrollable_set(Evas_Object *obj, Eina_Bool scroll);
984 * Get the scrollable state of the entry
986 * Normally the entry is not scrollable. This gets the scrollable state
987 * of the entry. See elm_entry_scrollable_set() for more information.
989 * @param obj The entry object
990 * @return The scrollable state
992 EAPI Eina_Bool elm_entry_scrollable_get(const Evas_Object *obj);
995 * This sets a widget to be displayed to the left of a scrolled entry.
997 * @param obj The scrolled entry object
998 * @param icon The widget to display on the left side of the scrolled
1001 * @note A previously set widget will be destroyed.
1002 * @note If the object being set does not have minimum size hints set,
1003 * it won't get properly displayed.
1005 * @see elm_entry_end_set()
1007 EAPI void elm_entry_icon_set(Evas_Object *obj, Evas_Object *icon);
1010 * Gets the leftmost widget of the scrolled entry. This object is
1011 * owned by the scrolled entry and should not be modified.
1013 * @param obj The scrolled entry object
1014 * @return the left widget inside the scroller
1016 EAPI Evas_Object *elm_entry_icon_get(const Evas_Object *obj);
1019 * Unset the leftmost widget of the scrolled entry, unparenting and
1022 * @param obj The scrolled entry object
1023 * @return the previously set icon sub-object of this entry, on
1026 * @see elm_entry_icon_set()
1028 EAPI Evas_Object *elm_entry_icon_unset(Evas_Object *obj);
1031 * Sets the visibility of the left-side widget of the scrolled entry,
1032 * set by elm_entry_icon_set().
1034 * @param obj The scrolled entry object
1035 * @param setting EINA_TRUE if the object should be displayed,
1036 * EINA_FALSE if not.
1038 EAPI void elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting);
1041 * This sets a widget to be displayed to the end of a scrolled entry.
1043 * @param obj The scrolled entry object
1044 * @param end The widget to display on the right side of the scrolled
1047 * @note A previously set widget will be destroyed.
1048 * @note If the object being set does not have minimum size hints set,
1049 * it won't get properly displayed.
1051 * @see elm_entry_icon_set
1053 EAPI void elm_entry_end_set(Evas_Object *obj, Evas_Object *end);
1056 * Gets the endmost widget of the scrolled entry. This object is owned
1057 * by the scrolled entry and should not be modified.
1059 * @param obj The scrolled entry object
1060 * @return the right widget inside the scroller
1062 EAPI Evas_Object *elm_entry_end_get(const Evas_Object *obj);
1065 * Unset the endmost widget of the scrolled entry, unparenting and
1068 * @param obj The scrolled entry object
1069 * @return the previously set icon sub-object of this entry, on
1072 * @see elm_entry_icon_set()
1074 EAPI Evas_Object *elm_entry_end_unset(Evas_Object *obj);
1077 * Sets the visibility of the end widget of the scrolled entry, set by
1078 * elm_entry_end_set().
1080 * @param obj The scrolled entry object
1081 * @param setting EINA_TRUE if the object should be displayed,
1082 * EINA_FALSE if not.
1084 EAPI void elm_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting);
1087 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling
1090 * Setting an entry to single-line mode with elm_entry_single_line_set()
1091 * will automatically disable the display of scrollbars when the entry
1092 * moves inside its scroller.
1094 * @param obj The scrolled entry object
1095 * @param h The horizontal scrollbar policy to apply
1096 * @param v The vertical scrollbar policy to apply
1098 EAPI void elm_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v);
1101 * This enables/disables bouncing within the entry.
1103 * This function sets whether the entry will bounce when scrolling reaches
1104 * the end of the contained entry.
1106 * @param obj The scrolled entry object
1107 * @param h The horizontal bounce state
1108 * @param v The vertical bounce state
1110 EAPI void elm_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
1113 * Get the bounce mode
1115 * @param obj The Entry object
1116 * @param h_bounce Allow bounce horizontally
1117 * @param v_bounce Allow bounce vertically
1119 EAPI void elm_entry_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
1121 /* pre-made filters for entries */
1123 * @typedef Elm_Entry_Filter_Limit_Size
1125 * Data for the elm_entry_filter_limit_size() entry filter.
1127 typedef struct _Elm_Entry_Filter_Limit_Size Elm_Entry_Filter_Limit_Size;
1130 * @struct _Elm_Entry_Filter_Limit_Size
1132 * Data for the elm_entry_filter_limit_size() entry filter.
1134 struct _Elm_Entry_Filter_Limit_Size
1136 int max_char_count; /**< The maximum number of characters allowed. */
1137 int max_byte_count; /**< The maximum number of bytes allowed*/
1141 * Filter inserted text based on user defined character and byte limits
1143 * Add this filter to an entry to limit the characters that it will accept
1144 * based the the contents of the provided #Elm_Entry_Filter_Limit_Size.
1145 * The funtion works on the UTF-8 representation of the string, converting
1146 * it from the set markup, thus not accounting for any format in it.
1148 * The user must create an #Elm_Entry_Filter_Limit_Size structure and pass
1149 * it as data when setting the filter. In it, it's possible to set limits
1150 * by character count or bytes (any of them is disabled if 0), and both can
1151 * be set at the same time. In that case, it first checks for characters,
1154 * The function will cut the inserted text in order to allow only the first
1155 * number of characters that are still allowed. The cut is made in
1156 * characters, even when limiting by bytes, in order to always contain
1157 * valid ones and avoid half unicode characters making it in.
1159 * This filter, like any others, does not apply when setting the entry text
1160 * directly with elm_object_text_set() (or the deprecated
1161 * elm_entry_entry_set()).
1163 EAPI void elm_entry_filter_limit_size(void *data, Evas_Object *entry, char **text) EINA_ARG_NONNULL(1, 2, 3);
1166 * @typedef Elm_Entry_Filter_Accept_Set
1168 * Data for the elm_entry_filter_accept_set() entry filter.
1170 typedef struct _Elm_Entry_Filter_Accept_Set Elm_Entry_Filter_Accept_Set;
1173 * @struct _Elm_Entry_Filter_Accept_Set
1175 * Data for the elm_entry_filter_accept_set() entry filter.
1177 struct _Elm_Entry_Filter_Accept_Set
1179 const char *accepted; /**< Set of characters accepted in the entry. */
1180 const char *rejected; /**< Set of characters rejected from the entry. */
1184 * Filter inserted text based on accepted or rejected sets of characters
1186 * Add this filter to an entry to restrict the set of accepted characters
1187 * based on the sets in the provided #Elm_Entry_Filter_Accept_Set.
1188 * This structure contains both accepted and rejected sets, but they are
1189 * mutually exclusive.
1191 * The @c accepted set takes preference, so if it is set, the filter will
1192 * only work based on the accepted characters, ignoring anything in the
1193 * @c rejected value. If @c accepted is @c NULL, then @c rejected is used.
1195 * In both cases, the function filters by matching utf8 characters to the
1196 * raw markup text, so it can be used to remove formatting tags.
1198 * This filter, like any others, does not apply when setting the entry text
1199 * directly with elm_object_text_set() (or the deprecated
1200 * elm_entry_entry_set()).
1202 EAPI void elm_entry_filter_accept_set(void *data, Evas_Object *entry, char **text) EINA_ARG_NONNULL(1, 3);
1204 * Set the input panel layout of the entry
1206 * @param obj The entry object
1207 * @param layout layout type
1209 EAPI void elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout) EINA_ARG_NONNULL(1);
1212 * Get the input panel layout of the entry
1214 * @param obj The entry object
1215 * @return layout type
1217 * @see elm_entry_input_panel_layout_set
1219 EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
1222 * Set the autocapitalization type on the immodule.
1224 * @param obj The entry object
1225 * @param autocapital_type The type of autocapitalization
1227 EAPI void elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapital_type) EINA_ARG_NONNULL(1);
1230 * Retrieve the autocapitalization type on the immodule.
1232 * @param obj The entry object
1233 * @return autocapitalization type
1235 EAPI Elm_Autocapital_Type elm_entry_autocapital_type_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
1238 * Sets the attribute to show the input panel automatically.
1240 * @param obj The entry object
1241 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
1243 EAPI void elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled) EINA_ARG_NONNULL(1);
1246 * Retrieve the attribute to show the input panel automatically.
1248 * @param obj The entry object
1249 * @return EINA_TRUE if input panel will be appeared when the entry is clicked or has a focus, EINA_FALSE otherwise
1251 EAPI Eina_Bool elm_entry_input_panel_enabled_get(Evas_Object *obj) EINA_ARG_NONNULL(1);