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