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