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 */
45 * @typedef Elm_CNP_Mode
46 * Enum of entry's copy & paste policy.
48 * @see elm_entry_cnp_mode_set()
49 * @see elm_entry_cnp_mode_get()
51 typedef enum _Elm_CNP_Mode {
52 ELM_CNP_MODE_MARKUP = 0, /**< copy & paste text with markup tag */
53 ELM_CNP_MODE_NO_IMAGE = 1, /**< copy & paste text without item(image) tag */
54 ELM_CNP_MODE_PLAINTEXT = 2 /**< copy & paste text without markup tag */
58 * @defgroup Entry Entry
60 * @image html img/widget/entry/preview-00.png
61 * @image latex img/widget/entry/preview-00.eps width=\textwidth
62 * @image html img/widget/entry/preview-01.png
63 * @image latex img/widget/entry/preview-01.eps width=\textwidth
64 * @image html img/widget/entry/preview-02.png
65 * @image latex img/widget/entry/preview-02.eps width=\textwidth
66 * @image html img/widget/entry/preview-03.png
67 * @image latex img/widget/entry/preview-03.eps width=\textwidth
69 * An entry is a convenience widget which shows a box that the user can
70 * enter text into. Entries by default don't scroll, so they grow to
71 * accomodate the entire text, resizing the parent window as needed. This
72 * can be changed with the elm_entry_scrollable_set() function.
74 * They can also be single line or multi line (the default) and when set
75 * to multi line mode they support text wrapping in any of the modes
76 * indicated by Elm_Wrap_Type.
78 * Other features include password mode, filtering of inserted text with
79 * elm_entry_text_filter_append() and related functions, inline "items" and
80 * formatted markup text.
82 * @section entry-markup Formatted text
84 * The markup tags supported by the Entry are defined by the theme, but
85 * even when writing new themes or extensions it's a good idea to stick to
86 * a sane default, to maintain coherency and avoid application breakages.
87 * Currently defined by the default theme are the following tags:
88 * @li \<br\>: Inserts a line break.
89 * @li \<ps\>: Inserts a paragraph separator. This is preferred over line
91 * @li \<tab\>: Inserts a tab.
92 * @li \<em\>...\</em\>: Emphasis. Sets the @em oblique style for the
94 * @li \<b\>...\</b\>: Sets the @b bold style for the enclosed text.
95 * @li \<link\>...\</link\>: Underlines the enclosed text.
96 * @li \<hilight\>...\</hilight\>: Hilights the enclosed text.
98 * @section entry-special Special markups
100 * Besides those used to format text, entries support two special markup
101 * tags used to insert clickable portions of text or items inlined within
104 * @subsection entry-anchors Anchors
106 * Anchors are similar to HTML anchors. Text can be surrounded by \<a\> and
107 * \</a\> tags and an event will be generated when this text is clicked,
111 * This text is outside <a href=anc-01>but this one is an anchor</a>
114 * The @c href attribute in the opening tag gives the name that will be
115 * used to identify the anchor and it can be any valid utf8 string.
117 * When an anchor is clicked, an @c "anchor,clicked" signal is emitted with
118 * an #Elm_Entry_Anchor_Info in the @c event_info parameter for the
119 * callback function. The same applies for "anchor,in" (mouse in), "anchor,out"
120 * (mouse out), "anchor,down" (mouse down), and "anchor,up" (mouse up) events on
123 * @subsection entry-items Items
125 * Inlined in the text, any other @c Evas_Object can be inserted by using
126 * \<item\> tags this way:
129 * <item size=16x16 vsize=full href=emoticon/haha></item>
132 * Just like with anchors, the @c href identifies each item, but these need,
133 * in addition, to indicate their size, which is done using any one of
134 * @c size, @c absize or @c relsize attributes. These attributes take their
135 * value in the WxH format, where W is the width and H the height of the
138 * @li absize: Absolute pixel size for the item. Whatever value is set will
139 * be the item's size regardless of any scale value the object may have
140 * been set to. The final line height will be adjusted to fit larger items.
141 * @li size: Similar to @c absize, but it's adjusted to the scale value set
143 * @li relsize: Size is adjusted for the item to fit within the current
146 * Besides their size, items are specificed a @c vsize value that affects
147 * how their final size and position are calculated. The possible values
149 * @li ascent: Item will be placed within the line's baseline and its
150 * ascent. That is, the height between the line where all characters are
151 * positioned and the highest point in the line. For @c size and @c absize
152 * items, the descent value will be added to the total line height to make
153 * them fit. @c relsize items will be adjusted to fit within this space.
154 * @li full: Items will be placed between the descent and ascent, or the
155 * lowest point in the line and its highest.
157 * The next image shows different configurations of items and how
158 * the previously mentioned options affect their sizes. In all cases,
159 * the green line indicates the ascent, blue for the baseline and red for
162 * @image html entry_item.png
163 * @image latex entry_item.eps width=\textwidth
165 * And another one to show how size differs from absize. In the first one,
166 * the scale value is set to 1.0, while the second one is using one of 2.0.
168 * @image html entry_item_scale.png
169 * @image latex entry_item_scale.eps width=\textwidth
171 * After the size for an item is calculated, the entry will request an
172 * object to place in its space. For this, the functions set with
173 * elm_entry_item_provider_append() and related functions will be called
174 * in order until one of them returns a @c non-NULL value. If no providers
175 * are available, or all of them return @c NULL, then the entry falls back
176 * to one of the internal defaults, provided the name matches with one of
179 * All of the following are currently supported:
182 * - emoticon/angry-shout
183 * - emoticon/crazy-laugh
184 * - emoticon/evil-laugh
186 * - emoticon/goggle-smile
188 * - emoticon/grumpy-smile
190 * - emoticon/guilty-smile
192 * - emoticon/half-smile
193 * - emoticon/happy-panting
195 * - emoticon/indifferent
197 * - emoticon/knowing-grin
199 * - emoticon/little-bit-sorry
200 * - emoticon/love-lots
202 * - emoticon/minimal-smile
203 * - emoticon/not-happy
204 * - emoticon/not-impressed
206 * - emoticon/opensmile
209 * - emoticon/squint-laugh
210 * - emoticon/surprised
211 * - emoticon/suspicious
212 * - emoticon/tongue-dangling
213 * - emoticon/tongue-poke
216 * - emoticon/very-sorry
222 * Alternatively, an item may reference an image by its path, using
223 * the URI form @c file:///path/to/an/image.png and the entry will then
224 * use that image for the item.
226 * @section entry-files Loading and saving files
228 * Entries have convinience functions to load text from a file and save
229 * changes back to it after a short delay. The automatic saving is enabled
230 * by default, but can be disabled with elm_entry_autosave_set() and files
231 * can be loaded directly as plain text or have any markup in them
232 * recognized. See elm_entry_file_set() for more details.
234 * @section entry-signals Emitted signals
236 * This widget emits the following signals:
238 * @li "changed": The text within the entry was changed.
239 * @li "changed,user": The text within the entry was changed because of user interaction.
240 * @li "activated": The enter key was pressed on a single line entry.
241 * @li "press": A mouse button has been pressed on the entry.
242 * @li "longpressed": A mouse button has been pressed and held for a couple
244 * @li "clicked": The entry has been clicked (mouse press and release).
245 * @li "clicked,double": The entry has been double clicked.
246 * @li "clicked,triple": The entry has been triple clicked.
247 * @li "focused": The entry has received focus.
248 * @li "unfocused": The entry has lost focus.
249 * @li "selection,paste": A paste of the clipboard contents was requested.
250 * @li "selection,copy": A copy of the selected text into the clipboard was
252 * @li "selection,cut": A cut of the selected text into the clipboard was
254 * @li "selection,start": A selection has begun and no previous selection
256 * @li "selection,changed": The current selection has changed.
257 * @li "selection,cleared": The current selection has been cleared.
258 * @li "cursor,changed": The cursor has changed position.
259 * @li "anchor,clicked": An anchor has been clicked. The event_info
260 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
261 * @li "anchor,in": Mouse cursor has moved into an anchor. The event_info
262 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
263 * @li "anchor,out": Mouse cursor has moved out of an anchor. The event_info
264 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
265 * @li "anchor,up": Mouse button has been unpressed on an anchor. The event_info
266 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
267 * @li "anchor,down": Mouse button has been pressed on an anchor. The event_info
268 * parameter for the callback will be an #Elm_Entry_Anchor_Info.
269 * @li "preedit,changed": The preedit string has changed.
270 * @li "language,changed": Program language changed.
272 * Default contents parts of the entry items that you can use for are:
273 * @li "icon" - An icon in the entry
274 * @li "end" - A content in the end of the entry
276 * Default text parts of the entry that you can use for are:
277 * @li "default" - text of the entry
279 * Supported elm_object common APIs.
280 * @li elm_object_signal_emit
281 * @li elm_object_part_text_set
282 * @li elm_object_part_text_get
283 * @li elm_object_part_content_set
284 * @li elm_object_part_content_get
285 * @li elm_object_part_content_unset
286 * @li elm_object_signal_callback_add
287 * @li elm_object_signal_callback_del
288 * @li elm_object_disabled_set
289 * @li elm_object_disabled_get
291 * @section entry-examples
293 * An overview of the Entry API can be seen in @ref entry_example_01
299 * @typedef Elm_Entry_Anchor_Info
301 * The info sent in the callback for the "anchor,clicked" signals emitted
304 typedef struct _Elm_Entry_Anchor_Info Elm_Entry_Anchor_Info;
307 * @struct _Elm_Entry_Anchor_Info
309 * The info sent in the callback for the "anchor,clicked" signals emitted
312 struct _Elm_Entry_Anchor_Info
314 const char *name; /**< The name of the anchor, as stated in its href */
315 int button; /**< The mouse button used to click on it */
316 Evas_Coord x, /**< Anchor geometry, relative to canvas */
317 y, /**< Anchor geometry, relative to canvas */
318 w, /**< Anchor geometry, relative to canvas */
319 h; /**< Anchor geometry, relative to canvas */
323 * @typedef Elm_Entry_Filter_Cb
324 * This callback type is used by entry filters to modify text.
325 * @param data The data specified as the last param when adding the filter
326 * @param entry The entry object
327 * @param text A pointer to the location of the text being filtered. This data can be modified,
328 * but any additional allocations must be managed by the user.
329 * @see elm_entry_text_filter_append
330 * @see elm_entry_text_filter_prepend
332 typedef void (*Elm_Entry_Filter_Cb)(void *data, Evas_Object *entry, char **text);
335 * @typedef Elm_Entry_Change_Info
336 * This corresponds to Edje_Entry_Change_Info. Includes information about
337 * a change in the entry.
339 typedef Edje_Entry_Change_Info Elm_Entry_Change_Info;
342 * This adds an entry to @p parent object.
344 * By default, entries are:
348 * @li autosave is enabled
350 * @param parent The parent object
351 * @return The new object or NULL if it cannot be created
353 EAPI Evas_Object *elm_entry_add(Evas_Object *parent);
356 * Sets the entry to single line mode.
358 * In single line mode, entries don't ever wrap when the text reaches the
359 * edge, and instead they keep growing horizontally. Pressing the @c Enter
360 * key will generate an @c "activate" event instead of adding a new line.
362 * When @p single_line is @c EINA_FALSE, line wrapping takes effect again
363 * and pressing enter will break the text into a different line
364 * without generating any events.
366 * @param obj The entry object
367 * @param single_line If true, the text in the entry
368 * will be on a single line.
370 EAPI void elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line);
373 * Gets whether the entry is set to be single line.
375 * @param obj The entry object
376 * @return single_line If true, the text in the entry is set to display
379 * @see elm_entry_single_line_set()
381 EAPI Eina_Bool elm_entry_single_line_get(const Evas_Object *obj);
384 * Sets the entry to password mode.
386 * In password mode, entries are implicitly single line and the display of
387 * any text in them is replaced with asterisks (*).
389 * @param obj The entry object
390 * @param password If true, password mode is enabled.
392 EAPI void elm_entry_password_set(Evas_Object *obj, Eina_Bool password);
395 * Gets whether the entry is set to password mode.
397 * @param obj The entry object
398 * @return If true, the entry is set to display all characters
401 * @see elm_entry_password_set()
403 EAPI Eina_Bool elm_entry_password_get(const Evas_Object *obj);
406 * This sets the text displayed within the entry to @p entry.
408 * @param obj The entry object
409 * @param entry The text to be displayed
411 * @note Using this function bypasses text filters
413 EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry);
416 * This returns the text currently shown in object @p entry.
417 * See also elm_entry_entry_set().
419 * @param obj The entry object
420 * @return The currently displayed text or NULL on failure
422 EAPI const char *elm_entry_entry_get(const Evas_Object *obj);
425 * Appends @p entry to the text of the entry.
427 * Adds the text in @p entry to the end of any text already present in the
430 * The appended text is subject to any filters set for the widget.
432 * @param obj The entry object
433 * @param entry The text to be displayed
435 * @see elm_entry_text_filter_append()
437 EAPI void elm_entry_entry_append(Evas_Object *obj, const char *entry);
440 * Gets whether the entry is empty.
442 * Empty means no text at all. If there are any markup tags, like an item
443 * tag for which no provider finds anything, and no text is displayed, this
444 * function still returns EINA_FALSE.
446 * @param obj The entry object
447 * @return EINA_TRUE if the entry is empty, EINA_FALSE otherwise.
449 EAPI Eina_Bool elm_entry_is_empty(const Evas_Object *obj);
452 * Gets any selected text within the entry.
454 * If there's any selected text in the entry, this function returns it as
455 * a string in markup format. NULL is returned if no selection exists or
456 * if an error occurred.
458 * The returned value points to an internal string and should not be freed
459 * or modified in any way. If the @p entry object is deleted or its
460 * contents are changed, the returned pointer should be considered invalid.
462 * @param obj The entry object
463 * @return The selected text within the entry or NULL on failure
465 EAPI const char *elm_entry_selection_get(const Evas_Object *obj);
468 * Returns the actual textblock object of the entry.
470 * This function exposes the internal textblock object that actually
471 * contains and draws the text. This should be used for low-level
472 * manipulations that are otherwise not possible.
474 * Changing the textblock directly from here will not notify edje/elm to
475 * recalculate the textblock size automatically, so any modifications
476 * done to the textblock returned by this function should be followed by
477 * a call to elm_entry_calc_force().
479 * The return value is marked as const as an additional warning.
480 * One should not use the returned object with any of the generic evas
481 * functions (geometry_get/resize/move and etc), but only with the textblock
482 * functions; The former will either not work at all, or break the correct
485 * IMPORTANT: Many functions may change (i.e delete and create a new one)
486 * the internal textblock object. Do NOT cache the returned object, and try
487 * not to mix calls on this object with regular elm_entry calls (which may
488 * change the internal textblock object). This applies to all cursors
489 * returned from textblock calls, and all the other derivative values.
491 * @param obj The entry object
492 * @return The textblock object.
494 EAPI Evas_Object * elm_entry_textblock_get(Evas_Object *obj);
497 * Forces calculation of the entry size and text layouting.
499 * This should be used after modifying the textblock object directly. See
500 * elm_entry_textblock_get() for more information.
502 * @param obj The entry object
504 * @see elm_entry_textblock_get()
506 EAPI void elm_entry_calc_force(Evas_Object *obj);
509 * Inserts the given text into the entry at the current cursor position.
511 * This inserts text at the cursor position as if it was typed
512 * by the user (note that this also allows markup which a user
513 * can't just "type" as it would be converted to escaped text, so this
514 * call can be used to insert things like emoticon items or bold push/pop
515 * tags, other font and color change tags etc.)
517 * If any selection exists, it will be replaced by the inserted text.
519 * The inserted text is subject to any filters set for the widget.
521 * @param obj The entry object
522 * @param entry The text to insert
524 * @see elm_entry_text_filter_append()
526 EAPI void elm_entry_entry_insert(Evas_Object *obj, const char *entry);
529 * Set the line wrap type to use on multi-line entries.
531 * Sets the wrap type used by the entry to any of the specified in
532 * Elm_Wrap_Type. This tells how the text will be implicitly cut into a new
533 * line (without inserting a line break or paragraph separator) when it
534 * reaches the far edge of the widget.
536 * Note that this only makes sense for multi-line entries. A widget set
537 * to be single line will never wrap.
539 * @param obj The entry object
540 * @param wrap The wrap mode to use. See Elm_Wrap_Type for details on them
542 EAPI void elm_entry_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap);
545 * Gets the wrap mode the entry was set to use.
547 * @param obj The entry object
550 * @see also elm_entry_line_wrap_set()
552 EAPI Elm_Wrap_Type elm_entry_line_wrap_get(const Evas_Object *obj);
555 * Sets if the entry is to be editable or not.
557 * By default, entries are editable and when focused, any text input by the
558 * user will be inserted at the current cursor position. But calling this
559 * function with @p editable as EINA_FALSE will prevent the user from
560 * inputting text into the entry.
562 * The only way to change the text of a non-editable entry is to use
563 * elm_object_text_set(), elm_entry_entry_insert() and other related
566 * @param obj The entry object
567 * @param editable If EINA_TRUE, user input will be inserted in the entry,
568 * if not, the entry is read-only and no user input is allowed.
570 EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable);
573 * Gets whether the entry is editable or not.
575 * @param obj The entry object
576 * @return If true, the entry is editable by the user.
577 * If false, it is not editable by the user
579 * @see elm_entry_editable_set()
581 EAPI Eina_Bool elm_entry_editable_get(const Evas_Object *obj);
584 * This drops any existing text selection within the entry.
586 * @param obj The entry object
588 EAPI void elm_entry_select_none(Evas_Object *obj);
591 * This selects all text within the entry.
593 * @param obj The entry object
595 EAPI void elm_entry_select_all(Evas_Object *obj);
598 * This moves the cursor one place to the right within the entry.
600 * @param obj The entry object
601 * @return EINA_TRUE upon success, EINA_FALSE upon failure
603 EAPI Eina_Bool elm_entry_cursor_next(Evas_Object *obj);
606 * This moves the cursor one place to the left within the entry.
608 * @param obj The entry object
609 * @return EINA_TRUE upon success, EINA_FALSE upon failure
611 EAPI Eina_Bool elm_entry_cursor_prev(Evas_Object *obj);
614 * This moves the cursor one line up within the entry.
616 * @param obj The entry object
617 * @return EINA_TRUE upon success, EINA_FALSE upon failure
619 EAPI Eina_Bool elm_entry_cursor_up(Evas_Object *obj);
622 * This moves the cursor one line down within the entry.
624 * @param obj The entry object
625 * @return EINA_TRUE upon success, EINA_FALSE upon failure
627 EAPI Eina_Bool elm_entry_cursor_down(Evas_Object *obj);
630 * This moves the cursor to the beginning of the entry.
632 * @param obj The entry object
634 EAPI void elm_entry_cursor_begin_set(Evas_Object *obj);
637 * This moves the cursor to the end of the entry.
639 * @param obj The entry object
641 EAPI void elm_entry_cursor_end_set(Evas_Object *obj);
644 * This moves the cursor to the beginning of the current line.
646 * @param obj The entry object
648 EAPI void elm_entry_cursor_line_begin_set(Evas_Object *obj);
651 * This moves the cursor to the end of the current line.
653 * @param obj The entry object
655 EAPI void elm_entry_cursor_line_end_set(Evas_Object *obj);
658 * This begins a selection within the entry as though
659 * the user were holding down the mouse button to make a selection.
661 * @param obj The entry object
663 EAPI void elm_entry_cursor_selection_begin(Evas_Object *obj);
666 * This ends a selection within the entry as though
667 * the user had just released the mouse button while making a selection.
669 * @param obj The entry object
671 EAPI void elm_entry_cursor_selection_end(Evas_Object *obj);
674 * Gets whether a format node exists at the current cursor position.
676 * A format node is anything that defines how the text is rendered. It can
677 * be a visible format node, such as a line break or a paragraph separator,
678 * or an invisible one, such as bold begin or end tag.
679 * This function returns whether any format node exists at the current
682 * @param obj The entry object
683 * @return EINA_TRUE if the current cursor position contains a format node,
684 * EINA_FALSE otherwise.
686 * @see elm_entry_cursor_is_visible_format_get()
688 EAPI Eina_Bool elm_entry_cursor_is_format_get(const Evas_Object *obj);
691 * Gets if the current cursor position holds a visible format node.
693 * @param obj The entry object
694 * @return EINA_TRUE if the current cursor is a visible format, EINA_FALSE
695 * if it's an invisible one or no format exists.
697 * @see elm_entry_cursor_is_format_get()
699 EAPI Eina_Bool elm_entry_cursor_is_visible_format_get(const Evas_Object *obj);
702 * Gets the character pointed by the cursor at its current position.
704 * This function returns a string with the utf8 character stored at the
705 * current cursor position.
706 * Only the text is returned, any format that may exist will not be part
707 * of the return value. You must free the string when done with free().
709 * @param obj The entry object
710 * @return The text pointed by the cursors.
712 EAPI char *elm_entry_cursor_content_get(const Evas_Object *obj);
715 * This function returns the geometry of the cursor.
717 * It's useful if you want to draw something on the cursor (or where it is),
718 * or for example in the case of scrolled entry where you want to show the
721 * @param obj The entry object
722 * @param x returned geometry
723 * @param y returned geometry
724 * @param w returned geometry
725 * @param h returned geometry
726 * @return EINA_TRUE upon success, EINA_FALSE upon failure
728 EAPI Eina_Bool elm_entry_cursor_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
731 * Sets the cursor position in the entry to the given value
733 * The value in @p pos is the index of the character position within the
734 * contents of the string as returned by elm_entry_cursor_pos_get().
736 * @param obj The entry object
737 * @param pos The position of the cursor
739 EAPI void elm_entry_cursor_pos_set(Evas_Object *obj, int pos);
742 * Retrieves the current position of the cursor in the entry
744 * @param obj The entry object
745 * @return The cursor position
747 EAPI int elm_entry_cursor_pos_get(const Evas_Object *obj);
750 * This executes a "cut" action on the selected text in the entry.
752 * @param obj The entry object
754 EAPI void elm_entry_selection_cut(Evas_Object *obj);
757 * This executes a "copy" action on the selected text in the entry.
759 * @param obj The entry object
761 EAPI void elm_entry_selection_copy(Evas_Object *obj);
764 * This executes a "paste" action in the entry.
766 * @param obj The entry object
768 EAPI void elm_entry_selection_paste(Evas_Object *obj);
771 * This clears and frees the items in a entry's contextual (longpress)
774 * @param obj The entry object
776 * @see elm_entry_context_menu_item_add()
778 EAPI void elm_entry_context_menu_clear(Evas_Object *obj);
781 * This adds an item to the entry's contextual menu.
783 * A longpress on an entry will make the contextual menu show up, if this
784 * hasn't been disabled with elm_entry_context_menu_disabled_set().
785 * By default, this menu provides a few options like enabling selection mode,
786 * which is useful on embedded devices that need to be explicit about it,
787 * and when a selection exists it also shows the copy and cut actions.
789 * With this function, developers can add other options to this menu to
790 * perform any action they deem necessary.
792 * @param obj The entry object
793 * @param label The item's text label
794 * @param icon_file The item's icon file
795 * @param icon_type The item's icon type
796 * @param func The callback to execute when the item is clicked
797 * @param data The data to associate with the item for related functions
799 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);
802 * This disables the entry's contextual (longpress) menu.
804 * @param obj The entry object
805 * @param disabled If true, the menu is disabled
807 EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled);
810 * This returns whether the entry's contextual (longpress) menu is
813 * @param obj The entry object
814 * @return If true, the menu is disabled
816 EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Evas_Object *obj);
819 * This disables the entry's magnifer feature.
821 * @param obj The entry object
822 * @param disabled If true, the magnifier is not displayed
825 EAPI void elm_entry_magnifier_disabled_set(Evas_Object *obj, Eina_Bool disabled);
827 * This returns whether the entry's magnifier feature is disabled.
829 * @param obj The entry object
830 * @return If true, the feature is disabled
832 EAPI Eina_Bool elm_entry_magnifier_disabled_get(const Evas_Object *obj);
835 * This appends a custom item provider to the list for that entry
837 * This appends the given callback. The list is walked from beginning to end
838 * with each function called given the item href string in the text. If the
839 * function returns an object handle other than NULL (it should create an
840 * object to do this), then this object is used to replace that item. If
841 * not the next provider is called until one provides an item object, or the
842 * default provider in entry does.
844 * @param obj The entry object
845 * @param func The function called to provide the item object
846 * @param data The data passed to @p func
848 * @see @ref entry-items
850 EAPI void elm_entry_item_provider_append(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data);
853 * This prepends a custom item provider to the list for that entry
855 * This prepends the given callback. See elm_entry_item_provider_append() for
858 * @param obj The entry object
859 * @param func The function called to provide the item object
860 * @param data The data passed to @p func
862 EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data);
865 * This removes a custom item provider to the list for that entry
867 * This removes the given callback. See elm_entry_item_provider_append() for
870 * @param obj The entry object
871 * @param func The function called to provide the item object
872 * @param data The data passed to @p func
874 EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data);
877 * Append a filter function for text inserted in the entry
879 * Append the given callback to the list. This functions will be called
880 * whenever any text is inserted into the entry, with the text to be inserted
881 * as a parameter. The callback function is free to alter the text in any way
882 * it wants, but it must remember to free the given pointer and update it.
883 * If the new text is to be discarded, the function can free it and set its
884 * text parameter to NULL. This will also prevent any following filters from
887 * @param obj The entry object
888 * @param func The function to use as text filter
889 * @param data User data to pass to @p func
891 EAPI void elm_entry_text_filter_append(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data);
894 * Prepend a filter function for text insdrted in the entry
896 * Prepend the given callback to the list. See elm_entry_text_filter_append()
897 * for more information
899 * @param obj The entry object
900 * @param func The function to use as text filter
901 * @param data User data to pass to @p func
903 EAPI void elm_entry_text_filter_prepend(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data);
906 * Remove a filter from the list
908 * Removes the given callback from the filter list. See
909 * elm_entry_text_filter_append() for more information.
911 * @param obj The entry object
912 * @param func The filter function to remove
913 * @param data The user data passed when adding the function
915 EAPI void elm_entry_text_filter_remove(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data);
918 * This converts a markup (HTML-like) string into UTF-8.
920 * The returned string is a malloc'ed buffer and it should be freed when
921 * not needed anymore.
923 * @param s The string (in markup) to be converted
924 * @return The converted string (in UTF-8). It should be freed.
926 EAPI char *elm_entry_markup_to_utf8(const char *s);
929 * This converts a UTF-8 string into markup (HTML-like).
931 * The returned string is a malloc'ed buffer and it should be freed when
932 * not needed anymore.
934 * @param s The string (in UTF-8) to be converted
935 * @return The converted string (in markup). It should be freed.
937 EAPI char *elm_entry_utf8_to_markup(const char *s);
940 * This sets the file (and implicitly loads it) for the text to display and
941 * then edit. All changes are written back to the file after a short delay if
942 * the entry object is set to autosave (which is the default).
944 * If the entry had any other file set previously, any changes made to it
945 * will be saved if the autosave feature is enabled, otherwise, the file
946 * will be silently discarded and any non-saved changes will be lost.
948 * @param obj The entry object
949 * @param file The path to the file to load and save
950 * @param format The file format
952 EAPI void elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format);
955 * Gets the file being edited by the entry.
957 * This function can be used to retrieve any file set on the entry for
958 * edition, along with the format used to load and save it.
960 * @param obj The entry object
961 * @param file The path to the file to load and save
962 * @param format The file format
964 EAPI void elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format);
967 * This function writes any changes made to the file set with
968 * elm_entry_file_set()
970 * @param obj The entry object
972 EAPI void elm_entry_file_save(Evas_Object *obj);
975 * This sets the entry object to 'autosave' the loaded text file or not.
977 * @param obj The entry object
978 * @param autosave Autosave the loaded file or not
980 * @see elm_entry_file_set()
982 EAPI void elm_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave);
985 * This gets the entry object's 'autosave' status.
987 * @param obj The entry object
988 * @return Autosave the loaded file or not
990 * @see elm_entry_file_set()
992 EAPI Eina_Bool elm_entry_autosave_get(const Evas_Object *obj);
995 * Control pasting of text and images for the widget.
997 * Normally the entry allows both text and images to be pasted.
998 * By setting textonly to be ELM_CNP_MODE_NO_IMAGE, this prevents images from being copy or past.
999 * By setting textonly to be ELM_CNP_MODE_PLAINTEXT, this remove all tags in text .
1001 * @note this only changes the behaviour of text.
1003 * @param obj The entry object
1004 * @param mode One of #Elm_CNP_Mode: #ELM_CNP_MODE_MARKUP,
1005 * #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT.
1007 EAPI void elm_entry_cnp_mode_set(Evas_Object *obj, Elm_CNP_Mode cnp_mode);
1010 * Getting elm_entry text paste/drop mode.
1012 * Normally the entry allows both text and images to be pasted.
1013 * This gets the copy & paste mode of the entry.
1015 * @param obj The entry object
1016 * @return mode One of #Elm_CNP_Mode: #ELM_CNP_MODE_MARKUP,
1017 * #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT.
1019 EAPI Elm_CNP_Mode elm_entry_cnp_mode_get(const Evas_Object *obj);
1022 * Control pasting of text and images for the widget.
1024 * Normally the entry allows both text and images to be pasted. By setting
1025 * textonly to be true, this prevents images from being pasted.
1027 * Note this only changes the behaviour of text.
1029 * @param obj The entry object
1030 * @param textonly paste mode - EINA_TRUE is text only, EINA_FALSE is
1035 * Control pasting of text and images for the widget.
1037 * Normally the entry allows both text and images to be pasted. By setting
1038 * textonly to be true, this prevents images from being pasted.
1040 * Note this only changes the behaviour of text.
1042 * @param obj The entry object
1043 * @param textonly paste mode - EINA_TRUE is text only, EINA_FALSE is
1046 EAPI void elm_entry_cnp_textonly_set(Evas_Object *obj, Eina_Bool textonly);
1049 * Getting elm_entry text paste/drop mode.
1051 * In textonly mode, only text may be pasted or dropped into the widget.
1053 * @param obj The entry object
1054 * @return If the widget only accepts text from pastes.
1056 EAPI Eina_Bool elm_entry_cnp_textonly_get(const Evas_Object *obj);
1059 * Enable or disable scrolling in entry
1061 * Normally the entry is not scrollable unless you enable it with this call.
1063 * @param obj The entry object
1064 * @param scroll EINA_TRUE if it is to be scrollable, EINA_FALSE otherwise
1066 EAPI void elm_entry_scrollable_set(Evas_Object *obj, Eina_Bool scroll);
1069 * Get the scrollable state of the entry
1071 * Normally the entry is not scrollable. This gets the scrollable state
1072 * of the entry. See elm_entry_scrollable_set() for more information.
1074 * @param obj The entry object
1075 * @return The scrollable state
1077 EAPI Eina_Bool elm_entry_scrollable_get(const Evas_Object *obj);
1080 * Sets the visibility of the left-side widget of the scrolled entry,
1081 * set by elm_entry_icon_set().
1083 * @param obj The scrolled entry object
1084 * @param setting EINA_TRUE if the object should be displayed,
1085 * EINA_FALSE if not.
1087 EAPI void elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting);
1090 * Sets the visibility of the end widget of the scrolled entry, set by
1091 * elm_object_part_content_set(ent, "end", content).
1093 * @param obj The scrolled entry object
1094 * @param setting EINA_TRUE if the object should be displayed,
1095 * EINA_FALSE if not.
1097 EAPI void elm_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting);
1100 * This sets the scrolled entry's scrollbar policy (ie. enabling/disabling
1103 * Setting an entry to single-line mode with elm_entry_single_line_set()
1104 * will automatically disable the display of scrollbars when the entry
1105 * moves inside its scroller.
1107 * @param obj The scrolled entry object
1108 * @param h The horizontal scrollbar policy to apply
1109 * @param v The vertical scrollbar policy to apply
1111 EAPI void elm_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v);
1114 * This enables/disables bouncing within the entry.
1116 * This function sets whether the entry will bounce when scrolling reaches
1117 * the end of the contained entry.
1119 * @param obj The scrolled entry object
1120 * @param h_bounce The horizontal bounce state
1121 * @param v_bounce The vertical bounce state
1123 EAPI void elm_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
1126 * Get the bounce mode
1128 * @param obj The Entry object
1129 * @param h_bounce Allow bounce horizontally
1130 * @param v_bounce Allow bounce vertically
1132 EAPI void elm_entry_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
1135 * Set the input panel layout of the entry
1137 * @param obj The entry object
1138 * @param layout layout type
1140 EAPI void elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout);
1143 * Get the input panel layout of the entry
1145 * @param obj The entry object
1146 * @return layout type
1148 * @see elm_entry_input_panel_layout_set
1150 EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(Evas_Object *obj);
1153 * Set the autocapitalization type on the immodule.
1155 * @param obj The entry object
1156 * @param autocapital_type The type of autocapitalization
1158 EAPI void elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapital_type);
1161 * Retrieve the autocapitalization type on the immodule.
1163 * @param obj The entry object
1164 * @return autocapitalization type
1166 EAPI Elm_Autocapital_Type elm_entry_autocapital_type_get(Evas_Object *obj);
1169 * Sets the attribute to show the input panel automatically.
1171 * @param obj The entry object
1172 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
1174 EAPI void elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled);
1177 * Retrieve the attribute to show the input panel automatically.
1179 * @param obj The entry object
1180 * @return EINA_TRUE if input panel will be appeared when the entry is clicked or has a focus, EINA_FALSE otherwise
1182 EAPI Eina_Bool elm_entry_input_panel_enabled_get(Evas_Object *obj);
1185 * Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on.
1187 * Note that input panel is shown or hidden automatically according to the focus state of entry widget.
1188 * This API can be used in the case of manually controling by using elm_entry_input_panel_enabled_set(en, EINA_FALSE)
1190 * @param obj The entry object
1192 EAPI void elm_entry_input_panel_show(Evas_Object *obj);
1195 * Hide the input panel (virtual keyboard).
1197 * Note that input panel is shown or hidden automatically according to the focus state of entry widget.
1198 * This API can be used in the case of manually controling by using elm_entry_input_panel_enabled_set(en, EINA_FALSE)
1200 * @param obj The entry object
1202 EAPI void elm_entry_input_panel_hide(Evas_Object *obj);
1204 /* pre-made filters for entries */
1207 * @typedef Elm_Entry_Filter_Limit_Size
1209 * Data for the elm_entry_filter_limit_size() entry filter.
1211 typedef struct _Elm_Entry_Filter_Limit_Size Elm_Entry_Filter_Limit_Size;
1214 * @struct _Elm_Entry_Filter_Limit_Size
1216 * Data for the elm_entry_filter_limit_size() entry filter.
1218 struct _Elm_Entry_Filter_Limit_Size
1220 int max_char_count; /**< The maximum number of characters allowed. */
1221 int max_byte_count; /**< The maximum number of bytes allowed*/
1225 * Filter inserted text based on user defined character and byte limits
1227 * Add this filter to an entry to limit the characters that it will accept
1228 * based the the contents of the provided #Elm_Entry_Filter_Limit_Size.
1229 * The funtion works on the UTF-8 representation of the string, converting
1230 * it from the set markup, thus not accounting for any format in it.
1232 * The user must create an #Elm_Entry_Filter_Limit_Size structure and pass
1233 * it as data when setting the filter. In it, it's possible to set limits
1234 * by character count or bytes (any of them is disabled if 0), and both can
1235 * be set at the same time. In that case, it first checks for characters,
1238 * The function will cut the inserted text in order to allow only the first
1239 * number of characters that are still allowed. The cut is made in
1240 * characters, even when limiting by bytes, in order to always contain
1241 * valid ones and avoid half unicode characters making it in.
1243 * This filter, like any others, does not apply when setting the entry text
1244 * directly with elm_object_text_set().
1246 EAPI void elm_entry_filter_limit_size(void *data, Evas_Object *entry, char **text);
1249 * @typedef Elm_Entry_Filter_Accept_Set
1251 * Data for the elm_entry_filter_accept_set() entry filter.
1253 typedef struct _Elm_Entry_Filter_Accept_Set Elm_Entry_Filter_Accept_Set;
1256 * @struct _Elm_Entry_Filter_Accept_Set
1258 * Data for the elm_entry_filter_accept_set() entry filter.
1260 struct _Elm_Entry_Filter_Accept_Set
1262 const char *accepted; /**< Set of characters accepted in the entry. */
1263 const char *rejected; /**< Set of characters rejected from the entry. */
1267 * Filter inserted text based on accepted or rejected sets of characters
1269 * Add this filter to an entry to restrict the set of accepted characters
1270 * based on the sets in the provided #Elm_Entry_Filter_Accept_Set.
1271 * This structure contains both accepted and rejected sets, but they are
1272 * mutually exclusive.
1274 * The @c accepted set takes preference, so if it is set, the filter will
1275 * only work based on the accepted characters, ignoring anything in the
1276 * @c rejected value. If @c accepted is @c NULL, then @c rejected is used.
1278 * In both cases, the function filters by matching utf8 characters to the
1279 * raw markup text, so it can be used to remove formatting tags.
1281 * This filter, like any others, does not apply when setting the entry text
1282 * directly with elm_object_text_set()
1284 EAPI void elm_entry_filter_accept_set(void *data, Evas_Object *entry, char **text);
1286 EAPI void elm_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool autocap);
1287 EINA_DEPRECATED EAPI void elm_entry_autoperiod_set(Evas_Object *obj, Eina_Bool autoperiod);
1288 EINA_DEPRECATED EAPI void elm_entry_autoenable_returnkey_set(Evas_Object *obj, Eina_Bool on);
1289 EAPI Ecore_IMF_Context *elm_entry_imf_context_get(Evas_Object *obj);
1290 EAPI void elm_entry_matchlist_set(Evas_Object *obj, Eina_List *match_list, Eina_Bool case_sensitive);
1291 EAPI void elm_entry_magnifier_type_set(Evas_Object *obj, int type);