Merge "[cnp] fixed S1-2415 issue("search" is not working)"
[framework/uifw/elementary.git] / src / lib / elm_entry.h
1 /**
2  * @defgroup Entry Entry
3  *
4  * @image html img/widget/entry/preview-00.png
5  * @image latex img/widget/entry/preview-00.eps width=\textwidth
6  * @image html img/widget/entry/preview-01.png
7  * @image latex img/widget/entry/preview-01.eps width=\textwidth
8  * @image html img/widget/entry/preview-02.png
9  * @image latex img/widget/entry/preview-02.eps width=\textwidth
10  * @image html img/widget/entry/preview-03.png
11  * @image latex img/widget/entry/preview-03.eps width=\textwidth
12  *
13  * An entry is a convenience widget which shows a box that the user can
14  * enter text into. Entries by default don't scroll, so they grow to
15  * accommodate the entire text, resizing the parent window as needed. This
16  * can be changed with the elm_entry_scrollable_set() function.
17  *
18  * They can also be single line or multi line (the default) and when set
19  * to multi line mode they support text wrapping in any of the modes
20  * indicated by #Elm_Wrap_Type.
21  *
22  * Other features include password mode, filtering of inserted text with
23  * elm_entry_markup_filter_append() and related functions, inline "items" and
24  * formatted markup text.
25  *
26  * @section entry-markup Formatted text
27  *
28  * The markup tags supported by the Entry are defined by the theme, but
29  * even when writing new themes or extensions it's a good idea to stick to
30  * a sane default, to maintain coherency and avoid application breakages.
31  * Currently defined by the default theme are the following tags:
32  * @li \<br\>: Inserts a line break.
33  * @li \<ps\>: Inserts a paragraph separator. This is preferred over line
34  * breaks.
35  * @li \<tab\>: Inserts a tab.
36  * @li \<em\>...\</em\>: Emphasis. Sets the @em oblique style for the
37  * enclosed text.
38  * @li \<b\>...\</b\>: Sets the @b bold style for the enclosed text.
39  * @li \<link\>...\</link\>: Underlines the enclosed text.
40  * @li \<hilight\>...\</hilight\>: Highlights the enclosed text.
41  *
42  * @section entry-special Special markups
43  *
44  * Besides those used to format text, entries support two special markup
45  * tags used to insert click-able portions of text or items inlined within
46  * the text.
47  *
48  * @subsection entry-anchors Anchors
49  *
50  * Anchors are similar to HTML anchors. Text can be surrounded by \<a\> and
51  * \</a\> tags and an event will be generated when this text is clicked,
52  * like this:
53  *
54  * @code
55  * This text is outside <a href=anc-01>but this one is an anchor</a>
56  * @endcode
57  *
58  * The @c href attribute in the opening tag gives the name that will be
59  * used to identify the anchor and it can be any valid utf8 string.
60  *
61  * When an anchor is clicked, an @c "anchor,clicked" signal is emitted with
62  * an #Elm_Entry_Anchor_Info in the @c event_info parameter for the
63  * callback function. The same applies for "anchor,in" (mouse in), "anchor,out"
64  * (mouse out), "anchor,down" (mouse down), and "anchor,up" (mouse up) events on
65  * an anchor.
66  *
67  * @subsection entry-items Items
68  *
69  * Inlined in the text, any other @c Evas_Object can be inserted by using
70  * \<item\> tags this way:
71  *
72  * @code
73  * <item size=16x16 vsize=full href=emoticon/haha></item>
74  * @endcode
75  *
76  * Just like with anchors, the @c href identifies each item, but these need,
77  * in addition, to indicate their size, which is done using any one of
78  * @c size, @c absize or @c relsize attributes. These attributes take their
79  * value in the WxH format, where W is the width and H the height of the
80  * item.
81  *
82  * @li absize: Absolute pixel size for the item. Whatever value is set will
83  * be the item's size regardless of any scale value the object may have
84  * been set to. The final line height will be adjusted to fit larger items.
85  * @li size: Similar to @c absize, but it's adjusted to the scale value set
86  * for the object.
87  * @li relsize: Size is adjusted for the item to fit within the current
88  * line height.
89  *
90  * Besides their size, items are specified a @c vsize value that affects
91  * how their final size and position are calculated. The possible values
92  * are:
93  * @li ascent: Item will be placed within the line's baseline and its
94  * ascent. That is, the height between the line where all characters are
95  * positioned and the highest point in the line. For @c size and @c absize
96  * items, the descent value will be added to the total line height to make
97  * them fit. @c relsize items will be adjusted to fit within this space.
98  * @li full: Items will be placed between the descent and ascent, or the
99  * lowest point in the line and its highest.
100  *
101  * The next image shows different configurations of items and how
102  * the previously mentioned options affect their sizes. In all cases,
103  * the green line indicates the ascent, blue for the baseline and red for
104  * the descent.
105  *
106  * @image html entry_item.png
107  * @image latex entry_item.eps width=\textwidth
108  *
109  * And another one to show how size differs from absize. In the first one,
110  * the scale value is set to 1.0, while the second one is using one of 2.0.
111  *
112  * @image html entry_item_scale.png
113  * @image latex entry_item_scale.eps width=\textwidth
114  *
115  * After the size for an item is calculated, the entry will request an
116  * object to place in its space. For this, the functions set with
117  * elm_entry_item_provider_append() and related functions will be called
118  * in order until one of them returns a @c non-NULL value. If no providers
119  * are available, or all of them return @c NULL, then the entry falls back
120  * to one of the internal defaults, provided the name matches with one of
121  * them.
122  *
123  * All of the following are currently supported:
124  *
125  * - emoticon/angry
126  * - emoticon/angry-shout
127  * - emoticon/crazy-laugh
128  * - emoticon/evil-laugh
129  * - emoticon/evil
130  * - emoticon/goggle-smile
131  * - emoticon/grumpy
132  * - emoticon/grumpy-smile
133  * - emoticon/guilty
134  * - emoticon/guilty-smile
135  * - emoticon/haha
136  * - emoticon/half-smile
137  * - emoticon/happy-panting
138  * - emoticon/happy
139  * - emoticon/indifferent
140  * - emoticon/kiss
141  * - emoticon/knowing-grin
142  * - emoticon/laugh
143  * - emoticon/little-bit-sorry
144  * - emoticon/love-lots
145  * - emoticon/love
146  * - emoticon/minimal-smile
147  * - emoticon/not-happy
148  * - emoticon/not-impressed
149  * - emoticon/omg
150  * - emoticon/opensmile
151  * - emoticon/smile
152  * - emoticon/sorry
153  * - emoticon/squint-laugh
154  * - emoticon/surprised
155  * - emoticon/suspicious
156  * - emoticon/tongue-dangling
157  * - emoticon/tongue-poke
158  * - emoticon/uh
159  * - emoticon/unhappy
160  * - emoticon/very-sorry
161  * - emoticon/what
162  * - emoticon/wink
163  * - emoticon/worried
164  * - emoticon/wtf
165  *
166  * Alternatively, an item may reference an image by its path, using
167  * the URI form @c file:///path/to/an/image.png and the entry will then
168  * use that image for the item.
169  *
170  * @section entry-files Loading and saving files
171  *
172  * Entries have convenience functions to load text from a file and save
173  * changes back to it after a short delay. The automatic saving is enabled
174  * by default, but can be disabled with elm_entry_autosave_set() and files
175  * can be loaded directly as plain text or have any markup in them
176  * recognized. See elm_entry_file_set() for more details.
177  *
178  * @section entry-signals Emitted signals
179  *
180  * This widget emits the following signals:
181  *
182  * @li "changed": The text within the entry was changed.
183  * @li "changed,user": The text within the entry was changed because of user interaction.
184  * @li "activated": The enter key was pressed on a single line entry.
185  * @li "press": A mouse button has been pressed on the entry.
186  * @li "longpressed": A mouse button has been pressed and held for a couple
187  * seconds.
188  * @li "clicked": The entry has been clicked (mouse press and release).
189  * @li "clicked,double": The entry has been double clicked.
190  * @li "clicked,triple": The entry has been triple clicked.
191  * @li "focused": The entry has received focus.
192  * @li "unfocused": The entry has lost focus.
193  * @li "selection,paste": A paste of the clipboard contents was requested.
194  * @li "selection,copy": A copy of the selected text into the clipboard was
195  * requested.
196  * @li "selection,cut": A cut of the selected text into the clipboard was
197  * requested.
198  * @li "selection,start": A selection has begun and no previous selection
199  * existed.
200  * @li "selection,changed": The current selection has changed.
201  * @li "selection,cleared": The current selection has been cleared.
202  * @li "cursor,changed": The cursor has changed position.
203  * @li "anchor,clicked": An anchor has been clicked. The event_info
204  * parameter for the callback will be an #Elm_Entry_Anchor_Info.
205  * @li "anchor,in": Mouse cursor has moved into an anchor. The event_info
206  * parameter for the callback will be an #Elm_Entry_Anchor_Info.
207  * @li "anchor,out": Mouse cursor has moved out of an anchor. The event_info
208  * parameter for the callback will be an #Elm_Entry_Anchor_Info.
209  * @li "anchor,up": Mouse button has been unpressed on an anchor. The event_info
210  * parameter for the callback will be an #Elm_Entry_Anchor_Info.
211  * @li "anchor,down": Mouse button has been pressed on an anchor. The event_info
212  * parameter for the callback will be an #Elm_Entry_Anchor_Info.
213  * @li "preedit,changed": The preedit string has changed.
214  * @li "language,changed": Program language changed.
215  *
216  * Default content parts of the entry items that you can use for are:
217  * @li "icon" - An icon in the entry
218  * @li "end" - A content in the end of the entry
219  *
220  * Default text parts of the entry that you can use for are:
221  * @li "default" - text of the entry
222  *
223  * Supported elm_object common APIs.
224  * @li elm_object_signal_emit
225  * @li elm_object_part_text_set
226  * @li elm_object_part_text_get
227  * @li elm_object_part_content_set
228  * @li elm_object_part_content_get
229  * @li elm_object_part_content_unset
230  * @li elm_object_signal_callback_add
231  * @li elm_object_signal_callback_del
232  * @li elm_object_disabled_set
233  * @li elm_object_disabled_get
234  *
235  * @section entry-examples
236  *
237  * An overview of the Entry API can be seen in @ref entry_example
238  *
239  * @{
240  */
241
242 /**
243  * @typedef Elm_Text_Format
244  *
245  * Text Format types.
246  *
247  * @see elm_entry_file_set()
248  */
249 typedef enum
250 {
251    ELM_TEXT_FORMAT_PLAIN_UTF8,  /**< Plain UTF8 type */
252    ELM_TEXT_FORMAT_MARKUP_UTF8  /**< Markup UTF8 type */
253 } Elm_Text_Format;
254
255 /**
256  * @typedef Elm_Wrap_Type
257  *
258  * Line wrapping types.
259  *
260  * @see elm_entry_line_wrap_set()
261  */
262 typedef enum
263 {
264    ELM_WRAP_NONE = 0, /**< No wrap - value is zero */
265    ELM_WRAP_CHAR,     /**< Char wrap - wrap between characters */
266    ELM_WRAP_WORD,     /**< Word wrap - wrap in allowed wrapping points (as defined in the unicode standard) */
267    ELM_WRAP_MIXED,    /**< Mixed wrap - Word wrap, and if that fails, char wrap. */
268    ELM_WRAP_LAST
269 } Elm_Wrap_Type; /**< Type of word or character wrapping to use */
270
271 /**
272  * @typedef Elm_Input_Panel_Layout
273  *
274  * Input panel (virtual keyboard) layout types.
275  *
276  * @see elm_entry_input_panel_layout_set()
277  */
278 typedef enum
279 {
280    ELM_INPUT_PANEL_LAYOUT_NORMAL,      /**< Default layout */
281    ELM_INPUT_PANEL_LAYOUT_NUMBER,      /**< Number layout */
282    ELM_INPUT_PANEL_LAYOUT_EMAIL,       /**< Email layout */
283    ELM_INPUT_PANEL_LAYOUT_URL,         /**< URL layout */
284    ELM_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */
285    ELM_INPUT_PANEL_LAYOUT_IP,          /**< IP layout */
286    ELM_INPUT_PANEL_LAYOUT_MONTH,       /**< Month layout */
287    ELM_INPUT_PANEL_LAYOUT_NUMBERONLY,  /**< Number Only layout */
288    ELM_INPUT_PANEL_LAYOUT_INVALID,     /**< Never use this */
289    ELM_INPUT_PANEL_LAYOUT_HEX,         /**< Hexadecimal layout */
290    ELM_INPUT_PANEL_LAYOUT_TERMINAL,    /**< Command-line terminal layout */
291    ELM_INPUT_PANEL_LAYOUT_PASSWORD     /**< Like normal, but no auto-correct, no auto-capitalization etc. */
292 } Elm_Input_Panel_Layout; /**< Type of input panel (virtual keyboard) to use - this is a hint and may not provide exactly what is desired. */
293
294 /**
295  * @typedef Elm_Input_Panel_Lang
296  *
297  * Input panel (virtual keyboard) language modes.
298  *
299  * @see elm_entry_input_panel_language_set()
300  */
301 typedef enum
302 {
303    ELM_INPUT_PANEL_LANG_AUTOMATIC,    /**< Automatic */
304    ELM_INPUT_PANEL_LANG_ALPHABET      /**< Alphabet */
305 } Elm_Input_Panel_Lang;
306
307 /**
308  * @typedef Elm_Autocapital_Type
309  *
310  * Autocapitalization Types.
311  *
312  * @see elm_entry_autocapital_type_set()
313  */
314 typedef enum
315 {
316    ELM_AUTOCAPITAL_TYPE_NONE,         /**< No auto-capitalization when typing */
317    ELM_AUTOCAPITAL_TYPE_WORD,         /**< Autocapitalize each word typed */
318    ELM_AUTOCAPITAL_TYPE_SENTENCE,     /**< Autocapitalize the start of each sentence */
319    ELM_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters */
320 } Elm_Autocapital_Type; /**< Choose method of auto-capitalization */
321
322 /**
323  * @typedef Elm_Input_Panel_Return_Key_Type
324  *
325  * "Return" Key types on the input panel (virtual keyboard).
326  *
327  * @see elm_entry_input_panel_return_key_type_set()
328  */
329 typedef enum
330 {
331    ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default */
332    ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE,    /**< Done */
333    ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO,      /**< Go */
334    ELM_INPUT_PANEL_RETURN_KEY_TYPE_JOIN,    /**< Join */
335    ELM_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN,   /**< Login */
336    ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT,    /**< Next */
337    ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH,  /**< Search string or magnifier icon */
338    ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND     /**< Send */
339 } Elm_Input_Panel_Return_Key_Type;
340
341 /**
342  * @typedef Elm_Entry_Anchor_Info
343  *
344  * The info sent in the callback for the "anchor,clicked" signals emitted
345  * by entries.
346  */
347 typedef struct _Elm_Entry_Anchor_Info Elm_Entry_Anchor_Info;
348
349 /**
350  * @struct _Elm_Entry_Anchor_Info
351  *
352  * The info sent in the callback for the "anchor,clicked" signals emitted
353  * by entries.
354  */
355 struct _Elm_Entry_Anchor_Info
356 {
357    const char *name; /**< The name of the anchor, as stated in its href */
358    int         button; /**< The mouse button used to click on it */
359    Evas_Coord  x, /**< Anchor geometry, relative to canvas */
360                y, /**< Anchor geometry, relative to canvas */
361                w, /**< Anchor geometry, relative to canvas */
362                h; /**< Anchor geometry, relative to canvas */
363 };
364
365 /**
366  * @typedef Elm_Entry_Anchor_Hover_Info
367  *
368  * The info sent in the callback for "anchor,clicked" signals emitted by
369  * the Anchor_Hover widget.
370  */
371 typedef struct _Elm_Entry_Anchor_Hover_Info Elm_Entry_Anchor_Hover_Info;
372
373 /**
374  * @struct _Elm_Entry_Anchor_Hover_Info
375  *
376  * The info sent in the callback for "anchor,clicked" signals emitted by
377  * the Anchor_Hover widget.
378  */
379 struct _Elm_Entry_Anchor_Hover_Info
380 {
381    const Elm_Entry_Anchor_Info *anchor_info; /**< The actual anchor info. */
382    Evas_Object *hover; /**< The hover object to use for the popup */
383    struct
384    {
385       Evas_Coord x, y, w, h;
386    } hover_parent; /**< Geometry of the object used as parent by the
387                         hover */
388    Eina_Bool    hover_left : 1; /**< Hint indicating if there's space
389                                      for content on the left side of
390                                      the hover. Before calling the
391                                      callback, the widget will make the
392                                      necessary calculations to check
393                                      which sides are fit to be set with
394                                      content, based on the position the
395                                      hover is activated and its distance
396                                      to the edges of its parent object
397                                  */
398    Eina_Bool    hover_right : 1; /**< Hint indicating content fits on
399                                       the right side of the hover.
400                                       See @ref hover_left */
401    Eina_Bool    hover_top : 1; /**< Hint indicating content fits on top
402                                     of the hover. See @ref hover_left */
403    Eina_Bool    hover_bottom : 1; /**< Hint indicating content fits
404                                        below the hover. See @ref
405                                        hover_left */
406 };
407
408 /**
409  * @typedef Elm_Entry_Item_Provider_Cb
410  * This callback type is used to provide items.
411  * If it returns an object handle other than NULL (it should create an
412  * object to do this), then this object is used to replace the current item.
413  * If not the next provider is called until one provides an item object, or the
414  * default provider in entry does.
415  * @param data The data specified as the last param when adding the provider
416  * @param entry The entry object
417  * @param text A pointer to the item href string in the text
418  * @return The object to be placed in the entry like an icon, or other element
419  * @see elm_entry_item_provider_append
420  * @see elm_entry_item_provider_prepend
421  * @see elm_entry_item_provider_remove
422  */
423 typedef Evas_Object * (*Elm_Entry_Item_Provider_Cb)(void *data, Evas_Object * entry, const char *item);
424
425 /**
426  * @typedef Elm_Entry_Filter_Cb
427  * This callback type is used by entry filters to modify text.
428  * @param data The data specified as the last param when adding the filter
429  * @param entry The entry object
430  * @param text A pointer to the location of the text being filtered. The type of text is always markup. This data can be modified, but any additional allocations must be managed by the user.
431  * @see elm_entry_markup_filter_append
432  * @see elm_entry_markup_filter_prepend
433  * @see elm_entry_markup_filter_remove
434  */
435 typedef void (*Elm_Entry_Filter_Cb)(void *data, Evas_Object *entry, char **text);
436
437 /**
438  * @typedef Elm_Entry_Change_Info
439  * This corresponds to Edje_Entry_Change_Info. Includes information about
440  * a change in the entry.
441  */
442 typedef Edje_Entry_Change_Info Elm_Entry_Change_Info;
443
444 /**
445  * This adds an entry to @p parent object.
446  *
447  * By default, entries are:
448  * @li not scrolled
449  * @li multi-line
450  * @li word wrapped
451  * @li autosave is enabled
452  *
453  * @param parent The parent object
454  * @return The new object or NULL if it cannot be created
455  */
456 EAPI Evas_Object       *elm_entry_add(Evas_Object *parent);
457
458 /**
459  * Sets the entry to single line mode.
460  *
461  * In single line mode, entries don't ever wrap when the text reaches the
462  * edge, and instead they keep growing horizontally. Pressing the @c Enter
463  * key will generate an @c "activate" event instead of adding a new line.
464  *
465  * When @p single_line is @c EINA_FALSE, line wrapping takes effect again
466  * and pressing enter will break the text into a different line
467  * without generating any events.
468  *
469  * @param obj The entry object
470  * @param single_line If true, the text in the entry
471  * will be on a single line.
472  */
473 EAPI void               elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line);
474
475 /**
476  * Gets whether the entry is set to be single line.
477  *
478  * @param obj The entry object
479  * @return single_line If true, the text in the entry is set to display
480  * on a single line.
481  *
482  * @see elm_entry_single_line_set()
483  */
484 EAPI Eina_Bool          elm_entry_single_line_get(const Evas_Object *obj);
485
486 /**
487  * Sets the entry to password mode.
488  *
489  * In password mode, entries are implicitly single line and the display of
490  * any text in them is replaced with asterisks (*).
491  *
492  * @param obj The entry object
493  * @param password If true, password mode is enabled.
494  */
495 EAPI void               elm_entry_password_set(Evas_Object *obj, Eina_Bool password);
496
497 /**
498  * Gets whether the entry is set to password mode.
499  *
500  * @param obj The entry object
501  * @return If true, the entry is set to display all characters
502  * as asterisks (*).
503  *
504  * @see elm_entry_password_set()
505  */
506 EAPI Eina_Bool          elm_entry_password_get(const Evas_Object *obj);
507
508 /**
509  * This sets the text displayed within the entry to @p entry.
510  *
511  * @param obj The entry object
512  * @param entry The text to be displayed
513  *
514  * @note Using this function bypasses text filters
515  */
516 EAPI void               elm_entry_entry_set(Evas_Object *obj, const char *entry);
517
518 /**
519  * This returns the text currently shown in object @p entry.
520  * See also elm_entry_entry_set().
521  *
522  * @param obj The entry object
523  * @return The currently displayed text or NULL on failure
524  */
525 EAPI const char        *elm_entry_entry_get(const Evas_Object *obj);
526
527 /**
528  * Appends @p entry to the text of the entry.
529  *
530  * Adds the text in @p entry to the end of any text already present in the
531  * widget.
532  *
533  * The appended text is subject to any filters set for the widget.
534  *
535  * @param obj The entry object
536  * @param entry The text to be displayed
537  *
538  * @see elm_entry_markup_filter_append()
539  */
540 EAPI void               elm_entry_entry_append(Evas_Object *obj, const char *entry);
541
542 /**
543  * Gets whether the entry is empty.
544  *
545  * Empty means no text at all. If there are any markup tags, like an item
546  * tag for which no provider finds anything, and no text is displayed, this
547  * function still returns EINA_FALSE.
548  *
549  * @param obj The entry object
550  * @return EINA_TRUE if the entry is empty, EINA_FALSE otherwise.
551  */
552 EAPI Eina_Bool          elm_entry_is_empty(const Evas_Object *obj);
553
554 /**
555  * Gets any selected text within the entry.
556  *
557  * If there's any selected text in the entry, this function returns it as
558  * a string in markup format. NULL is returned if no selection exists or
559  * if an error occurred.
560  *
561  * The returned value points to an internal string and should not be freed
562  * or modified in any way. If the @p entry object is deleted or its
563  * contents are changed, the returned pointer should be considered invalid.
564  *
565  * @param obj The entry object
566  * @return The selected text within the entry or NULL on failure
567  */
568 EAPI const char        *elm_entry_selection_get(const Evas_Object *obj);
569
570 /**
571  * Returns the actual textblock object of the entry.
572  *
573  * This function exposes the internal textblock object that actually
574  * contains and draws the text. This should be used for low-level
575  * manipulations that are otherwise not possible.
576  *
577  * Changing the textblock directly from here will not notify edje/elm to
578  * recalculate the textblock size automatically, so any modifications
579  * done to the textblock returned by this function should be followed by
580  * a call to elm_entry_calc_force().
581  *
582  * The return value is marked as const as an additional warning.
583  * One should not use the returned object with any of the generic evas
584  * functions (geometry_get/resize/move and etc), but only with the textblock
585  * functions; The former will either not work at all, or break the correct
586  * functionality.
587  *
588  * IMPORTANT: Many functions may change (i.e delete and create a new one)
589  * the internal textblock object. Do NOT cache the returned object, and try
590  * not to mix calls on this object with regular elm_entry calls (which may
591  * change the internal textblock object). This applies to all cursors
592  * returned from textblock calls, and all the other derivative values.
593  *
594  * @param obj The entry object
595  * @return The textblock object.
596  */
597 EAPI Evas_Object *      elm_entry_textblock_get(Evas_Object *obj);
598
599 /**
600  * Forces calculation of the entry size and text layouting.
601  *
602  * This should be used after modifying the textblock object directly. See
603  * elm_entry_textblock_get() for more information.
604  *
605  * @param obj The entry object
606  *
607  * @see elm_entry_textblock_get()
608  */
609 EAPI void               elm_entry_calc_force(Evas_Object *obj);
610
611 /**
612  * Inserts the given text into the entry at the current cursor position.
613  *
614  * This inserts text at the cursor position as if it was typed
615  * by the user (note that this also allows markup which a user
616  * can't just "type" as it would be converted to escaped text, so this
617  * call can be used to insert things like emoticon items or bold push/pop
618  * tags, other font and color change tags etc.)
619  *
620  * If any selection exists, it will be replaced by the inserted text.
621  *
622  * The inserted text is subject to any filters set for the widget.
623  *
624  * @param obj The entry object
625  * @param entry The text to insert
626  *
627  * @see elm_entry_markup_filter_append()
628  */
629 EAPI void               elm_entry_entry_insert(Evas_Object *obj, const char *entry);
630
631 /**
632  * Set the line wrap type to use on multi-line entries.
633  *
634  * Sets the wrap type used by the entry to any of the specified in
635  * Elm_Wrap_Type. This tells how the text will be implicitly cut into a new
636  * line (without inserting a line break or paragraph separator) when it
637  * reaches the far edge of the widget.
638  *
639  * Note that this only makes sense for multi-line entries. A widget set
640  * to be single line will never wrap.
641  *
642  * @param obj The entry object
643  * @param wrap The wrap mode to use. See Elm_Wrap_Type for details on them
644  */
645 EAPI void               elm_entry_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap);
646
647 /**
648  * Gets the wrap mode the entry was set to use.
649  *
650  * @param obj The entry object
651  * @return Wrap type
652  *
653  * @see also elm_entry_line_wrap_set()
654  */
655 EAPI Elm_Wrap_Type      elm_entry_line_wrap_get(const Evas_Object *obj);
656
657 /**
658  * Sets if the entry is to be editable or not.
659  *
660  * By default, entries are editable and when focused, any text input by the
661  * user will be inserted at the current cursor position. But calling this
662  * function with @p editable as EINA_FALSE will prevent the user from
663  * inputting text into the entry.
664  *
665  * The only way to change the text of a non-editable entry is to use
666  * elm_object_text_set(), elm_entry_entry_insert() and other related
667  * functions.
668  *
669  * @param obj The entry object
670  * @param editable If EINA_TRUE, user input will be inserted in the entry,
671  * if not, the entry is read-only and no user input is allowed.
672  */
673 EAPI void               elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable);
674
675 /**
676  * Gets whether the entry is editable or not.
677  *
678  * @param obj The entry object
679  * @return If true, the entry is editable by the user.
680  * If false, it is not editable by the user
681  *
682  * @see elm_entry_editable_set()
683  */
684 EAPI Eina_Bool          elm_entry_editable_get(const Evas_Object *obj);
685
686 /**
687  * This drops any existing text selection within the entry.
688  *
689  * @param obj The entry object
690  */
691 EAPI void               elm_entry_select_none(Evas_Object *obj);
692
693 /**
694  * This selects all text within the entry.
695  *
696  * @param obj The entry object
697  */
698 EAPI void               elm_entry_select_all(Evas_Object *obj);
699
700 /**
701  * This moves the cursor one place to the right within the entry.
702  *
703  * @param obj The entry object
704  * @return EINA_TRUE upon success, EINA_FALSE upon failure
705  */
706 EAPI Eina_Bool          elm_entry_cursor_next(Evas_Object *obj);
707
708 /**
709  * This moves the cursor one place to the left within the entry.
710  *
711  * @param obj The entry object
712  * @return EINA_TRUE upon success, EINA_FALSE upon failure
713  */
714 EAPI Eina_Bool          elm_entry_cursor_prev(Evas_Object *obj);
715
716 /**
717  * This moves the cursor one line up within the entry.
718  *
719  * @param obj The entry object
720  * @return EINA_TRUE upon success, EINA_FALSE upon failure
721  */
722 EAPI Eina_Bool          elm_entry_cursor_up(Evas_Object *obj);
723
724 /**
725  * This moves the cursor one line down within the entry.
726  *
727  * @param obj The entry object
728  * @return EINA_TRUE upon success, EINA_FALSE upon failure
729  */
730 EAPI Eina_Bool          elm_entry_cursor_down(Evas_Object *obj);
731
732 /**
733  * This moves the cursor to the beginning of the entry.
734  *
735  * @param obj The entry object
736  */
737 EAPI void               elm_entry_cursor_begin_set(Evas_Object *obj);
738
739 /**
740  * This moves the cursor to the end of the entry.
741  *
742  * @param obj The entry object
743  */
744 EAPI void               elm_entry_cursor_end_set(Evas_Object *obj);
745
746 /**
747  * This moves the cursor to the beginning of the current line.
748  *
749  * @param obj The entry object
750  */
751 EAPI void               elm_entry_cursor_line_begin_set(Evas_Object *obj);
752
753 /**
754  * This moves the cursor to the end of the current line.
755  *
756  * @param obj The entry object
757  */
758 EAPI void               elm_entry_cursor_line_end_set(Evas_Object *obj);
759
760 /**
761  * This begins a selection within the entry as though
762  * the user were holding down the mouse button to make a selection.
763  *
764  * @param obj The entry object
765  */
766 EAPI void               elm_entry_cursor_selection_begin(Evas_Object *obj);
767
768 /**
769  * This ends a selection within the entry as though
770  * the user had just released the mouse button while making a selection.
771  *
772  * @param obj The entry object
773  */
774 EAPI void               elm_entry_cursor_selection_end(Evas_Object *obj);
775
776 /**
777  * Gets whether a format node exists at the current cursor position.
778  *
779  * A format node is anything that defines how the text is rendered. It can
780  * be a visible format node, such as a line break or a paragraph separator,
781  * or an invisible one, such as bold begin or end tag.
782  * This function returns whether any format node exists at the current
783  * cursor position.
784  *
785  * @param obj The entry object
786  * @return EINA_TRUE if the current cursor position contains a format node,
787  * EINA_FALSE otherwise.
788  *
789  * @see elm_entry_cursor_is_visible_format_get()
790  */
791 EAPI Eina_Bool          elm_entry_cursor_is_format_get(const Evas_Object *obj);
792
793 /**
794  * Gets if the current cursor position holds a visible format node.
795  *
796  * @param obj The entry object
797  * @return EINA_TRUE if the current cursor is a visible format, EINA_FALSE
798  * if it's an invisible one or no format exists.
799  *
800  * @see elm_entry_cursor_is_format_get()
801  */
802 EAPI Eina_Bool          elm_entry_cursor_is_visible_format_get(const Evas_Object *obj);
803
804 /**
805  * Gets the character pointed by the cursor at its current position.
806  *
807  * This function returns a string with the utf8 character stored at the
808  * current cursor position.
809  * Only the text is returned, any format that may exist will not be part
810  * of the return value. You must free the string when done with free().
811  *
812  * @param obj The entry object
813  * @return The text pointed by the cursors.
814  */
815 EAPI char              *elm_entry_cursor_content_get(const Evas_Object *obj);
816
817 /**
818  * This function returns the geometry of the cursor.
819  *
820  * It's useful if you want to draw something on the cursor (or where it is),
821  * or for example in the case of scrolled entry where you want to show the
822  * cursor.
823  *
824  * @param obj The entry object
825  * @param x returned geometry
826  * @param y returned geometry
827  * @param w returned geometry
828  * @param h returned geometry
829  * @return EINA_TRUE upon success, EINA_FALSE upon failure
830  */
831 EAPI Eina_Bool          elm_entry_cursor_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
832
833 /**
834  * Sets the cursor position in the entry to the given value
835  *
836  * The value in @p pos is the index of the character position within the
837  * contents of the string as returned by elm_entry_cursor_pos_get().
838  *
839  * @param obj The entry object
840  * @param pos The position of the cursor
841  */
842 EAPI void               elm_entry_cursor_pos_set(Evas_Object *obj, int pos);
843
844 /**
845  * Retrieves the current position of the cursor in the entry
846  *
847  * @param obj The entry object
848  * @return The cursor position
849  */
850 EAPI int                elm_entry_cursor_pos_get(const Evas_Object *obj);
851
852 /**
853  * This executes a "cut" action on the selected text in the entry.
854  *
855  * @param obj The entry object
856  */
857 EAPI void               elm_entry_selection_cut(Evas_Object *obj);
858
859 /**
860  * This executes a "copy" action on the selected text in the entry.
861  *
862  * @param obj The entry object
863  */
864 EAPI void               elm_entry_selection_copy(Evas_Object *obj);
865
866 /**
867  * This executes a "paste" action in the entry.
868  *
869  * @param obj The entry object
870  */
871 EAPI void               elm_entry_selection_paste(Evas_Object *obj);
872
873 /**
874  * This clears and frees the items in a entry's contextual (longpress)
875  * menu.
876  *
877  * @param obj The entry object
878  *
879  * @see elm_entry_context_menu_item_add()
880  */
881 EAPI void               elm_entry_context_menu_clear(Evas_Object *obj);
882
883 /**
884  * This adds an item to the entry's contextual menu.
885  *
886  * A longpress on an entry will make the contextual menu show up, if this
887  * hasn't been disabled with elm_entry_context_menu_disabled_set().
888  * By default, this menu provides a few options like enabling selection mode,
889  * which is useful on embedded devices that need to be explicit about it,
890  * and when a selection exists it also shows the copy and cut actions.
891  *
892  * With this function, developers can add other options to this menu to
893  * perform any action they deem necessary.
894  *
895  * @param obj The entry object
896  * @param label The item's text label
897  * @param icon_file The item's icon file
898  * @param icon_type The item's icon type
899  * @param func The callback to execute when the item is clicked
900  * @param data The data to associate with the item for related functions
901  */
902 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);
903
904 /**
905  * This disables the entry's contextual (longpress) menu.
906  *
907  * @param obj The entry object
908  * @param disabled If true, the menu is disabled
909  */
910 EAPI void               elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled);
911
912 /**
913  * This returns whether the entry's contextual (longpress) menu is
914  * disabled.
915  *
916  * @param obj The entry object
917  * @return If true, the menu is disabled
918  */
919 EAPI Eina_Bool          elm_entry_context_menu_disabled_get(const Evas_Object *obj);
920
921 /**
922  * This appends a custom item provider to the list for that entry
923  *
924  * This appends the given callback. The list is walked from beginning to end
925  * with each function called given the item href string in the text. If the
926  * function returns an object handle other than NULL (it should create an
927  * object to do this), then this object is used to replace that item. If
928  * not the next provider is called until one provides an item object, or the
929  * default provider in entry does.
930  *
931  * @param obj The entry object
932  * @param func The function called to provide the item object
933  * @param data The data passed to @p func
934  *
935  * @see @ref entry-items
936  */
937 EAPI void               elm_entry_item_provider_append(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data);
938
939 /**
940  * This prepends a custom item provider to the list for that entry
941  *
942  * This prepends the given callback. See elm_entry_item_provider_append() for
943  * more information
944  *
945  * @param obj The entry object
946  * @param func The function called to provide the item object
947  * @param data The data passed to @p func
948  */
949 EAPI void               elm_entry_item_provider_prepend(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data);
950
951 /**
952  * This removes a custom item provider to the list for that entry
953  *
954  * This removes the given callback. See elm_entry_item_provider_append() for
955  * more information
956  *
957  * @param obj The entry object
958  * @param func The function called to provide the item object
959  * @param data The data passed to @p func
960  */
961 EAPI void               elm_entry_item_provider_remove(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data);
962
963 /**
964  * Append a markup filter function for text inserted in the entry
965  *
966  * Append the given callback to the list. This functions will be called
967  * whenever any text is inserted into the entry, with the text to be inserted
968  * as a parameter. The type of given text is always markup.
969  * The callback function is free to alter the text in any way it wants, but
970  * it must remember to free the given pointer and update it.
971  * If the new text is to be discarded, the function can free it and set its
972  * text parameter to NULL. This will also prevent any following filters from
973  * being called.
974  *
975  * @param obj The entry object
976  * @param func The function to use as text filter
977  * @param data User data to pass to @p func
978  */
979 EAPI void               elm_entry_markup_filter_append(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data);
980
981 /**
982  * Prepend a markup filter function for text inserted in the entry
983  *
984  * Prepend the given callback to the list. See elm_entry_markup_filter_append()
985  * for more information
986  *
987  * @param obj The entry object
988  * @param func The function to use as text filter
989  * @param data User data to pass to @p func
990  */
991 EAPI void               elm_entry_markup_filter_prepend(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data);
992
993 /**
994  * Remove a markup filter from the list
995  *
996  * Removes the given callback from the filter list. See
997  * elm_entry_markup_filter_append() for more information.
998  *
999  * @param obj The entry object
1000  * @param func The filter function to remove
1001  * @param data The user data passed when adding the function
1002  */
1003 EAPI void               elm_entry_markup_filter_remove(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data);
1004
1005 /**
1006  * This converts a markup (HTML-like) string into UTF-8.
1007  *
1008  * The returned string is a malloc'ed buffer and it should be freed when
1009  * not needed anymore.
1010  *
1011  * @param s The string (in markup) to be converted
1012  * @return The converted string (in UTF-8). It should be freed.
1013  */
1014 EAPI char              *elm_entry_markup_to_utf8(const char *s);
1015
1016 /**
1017  * This converts a UTF-8 string into markup (HTML-like).
1018  *
1019  * The returned string is a malloc'ed buffer and it should be freed when
1020  * not needed anymore.
1021  *
1022  * @param s The string (in UTF-8) to be converted
1023  * @return The converted string (in markup). It should be freed.
1024  */
1025 EAPI char              *elm_entry_utf8_to_markup(const char *s);
1026
1027 /**
1028  * This sets the file (and implicitly loads it) for the text to display and
1029  * then edit. All changes are written back to the file after a short delay if
1030  * the entry object is set to autosave (which is the default).
1031  *
1032  * If the entry had any other file set previously, any changes made to it
1033  * will be saved if the autosave feature is enabled, otherwise, the file
1034  * will be silently discarded and any non-saved changes will be lost.
1035  *
1036  * @param obj The entry object
1037  * @param file The path to the file to load and save
1038  * @param format The file format
1039  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
1040  */
1041 EAPI Eina_Bool          elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format);
1042
1043 /**
1044  * Gets the file being edited by the entry.
1045  *
1046  * This function can be used to retrieve any file set on the entry for
1047  * edition, along with the format used to load and save it.
1048  *
1049  * @param obj The entry object
1050  * @param file The path to the file to load and save
1051  * @param format The file format
1052  */
1053 EAPI void               elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format);
1054
1055 /**
1056  * This function writes any changes made to the file set with
1057  * elm_entry_file_set()
1058  *
1059  * @param obj The entry object
1060  */
1061 EAPI void               elm_entry_file_save(Evas_Object *obj);
1062
1063 /**
1064  * This sets the entry object to 'autosave' the loaded text file or not.
1065  *
1066  * @param obj The entry object
1067  * @param autosave Autosave the loaded file or not
1068  *
1069  * @see elm_entry_file_set()
1070  */
1071 EAPI void               elm_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave);
1072
1073 /**
1074  * This gets the entry object's 'autosave' status.
1075  *
1076  * @param obj The entry object
1077  * @return Autosave the loaded file or not
1078  *
1079  * @see elm_entry_file_set()
1080  */
1081 EAPI Eina_Bool          elm_entry_autosave_get(const Evas_Object *obj);
1082
1083 /**
1084  * Enable or disable scrolling in entry
1085  *
1086  * Normally the entry is not scrollable unless you enable it with this call.
1087  *
1088  * @param obj The entry object
1089  * @param scroll EINA_TRUE if it is to be scrollable, EINA_FALSE otherwise
1090  */
1091 EAPI void               elm_entry_scrollable_set(Evas_Object *obj, Eina_Bool scroll);
1092
1093 /**
1094  * Get the scrollable state of the entry
1095  *
1096  * Normally the entry is not scrollable. This gets the scrollable state
1097  * of the entry. See elm_entry_scrollable_set() for more information.
1098  *
1099  * @param obj The entry object
1100  * @return The scrollable state
1101  */
1102 EAPI Eina_Bool          elm_entry_scrollable_get(const Evas_Object *obj);
1103
1104 /**
1105  * Sets the visibility of the left-side widget of the entry,
1106  * set by elm_object_part_content_set().
1107  *
1108  * @param obj The entry object
1109  * @param setting EINA_TRUE if the object should be displayed,
1110  * EINA_FALSE if not.
1111  */
1112 EAPI void               elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting);
1113
1114 /**
1115  * Sets the visibility of the end widget of the entry, set by
1116  * elm_object_part_content_set(ent, "end", content).
1117  *
1118  * @param obj The entry object
1119  * @param setting EINA_TRUE if the object should be displayed,
1120  * EINA_FALSE if not.
1121  */
1122 EAPI void               elm_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting);
1123
1124 /**
1125  * This sets the entry's scrollbar policy (i.e. enabling/disabling
1126  * them).
1127  *
1128  * Setting an entry to single-line mode with elm_entry_single_line_set()
1129  * will automatically disable the display of scrollbars when the entry
1130  * moves inside its scroller.
1131  *
1132  * @param obj The entry object
1133  * @param h The horizontal scrollbar policy to apply
1134  * @param v The vertical scrollbar policy to apply
1135  */
1136 EAPI void               elm_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v);
1137
1138 /**
1139  * This enables/disables bouncing within the entry.
1140  *
1141  * This function sets whether the entry will bounce when scrolling reaches
1142  * the end of the contained entry.
1143  *
1144  * @param obj The entry object
1145  * @param h_bounce The horizontal bounce state
1146  * @param v_bounce The vertical bounce state
1147  */
1148 EAPI void               elm_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
1149
1150 /**
1151  * Get the bounce mode
1152  *
1153  * @param obj The Entry object
1154  * @param h_bounce Allow bounce horizontally
1155  * @param v_bounce Allow bounce vertically
1156  */
1157 EAPI void               elm_entry_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
1158
1159 /**
1160  * Set the input panel layout of the entry
1161  *
1162  * @param obj The entry object
1163  * @param layout layout type
1164  */
1165 EAPI void                   elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout);
1166
1167 /**
1168  * Get the input panel layout of the entry
1169  *
1170  * @param obj The entry object
1171  * @return layout type
1172  *
1173  * @see elm_entry_input_panel_layout_set
1174  */
1175 EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(const Evas_Object *obj);
1176
1177 /**
1178  * Set the autocapitalization type on the immodule.
1179  *
1180  * @param obj The entry object
1181  * @param autocapital_type The type of autocapitalization
1182  */
1183 EAPI void                   elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapital_type);
1184
1185 /**
1186  * Retrieve the autocapitalization type on the immodule.
1187  *
1188  * @param obj The entry object
1189  * @return autocapitalization type
1190  */
1191 EAPI Elm_Autocapital_Type   elm_entry_autocapital_type_get(const Evas_Object *obj);
1192
1193 /**
1194  * Sets the attribute to show the input panel automatically.
1195  *
1196  * @param obj The entry object
1197  * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
1198  */
1199 EAPI void                   elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled);
1200
1201 /**
1202  * Retrieve the attribute to show the input panel automatically.
1203  *
1204  * @param obj The entry object
1205  * @return EINA_TRUE if input panel will be appeared when the entry is clicked or has a focus, EINA_FALSE otherwise
1206  */
1207 EAPI Eina_Bool              elm_entry_input_panel_enabled_get(const Evas_Object *obj);
1208
1209 /**
1210  * Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on.
1211  *
1212  * Note that input panel is shown or hidden automatically according to the focus state of entry widget.
1213  * This API can be used in the case of manually controlling by using elm_entry_input_panel_enabled_set(en, EINA_FALSE).
1214  *
1215  * @param obj The entry object
1216  */
1217 EAPI void                   elm_entry_input_panel_show(Evas_Object *obj);
1218
1219 /**
1220  * Hide the input panel (virtual keyboard).
1221  *
1222  * Note that input panel is shown or hidden automatically according to the focus state of entry widget.
1223  * This API can be used in the case of manually controlling by using elm_entry_input_panel_enabled_set(en, EINA_FALSE)
1224  *
1225  * @param obj The entry object
1226  */
1227 EAPI void                   elm_entry_input_panel_hide(Evas_Object *obj);
1228
1229 /**
1230  * Set the language mode of the input panel.
1231  *
1232  * This API can be used if you want to show the alphabet keyboard mode.
1233  *
1234  * @param obj The entry object
1235  * @param lang language to be set to the input panel.
1236  */
1237 EAPI void                   elm_entry_input_panel_language_set(Evas_Object *obj, Elm_Input_Panel_Lang lang);
1238
1239 /**
1240  * Get the language mode of the input panel.
1241  *
1242  * See @ref elm_entry_input_panel_language_set for more details.
1243  *
1244  * @param obj The entry object
1245  * @return input panel language type
1246  */
1247 EAPI Elm_Input_Panel_Lang   elm_entry_input_panel_language_get(const Evas_Object *obj);
1248
1249 /**
1250  * Set the input panel-specific data to deliver to the input panel.
1251  *
1252  * This API is used by applications to deliver specific data to the input panel.
1253  * The data format MUST be negotiated by both application and the input panel.
1254  * The size and format of data are defined by the input panel.
1255  *
1256  * @param obj The entry object
1257  * @param data The specific data to be set to the input panel.
1258  * @param len the length of data, in bytes, to send to the input panel
1259  */
1260 EAPI void                   elm_entry_input_panel_imdata_set(Evas_Object *obj, const void *data, int len);
1261
1262 /**
1263  * Get the specific data of the current input panel.
1264  *
1265  * See @ref elm_entry_input_panel_imdata_set for more details.
1266  *
1267  * @param obj The entry object
1268  * @param data The specific data to be got from the input panel
1269  * @param len The length of data
1270  */
1271 EAPI void                   elm_entry_input_panel_imdata_get(const Evas_Object *obj, void *data, int *len);
1272
1273 /**
1274  * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
1275  *
1276  * An input panel displays the string or icon associated with this type
1277  *
1278  * @param obj The entry object
1279  * @param return_key_type The type of "return" key on the input panel
1280  */
1281 EAPI void                   elm_entry_input_panel_return_key_type_set(Evas_Object *obj, Elm_Input_Panel_Return_Key_Type return_key_type);
1282
1283 /**
1284  * Get the "return" key type.
1285  *
1286  * @see elm_entry_input_panel_return_key_type_set() for more details
1287  *
1288  * @param obj The entry object
1289  * @return The type of "return" key on the input panel
1290  */
1291 EAPI Elm_Input_Panel_Return_Key_Type elm_entry_input_panel_return_key_type_get(const Evas_Object *obj);
1292
1293 /**
1294  * Set the return key on the input panel to be disabled.
1295  *
1296  * @param obj The entry object
1297  * @param disabled The state to put in in: @c EINA_TRUE for
1298  *        disabled, @c EINA_FALSE for enabled
1299  */
1300 EAPI void                   elm_entry_input_panel_return_key_disabled_set(Evas_Object *obj, Eina_Bool disabled);
1301
1302 /**
1303  * Get whether the return key on the input panel should be disabled or not.
1304  *
1305  * @param obj The entry object
1306  * @return EINA_TRUE if it should be disabled
1307  */
1308 EAPI Eina_Bool              elm_entry_input_panel_return_key_disabled_get(const Evas_Object *obj);
1309
1310 /**
1311  * Set whether the return key on the input panel is disabled automatically when entry has no text.
1312  *
1313  * If @p enabled is EINA_TRUE, The return key on input panel is disabled when the entry has no text.
1314  * The return key on the input panel is automatically enabled when the entry has text.
1315  * The default value is EINA_FALSE.
1316  *
1317  * @param obj The entry object
1318  * @param enabled If @p enabled is EINA_TRUE, the return key is automatically disabled when the entry has no text.
1319  */
1320 EAPI void                   elm_entry_input_panel_return_key_autoenabled_set(Evas_Object *obj, Eina_Bool enabled);
1321
1322 /**
1323  * Reset the input method context of the entry if needed.
1324  *
1325  * This can be necessary in the case where modifying the buffer would confuse on-going input method behavior
1326  * @param obj The entry object
1327  */
1328 EAPI void                   elm_entry_imf_context_reset(Evas_Object *obj);
1329
1330 /**
1331  * Set whether the entry should allow to use the text prediction.
1332  *
1333  * @param obj The entry object
1334  * @param prediction Whether the entry should allow to use the text prediction.
1335  */
1336 EAPI void                   elm_entry_prediction_allow_set(Evas_Object *obj, Eina_Bool prediction);
1337
1338 /**
1339  * Get whether the entry should allow to use the text prediction.
1340  *
1341  * @param obj The entry object
1342  * @return EINA_TRUE if it allows to use the text prediction, otherwise EINA_FALSE.
1343  */
1344 EAPI Eina_Bool              elm_entry_prediction_allow_get(const Evas_Object *obj);
1345
1346 /* pre-made filters for entries */
1347
1348 /**
1349  * @typedef Elm_Entry_Filter_Limit_Size
1350  *
1351  * Data for the elm_entry_filter_limit_size() entry filter.
1352  */
1353 typedef struct _Elm_Entry_Filter_Limit_Size Elm_Entry_Filter_Limit_Size;
1354
1355 /**
1356  * @struct _Elm_Entry_Filter_Limit_Size
1357  *
1358  * Data for the elm_entry_filter_limit_size() entry filter.
1359  */
1360 struct _Elm_Entry_Filter_Limit_Size
1361 {
1362    int max_char_count;      /**< The maximum number of characters allowed. */
1363    int max_byte_count;      /**< The maximum number of bytes allowed*/
1364 };
1365
1366 /**
1367  * Filter inserted text based on user defined character and byte limits
1368  *
1369  * Add this filter to an entry to limit the characters that it will accept
1370  * based the contents of the provided #Elm_Entry_Filter_Limit_Size.
1371  * The function works on the UTF-8 representation of the string, converting
1372  * it from the set markup, thus not accounting for any format in it.
1373  *
1374  * The user must create an #Elm_Entry_Filter_Limit_Size structure and pass
1375  * it as data when setting the filter. In it, it's possible to set limits
1376  * by character count or bytes (any of them is disabled if 0), and both can
1377  * be set at the same time. In that case, it first checks for characters,
1378  * then bytes. The #Elm_Entry_Filter_Limit_Size structure must be alive and
1379  * valid for as long as the entry is alive AND the elm_entry_filter_limit_size
1380  * filter is set.
1381  *
1382  * The function will cut the inserted text in order to allow only the first
1383  * number of characters that are still allowed. The cut is made in
1384  * characters, even when limiting by bytes, in order to always contain
1385  * valid ones and avoid half unicode characters making it in.
1386  *
1387  * This filter, like any others, does not apply when setting the entry text
1388  * directly with elm_object_text_set().
1389  */
1390 EAPI void elm_entry_filter_limit_size(void *data, Evas_Object *entry, char **text);
1391
1392 /**
1393  * @typedef Elm_Entry_Filter_Accept_Set
1394  *
1395  * Data for the elm_entry_filter_accept_set() entry filter.
1396  */
1397 typedef struct _Elm_Entry_Filter_Accept_Set Elm_Entry_Filter_Accept_Set;
1398
1399 /**
1400  * @struct _Elm_Entry_Filter_Accept_Set
1401  *
1402  * Data for the elm_entry_filter_accept_set() entry filter.
1403  */
1404 struct _Elm_Entry_Filter_Accept_Set
1405 {
1406    const char *accepted;      /**< Set of characters accepted in the entry. */
1407    const char *rejected;      /**< Set of characters rejected from the entry. */
1408 };
1409
1410 /**
1411  * Filter inserted text based on accepted or rejected sets of characters
1412  *
1413  * Add this filter to an entry to restrict the set of accepted characters
1414  * based on the sets in the provided #Elm_Entry_Filter_Accept_Set.
1415  * This structure contains both accepted and rejected sets, but they are
1416  * mutually exclusive. This structure must be available for as long as
1417  * the entry is alive AND the elm_entry_filter_accept_set is being used.
1418  *
1419  * The @c accepted set takes preference, so if it is set, the filter will
1420  * only work based on the accepted characters, ignoring anything in the
1421  * @c rejected value. If @c accepted is @c NULL, then @c rejected is used.
1422  *
1423  * In both cases, the function filters by matching utf8 characters to the
1424  * raw markup text, so it can be used to remove formatting tags.
1425  *
1426  * This filter, like any others, does not apply when setting the entry text
1427  * directly with elm_object_text_set()
1428  */
1429 EAPI void                   elm_entry_filter_accept_set(void *data, Evas_Object *entry, char **text);
1430
1431 /**
1432  * Returns the input method context of the entry.
1433  *
1434  * This function exposes the internal input method context.
1435  *
1436  * IMPORTANT: Many functions may change (i.e delete and create a new one)
1437  * the internal input method context. Do NOT cache the returned object.
1438  *
1439  * @param obj The entry object
1440  * @return The input method context (Ecore_IMF_Context *) in entry.
1441  */
1442 EAPI void                  *elm_entry_imf_context_get(Evas_Object *obj);
1443
1444 /**
1445  * @typedef Elm_Cnp_Mode
1446  * Enum of entry's copy & paste policy.
1447  *
1448  * @see elm_entry_cnp_mode_set()
1449  * @see elm_entry_cnp_mode_get()
1450  */
1451 typedef enum {
1452    ELM_CNP_MODE_MARKUP,   /**< copy & paste text with markup tag */
1453    ELM_CNP_MODE_NO_IMAGE, /**< copy & paste text without item(image) tag */
1454    ELM_CNP_MODE_PLAINTEXT /**< copy & paste text without markup tag */
1455 } Elm_Cnp_Mode;
1456
1457 /**
1458  * Control pasting of text and images for the widget.
1459  *
1460  * Normally the entry allows both text and images to be pasted.
1461  * By setting cnp_mode to be ELM_CNP_MODE_NO_IMAGE, this prevents images from being copy or past.
1462  * By setting cnp_mode to be ELM_CNP_MODE_PLAINTEXT, this remove all tags in text .
1463  *
1464  * @note this only changes the behaviour of text.
1465  *
1466  * @param obj The entry object
1467  * @param cnp_mode One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP,
1468  * #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT.
1469  */
1470 EAPI void         elm_entry_cnp_mode_set(Evas_Object *obj, Elm_Cnp_Mode cnp_mode);
1471
1472 /**
1473  * Getting elm_entry text paste/drop mode.
1474  *
1475  * Normally the entry allows both text and images to be pasted.
1476  * This gets the copy & paste mode of the entry.
1477  *
1478  * @param obj The entry object
1479  * @return mode One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP,
1480  * #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT.
1481  */
1482 EAPI Elm_Cnp_Mode elm_entry_cnp_mode_get(const Evas_Object *obj);
1483
1484 /**
1485  * Set the parent of the hover popup
1486  *
1487  * Sets the parent object to use by the hover created by the entry
1488  * when an anchor is clicked. See @ref Hover for more details on this.
1489  *
1490  * @param obj The entry object
1491  * @param parent The object to use as parent for the hover
1492  */
1493 EAPI void                        elm_entry_anchor_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
1494
1495 /**
1496  * Get the parent of the hover popup
1497  *
1498  * Get the object used as parent for the hover created by the entry
1499  * widget. See @ref Hover for more details on this.
1500  * If no parent is set, the same entry object will be used.
1501  *
1502  * @param obj The entry object
1503  * @return The object used as parent for the hover, NULL if none is set.
1504  */
1505 EAPI Evas_Object                *elm_entry_anchor_hover_parent_get(const Evas_Object *obj);
1506
1507 /**
1508  * Set the style that the hover should use
1509  *
1510  * When creating the popup hover, entry will request that it's
1511  * themed according to @p style.
1512  *
1513  * Setting style no NULL means disabling automatic hover.
1514  *
1515  * @param obj The entry object
1516  * @param style The style to use for the underlying hover
1517  *
1518  * @see elm_object_style_set()
1519  */
1520 EAPI void                        elm_entry_anchor_hover_style_set(Evas_Object *obj, const char *style);
1521
1522 /**
1523  * Get the style that the hover should use
1524  *
1525  * Get the style, the hover created by entry will use.
1526  *
1527  * @param obj The entry object
1528  * @return The style to use by the hover. NULL means the default is used.
1529  *
1530  * @see elm_object_style_set()
1531  */
1532 EAPI const char                 *elm_entry_anchor_hover_style_get(const Evas_Object *obj);
1533
1534 /**
1535  * Ends the hover popup in the entry
1536  *
1537  * When an anchor is clicked, the entry widget will create a hover
1538  * object to use as a popup with user provided content. This function
1539  * terminates this popup, returning the entry to its normal state.
1540  *
1541  * @param obj The entry object
1542  */
1543 EAPI void                        elm_entry_anchor_hover_end(Evas_Object *obj);
1544
1545 /**
1546  * This disables the entry's magnifer feature.
1547  *
1548  * @param obj The entry object
1549  * @param disabled If true, the magnifier is not displayed
1550  */
1551
1552 EAPI void         elm_entry_magnifier_disabled_set(Evas_Object *obj, Eina_Bool disabled);
1553 /**
1554  * This returns whether the entry's magnifier feature is disabled.
1555  *
1556  * @param obj The entry object
1557  * @return If true, the feature is disabled
1558  */
1559 EAPI Eina_Bool    elm_entry_magnifier_disabled_get(const Evas_Object *obj);
1560
1561 EAPI void                   elm_entry_magnifier_type_set(Evas_Object *obj, int type);
1562
1563 /**
1564  * @}
1565  */