3 ELM_TEXT_FORMAT_PLAIN_UTF8,
4 ELM_TEXT_FORMAT_MARKUP_UTF8
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. */
17 } Elm_Wrap_Type; /**< Type of word or character wrapping to use */
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, /**< Never use this */
30 ELM_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout */
31 ELM_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout */
32 ELM_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. */
33 } Elm_Input_Panel_Layout; /**< Type of input panel (virtual keyboard) to use - this is a hint and may not provide exactly what is desired. */
37 ELM_AUTOCAPITAL_TYPE_NONE, /**< No auto-capitalization when typing */
38 ELM_AUTOCAPITAL_TYPE_WORD, /**< Autocapitalize each word typed */
39 ELM_AUTOCAPITAL_TYPE_SENTENCE, /**< Autocapitalize the start of each sentence */
40 ELM_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters */
41 } Elm_Autocapital_Type; /**< Choose method of auto-capitalization */
44 * @defgroup Entry Entry
46 * @image html img/widget/entry/preview-00.png
47 * @image latex img/widget/entry/preview-00.eps width=\textwidth
48 * @image html img/widget/entry/preview-01.png
49 * @image latex img/widget/entry/preview-01.eps width=\textwidth
50 * @image html img/widget/entry/preview-02.png
51 * @image latex img/widget/entry/preview-02.eps width=\textwidth
52 * @image html img/widget/entry/preview-03.png
53 * @image latex img/widget/entry/preview-03.eps width=\textwidth
55 * An entry is a convenience widget which shows a box that the user can
56 * enter text into. Entries by default don't scroll, so they grow to
57 * accomodate the entire text, resizing the parent window as needed. This
58 * can be changed with the elm_entry_scrollable_set() function.
60 * They can also be single line or multi line (the default) and when set
61 * to multi line mode they support text wrapping in any of the modes
62 * indicated by Elm_Wrap_Type.
64 * Other features include password mode, filtering of inserted text with
65 * elm_entry_text_filter_append() and related functions, inline "items" and
66 * formatted markup text.
68 * @section entry-markup Formatted text
70 * The markup tags supported by the Entry are defined by the theme, but
71 * even when writing new themes or extensions it's a good idea to stick to
72 * a sane default, to maintain coherency and avoid application breakages.
73 * Currently defined by the default theme are the following tags:
74 * @li \<br\>: Inserts a line break.
75 * @li \<ps\>: Inserts a paragraph separator. This is preferred over line
77 * @li \<tab\>: Inserts a tab.
78 * @li \<em\>...\</em\>: Emphasis. Sets the @em oblique style for the
80 * @li \<b\>...\</b\>: Sets the @b bold style for the enclosed text.
81 * @li \<link\>...\</link\>: Underlines the enclosed text.
82 * @li \<hilight\>...\</hilight\>: Hilights the enclosed text.
84 * @section entry-special Special markups
86 * Besides those used to format text, entries support two special markup
87 * tags used to insert clickable portions of text or items inlined within
90 * @subsection entry-anchors Anchors
92 * Anchors are similar to HTML anchors. Text can be surrounded by \<a\> and
93 * \</a\> tags and an event will be generated when this text is clicked,
97 * This text is outside <a href=anc-01>but this one is an anchor</a>
100 * The @c href attribute in the opening tag gives the name that will be
101 * used to identify the anchor and it can be any valid utf8 string.
103 * When an anchor is clicked, an @c "anchor,clicked" signal is emitted with
104 * an #Elm_Entry_Anchor_Info in the @c event_info parameter for the
105 * callback function. The same applies for "anchor,in" (mouse in), "anchor,out"
106 * (mouse out), "anchor,down" (mouse down), and "anchor,up" (mouse up) events on
109 * @subsection entry-items Items
111 * Inlined in the text, any other @c Evas_Object can be inserted by using
112 * \<item\> tags this way:
115 * <item size=16x16 vsize=full href=emoticon/haha></item>
118 * Just like with anchors, the @c href identifies each item, but these need,
119 * in addition, to indicate their size, which is done using any one of
120 * @c size, @c absize or @c relsize attributes. These attributes take their
121 * value in the WxH format, where W is the width and H the height of the
124 * @li absize: Absolute pixel size for the item. Whatever value is set will
125 * be the item's size regardless of any scale value the object may have
126 * been set to. The final line height will be adjusted to fit larger items.
127 * @li size: Similar to @c absize, but it's adjusted to the scale value set
129 * @li relsize: Size is adjusted for the item to fit within the current
132 * Besides their size, items are specificed a @c vsize value that affects
133 * how their final size and position are calculated. The possible values
135 * @li ascent: Item will be placed within the line's baseline and its
136 * ascent. That is, the height between the line where all characters are
137 * positioned and the highest point in the line. For @c size and @c absize
138 * items, the descent value will be added to the total line height to make
139 * them fit. @c relsize items will be adjusted to fit within this space.
140 * @li full: Items will be placed between the descent and ascent, or the
141 * lowest point in the line and its highest.
143 * The next image shows different configurations of items and how
144 * the previously mentioned options affect their sizes. In all cases,
145 * the green line indicates the ascent, blue for the baseline and red for
148 * @image html entry_item.png
149 * @image latex entry_item.eps width=\textwidth
151 * And another one to show how size differs from absize. In the first one,
152 * the scale value is set to 1.0, while the second one is using one of 2.0.
154 * @image html entry_item_scale.png
155 * @image latex entry_item_scale.eps width=\textwidth
157 * After the size for an item is calculated, the entry will request an
158 * object to place in its space. For this, the functions set with
159 * elm_entry_item_provider_append() and related functions will be called
160 * in order until one of them returns a @c non-NULL value. If no providers
161 * are available, or all of them return @c NULL, then the entry falls back
162 * to one of the internal defaults, provided the name matches with one of
165 * All of the following are currently supported:
168 * - emoticon/angry-shout
169 * - emoticon/crazy-laugh
170 * - emoticon/evil-laugh
172 * - emoticon/goggle-smile
174 * - emoticon/grumpy-smile
176 * - emoticon/guilty-smile
178 * - emoticon/half-smile
179 * - emoticon/happy-panting
181 * - emoticon/indifferent
183 * - emoticon/knowing-grin
185 * - emoticon/little-bit-sorry
186 * - emoticon/love-lots
188 * - emoticon/minimal-smile
189 * - emoticon/not-happy
190 * - emoticon/not-impressed
192 * - emoticon/opensmile
195 * - emoticon/squint-laugh
196 * - emoticon/surprised
197 * - emoticon/suspicious
198 * - emoticon/tongue-dangling
199 * - emoticon/tongue-poke
202 * - emoticon/very-sorry
208 * Alternatively, an item may reference an image by its path, using
209 * the URI form @c file:///path/to/an/image.png and the entry will then
210 * use that image for the item.
212 * @section entry-files Loading and saving files
214 * Entries have convinience functions to load text from a file and save
215 * changes back to it after a short delay. The automatic saving is enabled
216 * by default, but can be disabled with elm_entry_autosave_set() and files
217 * can be loaded directly as plain text or have any markup in them
218 * recognized. See elm_entry_file_set() for more details.
220 * @section entry-signals Emitted signals
222 * This widget emits the following signals:
224 * @li "changed": The text within the entry was changed.
225 * @li "changed,user": The text within the entry was changed because of user interaction.
226 * @li "activated": The enter key was pressed on a single line entry.
227 * @li "press": A mouse button has been pressed on the entry.
228 * @li "longpressed": A mouse button has been pressed and held for a couple
230 * @li "clicked": The entry has been clicked (mouse press and release).
231 * @li "clicked,double": The entry has been double clicked.
232 * @li "clicked,triple": The entry has been triple clicked.
233 * @li "focused": The entry has received focus.
234 * @li "unfocused": The entry has lost focus.
235 * @li "selection,paste": A paste of the clipboard contents was requested.
236 * @li "selection,copy": A copy of the selected text into the clipboard was
238 * @li "selection,cut": A cut of the selected text into the clipboard was
240 * @li "selection,start": A selection has begun and no previous selection
242 * @li "selection,changed": The current selection has changed.
243 * @li "selection,cleared": The current selection has been cleared.
244 * @li "cursor,changed": The cursor has changed position.
245 * @li "anchor,clicked": An anchor has been clicked. The event_info
246 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
247 * @li "anchor,in": Mouse cursor has moved into an anchor. The event_info
248 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
249 * @li "anchor,out": Mouse cursor has moved out of an anchor. The event_info
250 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
251 * @li "anchor,up": Mouse button has been unpressed on an anchor. The event_info
252 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
253 * @li "anchor,down": Mouse button has been pressed on an anchor. The event_info
254 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
255 * @li "preedit,changed": The preedit string has changed.
256 * @li "language,changed": Program language changed.
258 * Default contents parts of the entry items that you can use for are:
259 * @li "icon" - An icon in the entry
260 * @li "end" - A content in the end of the entry
262 * Default text parts of the entry that you can use for are:
263 * @li "default" - text of the entry
265 * Supported elm_object common APIs.
266 * @li elm_object_signal_emit
267 * @li elm_object_part_text_set
268 * @li elm_object_part_text_get
269 * @li elm_object_part_content_set
270 * @li elm_object_part_content_get
271 * @li elm_object_part_content_unset
272 * @li elm_object_signal_callback_add
273 * @li elm_object_signal_callback_del
274 * @li elm_object_disabled_set
275 * @li elm_object_disabled_get
277 * @section entry-examples
279 * An overview of the Entry API can be seen in @ref entry_example_01
285 * @typedef Elm_Entry_Anchor_Info
287 * The info sent in the callback for the "anchor,clicked" signals emitted
290 typedef struct _Elm_Entry_Anchor_Info Elm_Entry_Anchor_Info;
293 * @struct _Elm_Entry_Anchor_Info
295 * The info sent in the callback for the "anchor,clicked" signals emitted
298 struct _Elm_Entry_Anchor_Info
300 const char *name; /**< The name of the anchor, as stated in its href */
301 int button; /**< The mouse button used to click on it */
302 Evas_Coord x, /**< Anchor geometry, relative to canvas */
303 y, /**< Anchor geometry, relative to canvas */
304 w, /**< Anchor geometry, relative to canvas */
305 h; /**< Anchor geometry, relative to canvas */
309 * @typedef Elm_Entry_Filter_Cb
310 * This callback type is used by entry filters to modify text.
311 * @param data The data specified as the last param when adding the filter
312 * @param entry The entry object
313 * @param text A pointer to the location of the text being filtered. This data can be modified,
314 * but any additional allocations must be managed by the user.
315 * @see elm_entry_text_filter_append
316 * @see elm_entry_text_filter_prepend
318 typedef void (*Elm_Entry_Filter_Cb)(void *data, Evas_Object *entry, char **text);
321 * @typedef Elm_Entry_Change_Info
322 * This corresponds to Edje_Entry_Change_Info. Includes information about
323 * a change in the entry.
325 typedef Edje_Entry_Change_Info Elm_Entry_Change_Info;
328 * This adds an entry to @p parent object.
330 * By default, entries are:
334 * @li autosave is enabled
336 * @param parent The parent object
337 * @return The new object or NULL if it cannot be created
339 EAPI Evas_Object *elm_entry_add(Evas_Object *parent);
342 * Sets the entry to single line mode.
344 * In single line mode, entries don't ever wrap when the text reaches the
345 * edge, and instead they keep growing horizontally. Pressing the @c Enter
346 * key will generate an @c "activate" event instead of adding a new line.
348 * When @p single_line is @c EINA_FALSE, line wrapping takes effect again
349 * and pressing enter will break the text into a different line
350 * without generating any events.
352 * @param obj The entry object
353 * @param single_line If true, the text in the entry
354 * will be on a single line.
356 EAPI void elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line);
359 * Gets whether the entry is set to be single line.
361 * @param obj The entry object
362 * @return single_line If true, the text in the entry is set to display
365 * @see elm_entry_single_line_set()
367 EAPI Eina_Bool elm_entry_single_line_get(const Evas_Object *obj);
370 * Sets the entry to password mode.
372 * In password mode, entries are implicitly single line and the display of
373 * any text in them is replaced with asterisks (*).
375 * @param obj The entry object
376 * @param password If true, password mode is enabled.
378 EAPI void elm_entry_password_set(Evas_Object *obj, Eina_Bool password);
381 * Gets whether the entry is set to password mode.
383 * @param obj The entry object
384 * @return If true, the entry is set to display all characters
387 * @see elm_entry_password_set()
389 EAPI Eina_Bool elm_entry_password_get(const Evas_Object *obj);
392 * This sets the text displayed within the entry to @p entry.
394 * @param obj The entry object
395 * @param entry The text to be displayed
397 * @note Using this function bypasses text filters
399 EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry);
402 * This returns the text currently shown in object @p entry.
403 * See also elm_entry_entry_set().
405 * @param obj The entry object
406 * @return The currently displayed text or NULL on failure
408 EAPI const char *elm_entry_entry_get(const Evas_Object *obj);
411 * Appends @p entry to the text of the entry.
413 * Adds the text in @p entry to the end of any text already present in the
416 * The appended text is subject to any filters set for the widget.
418 * @param obj The entry object
419 * @param entry The text to be displayed
421 * @see elm_entry_text_filter_append()
423 EAPI void elm_entry_entry_append(Evas_Object *obj, const char *entry);
426 * Gets whether the entry is empty.
428 * Empty means no text at all. If there are any markup tags, like an item
429 * tag for which no provider finds anything, and no text is displayed, this
430 * function still returns EINA_FALSE.
432 * @param obj The entry object
433 * @return EINA_TRUE if the entry is empty, EINA_FALSE otherwise.
435 EAPI Eina_Bool elm_entry_is_empty(const Evas_Object *obj);
438 * Gets any selected text within the entry.
440 * If there's any selected text in the entry, this function returns it as
441 * a string in markup format. NULL is returned if no selection exists or
442 * if an error occurred.
444 * The returned value points to an internal string and should not be freed
445 * or modified in any way. If the @p entry object is deleted or its
446 * contents are changed, the returned pointer should be considered invalid.
448 * @param obj The entry object
449 * @return The selected text within the entry or NULL on failure
451 EAPI const char *elm_entry_selection_get(const Evas_Object *obj);
454 * Returns the actual textblock object of the entry.
456 * This function exposes the internal textblock object that actually
457 * contains and draws the text. This should be used for low-level
458 * manipulations that are otherwise not possible.
460 * Changing the textblock directly from here will not notify edje/elm to
461 * recalculate the textblock size automatically, so any modifications
462 * done to the textblock returned by this function should be followed by
463 * a call to elm_entry_calc_force().
465 * The return value is marked as const as an additional warning.
466 * One should not use the returned object with any of the generic evas
467 * functions (geometry_get/resize/move and etc), but only with the textblock
468 * functions; The former will either not work at all, or break the correct
471 * IMPORTANT: Many functions may change (i.e delete and create a new one)
472 * the internal textblock object. Do NOT cache the returned object, and try
473 * not to mix calls on this object with regular elm_entry calls (which may
474 * change the internal textblock object). This applies to all cursors
475 * returned from textblock calls, and all the other derivative values.
477 * @param obj The entry object
478 * @return The textblock object.
480 EAPI Evas_Object * elm_entry_textblock_get(Evas_Object *obj);
483 * Forces calculation of the entry size and text layouting.
485 * This should be used after modifying the textblock object directly. See
486 * elm_entry_textblock_get() for more information.
488 * @param obj The entry object
490 * @see elm_entry_textblock_get()
492 EAPI void elm_entry_calc_force(Evas_Object *obj);
495 * Inserts the given text into the entry at the current cursor position.
497 * This inserts text at the cursor position as if it was typed
498 * by the user (note that this also allows markup which a user
499 * can't just "type" as it would be converted to escaped text, so this
500 * call can be used to insert things like emoticon items or bold push/pop
501 * tags, other font and color change tags etc.)
503 * If any selection exists, it will be replaced by the inserted text.
505 * The inserted text is subject to any filters set for the widget.
507 * @param obj The entry object
508 * @param entry The text to insert
510 * @see elm_entry_text_filter_append()
512 EAPI void elm_entry_entry_insert(Evas_Object *obj, const char *entry);
515 * Set the line wrap type to use on multi-line entries.
517 * Sets the wrap type used by the entry to any of the specified in
518 * Elm_Wrap_Type. This tells how the text will be implicitly cut into a new
519 * line (without inserting a line break or paragraph separator) when it
520 * reaches the far edge of the widget.
522 * Note that this only makes sense for multi-line entries. A widget set
523 * to be single line will never wrap.
525 * @param obj The entry object
526 * @param wrap The wrap mode to use. See Elm_Wrap_Type for details on them
528 EAPI void elm_entry_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap);
531 * Gets the wrap mode the entry was set to use.
533 * @param obj The entry object
536 * @see also elm_entry_line_wrap_set()
538 EAPI Elm_Wrap_Type elm_entry_line_wrap_get(const Evas_Object *obj);
541 * Sets if the entry is to be editable or not.
543 * By default, entries are editable and when focused, any text input by the
544 * user will be inserted at the current cursor position. But calling this
545 * function with @p editable as EINA_FALSE will prevent the user from
546 * inputting text into the entry.
548 * The only way to change the text of a non-editable entry is to use
549 * elm_object_text_set(), elm_entry_entry_insert() and other related
552 * @param obj The entry object
553 * @param editable If EINA_TRUE, user input will be inserted in the entry,
554 * if not, the entry is read-only and no user input is allowed.
556 EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable);
559 * Gets whether the entry is editable or not.
561 * @param obj The entry object
562 * @return If true, the entry is editable by the user.
563 * If false, it is not editable by the user
565 * @see elm_entry_editable_set()
567 EAPI Eina_Bool elm_entry_editable_get(const Evas_Object *obj);
570 * This drops any existing text selection within the entry.
572 * @param obj The entry object
574 EAPI void elm_entry_select_none(Evas_Object *obj);
577 * This selects all text within the entry.
579 * @param obj The entry object
581 EAPI void elm_entry_select_all(Evas_Object *obj);
584 * This moves the cursor one place to the right within the entry.
586 * @param obj The entry object
587 * @return EINA_TRUE upon success, EINA_FALSE upon failure
589 EAPI Eina_Bool elm_entry_cursor_next(Evas_Object *obj);
592 * This moves the cursor one place to the left within the entry.
594 * @param obj The entry object
595 * @return EINA_TRUE upon success, EINA_FALSE upon failure
597 EAPI Eina_Bool elm_entry_cursor_prev(Evas_Object *obj);
600 * This moves the cursor one line up within the entry.
602 * @param obj The entry object
603 * @return EINA_TRUE upon success, EINA_FALSE upon failure
605 EAPI Eina_Bool elm_entry_cursor_up(Evas_Object *obj);
608 * This moves the cursor one line down within the entry.
610 * @param obj The entry object
611 * @return EINA_TRUE upon success, EINA_FALSE upon failure
613 EAPI Eina_Bool elm_entry_cursor_down(Evas_Object *obj);
616 * This moves the cursor to the beginning of the entry.
618 * @param obj The entry object
620 EAPI void elm_entry_cursor_begin_set(Evas_Object *obj);
623 * This moves the cursor to the end of the entry.
625 * @param obj The entry object
627 EAPI void elm_entry_cursor_end_set(Evas_Object *obj);
630 * This moves the cursor to the beginning of the current line.
632 * @param obj The entry object
634 EAPI void elm_entry_cursor_line_begin_set(Evas_Object *obj);
637 * This moves the cursor to the end of the current line.
639 * @param obj The entry object
641 EAPI void elm_entry_cursor_line_end_set(Evas_Object *obj);
644 * This begins a selection within the entry as though
645 * the user were holding down the mouse button to make a selection.
647 * @param obj The entry object
649 EAPI void elm_entry_cursor_selection_begin(Evas_Object *obj);
652 * This ends a selection within the entry as though
653 * the user had just released the mouse button while making a selection.
655 * @param obj The entry object
657 EAPI void elm_entry_cursor_selection_end(Evas_Object *obj);
660 * Gets whether a format node exists at the current cursor position.
662 * A format node is anything that defines how the text is rendered. It can
663 * be a visible format node, such as a line break or a paragraph separator,
664 * or an invisible one, such as bold begin or end tag.
665 * This function returns whether any format node exists at the current
668 * @param obj The entry object
669 * @return EINA_TRUE if the current cursor position contains a format node,
670 * EINA_FALSE otherwise.
672 * @see elm_entry_cursor_is_visible_format_get()
674 EAPI Eina_Bool elm_entry_cursor_is_format_get(const Evas_Object *obj);
677 * Gets if the current cursor position holds a visible format node.
679 * @param obj The entry object
680 * @return EINA_TRUE if the current cursor is a visible format, EINA_FALSE
681 * if it's an invisible one or no format exists.
683 * @see elm_entry_cursor_is_format_get()
685 EAPI Eina_Bool elm_entry_cursor_is_visible_format_get(const Evas_Object *obj);
688 * Gets the character pointed by the cursor at its current position.
690 * This function returns a string with the utf8 character stored at the
691 * current cursor position.
692 * Only the text is returned, any format that may exist will not be part
693 * of the return value. You must free the string when done with free().
695 * @param obj The entry object
696 * @return The text pointed by the cursors.
698 EAPI char *elm_entry_cursor_content_get(const Evas_Object *obj);
701 * This function returns the geometry of the cursor.
703 * It's useful if you want to draw something on the cursor (or where it is),
704 * or for example in the case of scrolled entry where you want to show the
707 * @param obj The entry object
708 * @param x returned geometry
709 * @param y returned geometry
710 * @param w returned geometry
711 * @param h returned geometry
712 * @return EINA_TRUE upon success, EINA_FALSE upon failure
714 EAPI Eina_Bool elm_entry_cursor_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
717 * Sets the cursor position in the entry to the given value
719 * The value in @p pos is the index of the character position within the
720 * contents of the string as returned by elm_entry_cursor_pos_get().
722 * @param obj The entry object
723 * @param pos The position of the cursor
725 EAPI void elm_entry_cursor_pos_set(Evas_Object *obj, int pos);
728 * Retrieves the current position of the cursor in the entry
730 * @param obj The entry object
731 * @return The cursor position
733 EAPI int elm_entry_cursor_pos_get(const Evas_Object *obj);
736 * This executes a "cut" action on the selected text in the entry.
738 * @param obj The entry object
740 EAPI void elm_entry_selection_cut(Evas_Object *obj);
743 * This executes a "copy" action on the selected text in the entry.
745 * @param obj The entry object
747 EAPI void elm_entry_selection_copy(Evas_Object *obj);
750 * This executes a "paste" action in the entry.
752 * @param obj The entry object
754 EAPI void elm_entry_selection_paste(Evas_Object *obj);
757 * This clears and frees the items in a entry's contextual (longpress)
760 * @param obj The entry object
762 * @see elm_entry_context_menu_item_add()
764 EAPI void elm_entry_context_menu_clear(Evas_Object *obj);
767 * This adds an item to the entry's contextual menu.
769 * A longpress on an entry will make the contextual menu show up, if this
770 * hasn't been disabled with elm_entry_context_menu_disabled_set().
771 * By default, this menu provides a few options like enabling selection mode,
772 * which is useful on embedded devices that need to be explicit about it,
773 * and when a selection exists it also shows the copy and cut actions.
775 * With this function, developers can add other options to this menu to
776 * perform any action they deem necessary.
778 * @param obj The entry object
779 * @param label The item's text label
780 * @param icon_file The item's icon file
781 * @param icon_type The item's icon type
782 * @param func The callback to execute when the item is clicked
783 * @param data The data to associate with the item for related functions
785 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);
788 * This disables the entry's contextual (longpress) menu.
790 * @param obj The entry object
791 * @param disabled If true, the menu is disabled
793 EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled);
796 * This returns whether the entry's contextual (longpress) menu is
799 * @param obj The entry object
800 * @return If true, the menu is disabled
802 EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Evas_Object *obj);
805 * This appends a custom item provider to the list for that entry
807 * This appends the given callback. The list is walked from beginning to end
808 * with each function called given the item href string in the text. If the
809 * function returns an object handle other than NULL (it should create an
810 * object to do this), then this object is used to replace that item. If
811 * not the next provider is called until one provides an item object, or the
812 * default provider in entry does.
814 * @param obj The entry object
815 * @param func The function called to provide the item object
816 * @param data The data passed to @p func
818 * @see @ref entry-items
820 EAPI void elm_entry_item_provider_append(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data);
823 * This prepends a custom item provider to the list for that entry
825 * This prepends the given callback. See elm_entry_item_provider_append() for
828 * @param obj The entry object
829 * @param func The function called to provide the item object
830 * @param data The data passed to @p func
832 EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data);
835 * This removes a custom item provider to the list for that entry
837 * This removes the given callback. See elm_entry_item_provider_append() for
840 * @param obj The entry object
841 * @param func The function called to provide the item object
842 * @param data The data passed to @p func
844 EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data);
847 * Append a filter function for text inserted in the entry
849 * Append the given callback to the list. This functions will be called
850 * whenever any text is inserted into the entry, with the text to be inserted
851 * as a parameter. The callback function is free to alter the text in any way
852 * it wants, but it must remember to free the given pointer and update it.
853 * If the new text is to be discarded, the function can free it and set its
854 * text parameter to NULL. This will also prevent any following filters from
857 * @param obj The entry object
858 * @param func The function to use as text filter
859 * @param data User data to pass to @p func
861 EAPI void elm_entry_text_filter_append(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data);
864 * Prepend a filter function for text insdrted in the entry
866 * Prepend the given callback to the list. See elm_entry_text_filter_append()
867 * for more information
869 * @param obj The entry object
870 * @param func The function to use as text filter
871 * @param data User data to pass to @p func
873 EAPI void elm_entry_text_filter_prepend(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data);
876 * Remove a filter from the list
878 * Removes the given callback from the filter list. See
879 * elm_entry_text_filter_append() for more information.
881 * @param obj The entry object
882 * @param func The filter function to remove
883 * @param data The user data passed when adding the function
885 EAPI void elm_entry_text_filter_remove(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data);
888 * This converts a markup (HTML-like) string into UTF-8.
890 * The returned string is a malloc'ed buffer and it should be freed when
891 * not needed anymore.
893 * @param s The string (in markup) to be converted
894 * @return The converted string (in UTF-8). It should be freed.
896 EAPI char *elm_entry_markup_to_utf8(const char *s);
899 * This converts a UTF-8 string into markup (HTML-like).
901 * The returned string is a malloc'ed buffer and it should be freed when
902 * not needed anymore.
904 * @param s The string (in UTF-8) to be converted
905 * @return The converted string (in markup). It should be freed.
907 EAPI char *elm_entry_utf8_to_markup(const char *s);
910 * This sets the file (and implicitly loads it) for the text to display and
911 * then edit. All changes are written back to the file after a short delay if
912 * the entry object is set to autosave (which is the default).
914 * If the entry had any other file set previously, any changes made to it
915 * will be saved if the autosave feature is enabled, otherwise, the file
916 * will be silently discarded and any non-saved changes will be lost.
918 * @param obj The entry object
919 * @param file The path to the file to load and save
920 * @param format The file format
922 EAPI void elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format);
925 * Gets the file being edited by the entry.
927 * This function can be used to retrieve any file set on the entry for
928 * edition, along with the format used to load and save it.
930 * @param obj The entry object
931 * @param file The path to the file to load and save
932 * @param format The file format
934 EAPI void elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format);
937 * This function writes any changes made to the file set with
938 * elm_entry_file_set()
940 * @param obj The entry object
942 EAPI void elm_entry_file_save(Evas_Object *obj);
945 * This sets the entry object to 'autosave' the loaded text file or not.
947 * @param obj The entry object
948 * @param autosave Autosave the loaded file or not
950 * @see elm_entry_file_set()
952 EAPI void elm_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave);
955 * This gets the entry object's 'autosave' status.
957 * @param obj The entry object
958 * @return Autosave the loaded file or not
960 * @see elm_entry_file_set()
962 EAPI Eina_Bool elm_entry_autosave_get(const Evas_Object *obj);
965 * Control pasting of text and images for the widget.
967 * Normally the entry allows both text and images to be pasted. By setting
968 * textonly to be true, this prevents images from being pasted.
970 * Note this only changes the behaviour of text.
972 * @param obj The entry object
973 * @param textonly paste mode - EINA_TRUE is text only, EINA_FALSE is
976 EAPI void elm_entry_cnp_textonly_set(Evas_Object *obj, Eina_Bool textonly);
979 * Getting elm_entry text paste/drop mode.
981 * In textonly mode, only text may be pasted or dropped into the widget.
983 * @param obj The entry object
984 * @return If the widget only accepts text from pastes.
986 EAPI Eina_Bool elm_entry_cnp_textonly_get(const Evas_Object *obj);
989 * Enable or disable scrolling in entry
991 * Normally the entry is not scrollable unless you enable it with this call.
993 * @param obj The entry object
994 * @param scroll EINA_TRUE if it is to be scrollable, EINA_FALSE otherwise
996 EAPI void elm_entry_scrollable_set(Evas_Object *obj, Eina_Bool scroll);
999 * Get the scrollable state of the entry
1001 * Normally the entry is not scrollable. This gets the scrollable state
1002 * of the entry. See elm_entry_scrollable_set() for more information.
1004 * @param obj The entry object
1005 * @return The scrollable state
1007 EAPI Eina_Bool elm_entry_scrollable_get(const Evas_Object *obj);
1010 * Sets the visibility of the left-side widget of the scrolled entry,
1011 * set by elm_entry_icon_set().
1013 * @param obj The scrolled entry object
1014 * @param setting EINA_TRUE if the object should be displayed,
1015 * EINA_FALSE if not.
1017 EAPI void elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting);
1020 * Sets the visibility of the end widget of the scrolled entry, set by
1021 * elm_object_part_content_set(ent, "end", content).
1023 * @param obj The scrolled entry object
1024 * @param setting EINA_TRUE if the object should be displayed,
1025 * EINA_FALSE if not.
1027 EAPI void elm_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting);
1030 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling
1033 * Setting an entry to single-line mode with elm_entry_single_line_set()
1034 * will automatically disable the display of scrollbars when the entry
1035 * moves inside its scroller.
1037 * @param obj The scrolled entry object
1038 * @param h The horizontal scrollbar policy to apply
1039 * @param v The vertical scrollbar policy to apply
1041 EAPI void elm_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v);
1044 * This enables/disables bouncing within the entry.
1046 * This function sets whether the entry will bounce when scrolling reaches
1047 * the end of the contained entry.
1049 * @param obj The scrolled entry object
1050 * @param h_bounce The horizontal bounce state
1051 * @param v_bounce The vertical bounce state
1053 EAPI void elm_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
1056 * Get the bounce mode
1058 * @param obj The Entry object
1059 * @param h_bounce Allow bounce horizontally
1060 * @param v_bounce Allow bounce vertically
1062 EAPI void elm_entry_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
1065 * Set the input panel layout of the entry
1067 * @param obj The entry object
1068 * @param layout layout type
1070 EAPI void elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout);
1073 * Get the input panel layout of the entry
1075 * @param obj The entry object
1076 * @return layout type
1078 * @see elm_entry_input_panel_layout_set
1080 EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(Evas_Object *obj);
1083 * Set the autocapitalization type on the immodule.
1085 * @param obj The entry object
1086 * @param autocapital_type The type of autocapitalization
1088 EAPI void elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapital_type);
1091 * Retrieve the autocapitalization type on the immodule.
1093 * @param obj The entry object
1094 * @return autocapitalization type
1096 EAPI Elm_Autocapital_Type elm_entry_autocapital_type_get(Evas_Object *obj);
1099 * Sets the attribute to show the input panel automatically.
1101 * @param obj The entry object
1102 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
1104 EAPI void elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled);
1107 * Retrieve the attribute to show the input panel automatically.
1109 * @param obj The entry object
1110 * @return EINA_TRUE if input panel will be appeared when the entry is clicked or has a focus, EINA_FALSE otherwise
1112 EAPI Eina_Bool elm_entry_input_panel_enabled_get(Evas_Object *obj);
1114 /* pre-made filters for entries */
1117 * @typedef Elm_Entry_Filter_Limit_Size
1119 * Data for the elm_entry_filter_limit_size() entry filter.
1121 typedef struct _Elm_Entry_Filter_Limit_Size Elm_Entry_Filter_Limit_Size;
1124 * @struct _Elm_Entry_Filter_Limit_Size
1126 * Data for the elm_entry_filter_limit_size() entry filter.
1128 struct _Elm_Entry_Filter_Limit_Size
1130 int max_char_count; /**< The maximum number of characters allowed. */
1131 int max_byte_count; /**< The maximum number of bytes allowed*/
1135 * Filter inserted text based on user defined character and byte limits
1137 * Add this filter to an entry to limit the characters that it will accept
1138 * based the the contents of the provided #Elm_Entry_Filter_Limit_Size.
1139 * The funtion works on the UTF-8 representation of the string, converting
1140 * it from the set markup, thus not accounting for any format in it.
1142 * The user must create an #Elm_Entry_Filter_Limit_Size structure and pass
1143 * it as data when setting the filter. In it, it's possible to set limits
1144 * by character count or bytes (any of them is disabled if 0), and both can
1145 * be set at the same time. In that case, it first checks for characters,
1148 * The function will cut the inserted text in order to allow only the first
1149 * number of characters that are still allowed. The cut is made in
1150 * characters, even when limiting by bytes, in order to always contain
1151 * valid ones and avoid half unicode characters making it in.
1153 * This filter, like any others, does not apply when setting the entry text
1154 * directly with elm_object_text_set().
1156 EAPI void elm_entry_filter_limit_size(void *data, Evas_Object *entry, char **text);
1159 * @typedef Elm_Entry_Filter_Accept_Set
1161 * Data for the elm_entry_filter_accept_set() entry filter.
1163 typedef struct _Elm_Entry_Filter_Accept_Set Elm_Entry_Filter_Accept_Set;
1166 * @struct _Elm_Entry_Filter_Accept_Set
1168 * Data for the elm_entry_filter_accept_set() entry filter.
1170 struct _Elm_Entry_Filter_Accept_Set
1172 const char *accepted; /**< Set of characters accepted in the entry. */
1173 const char *rejected; /**< Set of characters rejected from the entry. */
1177 * Filter inserted text based on accepted or rejected sets of characters
1179 * Add this filter to an entry to restrict the set of accepted characters
1180 * based on the sets in the provided #Elm_Entry_Filter_Accept_Set.
1181 * This structure contains both accepted and rejected sets, but they are
1182 * mutually exclusive.
1184 * The @c accepted set takes preference, so if it is set, the filter will
1185 * only work based on the accepted characters, ignoring anything in the
1186 * @c rejected value. If @c accepted is @c NULL, then @c rejected is used.
1188 * In both cases, the function filters by matching utf8 characters to the
1189 * raw markup text, so it can be used to remove formatting tags.
1191 * This filter, like any others, does not apply when setting the entry text
1192 * directly with elm_object_text_set()
1194 EAPI void elm_entry_filter_accept_set(void *data, Evas_Object *entry, char **text);