[M108 Migration] Remove unapproved API from the public header.
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_view.h
1 /*
2  * Copyright (C) 2011-2016 Samsung Electronics.
3  * Copyright (C) 2012 Intel Corporation.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 /**
21  * @file    ewk_view.h
22  * @brief   This file describes the Chromium-efl main smart object.
23  *
24  * This object provides view related APIs of Chromium to EFL objects.
25  */
26
27 #ifndef ewk_view_h
28 #define ewk_view_h
29
30 #include <Eina.h>
31 #include <Evas.h>
32 #include <string.h>
33 #include <tizen.h>
34 #include "ewk_back_forward_list.h"
35 #include "ewk_context.h"
36 #include "ewk_context_menu.h"
37 #include "ewk_manifest.h"
38 #include "ewk_settings.h"
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /**
45  * @addtogroup WEBVIEW
46  * @{
47  */
48
49 /**
50  * @brief Request to set the current page's visibility.
51  *
52  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
53  *
54  * @param[in] o View object to set the visibility.
55  * @param[in] enable EINA_TRUE to set on the visibility of the page,
56  *            EINA_FALSE otherwise.
57  *
58  * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
59  */
60 EXPORT_API Eina_Bool ewk_view_visibility_set(Evas_Object* o, Eina_Bool enable);
61
62 /**
63  * @brief Sends the orientation of the device.
64  *
65  * If orientation value is changed, orientationchanged event will occur.
66  *
67  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
68  *
69  * @param[in] o View object to receive orientation event.
70  * @param[in] orientation The new orientation of the device. (degree)
71  *
72  * orientation will be 0 degrees when the device is oriented to natural position
73  *                  ,-90 degrees when it's left side is at the top
74  *                  , 90 degrees when it's right side is at the top
75  *                  ,180 degrees when it is upside down.
76  */
77 EXPORT_API void ewk_view_orientation_send(Evas_Object *o, int orientation);
78
79 /**
80  * @if MOBILE
81  * @brief Returns the selection text.
82  *
83  * @details Returned string becomes invalidated upon next call to this api.
84  *
85  * @since_tizen 2.4
86  *
87  * @param[in] o View object to get selection text.
88  *
89  * @return @c selection text, otherwise @c NULL
90  * @endif
91  */
92 EXPORT_API const char* ewk_view_text_selection_text_get(Evas_Object* o);
93
94 /**
95  * @if MOBILE
96  * @brief Clears the current selection.
97  *
98  * @since_tizen 2.4
99  *
100  * @param[in] o View object with selection in progress
101  *
102  * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
103  * @endif
104  */
105 EXPORT_API Eina_Bool ewk_view_text_selection_clear(Evas_Object* o);
106
107 /**
108  * @brief Creates a new EFL Chromium view object.
109  *
110  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
111  *
112  * @param[in] e The canvas object where to create the view object
113  *
114  * @return The view object on success,\n
115  *         otherwise @c NULL on failure
116  */
117 EXPORT_API Evas_Object* ewk_view_add(Evas* e);
118
119 /**
120  * @brief Creates a new EFL web view object in incognito mode.
121  *
122  * @since_tizen 3.0
123  *
124  * @param[in] e The canvas object where to create the view object
125  *
126  * @return The view object on success,\n
127  *         otherwise @c NULL on failure
128  */
129 EXPORT_API Evas_Object *ewk_view_add_in_incognito_mode(Evas *e);
130
131 /**
132  * @brief Gets the #Ewk_Context of this view.
133  *
134  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
135  *
136  * @param[in] o The view object to get the #Ewk_Context
137  *
138  * @return The #Ewk_Context of this view,\n
139  *         otherwise @c NULL on failure
140  */
141 EXPORT_API Ewk_Context* ewk_view_context_get(const Evas_Object* o);
142
143 /**
144  * @brief Asks the object to load the given URL.
145  *
146  * @remarks You can only be sure that url changed after ewk view\n
147  *          smart callback 'url,changed' is called. This is important for\n
148  *          EWK API functions which operate on pages.
149  *
150  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
151  *
152  * @param[in] o The view object to load @a url
153  * @param[in] url The uniform resource identifier to load
154  *
155  * @return @c EINA_TRUE if @a o is valid, irrespective of load,\n
156  *         otherwise @c EINA_FALSE on failure
157  */
158 EXPORT_API Eina_Bool ewk_view_url_set(Evas_Object* o, const char* url);
159
160 /**
161  * @brief Returns the current URL string of the view object.
162  *
163  * @details It returns an internal string that should not be modified.\n
164  *          The string is guaranteed to be stringshared.
165  *
166  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
167  *
168  * @param[in] o The view object to get the current URL
169  *
170  * @return The current URL on success,\n
171  *         otherwise @c NULL on failure
172  */
173 EXPORT_API const char* ewk_view_url_get(const Evas_Object* o);
174
175 /**
176  * @brief Returns the original URL string of the view object.
177  *
178  * @details It returns an internal string that should not be modified.\n
179  *          The string is guaranteed to be stringshared.
180  *
181  * @since_tizen 4.0
182  *
183  * @param[in] o The view object to get the original URL
184  *
185  * @return The original URL on success,\n
186  *         otherwise @c NULL on failure
187  */
188 EXPORT_API const char* ewk_view_original_url_get(const Evas_Object* o);
189
190 /**
191  * @brief Asks the main frame to reload the current document.
192  *
193  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
194  *
195  * @param[in] o The view object to reload the current document
196  *
197  * @return @c EINA_TRUE on success,\n
198  *         otherwise @c EINA_FALSE
199  */
200 EXPORT_API Eina_Bool ewk_view_reload(Evas_Object* o);
201
202 /**
203  * @brief Asks the main frame to stop loading.
204  *
205  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
206  *
207  * @param[in] o The view object to stop loading
208  *
209  * @return @c EINA_TRUE on success,\n
210  *         otherwise @c EINA_FALSE
211  */
212 EXPORT_API Eina_Bool ewk_view_stop(Evas_Object* o);
213
214 /**
215  * @brief Gets the #Ewk_Settings of this view.
216  *
217  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
218  *
219  * @param[in] o The view object to get the #Ewk_Settings
220  *
221  * @return The #Ewk_Settings of this view,\n
222  *         otherwise @c NULL on failure
223  */
224 EXPORT_API Ewk_Settings* ewk_view_settings_get(const Evas_Object* o);
225
226 /**
227  * @brief Asks the main frame to navigate back in history.
228  *
229  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
230  *
231  * @param[in] o The view object to navigate back
232  *
233  * @return @c EINA_TRUE on success,\n
234  *         otherwise @c EINA_FALSE
235  */
236 EXPORT_API Eina_Bool ewk_view_back(Evas_Object* o);
237
238 /**
239  * @brief Asks the main frame to navigate forward in history.
240  *
241  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
242  *
243  * @param[in] o The view object to navigate forward
244  *
245  * @return @c EINA_TRUE on success,\n
246  *         otherwise @c EINA_FALSE
247  */
248 EXPORT_API Eina_Bool ewk_view_forward(Evas_Object* o);
249
250 /**
251  * @brief Checks whether it is possible to navigate backwards one item in
252  *         history.
253  *
254  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
255  *
256  * @param[in] o The view object to query if backward navigation is possible
257  *
258  * @return @c EINA_TRUE if it is possible to navigate backwards in history,\n
259  *         otherwise @c EINA_FALSE
260  */
261 EXPORT_API Eina_Bool ewk_view_back_possible(Evas_Object* o);
262
263 /**
264  * @brief Checks whether it is possible to navigate forwards one item in
265  *        history.
266  *
267  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
268  *
269  * @param[in] o The view object to query if forward navigation is possible
270  *
271  * @return @c EINA_TRUE if it is possible to navigate forwards in history,\n
272  *         otherwise @c EINA_FALSE
273  */
274 EXPORT_API Eina_Bool ewk_view_forward_possible(Evas_Object* o);
275
276 /**
277  * @brief Gets the back-forward list associated with this view.
278  *
279  * @details The returned instance is unique for this view and thus multiple
280  *          calls\n
281  *          to this function with the same view as a parameter returns the
282  *          same handle.\n
283  *          This handle is alive while the view is alive, thus one might want\n
284  *          to listen for EVAS_CALLBACK_DEL on a given view (@a o) to know\n
285  *          when to stop using the returned handle.
286  *
287  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
288  *
289  * @param[in] o The view object to get the back-forward navigation list
290  *
291  * @return The back-forward list instance handle associated with this view
292  */
293 EXPORT_API Ewk_Back_Forward_List* ewk_view_back_forward_list_get(const Evas_Object* o);
294
295 /**
296  * @brief Clears the back-forward list of a page.
297  *
298  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
299  *
300  * @param[in] o The view object to clear the back-forward list
301  */
302 EXPORT_API void ewk_view_back_forward_list_clear(const Evas_Object* o);
303
304 /**
305  * @brief Gets the current title of the main frame.
306  *
307  * @details It returns an internal string that should not be modified.\n
308  *          The string is guaranteed to be stringshared.
309  *
310  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
311  *
312  * @param[in] o The view object to get the current title
313  *
314  * @return The current title on success,\n
315  *         otherwise @c NULL on failure
316  */
317 EXPORT_API const char* ewk_view_title_get(const Evas_Object* o);
318
319 /**
320  * @brief Gets the current load progress of the page.
321  *
322  * @details The progress estimation from @c 0.0 to @c 1.0.
323  *
324  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
325  *
326  * @param[in] o The view object to get the current progress
327  *
328  * @return The load progress of the page, value from @c 0.0 to @c 1.0,\n
329  *         otherwise @c -1.0 on failure
330  */
331 EXPORT_API double ewk_view_load_progress_get(const Evas_Object* o);
332
333 /**
334  * @brief Requests to set the user agent string.
335  *
336  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
337  *
338  * @param[in] o The view object to set the user agent string
339  * @param[in] user_agent The user agent string to set,\n
340  *                       otherwise @c NULL to restore the default one
341  *
342  * @return @c EINA_TRUE on success,\n
343  *         otherwise @c EINA_FALSE on failure
344  */
345 EXPORT_API Eina_Bool ewk_view_user_agent_set(Evas_Object* o, const char* user_agent);
346
347 /**
348  * @brief Returns the user agent string.
349  *
350  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
351  *
352  * @param[in] o The view object to get the user agent string
353  *
354  * @return The user agent string
355  */
356 EXPORT_API const char* ewk_view_user_agent_get(const Evas_Object* o);
357
358 /**
359  * @brief Gets the last known content's size.
360  *
361  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
362  *
363  * @param[in] o The view object to get the content's size
364  * @param[in] width The width pointer to store the content's size width,
365  *            may be @c 0
366  * @param[in] height The height pointer to store the content's size height,
367  *            may be @c 0
368  *
369  * @return @c EINA_TRUE on success,\n
370  *         otherwise @c EINA_FALSE on failure and\n
371  *         @a width and @a height are zeroed
372  */
373 EXPORT_API Eina_Bool ewk_view_contents_size_get(const Evas_Object* o, Evas_Coord* width, Evas_Coord* height);
374
375 /**
376  * @brief Callback for ewk_view_script_execute().
377  *
378  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
379  *
380  * @param[in] o The view object
381  * @param[in] result_value The value returned by the script\n
382  *            If executed script returns a value, it would be @a result_value,\n
383  *            otherwise @c NULL if there is no value returned by the script
384  * @param[in] user_data The user_data will be passed when
385  *            ewk_view_script_execute() is called
386  */
387 typedef void (*Ewk_View_Script_Execute_Cb)(Evas_Object* o, const char* result_value, void* user_data);
388
389 /**
390  * @brief Requests the execution of the given script.
391  *
392  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
393  *
394  * @remarks This allows to use @c NULL for the callback parameter\n
395  *          So, if the result data from the script is not required,
396  *          @c NULL might be used for the callback parameter\n
397  *          Also, @a script should be valid statement according to JavaScript language\n
398  *          If @a script is empty, NULL or invalid statement, this function returns @c EINA_FALSE
399  *
400  * @param[in] o The view object to execute the script
401  * @param[in] script The JavaScript code string to execute
402  * @param[in] callback The result callback
403  * @param[in] user_data The user data
404  *
405  * @return @c EINA_TRUE  on success,\n
406  *         otherwise @c EINA_FALSE on failure
407  */
408 EXPORT_API Eina_Bool ewk_view_script_execute(Evas_Object* o, const char* script, Ewk_View_Script_Execute_Cb callback, void* user_data);
409
410 /**
411  * @brief Scales the current page, centered at the given point.
412  *
413  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
414  *
415  * @param[in] o The view object to set the zoom level
416  * @param[in] scale_factor A new level to set
417  * @param[in] cx The x value of the center coordinate
418  * @param[in] cy The y value of the center coordinate
419  *
420  * @return @c EINA_TRUE on success,\n
421  *         otherwise EINA_FALSE
422  */
423 EXPORT_API Eina_Bool ewk_view_scale_set(Evas_Object* o, double scale_factor, int cx, int cy);
424
425 /**
426  * @brief Gets the current scale factor of the page.
427  *
428  * @details It returns the previous scale factor after ewk_view_scale_set() is
429  *          called immediately\n
430  *          until the scale factor of the page is really changed.
431  *
432  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
433  *
434  * @param[in] o The view object to get the scale factor of
435  *
436  * @return The current scale factor in use on success,\n
437  *         otherwise @c -1.0 on failure
438  */
439 EXPORT_API double ewk_view_scale_get(const Evas_Object* o);
440
441 /**
442  * @brief Exits fullscreen when the back key is pressed.
443  *
444  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
445  *
446  * @param[in] o The view object to exit the fullscreen mode
447  *
448  * @return @c EINA_TRUE on success,\n
449  *         otherwise @c EINA_FALSE
450  */
451 EXPORT_API Eina_Bool ewk_view_fullscreen_exit(Evas_Object* o);
452
453 /**
454  * @brief Suspends the operation associated with the view object.
455  *
456  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
457  *
458  * @param[in] o The view object to suspend
459  */
460 EXPORT_API void ewk_view_suspend(Evas_Object* o);
461
462 /**
463  * @brief Resumes the operation associated with the view object after calling
464  *        ewk_view_suspend().
465  *
466  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
467  *
468  * @param[in] o The view object to resume
469  */
470 EXPORT_API void ewk_view_resume(Evas_Object* o);
471
472 /**
473  * \enum Ewk_Http_Method
474  * @brief Enumeration that provides HTTP method options.
475  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
476  */
477 enum Ewk_Http_Method {
478     EWK_HTTP_METHOD_GET, /**< Get */
479     EWK_HTTP_METHOD_HEAD, /**< Head */
480     EWK_HTTP_METHOD_POST, /**< Post */
481     EWK_HTTP_METHOD_PUT, /**< Put */
482     EWK_HTTP_METHOD_DELETE, /**< Delete */
483 };
484
485 /**
486  * @brief Enumeration that creates a type name for the #Ewk_Http_Method.
487  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
488  */
489 typedef enum Ewk_Http_Method Ewk_Http_Method;
490
491 /**
492  * @brief Requests loading of the given request data.
493  *
494  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
495  *
496  * @param[in] o The view object to load
497  * @param[in] url The uniform resource identifier to load
498  * @param[in] method The http method
499  * @param[in] headers The http headers
500  * @param[in] body The http body data
501  *
502  * @return @c EINA_TRUE on a successful request,\n
503  *         otherwise @c EINA_FALSE on failure
504  */
505 EXPORT_API Eina_Bool ewk_view_url_request_set(Evas_Object* o, const char* url, Ewk_Http_Method method, Eina_Hash* headers, const char* body);
506
507 /**
508  * @if MOBILE
509  * @brief Requests loading the given contents by MIME type into the view object.
510  *
511  * @since_tizen 2.3
512  *
513  * @param[in] o The view object to load
514  * @param[in] contents The content to load
515  * @param[in] contents_size The size of @a contents (in bytes)
516  * @param[in] mime_type The type of @a contents,
517  *            if @c 0 is given "text/html" is assumed
518  * @param[in] encoding The encoding for @a contents,
519  *            if @c 0 is given "UTF-8" is assumed
520  * @param[in] base_uri The base URI to use for relative resources,
521  *            may be @c 0,\n if provided @b must be an absolute URI
522  *
523  * @return @c EINA_TRUE on a successful request,\n
524  *         otherwise @c EINA_FALSE on errors
525  * @endif
526  */
527 EXPORT_API Eina_Bool ewk_view_contents_set(Evas_Object* o, const char* contents, size_t contents_size, char* mime_type, char* encoding, char* base_uri);
528
529 /**
530  * @brief Scrolls the webpage of view by dx and dy.
531  *
532  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
533  *
534  * @param[in] o The view object to scroll
535  * @param[in] dx The horizontal offset to scroll
536  * @param[in] dy The vertical offset to scroll
537  */
538 EXPORT_API void ewk_view_scroll_by(Evas_Object* o, int dx, int dy);
539
540 /**
541  * @brief Gets the current scroll position of the given view.
542  *
543  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
544  *
545  * @param[in] o The view object to get the current scroll position
546  * @param[in] x The pointer to store the horizontal position, may be @c NULL
547  * @param[in] y The pointer to store the vertical position, may be @c NULL
548  *
549  * @return @c EINA_TRUE on success,\n
550  *         otherwise @c EINA_FALSE
551  */
552 EXPORT_API Eina_Bool ewk_view_scroll_pos_get(Evas_Object* o, int* x, int* y);
553
554 /**
555  * @brief Sets an absolute scroll of the given view.
556  *
557  * @details Both values are from zero to the contents size minus
558  *          the viewport size.
559  *
560  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
561  *
562  * @param[in] o The view object to scroll
563  * @param[in] x The horizontal position to scroll
564  * @param[in] y The vertical position to scroll
565  *
566  * @return @c EINA_TRUE on success,\n
567  *         otherwise @c EINA_FALSE
568  */
569 EXPORT_API Eina_Bool ewk_view_scroll_set(Evas_Object* o, int x, int y);
570
571 /**
572  * Enum values used to specify search options.
573  * @brief  Enumeration that provides the option to find text.
574  * @details It contains enum values used to specify search options.
575  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
576  */
577 enum Ewk_Find_Options {
578     EWK_FIND_OPTIONS_NONE, /**< No search flags, this means a case sensitive, no wrap, forward only search */
579     EWK_FIND_OPTIONS_CASE_INSENSITIVE = 1 << 0, /**< Case insensitive search */
580     EWK_FIND_OPTIONS_AT_WORD_STARTS = 1 << 1, /**< Search text only at the beginning of the words */
581     EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START = 1 << 2, /**< Treat capital letters in the middle of words as word start */
582     EWK_FIND_OPTIONS_BACKWARDS = 1 << 3, /**< Search backwards */
583     EWK_FIND_OPTIONS_WRAP_AROUND = 1 << 4, /**< If not present the search stops at the end of the document */
584     EWK_FIND_OPTIONS_SHOW_OVERLAY = 1 << 5, /**< Show overlay */
585     EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR = 1 << 6, /**< Show indicator */
586     EWK_FIND_OPTIONS_SHOW_HIGHLIGHT = 1 << 7 /**< Show highlight */
587 };
588
589 /**
590  * @brief Enumeration that creates a type name for the #Ewk_Find_Options.
591  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
592  */
593 typedef enum Ewk_Find_Options Ewk_Find_Options;
594
595 /**
596  * @brief Searches and highlights the given string in the document.
597  *
598  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
599  *
600  * @param[in] o The view object to find text
601  * @param[in] text The text to find
602  * @param[in] options The options to find
603  * @param[in] max_match_count The maximum match count to find, unlimited if @c 0
604  *
605  * @return @c EINA_TRUE on success,\n
606  *         otherwise EINA_FALSE on errors
607  */
608 EXPORT_API Eina_Bool ewk_view_text_find(Evas_Object* o, const char* text, Ewk_Find_Options options, unsigned max_match_count);
609
610 /**
611  * @brief Loads the specified @a html string as the content of the view.
612  *
613  * @details External objects such as stylesheets or images referenced
614  *          in the HTML\n document are located relative to @a baseUrl.\n
615  *
616  * @remarks There is an alternative API ewk_view_html_string_override_current_entry_load()
617  *          which is able to override current entry which prevents from backing back to
618  *          malicious page.
619  *
620  * If an @a unreachableUrl is passed it is used as the url for the loaded
621  * content.\n This is typically used to display error pages for a failed load.
622  *
623  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 2.3.1 @endif
624  *
625  * @param[in] o view object to load the HTML into
626  * @param[in] html HTML data to load
627  * @param[in] base_url Base URL used for relative paths to external objects
628  *            (optional)
629  * @param[in] unreachable_url URL that could not be reached (optional)
630  *
631  * @return @c EINA_TRUE if it the HTML was successfully loaded,
632  *         @c EINA_FALSE otherwise
633  */
634 EXPORT_API Eina_Bool ewk_view_html_string_load(Evas_Object* o, const char* html, const char* base_url, const char* unreachable_url);
635
636 /**
637  * @brief A ScriptMessage contains information that sent from JavaScript running in a webpage.
638  *
639  * @since_tizen 3.0
640  */
641 struct _Ewk_Script_Message {
642   const char* name; /**< The name used to expose the object in JavaScript*/
643   void* body; /**< Message body */
644 };
645
646 /**
647  * @brief A struct that creates a type name for the #Ewk_Script_Message.
648  * @since_tizen 3.0
649  */
650 typedef struct _Ewk_Script_Message Ewk_Script_Message;
651
652 /**
653  * @brief Callback for ewk_view_javascript_message_handler_add().
654  *
655  * @since_tizen 3.0
656  *
657  * @param[in] o The view object
658  * @param[in] message The ScriptMessage returned by the script. \n
659  *    It will be passed when ewk_view_javascript_message_handler_add() is called.
660  */
661 typedef void (*Ewk_View_Script_Message_Cb)(Evas_Object* o, Ewk_Script_Message message);
662
663 /**
664  * @brief Injects the supplied javascript message handler into webview.
665  *
666  * @since_tizen 3.0
667  *
668  * @remarks Note that injected objects will not appear in JavaScript
669  *          until the page is next (re)loaded.
670  *
671  *          Certainly, specify privileges of using native API to users,
672  *          if using native API affects system settings, stability or security.
673  *          Privilege display name & description which will be noticed to user.
674  *
675  * @param[in] o The view object
676  * @param[in] callback The result callback
677  * @param[in] name The name used to expose the object in JavaScript
678  *
679  * @return @c EINA_TRUE on success,\n
680  *         otherwise @c EINA_FALSE
681  */
682 EXPORT_API Eina_Bool ewk_view_javascript_message_handler_add(Evas_Object* o, Ewk_View_Script_Message_Cb callback, const char * name);
683
684 /**
685  * @brief Requests the execution of given name & result to the JavaScript runtime.
686  *
687  * @since_tizen 3.0
688  *
689  * @param[in] o The view object
690  * @param[in] name The name used to expose the object in JavaScript
691  * @param[in] result The result to the JavaScript runtime
692  *
693  * @return @c EINA_TRUE on success,\n
694  *         otherwise @c EINA_FALSE
695  */
696 EXPORT_API Eina_Bool ewk_view_evaluate_javascript(Evas_Object* o, const char* name, const char* result);
697
698 /**
699  * @brief Requests to set or unset a web view as the currently focused one.
700  *
701  * @since_tizen 3.0
702  *
703  * @param[in] o The view object.
704  * @param[in] focused @c EINA_TRUE to set the focus on the web view,
705  *            @c EINA_FALSE to remove the focus from the web view.
706  *
707  * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
708  */
709 EXPORT_API Eina_Bool ewk_view_focus_set(const Evas_Object* o, Eina_Bool focused);
710
711 /**
712  * @brief Checks whether a web view has the focus.
713  *
714  * @since_tizen 3.0
715  *
716  * @param[in] o The view object.
717  *
718  * @return @c EINA_TRUE if the web view has the focus, otherwise @c EINA_FALSE
719  */
720 EXPORT_API Eina_Bool ewk_view_focus_get(const Evas_Object* o);
721
722 /**
723  * @brief Callback invoked when requested manifest inform is responded.
724  *
725  * @since_tizen 3.0
726  *
727  * @param[in] o View object for which callback was set
728  * @param[in] manifest Received manifest object of current's page
729  *            This object is valid after callback data is received.
730  *            If the manifest file is empty, it is returned NULL.
731  * @param[in] user_data User data passed to
732  *            ewk_view_request_manifest
733  *
734  * @see ewk_view_request_manifest
735  */
736 typedef void (*Ewk_View_Request_Manifest_Callback)(Evas_Object* o, Ewk_View_Request_Manifest* manifest, void* user_data);
737
738 /**
739  * @brief Requests the manifest data of current's page.
740  *
741  * @since_tizen 3.0
742  *
743  * @param[in] o view object to request the manifest information
744  * @param[in] callback Ewk_View_Request_Manifest_Callback function to request manifest information
745  * @param[in] user_data user data
746  *
747  * @see Ewk_View_Request_Manifest_Callback
748  */
749 EXPORT_API void ewk_view_request_manifest(Evas_Object* o, Ewk_View_Request_Manifest_Callback callback, void* user_data);
750
751 /**
752 * @}
753 */
754
755 #ifdef __cplusplus
756 }
757 #endif
758 #endif // ewk_view_h