Fix conflicts: Map, Hover, Hoversel, Menu, Web
[framework/uifw/elementary.git] / src / lib / elm_web.h
1 /**
2  * @defgroup Web Web
3  *
4  * @image html img/widget/web/preview-00.png
5  * @image latex img/widget/web/preview-00.eps
6  *
7  * A web widget is used for displaying web pages (HTML/CSS/JS)
8  * using WebKit-EFL. You must have compiled Elementary with
9  * ewebkit support.
10  *
11  * Signals that you can add callbacks for are:
12  * @li "download,request": A file download has been requested. Event info is
13  * a pointer to a Elm_Web_Download
14  * @li "editorclient,contents,changed": Editor client's contents changed
15  * @li "editorclient,selection,changed": Editor client's selection changed
16  * @li "frame,created": A new frame was created. Event info is an
17  * Evas_Object which can be handled with WebKit's ewk_frame API
18  * @li "icon,received": An icon was received by the main frame
19  * @li "inputmethod,changed": Input method changed. Event info is an
20  * Eina_Bool indicating whether it's enabled or not
21  * @li "js,windowobject,clear": JS window object has been cleared
22  * @li "link,hover,in": Mouse cursor is hovering over a link. Event info
23  * is a char *link[2], where the first string contains the URL the link
24  * points to, and the second one the title of the link
25  * @li "link,hover,out": Mouse cursor left the link
26  * @li "load,document,finished": Loading of a document finished. Event info
27  * is the frame that finished loading
28  * @li "load,error": Load failed. Event info is a pointer to
29  * Elm_Web_Frame_Load_Error
30  * @li "load,finished": Load finished. Event info is NULL on success, on
31  * error it's a pointer to Elm_Web_Frame_Load_Error
32  * @li "load,newwindow,show": A new window was created and is ready to be
33  * shown
34  * @li "load,progress": Overall load progress. Event info is a pointer to
35  * a double containing a value between 0.0 and 1.0
36  * @li "load,provisional": Started provisional load
37  * @li "load,started": Loading of a document started
38  * @li "menubar,visible,get": Queries if the menubar is visible. Event info
39  * is a pointer to Eina_Bool where the callback should set EINA_TRUE if
40  * the menubar is visible, or EINA_FALSE in case it's not
41  * @li "menubar,visible,set": Informs menubar visibility. Event info is
42  * an Eina_Bool indicating the visibility
43  * @li "popup,created": A dropdown widget was activated, requesting its
44  * popup menu to be created. Event info is a pointer to Elm_Web_Menu
45  * @li "popup,willdelete": The web object is ready to destroy the popup
46  * object created. Event info is a pointer to Elm_Web_Menu
47  * @li "ready": Page is fully loaded
48  * @li "scrollbars,visible,get": Queries visibility of scrollbars. Event
49  * info is a pointer to Eina_Bool where the visibility state should be set
50  * @li "scrollbars,visible,set": Informs scrollbars visibility. Event info
51  * is an Eina_Bool with the visibility state set
52  * @li "statusbar,text,set": Text of the statusbar changed. Even info is
53  * a string with the new text
54  * @li "statusbar,visible,get": Queries visibility of the status bar.
55  * Event info is a pointer to Eina_Bool where the visibility state should be
56  * set.
57  * @li "statusbar,visible,set": Informs statusbar visibility. Event info is
58  * an Eina_Bool with the visibility value
59  * @li "title,changed": Title of the main frame changed. Event info is a
60  * string with the new title
61  * @li "toolbars,visible,get": Queries visibility of toolbars. Event info
62  * is a pointer to Eina_Bool where the visibility state should be set
63  * @li "toolbars,visible,set": Informs the visibility of toolbars. Event
64  * info is an Eina_Bool with the visibility state
65  * @li "tooltip,text,set": Show and set text of a tooltip. Event info is
66  * a string with the text to show
67  * @li "uri,changed": URI of the main frame changed. Event info is a string
68  * with the new URI
69  * @li "view,resized": The web object internal's view changed sized
70  * @li "windows,close,request": A JavaScript request to close the current
71  * window was requested
72  * @li "zoom,animated,end": Animated zoom finished
73  *
74  * available styles:
75  * - default
76  *
77  * An example of use of web:
78  *
79  * - @ref web_example_01 TBD
80  */
81
82 /**
83  * @addtogroup Web
84  * @{
85  */
86
87 /**
88  * Structure used to report load errors.
89  *
90  * Load errors are reported as signal by elm_web. All the strings are
91  * temporary references and should @b not be used after the signal
92  * callback returns. If it's required, make copies with strdup() or
93  * eina_stringshare_add() (they are not even guaranteed to be
94  * stringshared, so must use eina_stringshare_add() and not
95  * eina_stringshare_ref()).
96  */
97 typedef struct _Elm_Web_Frame_Load_Error Elm_Web_Frame_Load_Error;
98
99 /**
100  * Structure used to report load errors.
101  *
102  * Load errors are reported as signal by elm_web. All the strings are
103  * temporary references and should @b not be used after the signal
104  * callback returns. If it's required, make copies with strdup() or
105  * eina_stringshare_add() (they are not even guaranteed to be
106  * stringshared, so must use eina_stringshare_add() and not
107  * eina_stringshare_ref()).
108  */
109 struct _Elm_Web_Frame_Load_Error
110 {
111    int          code; /**< Numeric error code */
112    Eina_Bool    is_cancellation; /**< Error produced by canceling a request */
113    const char  *domain; /**< Error domain name */
114    const char  *description; /**< Error description (already localized) */
115    const char  *failing_url; /**< The URL that failed to load */
116    Evas_Object *frame; /**< Frame object that produced the error */
117 };
118
119 /**
120  * The possibles types that the items in a menu can be
121  */
122 typedef enum
123 {
124    ELM_WEB_MENU_SEPARATOR,
125    ELM_WEB_MENU_GROUP,
126    ELM_WEB_MENU_OPTION
127 } Elm_Web_Menu_Item_Type;
128
129 /**
130  * Structure describing the items in a menu
131  */
132 typedef struct _Elm_Web_Menu_Item Elm_Web_Menu_Item;
133
134 /**
135  * Structure describing the items in a menu
136  */
137 struct _Elm_Web_Menu_Item
138 {
139    const char            *text; /**< The text for the item */
140    Elm_Web_Menu_Item_Type type; /**< The type of the item */
141 };
142
143 /**
144  * Structure describing the menu of a popup
145  *
146  * This structure will be passed as the @c event_info for the "popup,create"
147  * signal, which is emitted when a dropdown menu is opened. Users wanting
148  * to handle these popups by themselves should listen to this signal and
149  * set the @c handled property of the struct to @c EINA_TRUE. Leaving this
150  * property as @c EINA_FALSE means that the user will not handle the popup
151  * and the default implementation will be used.
152  *
153  * When the popup is ready to be dismissed, a "popup,willdelete" signal
154  * will be emitted to notify the user that it can destroy any objects and
155  * free all data related to it.
156  *
157  * @see elm_web_popup_selected_set()
158  * @see elm_web_popup_destroy()
159  */
160 typedef struct _Elm_Web_Menu Elm_Web_Menu;
161
162 /**
163  * Structure describing the menu of a popup
164  *
165  * This structure will be passed as the @c event_info for the "popup,create"
166  * signal, which is emitted when a dropdown menu is opened. Users wanting
167  * to handle these popups by themselves should listen to this signal and
168  * set the @c handled property of the struct to @c EINA_TRUE. Leaving this
169  * property as @c EINA_FALSE means that the user will not handle the popup
170  * and the default implementation will be used.
171  *
172  * When the popup is ready to be dismissed, a "popup,willdelete" signal
173  * will be emitted to notify the user that it can destroy any objects and
174  * free all data related to it.
175  *
176  * @see elm_web_popup_selected_set()
177  * @see elm_web_popup_destroy()
178  */
179 struct _Elm_Web_Menu
180 {
181    Eina_List *items; /**< List of #Elm_Web_Menu_Item */
182    int        x; /**< The X position of the popup, relative to the elm_web object */
183    int        y; /**< The Y position of the popup, relative to the elm_web object */
184    int        width; /**< Width of the popup menu */
185    int        height; /**< Height of the popup menu */
186
187    Eina_Bool  handled : 1; /**< Set to @c EINA_TRUE by the user to indicate that the popup has been handled and the default implementation should be ignored. Leave as @c EINA_FALSE otherwise. */
188 };
189
190 typedef struct _Elm_Web_Download Elm_Web_Download;
191 struct _Elm_Web_Download
192 {
193    const char *url;
194 };
195
196 /**
197  * Types of zoom available.
198  */
199 typedef enum
200 {
201    ELM_WEB_ZOOM_MODE_MANUAL = 0, /**< Zoom controlled normally by elm_web_zoom_set */
202    ELM_WEB_ZOOM_MODE_AUTO_FIT, /**< Zoom until content fits in web object */
203    ELM_WEB_ZOOM_MODE_AUTO_FILL, /**< Zoom until content fills web object */
204    ELM_WEB_ZOOM_MODE_LAST
205 } Elm_Web_Zoom_Mode;
206
207 /**
208  * Opaque handler containing the features (such as statusbar, menubar, etc)
209  * that are to be set on a newly requested window.
210  */
211 typedef struct _Elm_Web_Window_Features Elm_Web_Window_Features;
212
213
214 /**
215  * Definitions of web window features.
216  *
217  */
218 typedef enum
219 {
220    ELM_WEB_WINDOW_FEATURE_TOOLBAR,
221    ELM_WEB_WINDOW_FEATURE_STATUSBAR,
222    ELM_WEB_WINDOW_FEATURE_SCROLLBARS,
223    ELM_WEB_WINDOW_FEATURE_MENUBAR,
224    ELM_WEB_WINDOW_FEATURE_LOCATIONBAR,
225    ELM_WEB_WINDOW_FEATURE_FULLSCREEN
226 } Elm_Web_Window_Feature_Flag;
227
228 /**
229  * Callback type for the create_window hook.
230  *
231  * The function parameters are:
232  * @li @p data User data pointer set when setting the hook function
233  * @li @p obj The elm_web object requesting the new window
234  * @li @p js Set to @c EINA_TRUE if the request was originated from
235  * JavaScript. @c EINA_FALSE otherwise.
236  * @li @p window_features A pointer of #Elm_Web_Window_Features indicating
237  * the features requested for the new window.
238  *
239  * The returned value of the function should be the @c elm_web widget where
240  * the request will be loaded. That is, if a new window or tab is created,
241  * the elm_web widget in it should be returned, and @b NOT the window
242  * object.
243  * Returning @c NULL should cancel the request.
244  *
245  * @see elm_web_window_create_hook_set()
246  */
247 typedef Evas_Object *(*Elm_Web_Window_Open)(void *data, Evas_Object *obj, Eina_Bool js, const Elm_Web_Window_Features *window_features);
248
249 /**
250  * Callback type for the JS alert hook.
251  *
252  * The function parameters are:
253  * @li @p data User data pointer set when setting the hook function
254  * @li @p obj The elm_web object requesting the new window
255  * @li @p message The message to show in the alert dialog
256  *
257  * The function should return the object representing the alert dialog.
258  * Elm_Web will run a second main loop to handle the dialog and normal
259  * flow of the application will be restored when the object is deleted, so
260  * the user should handle the popup properly in order to delete the object
261  * when the action is finished.
262  * If the function returns @c NULL the popup will be ignored.
263  *
264  * @see elm_web_dialog_alert_hook_set()
265  */
266 typedef Evas_Object *(*Elm_Web_Dialog_Alert)(void *data, Evas_Object *obj, const char *message);
267
268 /**
269  * Callback type for the JS confirm hook.
270  *
271  * The function parameters are:
272  * @li @p data User data pointer set when setting the hook function
273  * @li @p obj The elm_web object requesting the new window
274  * @li @p message The message to show in the confirm dialog
275  * @li @p ret Pointer to store the user selection. @c EINA_TRUE if
276  * the user selected @c Ok, @c EINA_FALSE otherwise.
277  *
278  * The function should return the object representing the confirm dialog.
279  * Elm_Web will run a second main loop to handle the dialog and normal
280  * flow of the application will be restored when the object is deleted, so
281  * the user should handle the popup properly in order to delete the object
282  * when the action is finished.
283  * If the function returns @c NULL the popup will be ignored.
284  *
285  * @see elm_web_dialog_confirm_hook_set()
286  */
287 typedef Evas_Object *(*Elm_Web_Dialog_Confirm)(void *data, Evas_Object *obj, const char *message, Eina_Bool *ret);
288
289 /**
290  * Callback type for the JS prompt hook.
291  *
292  * The function parameters are:
293  * @li @p data User data pointer set when setting the hook function
294  * @li @p obj The elm_web object requesting the new window
295  * @li @p message The message to show in the prompt dialog
296  * @li @p def_value The default value to present the user in the entry
297  * @li @p value Pointer to store the value given by the user. Must
298  * be a malloc'ed string or @c NULL if the user canceled the popup.
299  * @li @p ret Pointer to store the user selection. @c EINA_TRUE if
300  * the user selected @c Ok, @c EINA_FALSE otherwise.
301  *
302  * The function should return the object representing the prompt dialog.
303  * Elm_Web will run a second main loop to handle the dialog and normal
304  * flow of the application will be restored when the object is deleted, so
305  * the user should handle the popup properly in order to delete the object
306  * when the action is finished.
307  * If the function returns @c NULL the popup will be ignored.
308  *
309  * @see elm_web_dialog_prompt_hook_set()
310  */
311 typedef Evas_Object *(*Elm_Web_Dialog_Prompt)(void *data, Evas_Object *obj, const char *message, const char *def_value, char **value, Eina_Bool *ret);
312
313 /**
314  * Callback type for the JS file selector hook.
315  *
316  * The function parameters are:
317  * @li @p data User data pointer set when setting the hook function
318  * @li @p obj The elm_web object requesting the new window
319  * @li @p allows_multiple @c EINA_TRUE if multiple files can be selected.
320  * @li @p accept_types Mime types accepted
321  * @li @p selected Pointer to store the list of malloc'ed strings
322  * containing the path to each file selected. Must be @c NULL if the file
323  * dialog is canceled
324  * @li @p ret Pointer to store the user selection. @c EINA_TRUE if
325  * the user selected @c Ok, @c EINA_FALSE otherwise.
326  *
327  * The function should return the object representing the file selector
328  * dialog.
329  * Elm_Web will run a second main loop to handle the dialog and normal
330  * flow of the application will be restored when the object is deleted, so
331  * the user should handle the popup properly in order to delete the object
332  * when the action is finished.
333  * If the function returns @c NULL the popup will be ignored.
334  *
335  * @see elm_web_dialog_file selector_hook_set()
336  */
337 typedef Evas_Object *(*Elm_Web_Dialog_File_Selector)(void *data, Evas_Object *obj, Eina_Bool allows_multiple, Eina_List *accept_types, Eina_List **selected, Eina_Bool *ret);
338
339 /**
340  * Callback type for the JS console message hook.
341  *
342  * When a console message is added from JavaScript, any set function to the
343  * console message hook will be called for the user to handle. There is no
344  * default implementation of this hook.
345  *
346  * The function parameters are:
347  * @li @p data User data pointer set when setting the hook function
348  * @li @p obj The elm_web object that originated the message
349  * @li @p message The message sent
350  * @li @p line_number The line number
351  * @li @p source_id Source id
352  *
353  * @see elm_web_console_message_hook_set()
354  */
355 typedef void (*Elm_Web_Console_Message)(void *data, Evas_Object *obj, const char *message, unsigned int line_number, const char *source_id);
356
357 /**
358  * Add a new web object to the parent.
359  *
360  * @param parent The parent object.
361  * @return The new object or NULL if it cannot be created.
362  *
363  * @see elm_web_uri_set()
364  * @see elm_web_webkit_view_get()
365  */
366 EAPI Evas_Object      *elm_web_add(Evas_Object *parent);
367
368 /**
369  * Change useragent of a elm_web object
370  * 
371  * @param obj The object
372  * @param user_agent String for useragent
373  *
374  */
375 EAPI void elm_web_useragent_set(Evas_Object *obj, const char *user_agent);
376
377 /**
378  * Return current useragent of elm_web object
379  *
380  * @param obj The object
381  * @return Useragent string
382  *
383  */
384 EAPI const char* elm_web_useragent_get(const Evas_Object *obj);
385
386 /**
387  * Get internal ewk_view object from web object.
388  *
389  * Elementary may not provide some low level features of EWebKit,
390  * instead of cluttering the API with proxy methods we opted to
391  * return the internal reference. Be careful using it as it may
392  * interfere with elm_web behavior.
393  *
394  * @param obj The web object.
395  * @return The internal ewk_view object or NULL if it does not
396  *         exist. (Failure to create or Elementary compiled without
397  *         ewebkit)
398  *
399  * @see elm_web_add()
400  */
401 EAPI Evas_Object      *elm_web_webkit_view_get(const Evas_Object *obj);
402
403 /**
404  * Sets the function to call when a new window is requested
405  *
406  * This hook will be called when a request to create a new window is
407  * issued from the web page loaded.
408  * There is no default implementation for this feature, so leaving this
409  * unset or passing @c NULL in @p func will prevent new windows from
410  * opening.
411  *
412  * @param obj The web object where to set the hook function
413  * @param func The hook function to be called when a window is requested
414  * @param data User data
415  */
416 EAPI void              elm_web_window_create_hook_set(Evas_Object *obj, Elm_Web_Window_Open func, void *data);
417
418 /**
419  * Sets the function to call when an alert dialog
420  *
421  * This hook will be called when a JavaScript alert dialog is requested.
422  * If no function is set or @c NULL is passed in @p func, the default
423  * implementation will take place.
424  *
425  * @param obj The web object where to set the hook function
426  * @param func The callback function to be used
427  * @param data User data
428  *
429  * @see elm_web_inwin_mode_set()
430  */
431 EAPI void              elm_web_dialog_alert_hook_set(Evas_Object *obj, Elm_Web_Dialog_Alert func, void *data);
432
433 /**
434  * Sets the function to call when an confirm dialog
435  *
436  * This hook will be called when a JavaScript confirm dialog is requested.
437  * If no function is set or @c NULL is passed in @p func, the default
438  * implementation will take place.
439  *
440  * @param obj The web object where to set the hook function
441  * @param func The callback function to be used
442  * @param data User data
443  *
444  * @see elm_web_inwin_mode_set()
445  */
446 EAPI void              elm_web_dialog_confirm_hook_set(Evas_Object *obj, Elm_Web_Dialog_Confirm func, void *data);
447
448 /**
449  * Sets the function to call when an prompt dialog
450  *
451  * This hook will be called when a JavaScript prompt dialog is requested.
452  * If no function is set or @c NULL is passed in @p func, the default
453  * implementation will take place.
454  *
455  * @param obj The web object where to set the hook function
456  * @param func The callback function to be used
457  * @param data User data
458  *
459  * @see elm_web_inwin_mode_set()
460  */
461 EAPI void              elm_web_dialog_prompt_hook_set(Evas_Object *obj, Elm_Web_Dialog_Prompt func, void *data);
462
463 /**
464  * Sets the function to call when an file selector dialog
465  *
466  * This hook will be called when a JavaScript file selector dialog is
467  * requested.
468  * If no function is set or @c NULL is passed in @p func, the default
469  * implementation will take place.
470  *
471  * @param obj The web object where to set the hook function
472  * @param func The callback function to be used
473  * @param data User data
474  *
475  * @see elm_web_inwin_mode_set()
476  */
477 EAPI void              elm_web_dialog_file_selector_hook_set(Evas_Object *obj, Elm_Web_Dialog_File_Selector func, void *data);
478
479 /**
480  * Sets the function to call when a console message is emitted from JS
481  *
482  * This hook will be called when a console message is emitted from
483  * JavaScript. There is no default implementation for this feature.
484  *
485  * @param obj The web object where to set the hook function
486  * @param func The callback function to be used
487  * @param data User data
488  */
489 EAPI void              elm_web_console_message_hook_set(Evas_Object *obj, Elm_Web_Console_Message func, void *data);
490
491 /**
492  * Gets the status of the tab propagation
493  *
494  * @param obj The web object to query
495  * @return EINA_TRUE if tab propagation is enabled, EINA_FALSE otherwise
496  *
497  * @see elm_web_tab_propagate_set()
498  */
499 EAPI Eina_Bool         elm_web_tab_propagate_get(const Evas_Object *obj);
500
501 /**
502  * Sets whether to use tab propagation
503  *
504  * If tab propagation is enabled, whenever the user presses the Tab key,
505  * Elementary will handle it and switch focus to the next widget.
506  * The default value is disabled, where WebKit will handle the Tab key to
507  * cycle focus though its internal objects, jumping to the next widget
508  * only when that cycle ends.
509  *
510  * @param obj The web object
511  * @param propagate Whether to propagate Tab keys to Elementary or not
512  */
513 EAPI void              elm_web_tab_propagate_set(Evas_Object *obj, Eina_Bool propagate);
514
515 /**
516  * Sets the URI for the web object
517  *
518  * It must be a full URI, with resource included, in the form
519  * http://www.enlightenment.org or file:///tmp/something.html
520  *
521  * @param obj The web object
522  * @param uri The URI to set
523  * @return EINA_TRUE if the URI could be set, EINA_FALSE if an error occurred
524  */
525 EAPI Eina_Bool         elm_web_uri_set(Evas_Object *obj, const char *uri);
526
527 /**
528  * Gets the current URI for the object
529  *
530  * The returned string must not be freed and is guaranteed to be
531  * stringshared.
532  *
533  * @param obj The web object
534  * @return A stringshared internal string with the current URI, or NULL on
535  * failure
536  */
537 EAPI const char       *elm_web_uri_get(const Evas_Object *obj);
538
539 /**
540  * Gets the current title
541  *
542  * The returned string must not be freed and is guaranteed to be
543  * stringshared.
544  *
545  * @param obj The web object
546  * @return A stringshared internal string with the current title, or NULL on
547  * failure
548  */
549 EAPI const char       *elm_web_title_get(const Evas_Object *obj);
550
551 /**
552  * Sets the background color to be used by the web object
553  *
554  * This is the color that will be used by default when the loaded page
555  * does not set it's own. Color values are pre-multiplied.
556  *
557  * @param obj The web object
558  * @param r Red component
559  * @param g Green component
560  * @param b Blue component
561  * @param a Alpha component
562  */
563 EAPI void              elm_web_bg_color_set(Evas_Object *obj, int r, int g, int b, int a);
564
565 /**
566  * Gets the background color to be used by the web object
567  *
568  * This is the color that will be used by default when the loaded page
569  * does not set it's own. Color values are pre-multiplied.
570  *
571  * @param obj The web object
572  * @param r Red component
573  * @param g Green component
574  * @param b Blue component
575  * @param a Alpha component
576  */
577 EAPI void              elm_web_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a);
578
579 /**
580  * Gets a copy of the currently selected text
581  *
582  * The string returned must be freed by the user when it's done with it.
583  *
584  * @param obj The web object
585  * @return A newly allocated string, or NULL if nothing is selected or an
586  * error occurred
587  */
588 EAPI char             *elm_web_selection_get(const Evas_Object *obj);
589
590 /**
591  * Tells the web object which index in the currently open popup was selected
592  *
593  * When the user handles the popup creation from the "popup,created" signal,
594  * it needs to tell the web object which item was selected by calling this
595  * function with the index corresponding to the item.
596  *
597  * @param obj The web object
598  * @param index The index selected
599  *
600  * @see elm_web_popup_destroy()
601  */
602 EAPI void              elm_web_popup_selected_set(Evas_Object *obj, int index);
603
604 /**
605  * Dismisses an open dropdown popup
606  *
607  * When the popup from a dropdown widget is to be dismissed, either after
608  * selecting an option or to cancel it, this function must be called, which
609  * will later emit an "popup,willdelete" signal to notify the user that
610  * any memory and objects related to this popup can be freed.
611  *
612  * @param obj The web object
613  * @return EINA_TRUE if the menu was successfully destroyed, or EINA_FALSE
614  * if there was no menu to destroy
615  */
616 EAPI Eina_Bool         elm_web_popup_destroy(Evas_Object *obj);
617
618 /**
619  * Searches the given string in a document.
620  *
621  * @param obj The web object where to search the text
622  * @param string String to search
623  * @param case_sensitive If search should be case sensitive or not
624  * @param forward If search is from cursor and on or backwards
625  * @param wrap If search should wrap at the end
626  *
627  * @return @c EINA_TRUE if the given string was found, @c EINA_FALSE if not
628  * or failure
629  */
630 EAPI Eina_Bool         elm_web_text_search(const Evas_Object *obj, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap);
631
632 /**
633  * Marks matches of the given string in a document.
634  *
635  * @param obj The web object where to search text
636  * @param string String to match
637  * @param case_sensitive If match should be case sensitive or not
638  * @param highlight If matches should be highlighted
639  * @param limit Maximum amount of matches, or zero to unlimited
640  *
641  * @return number of matched @a string
642  */
643 EAPI unsigned int      elm_web_text_matches_mark(Evas_Object *obj, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit);
644
645 /**
646  * Clears all marked matches in the document
647  *
648  * @param obj The web object
649  *
650  * @return EINA_TRUE on success, EINA_FALSE otherwise
651  */
652 EAPI Eina_Bool         elm_web_text_matches_unmark_all(Evas_Object *obj);
653
654 /**
655  * Sets whether to highlight the matched marks
656  *
657  * If enabled, marks set with elm_web_text_matches_mark() will be
658  * highlighted.
659  *
660  * @param obj The web object
661  * @param highlight Whether to highlight the marks or not
662  *
663  * @return EINA_TRUE on success, EINA_FALSE otherwise
664  */
665 EAPI Eina_Bool         elm_web_text_matches_highlight_set(Evas_Object *obj, Eina_Bool highlight);
666
667 /**
668  * Gets whether highlighting marks is enabled
669  *
670  * @param obj The web object
671  *
672  * @return EINA_TRUE is marks are set to be highlighted, EINA_FALSE
673  * otherwise
674  */
675 EAPI Eina_Bool         elm_web_text_matches_highlight_get(const Evas_Object *obj);
676
677 /**
678  * Gets the overall loading progress of the page
679  *
680  * Returns the estimated loading progress of the page, with a value between
681  * 0.0 and 1.0. This is an estimated progress accounting for all the frames
682  * included in the page.
683  *
684  * @param obj The web object
685  *
686  * @return A value between 0.0 and 1.0 indicating the progress, or -1.0 on
687  * failure
688  */
689 EAPI double            elm_web_load_progress_get(const Evas_Object *obj);
690
691 /**
692  * Stops loading the current page
693  *
694  * Cancels the loading of the current page in the web object. This will
695  * cause a "load,error" signal to be emitted, with the is_cancellation
696  * flag set to EINA_TRUE.
697  *
698  * @param obj The web object
699  *
700  * @return EINA_TRUE if the cancel was successful, EINA_FALSE otherwise
701  */
702 EAPI Eina_Bool         elm_web_stop(Evas_Object *obj);
703
704 /**
705  * Requests a reload of the current document in the object
706  *
707  * @param obj The web object
708  *
709  * @return EINA_TRUE on success, EINA_FALSE otherwise
710  */
711 EAPI Eina_Bool         elm_web_reload(Evas_Object *obj);
712
713 /**
714  * Requests a reload of the current document, avoiding any existing caches
715  *
716  * @param obj The web object
717  *
718  * @return EINA_TRUE on success, EINA_FALSE otherwise
719  */
720 EAPI Eina_Bool         elm_web_reload_full(Evas_Object *obj);
721
722 /**
723  * Goes back one step in the browsing history
724  *
725  * This is equivalent to calling elm_web_object_navigate(obj, -1);
726  *
727  * @param obj The web object
728  *
729  * @return EINA_TRUE on success, EINA_FALSE otherwise
730  *
731  * @see elm_web_history_enabled_set()
732  * @see elm_web_back_possible()
733  * @see elm_web_forward()
734  * @see elm_web_navigate()
735  */
736 EAPI Eina_Bool         elm_web_back(Evas_Object *obj);
737
738 /**
739  * Goes forward one step in the browsing history
740  *
741  * This is equivalent to calling elm_web_object_navigate(obj, 1);
742  *
743  * @param obj The web object
744  *
745  * @return EINA_TRUE on success, EINA_FALSE otherwise
746  *
747  * @see elm_web_history_enabled_set()
748  * @see elm_web_forward_possible_get()
749  * @see elm_web_back()
750  * @see elm_web_navigate()
751  */
752 EAPI Eina_Bool         elm_web_forward(Evas_Object *obj);
753
754 /**
755  * Jumps the given number of steps in the browsing history
756  *
757  * The @p steps value can be a negative integer to back in history, or a
758  * positive to move forward.
759  *
760  * @param obj The web object
761  * @param steps The number of steps to jump
762  *
763  * @return EINA_TRUE on success, EINA_FALSE on error or if not enough
764  * history exists to jump the given number of steps
765  *
766  * @see elm_web_history_enabled_set()
767  * @see elm_web_back()
768  * @see elm_web_forward()
769  */
770 EAPI Eina_Bool         elm_web_navigate(Evas_Object *obj, int steps);
771
772 /**
773  * Queries whether it's possible to go back in history
774  *
775  * @param obj The web object
776  *
777  * @return EINA_TRUE if it's possible to back in history, EINA_FALSE
778  * otherwise
779  */
780 EAPI Eina_Bool         elm_web_back_possible_get(Evas_Object *obj);
781
782 /**
783  * Queries whether it's possible to go forward in history
784  *
785  * @param obj The web object
786  *
787  * @return EINA_TRUE if it's possible to forward in history, EINA_FALSE
788  * otherwise
789  */
790 EAPI Eina_Bool         elm_web_forward_possible_get(Evas_Object *obj);
791
792 /**
793  * Queries whether it's possible to jump the given number of steps
794  *
795  * The @p steps value can be a negative integer to back in history, or a
796  * positive to move forward.
797  *
798  * @param obj The web object
799  * @param steps The number of steps to check for
800  *
801  * @return EINA_TRUE if enough history exists to perform the given jump,
802  * EINA_FALSE otherwise
803  */
804 EAPI Eina_Bool         elm_web_navigate_possible_get(Evas_Object *obj, int steps);
805
806 /**
807  * Gets whether browsing history is enabled for the given object
808  *
809  * @param obj The web object
810  *
811  * @return EINA_TRUE if history is enabled, EINA_FALSE otherwise
812  */
813 EAPI Eina_Bool         elm_web_history_enabled_get(const Evas_Object *obj);
814
815 /**
816  * Enables or disables the browsing history
817  *
818  * @param obj The web object
819  * @param enabled Whether to enable or disable the browsing history
820  */
821 EAPI void              elm_web_history_enabled_set(Evas_Object *obj, Eina_Bool enabled);
822
823 /**
824  * Sets the zoom level of the web object
825  *
826  * Zoom level matches the Webkit API, so 1.0 means normal zoom, with higher
827  * values meaning zoom in and lower meaning zoom out. This function will
828  * only affect the zoom level if the mode set with elm_web_zoom_mode_set()
829  * is ::ELM_WEB_ZOOM_MODE_MANUAL.
830  *
831  * @param obj The web object
832  * @param zoom The zoom level to set
833  */
834 EAPI void              elm_web_zoom_set(Evas_Object *obj, double zoom);
835
836 /**
837  * Gets the current zoom level set on the web object
838  *
839  * Note that this is the zoom level set on the web object and not that
840  * of the underlying Webkit one. In the ::ELM_WEB_ZOOM_MODE_MANUAL mode,
841  * the two zoom levels should match, but for the other two modes the
842  * Webkit zoom is calculated internally to match the chosen mode without
843  * changing the zoom level set for the web object.
844  *
845  * @param obj The web object
846  *
847  * @return The zoom level set on the object
848  */
849 EAPI double            elm_web_zoom_get(const Evas_Object *obj);
850
851 /**
852  * Sets the zoom mode to use
853  *
854  * The modes can be any of those defined in ::Elm_Web_Zoom_Mode, except
855  * ::ELM_WEB_ZOOM_MODE_LAST. The default is ::ELM_WEB_ZOOM_MODE_MANUAL.
856  *
857  * ::ELM_WEB_ZOOM_MODE_MANUAL means the zoom level will be controlled
858  * with the elm_web_zoom_set() function.
859  * ::ELM_WEB_ZOOM_MODE_AUTO_FIT will calculate the needed zoom level to
860  * make sure the entirety of the web object's contents are shown.
861  * ::ELM_WEB_ZOOM_MODE_AUTO_FILL will calculate the needed zoom level to
862  * fit the contents in the web object's size, without leaving any space
863  * unused.
864  *
865  * @param obj The web object
866  * @param mode The mode to set
867  */
868 EAPI void              elm_web_zoom_mode_set(Evas_Object *obj, Elm_Web_Zoom_Mode mode);
869
870 /**
871  * Gets the currently set zoom mode
872  *
873  * @param obj The web object
874  *
875  * @return The current zoom mode set for the object, or
876  * ::ELM_WEB_ZOOM_MODE_LAST on error
877  */
878 EAPI Elm_Web_Zoom_Mode elm_web_zoom_mode_get(const Evas_Object *obj);
879
880 /**
881  * Shows the given region in the web object
882  *
883  * @param obj The web object
884  * @param x The x coordinate of the region to show
885  * @param y The y coordinate of the region to show
886  * @param w The width of the region to show
887  * @param h The height of the region to show
888  */
889 EAPI void              elm_web_region_show(Evas_Object *obj, int x, int y, int w, int h);
890
891 /**
892  * Brings in the region to the visible area
893  *
894  * Like elm_web_region_show(), but it animates the scrolling of the object
895  * to show the area
896  *
897  * @param obj The web object
898  * @param x The x coordinate of the region to show
899  * @param y The y coordinate of the region to show
900  * @param w The width of the region to show
901  * @param h The height of the region to show
902  */
903 EAPI void              elm_web_region_bring_in(Evas_Object *obj, int x, int y, int w, int h);
904
905 /**
906  * Sets the default dialogs to use an Inwin instead of a normal window
907  *
908  * If set, then the default implementation for the JavaScript dialogs and
909  * file selector will be opened in an Inwin. Otherwise they will use a
910  * normal separated window.
911  *
912  * @param obj The web object
913  * @param value EINA_TRUE to use Inwin, EINA_FALSE to use a normal window
914  */
915 EAPI void              elm_web_inwin_mode_set(Evas_Object *obj, Eina_Bool value);
916
917 /**
918  * Gets whether Inwin mode is set for the current object
919  *
920  * @param obj The web object
921  *
922  * @return EINA_TRUE if Inwin mode is set, EINA_FALSE otherwise
923  */
924 EAPI Eina_Bool         elm_web_inwin_mode_get(const Evas_Object *obj);
925
926 EAPI void              elm_web_window_features_ref(Elm_Web_Window_Features *wf);
927 EAPI void              elm_web_window_features_unref(Elm_Web_Window_Features *wf);
928
929 /**
930  * Gets boolean properties from Elm_Web_Window_Features
931  * (such as statusbar, menubar, etc) that are on a window.
932  *
933  * @param obj The web window features object
934  * @param flag The web window feature flag whose value is required.
935  *
936  * @return EINA_TRUE if the flag is set, EINA_FALSE otherwise
937  */
938 EAPI Eina_Bool              elm_web_window_features_property_get(const Elm_Web_Window_Features *wf, Elm_Web_Window_Feature_Flag flag);
939
940 /**
941  *
942  * TODO : Add documentation.
943  *
944  * @param obj The web window features object
945  * @param x, y, w, h - the co-ordinates of the web view window.
946  *
947  */
948 EAPI void              elm_web_window_features_region_get(const Elm_Web_Window_Features *wf, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
949
950 /**
951  * @}
952  */