Missing ewk API tests
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_view.h
1 /*
2    Copyright (C) 2011 Samsung Electronics
3    Copyright (C) 2012 Intel Corporation. All rights reserved.
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Library General Public
7     License as published by the Free Software Foundation; either
8     version 2 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     Library General Public License for more details.
14
15     You should have received a copy of the GNU Library General Public License
16     along with this library; see the file COPYING.LIB.  If not, write to
17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18     Boston, MA 02110-1301, USA.
19 */
20
21 /**
22  * @file    ewk_view.h
23  * @brief   WebKit main smart object.
24  *
25  * This object provides view related APIs of WebKit2 to EFL object.
26  *
27  * The following signals (see evas_object_smart_callback_add()) are emitted:
28  *
29  * - "back,forward,list,changed", void: reports that the view's back / forward list had changed.
30  * - "close,window", void: window is closed.
31  * - "create,window", Evas_Object**: a new window is created.
32  * - "download,cancelled", Ewk_Download_Job*: reports that a download was effectively cancelled.
33  * - "download,failed", Ewk_Download_Job_Error*: reports that a download failed with the given error.
34  * - "download,finished", Ewk_Download_Job*: reports that a download completed successfully.
35  * - "download,request", Ewk_Download_Job*: reports that a new download has been requested. The client should set the
36  *   destination path by calling ewk_download_job_destination_set() or the download will fail.
37  * - "form,submission,request", Ewk_Form_Submission_Request*: Reports that a form request is about to be submitted.
38  *   The Ewk_Form_Submission_Request passed contains information about the text fields of the form. This
39  *   is typically used to store login information that can be used later to pre-fill the form.
40  *   The form will not be submitted until ewk_form_submission_request_submit() is called.
41  *   It is possible to handle the form submission request asynchronously, by simply calling
42  *   ewk_form_submission_request_ref() on the request and calling ewk_form_submission_request_submit()
43  *   when done to continue with the form submission. If the last reference is removed on a
44  *   #Ewk_Form_Submission_Request and the form has not been submitted yet,
45  *   ewk_form_submission_request_submit() will be called automatically.
46  * - "icon,changed", void: reports that the view's favicon has changed.
47  * - "intent,request,new", Ewk_Intent*: reports new Web intent request.
48  * - "intent,service,register", Ewk_Intent_Service*: reports new Web intent service registration.
49  * - "load,error", const Ewk_Error*: reports main frame load failed.
50  * - "load,finished", void: reports load finished.
51  * - "load,progress", double*: load progress has changed (value from 0.0 to 1.0).
52  * - "load,provisional,failed", const Ewk_Error*: view provisional load failed.
53  * - "load,provisional,redirect", void: view received redirect for provisional load.
54  * - "load,provisional,started", void: view started provisional load.
55  * - "pageSave,success", void: page save operation was success.
56  * - "pageSave,error", void: page save operation has failed.
57  * - "policy,decision,navigation", Ewk_Navigation_Policy_Decision*: a navigation policy decision should be taken.
58  *   To make a policy decision asynchronously, simply increment the reference count of the
59  *   #Ewk_Navigation_Policy_Decision object using ewk_navigation_policy_decision_ref().
60  * - "policy,decision,new,window", Ewk_Navigation_Policy_Decision*: a new window policy decision should be taken.
61  *   To make a policy decision asynchronously, simply increment the reference count of the
62  *   #Ewk_Navigation_Policy_Decision object using ewk_navigation_policy_decision_ref().
63  * - "resource,request,failed", const Ewk_Resource_Load_Error*: a resource failed loading.
64  * - "resource,request,finished", const Ewk_Resource*: a resource finished loading.
65  * - "resource,request,new", const Ewk_Resource_Request*: a resource request was initiated.
66  * - "resource,request,response", Ewk_Resource_Load_Response*: a response to a resource request was received.
67  * - "resource,request,sent", const Ewk_Resource_Request*: a resource request was sent.
68  * - "text,found", unsigned int*: the requested text was found and it gives the number of matches.
69  * - "title,changed", const char*: title of the main frame was changed.
70  * - "tooltip,text,set", const char*: tooltip was set.
71  * - "tooltip,text,unset", void: tooltip was unset.
72  * - "url,changed", const char*: url of the main frame was changed.
73  * - "webprocess,crashed", Eina_Bool*: expects a @c EINA_TRUE if web process crash is handled; @c EINA_FALSE, otherwise.
74  *
75  *
76  * Tizen specific signals
77  * - "magnifier,show", void: magifier of text selection was showed.
78  * - "magnifier,hide", void: magifier of text selection was hidden.
79  */
80
81 #ifndef ewk_view_h
82 #define ewk_view_h
83
84 #include "ewk_back_forward_list.h"
85 #include "ewk_context.h"
86 #include "ewk_download_job.h"
87 #include "ewk_error.h"
88 #include "ewk_intent.h"
89 #include "ewk_resource.h"
90 #include "ewk_settings.h"
91 #include "ewk_touch.h"
92 #include "ewk_url_request.h"
93 #include "ewk_url_response.h"
94 #include <Evas.h>
95
96 // #if OS(TIZEN)
97 #include "ewk_frame.h"
98 // #endif
99
100 #include "ewk_history.h"
101
102 //#if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
103 #include "ewk_hit_test.h"
104 //#endif
105
106 //#if ENABLE(TIZEN_WEBKIT2_POPUP_INTERNAL)
107 #include "ewk_enums.h"
108 //#endif
109
110 // #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
111 #include "ewk_web_application_icon_data.h"
112 // #endif
113
114 #ifdef __cplusplus
115 extern "C" {
116 #endif
117
118 /// Enum values containing text directionality values.
119 typedef enum {
120     EWK_TEXT_DIRECTION_RIGHT_TO_LEFT,
121     EWK_TEXT_DIRECTION_LEFT_TO_RIGHT
122 } Ewk_Text_Direction;
123
124 typedef struct Ewk_View_Smart_Data Ewk_View_Smart_Data;
125 typedef struct Ewk_View_Smart_Class Ewk_View_Smart_Class;
126
127 // #if OS(TIZEN)
128 /// Creates a type name for _Ewk_Event_Gesture.
129 typedef struct Ewk_Event_Gesture Ewk_Event_Gesture;
130
131 /// Represents a gesture event.
132 struct Ewk_Event_Gesture {
133     Ewk_Gesture_Type type; /**< type of the gesture event */
134     Evas_Coord_Point position; /**< position of the gesture event */
135     Evas_Point velocity; /**< velocity of the gesture event. The unit is pixel per second. */
136     double scale; /**< scale of the gesture event */
137     int count; /**< count of the gesture */
138     unsigned int timestamp; /**< timestamp of the gesture */
139 };
140
141 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
142 /**
143  * \enum    Ewk_Input_Type
144  * @brief   Provides type of focused input element
145  */
146 enum Ewk_Input_Type {
147     EWK_INPUT_TYPE_TEXT,
148     EWK_INPUT_TYPE_TELEPHONE,
149     EWK_INPUT_TYPE_NUMBER,
150     EWK_INPUT_TYPE_EMAIL,
151     EWK_INPUT_TYPE_URL,
152     EWK_INPUT_TYPE_PASSWORD,
153     EWK_INPUT_TYPE_COLOR,
154     EWK_INPUT_TYPE_DATE,
155     EWK_INPUT_TYPE_DATETIME,
156     EWK_INPUT_TYPE_DATETIMELOCAL,
157     EWK_INPUT_TYPE_MONTH,
158     EWK_INPUT_TYPE_TIME,
159     EWK_INPUT_TYPE_WEEK
160 };
161 typedef enum Ewk_Input_Type Ewk_Input_Type;
162 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
163 // #endif // #if OS(TIZEN)
164
165 /// Ewk view's class, to be overridden by sub-classes.
166 struct Ewk_View_Smart_Class {
167     Evas_Smart_Class sc; /**< all but 'data' is free to be changed. */
168     unsigned long version;
169
170     Eina_Bool (*popup_menu_show)(Ewk_View_Smart_Data *sd, Eina_Rectangle rect, Ewk_Text_Direction text_direction, double page_scale_factor, Eina_List* items, int selected_index);
171 //#if ENABLE(TIZEN_MULTIPLE_SELECT)
172     Eina_Bool (*multiple_popup_menu_show)(Ewk_View_Smart_Data *sd, Eina_Rectangle rect,Ewk_Text_Direction text_direction, double page_scale_factor, Eina_List* items);
173 //#endif
174     Eina_Bool (*popup_menu_hide)(Ewk_View_Smart_Data *sd);
175     Eina_Bool (*popup_menu_update)(Ewk_View_Smart_Data *sd, Eina_Rectangle rect, Ewk_Text_Direction text_direction, Eina_List* items, int selected_index);
176
177 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
178     Eina_Bool (*text_selection_down)(Ewk_View_Smart_Data *sd, int x, int y);
179     Eina_Bool (*text_selection_move)(Ewk_View_Smart_Data *sd, int x, int y);
180     Eina_Bool (*text_selection_up)(Ewk_View_Smart_Data *sd, int x, int y);
181 // #endif
182
183 //#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
184     Eina_Bool (*input_picker_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, const char* inputValue);
185 //#endif
186
187 //#if ENABLE(TIZEN_DATALIST_ELEMENT)
188     Eina_Bool (*data_list_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, Eina_List *optionList);
189     Eina_Bool (*data_list_hide)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType);
190 // #endif
191
192 // #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
193     Eina_Bool (*orientation_lock)(Ewk_View_Smart_Data *sd, int orientations);
194     void (*orientation_unlock)(Ewk_View_Smart_Data *sd);
195 // #endif
196
197     // event handling:
198     //  - returns true if handled
199     //  - if overridden, have to call parent method if desired
200     Eina_Bool (*focus_in)(Ewk_View_Smart_Data *sd);
201     Eina_Bool (*focus_out)(Ewk_View_Smart_Data *sd);
202     Eina_Bool (*fullscreen_enter)(Ewk_View_Smart_Data *sd);
203     Eina_Bool (*fullscreen_exit)(Ewk_View_Smart_Data *sd);
204     Eina_Bool (*mouse_wheel)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Wheel *ev);
205     Eina_Bool (*mouse_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Down *ev);
206     Eina_Bool (*mouse_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Up *ev);
207     Eina_Bool (*mouse_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Move *ev);
208     Eina_Bool (*key_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Down *ev);
209     Eina_Bool (*key_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Up *ev);
210
211     // javascript popup:
212     //   - All strings should be guaranteed to be stringshared.
213     void (*run_javascript_alert)(Ewk_View_Smart_Data *sd, const char *message);
214     Eina_Bool (*run_javascript_confirm)(Ewk_View_Smart_Data *sd, const char *message);
215     const char *(*run_javascript_prompt)(Ewk_View_Smart_Data *sd, const char *message, const char *default_value); /**< return string should be stringshared. */
216
217     // color picker:
218     //   - Shows and hides color picker.
219     Eina_Bool (*input_picker_color_request)(Ewk_View_Smart_Data *sd, int r, int g, int b, int a);
220     Eina_Bool (*input_picker_color_dismiss)(Ewk_View_Smart_Data *sd);
221
222     // storage:
223     //   - Web database.
224     unsigned long long (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, const char *databaseName, const char *displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage);
225
226 // #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
227     Eina_Bool (*formdata_candidate_show)(Ewk_View_Smart_Data *sd, int x, int y, int w, int h);
228     Eina_Bool (*formdata_candidate_hide)(Ewk_View_Smart_Data *sd);
229     Eina_Bool (*formdata_candidate_update_data)(Ewk_View_Smart_Data *sd, Eina_List *dataList);
230     Eina_Bool (*formdata_candidate_is_showing)(Ewk_View_Smart_Data *sd);
231 // #endif
232
233 //#if OS(TIZEN)
234     Eina_Bool (*gesture_start)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
235     Eina_Bool (*gesture_end)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
236     Eina_Bool (*gesture_move)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
237 //#endif
238
239 //#if ENABLE(TIZEN_SCREEN_READER)
240     Eina_Bool (*screen_reader_action_execute)(Ewk_View_Smart_Data *sd, void *elmAccessActionInfo);
241 //#endif
242 };
243
244 // #if OS(TIZEN)
245 /**
246  * Callback for ewk_view_web_app_capable_get
247  *
248  * @param capable web application capable
249  * @param user_data user_data will be passsed when ewk_view_web_app_capable_get is called
250  */
251 typedef void (*Ewk_Web_App_Capable_Get_Callback)(Eina_Bool capable, void* user_data);
252
253 /**
254  * Callback for ewk_view_web_app_icon_get
255  *
256  * @param icon_url web application icon
257  * @param user_data user_data will be passsed when ewk_view_web_app_icon_get is called
258  */
259 typedef void (*Ewk_Web_App_Icon_URL_Get_Callback)(const char* icon_url, void* user_data);
260
261 /**
262  * Callback for ewk_view_web_app_icon_urls_get.
263  *
264  * @param icon_urls list of Ewk_Web_App_Icon_Data for web app
265  * @param user_data user_data will be passsed when ewk_view_web_app_icon_urls_get is called
266  */
267 typedef void (*Ewk_Web_App_Icon_URLs_Get_Callback)(Eina_List *icon_urls, void *user_data);
268 // #endif
269
270 /**
271  * The version you have to put into the version field
272  * in the @a Ewk_View_Smart_Class structure.
273  */
274 #define EWK_VIEW_SMART_CLASS_VERSION 6UL
275
276 /**
277  * Initializer for whole Ewk_View_Smart_Class structure.
278  *
279  * @param smart_class_init initializer to use for the "base" field
280  * (Evas_Smart_Class).
281  *
282  * @see EWK_VIEW_SMART_CLASS_INIT_NULL
283  * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
284  * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
285  */
286 #define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
287
288 /**
289  * Initializer to zero a whole Ewk_View_Smart_Class structure.
290  *
291  * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
292  * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
293  * @see EWK_VIEW_SMART_CLASS_INIT
294  */
295 #define EWK_VIEW_SMART_CLASS_INIT_NULL EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
296
297 /**
298  * Initializer to zero a whole Ewk_View_Smart_Class structure and set
299  * name and version.
300  *
301  * Similar to EWK_VIEW_SMART_CLASS_INIT_NULL, but will set version field of
302  * Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION and name
303  * to the specific value.
304  *
305  * It will keep a reference to name field as a "const char *", that is,
306  * name must be available while the structure is used (hint: static or global!)
307  * and will not be modified.
308  *
309  * @see EWK_VIEW_SMART_CLASS_INIT_NULL
310  * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
311  * @see EWK_VIEW_SMART_CLASS_INIT
312  */
313 #define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
314
315 typedef struct EwkViewImpl EwkViewImpl;
316 /**
317  * @brief Contains an internal View data.
318  *
319  * It is to be considered private by users, but may be extended or
320  * changed by sub-classes (that's why it's in public header file).
321  */
322 struct Ewk_View_Smart_Data {
323     Evas_Object_Smart_Clipped_Data base;
324     const Ewk_View_Smart_Class* api; /**< reference to casted class instance */
325     Evas_Object* self; /**< reference to owner object */
326     Evas_Object* image; /**< reference to evas_object_image for drawing web contents */
327     EwkViewImpl* priv; /**< should never be accessed, c++ stuff */
328     struct {
329         Evas_Coord x, y, w, h; /**< last used viewport */
330     } view;
331     struct { /**< what changed since last smart_calculate */
332         Eina_Bool any:1;
333         Eina_Bool size:1;
334         Eina_Bool position:1;
335     } changed;
336 };
337
338 /// Creates a type name for Ewk_Resource_Request.
339 typedef struct Ewk_Resource_Request Ewk_Resource_Request;
340
341 /**
342  * @brief Structure containing details about a resource request.
343  */
344 struct Ewk_Resource_Request {
345     Ewk_Resource *resource; /**< resource being requested */
346     Ewk_Url_Request *request; /**< URL request for the resource */
347     Ewk_Url_Response *redirect_response; /**< Possible redirect response for the resource or @c NULL */
348 };
349
350 /// Creates a type name for Ewk_Resource_Load_Response.
351 typedef struct Ewk_Resource_Load_Response Ewk_Resource_Load_Response;
352
353 /**
354  * @brief Structure containing details about a response to a resource request.
355  */
356 struct Ewk_Resource_Load_Response {
357     Ewk_Resource *resource; /**< resource requested */
358     Ewk_Url_Response *response; /**< resource load response */
359 };
360
361 /// Creates a type name for Ewk_Resource_Load_Error.
362 typedef struct Ewk_Resource_Load_Error Ewk_Resource_Load_Error;
363
364 /**
365  * @brief Structure containing details about a resource load error.
366  *
367  * Details given about a resource load failure.
368  */
369 struct Ewk_Resource_Load_Error {
370     Ewk_Resource *resource; /**< resource that failed loading */
371     Ewk_Error *error; /**< load error */
372 };
373
374 /// Creates a type name for Ewk_Download_Job_Error.
375 typedef struct Ewk_Download_Job_Error Ewk_Download_Job_Error;
376
377 /**
378  * @brief Structure containing details about a download failure.
379  */
380 struct Ewk_Download_Job_Error {
381     Ewk_Download_Job *download_job; /**< download that failed */
382     Ewk_Error *error; /**< download error */
383 };
384
385 /// Enum values containing page contents type values.
386 typedef enum {
387     EWK_PAGE_CONTENTS_TYPE_MHTML,
388     EWK_PAGE_CONTENTS_TYPE_STRING
389 } Ewk_Page_Contents_Type;
390
391 /**
392  * Creates a type name for the callback function used to get the page contents.
393  *
394  * @param type type of the contents
395  * @param data string buffer of the contents
396  */
397 typedef void (*Ewk_Page_Contents_Cb)(Ewk_Page_Contents_Type type, const char *data);
398
399 /// Creates a type name for Ewk_Page_Contents_Context.
400 typedef struct Ewk_Page_Contents_Context Ewk_Page_Contents_Context;
401
402 /*
403  * @brief Structure containing page contents context used for ewk_view_page_contents_get() API.
404  */
405 struct Ewk_Page_Contents_Context {
406     Ewk_Page_Contents_Type type;
407     Ewk_Page_Contents_Cb callback;
408 };
409
410 /**
411  * Sets the smart class APIs, enabling view to be inherited.
412  *
413  * @param api class definition to set, all members with the
414  *        exception of @a Evas_Smart_Class->data may be overridden, must
415  *        @b not be @c NULL
416  *
417  * @note @a Evas_Smart_Class->data is used to implement type checking and
418  *       is not supposed to be changed/overridden. If you need extra
419  *       data for your smart class to work, just extend
420  *       Ewk_View_Smart_Class instead.
421  *       The Evas_Object which inherits the ewk_view should use
422  *       ewk_view_smart_add() to create Evas_Object instead of
423  *       evas_object_smart_add() because it performs additional initialization
424  *       for the ewk_view.
425  *
426  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
427  *         version mismatch)
428  *
429  * @see ewk_view_smart_add()
430  */
431 EAPI Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class *api);
432
433 /**
434  * Creates a new EFL WebKit view object with Evas_Smart and Ewk_Context.
435  *
436  * @note The Evas_Object which inherits the ewk_view should create its
437  *       Evas_Object using this API instead of evas_object_smart_add()
438  *       because the default initialization for ewk_view is done in this API.
439  *
440  * @param e canvas object where to create the view object
441  * @param smart Evas_Smart object. Its type should be EWK_VIEW_TYPE_STR
442  * @param context Ewk_Context object which is used for initializing
443  *
444  * @return view object on success or @c NULL on failure
445  */
446 EAPI Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context);
447
448 /**
449  * Enum values used to specify search options.
450  * @brief   Provides option to find text
451  * @info    Keep this in sync with WKFindOptions.h
452  */
453 enum Ewk_Find_Options {
454     EWK_FIND_OPTIONS_NONE, /**< no search flags, this means a case sensitive, no wrap, forward only search. */
455     EWK_FIND_OPTIONS_CASE_INSENSITIVE = 1 << 0, /**< case insensitive search. */
456     EWK_FIND_OPTIONS_AT_WORD_STARTS = 1 << 1, /**< search text only at the beginning of the words. */
457     EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START = 1 << 2, /**< treat capital letters in the middle of words as word start. */
458     EWK_FIND_OPTIONS_BACKWARDS = 1 << 3, /**< search backwards. */
459     EWK_FIND_OPTIONS_WRAP_AROUND = 1 << 4, /**< if not present search will stop at the end of the document. */
460     EWK_FIND_OPTIONS_SHOW_OVERLAY = 1 << 5, /**< show overlay */
461     EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR = 1 << 6, /**< show indicator */
462     EWK_FIND_OPTIONS_SHOW_HIGHLIGHT = 1 << 7 /**< show highlight */
463 };
464 typedef enum Ewk_Find_Options Ewk_Find_Options;
465
466 /**
467  * Creates a new EFL WebKit view object.
468  *
469  * @param e canvas object where to create the view object
470  *
471  * @return view object on success or @c NULL on failure
472  */
473 EAPI Evas_Object *ewk_view_add(Evas *e);
474
475 /**
476  * Creates a new EFL WebKit view object based on specific Ewk_Context.
477  *
478  * @param e canvas object where to create the view object
479  * @param context Ewk_Context object to declare process model
480  *
481  * @return view object on success or @c NULL on failure
482  */
483 EAPI Evas_Object *ewk_view_add_with_context(Evas *e, Ewk_Context *context);
484
485 /**
486  * Gets the Ewk_Context of this view.
487  *
488  * @param o the view object to get the Ewk_Context
489  *
490  * @return the Ewk_Context of this view or @c NULL on failure
491  */
492 EAPI Ewk_Context *ewk_view_context_get(const Evas_Object *o);
493
494 /**
495  * Asks the object to load the given URL.
496  *
497  * @param o view object to load @a URL
498  * @param url uniform resource identifier to load
499  *
500  * @return @c EINA_TRUE is returned if @a o is valid, irrespective of load,
501  *         or @c EINA_FALSE on failure
502  */
503 EAPI Eina_Bool ewk_view_url_set(Evas_Object *o, const char *url);
504
505 /**
506  * Returns the current URL string of view object.
507  *
508  * It returns an internal string and should not
509  * be modified. The string is guaranteed to be stringshared.
510  *
511  * @param o view object to get current URL
512  *
513  * @return current URL on success or @c NULL on failure
514  */
515 EAPI const char *ewk_view_url_get(const Evas_Object *o);
516
517 /**
518  * Returns the current icon URL of view object.
519  *
520  * It returns an internal string and should not
521  * be modified. The string is guaranteed to be stringshared.
522  *
523  * @param o view object to get current icon URL
524  *
525  * @return current icon URL on success or @c NULL if unavailable or on failure
526  */
527 EAPI const char *ewk_view_icon_url_get(const Evas_Object *o);
528
529 /**
530  * Asks the main frame to reload the current document.
531  *
532  * @param o view object to reload current document
533  *
534  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
535  *
536  * @see ewk_view_reload_bypass_cache()
537  */
538 EAPI Eina_Bool    ewk_view_reload(Evas_Object *o);
539
540 /**
541  * Reloads the current page's document without cache.
542  *
543  * @param o view object to reload current document
544  *
545  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
546  */
547 EAPI Eina_Bool ewk_view_reload_bypass_cache(Evas_Object *o);
548
549 /**
550  * Asks the main frame to stop loading.
551  *
552  * @param o view object to stop loading
553  *
554  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
555  */
556 EAPI Eina_Bool ewk_view_stop(Evas_Object* o);
557
558 /**
559  * Gets the Ewk_Settings of this view.
560  *
561  * @param o view object to get Ewk_Settings
562  *
563  * @return the Ewk_Settings of this view or @c NULL on failure
564  */
565 EAPI Ewk_Settings *ewk_view_settings_get(const Evas_Object *o);
566
567 // #if OS(TIZEN)
568
569 enum Ewk_Page_Visibility_State {
570     EWK_PAGE_VISIBILITY_STATE_VISIBLE,
571     EWK_PAGE_VISIBILITY_STATE_HIDDEN,
572     EWK_PAGE_VISIBILITY_STATE_PRERENDER
573 };
574 typedef enum Ewk_Page_Visibility_State Ewk_Page_Visibility_State;
575
576 enum Ewk_Http_Method {
577     EWK_HTTP_METHOD_GET,
578     EWK_HTTP_METHOD_HEAD,
579     EWK_HTTP_METHOD_POST,
580     EWK_HTTP_METHOD_PUT,
581     EWK_HTTP_METHOD_DELETE,
582 };
583 typedef enum Ewk_Http_Method Ewk_Http_Method;
584
585 /**
586  * Callback for ewk_view_script_execute
587  *
588  * @param o the view object
589  * @param result_value value returned by script
590  * @param user_data user data
591  */
592 typedef void (*Ewk_View_Script_Execute_Callback)(Evas_Object* o, const char* result_value, void* user_data);
593
594 /**
595  * Callback for ewk_view_plain_text_get
596  *
597  * @param o the view object
598  * @param plain_text the contents of the given frame converted to plain text
599  * @param user_data user data
600  */
601 typedef void (*Ewk_View_Plain_Text_Get_Callback)(Evas_Object* o, const char* plain_text, void* user_data);
602
603 // #if ENABLE(TIZEN_SUPPORT_MHTML)
604 /**
605  * Creates a type name for the callback function used to get the page contents.
606  *
607  * @param o view object
608  * @param data mhtml data of the page contents
609  * @param user_data user data will be passed when ewk_view_mhtml_data_get is called
610  */
611 typedef void (*Ewk_View_MHTML_Data_Get_Callback)(Evas_Object *o, const char *data, void *user_data);
612 // #endif // ENABLE(TIZEN_SUPPORT_MHTML)
613
614 /**
615  * Gets the Ewk_Context of this view.
616  *
617  * @param o the view object to get the WKPageRef
618  *
619  * @return the Ewk_Context of this view
620  */
621 EAPI Ewk_Context* ewk_view_context_get(const Evas_Object* o);
622
623 /**
624  * Gets the reference object for frame that represents the main frame.
625  *
626  * @param o view object to get main frame
627  *
628  * @return frame reference of frame object on success, or NULL on failure
629  */
630 EAPI Ewk_Frame_Ref ewk_view_main_frame_get(Evas_Object* o);
631
632 /**
633  * Gets the reference obect for the currently focused frame.
634  *
635  * @param o view object to get main frame
636  *
637  * @return frame reference of frame object on success, or NULL on failure
638  */
639 EAPI Ewk_Frame_Ref ewk_view_focused_frame_get(Evas_Object* o);
640
641 EAPI Eina_Bool ewk_view_horizontal_panning_hold_get(Evas_Object* o);
642 EAPI void ewk_view_horizontal_panning_hold_set(Evas_Object* o, Eina_Bool hold);
643 EAPI Eina_Bool ewk_view_vertical_panning_hold_get(Evas_Object* o);
644 EAPI void ewk_view_vertical_panning_hold_set(Evas_Object* o, Eina_Bool hold);
645
646 /**
647  * Gets the minimum and maximum value of the scale range or -1 on failure
648  *
649  * @param o view object to get the minimum and maximum value of the scale range
650  * @param min_scale Pointer to an double in which to store the minimum scale factor of the object.
651  * @param max_scale Pointer to an double in which to store the maximum scale factor of the object.
652  *
653  * @note Use @c NULL pointers on the scale components you're not
654  * interested in: they'll be ignored by the function.
655  */
656 EAPI void ewk_view_scale_range_get(Evas_Object* o, double* min_scale, double* max_scale);
657
658 /**
659  * Gets the current text zoom level.
660  *
661  * @param o view object to get the zoom level
662  *
663  * @return current zoom level in use on success or @c -1.0 on failure
664  */
665 EAPI double ewk_view_text_zoom_get(const Evas_Object* o);
666
667 /**
668  * Sets the current text zoom level.
669  *
670  * @param o view object to set the zoom level
671  * @param textZoomFactor a new level to set
672  *
673  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
674  */
675 EAPI Eina_Bool ewk_view_text_zoom_set(Evas_Object* o, double text_zoom_factor);
676
677 EAPI void ewk_view_suspend(Evas_Object* o);
678 EAPI void ewk_view_resume(Evas_Object* o);
679
680 typedef Eina_Bool (*Ewk_View_JavaScript_Alert_Callback)(Evas_Object* o, const char* alert_text, void* user_data);
681 EAPI void ewk_view_javascript_alert_callback_set(Evas_Object* o, Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
682 EAPI void ewk_view_javascript_alert_reply(Evas_Object* o);
683
684 typedef Eina_Bool (*Ewk_View_JavaScript_Confirm_Callback)(Evas_Object* o, const char* message, void* user_data);
685 EAPI void ewk_view_javascript_confirm_callback_set(Evas_Object* o, Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
686 EAPI void ewk_view_javascript_confirm_reply(Evas_Object* o, Eina_Bool result);
687
688 typedef Eina_Bool (*Ewk_View_JavaScript_Prompt_Callback)(Evas_Object* o, const char* message, const char* default_value, void* user_data);
689 EAPI void ewk_view_javascript_prompt_callback_set(Evas_Object* o, Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
690 EAPI void ewk_view_javascript_prompt_reply(Evas_Object* o, const char* result);
691
692 //#if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
693 typedef Eina_Bool (*Ewk_View_Before_Unload_Confirm_Panel_Callback)(Evas_Object* o, const char* message, void* user_data);
694 EAPI void ewk_view_before_unload_confirm_panel_callback_set(Evas_Object* o, Ewk_View_Before_Unload_Confirm_Panel_Callback callback, void* user_data);
695 EAPI void ewk_view_before_unload_confirm_panel_reply(Evas_Object* o, Eina_Bool result);
696 //#endif
697
698 typedef Eina_Bool (*Ewk_View_Open_Panel_Callback)(Evas_Object* o, Eina_Bool allow_multiple_files, Eina_List* accepted_mime_types, const char* capture, void* user_data);
699 EAPI void ewk_view_open_panel_callback_set(Evas_Object* o, Ewk_View_Open_Panel_Callback callback, void* user_data);
700 EAPI void ewk_view_open_panel_reply(Evas_Object* o, Eina_List* file_url, Eina_Bool result);
701
702 //#if ENABLE(TIZEN_APPLICATION_CACHE)
703 typedef Eina_Bool (*Ewk_View_Applicacion_Cache_Permission_Callback)(Evas_Object* o, Ewk_Security_Origin* origin,  void* user_data);
704 EAPI void ewk_view_application_cache_permission_callback_set(Evas_Object* o, Ewk_View_Applicacion_Cache_Permission_Callback callback, void* user_data);
705 EAPI void ewk_view_application_cache_permission_reply(Evas_Object* o, Eina_Bool allow);
706 //#endif
707
708 //#if ENABLE(TIZEN_INDEXED_DATABASE)
709 typedef Eina_Bool (*Ewk_View_Exceeded_Indexed_Database_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin,  long long currentQuota, void* user_data);
710 EAPI void ewk_view_exceeded_indexed_database_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback, void* user_data);
711 EAPI void ewk_view_exceeded_indexed_database_quota_reply(Evas_Object* o, Eina_Bool allow);
712 //#endif
713
714 // #if ENABLE(TIZEN_SQL_DATABASE)
715 typedef Eina_Bool (*Ewk_View_Exceeded_Database_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, const char* database_name, unsigned long long expectedQuota, void* user_data);
716 EAPI void ewk_view_exceeded_database_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Database_Quota_Callback callback, void* user_data);
717 EAPI void ewk_view_exceeded_database_quota_reply(Evas_Object* o, Eina_Bool allow);
718 // #endif
719
720 //#if ENABLE(TIZEN_FILE_SYSTEM)
721 typedef Eina_Bool (*Ewk_View_Exceeded_Local_File_System_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin,  long long currentQuota, void* user_data);
722 EAPI void ewk_view_exceeded_local_file_system_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Local_File_System_Quota_Callback callback, void* user_data);
723 EAPI void ewk_view_exceeded_local_file_system_quota_reply(Evas_Object* o, Eina_Bool allow);
724 //#endif
725
726 /**
727  * Gets the Ewk_Settings of this view.
728  *
729  * @param o view object to get Ewk_Settings
730  *
731  * @return the Ewk_Settings of this view or @c NULL on failure
732  */
733 EAPI Ewk_Settings *ewk_view_settings_get(const Evas_Object *o);
734
735 /**
736  * Delivers a Web intent to the view's main frame.
737  *
738  * @param o view object to deliver the intent to
739  *
740  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
741  */
742 EAPI Eina_Bool    ewk_view_intent_deliver(Evas_Object *o, Ewk_Intent *intent);
743
744 /**
745  * Asks the main frame to navigate back in the history.
746  *
747  * @param o view object to navigate back
748  *
749  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
750  *
751  * @see ewk_frame_back()
752  */
753 EAPI Eina_Bool    ewk_view_back(Evas_Object *o);
754
755 /**
756  * Asks the main frame to navigate forward in the history.
757  *
758  * @param o view object to navigate forward
759  *
760  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
761  *
762  * @see ewk_frame_forward()
763  */
764 EAPI Eina_Bool    ewk_view_forward(Evas_Object *o);
765
766 /**
767  * Queries if it is possible to navigate backwards one item in the history.
768  *
769  * @param o view object to query if backward navigation is possible
770  *
771  * @return @c EINA_TRUE if it is possible to navigate backwards in the history, @c EINA_FALSE otherwise
772  */
773 EAPI Eina_Bool    ewk_view_back_possible(Evas_Object *o);
774
775 /**
776  * Queries if it is possible to navigate forwards one item in the history.
777  *
778  * @param o view object to query if forward navigation is possible
779  *
780  * @return @c EINA_TRUE if it is possible to navigate forwards in the history, @c EINA_FALSE otherwise
781  */
782 EAPI Eina_Bool    ewk_view_forward_possible(Evas_Object *o);
783
784 /**
785  * Gets the back-forward list associated with this view.
786  *
787  * The returned instance is unique for this view and thus multiple calls
788  * to this function with the same view as parameter returns the same
789  * handle. This handle is alive while view is alive, thus one
790  * might want to listen for EVAS_CALLBACK_DEL on given view
791  * (@a o) to know when to stop using returned handle.
792  *
793  * @param o view object to get navigation back-forward list
794  *
795  * @return the back-forward list instance handle associated with this view
796  */
797 EAPI Ewk_Back_Forward_List *ewk_view_back_forward_list_get(const Evas_Object *o);
798
799 /**
800  * Gets the current title of the main frame.
801  *
802  * It returns an internal string and should not
803  * be modified. The string is guaranteed to be stringshared.
804  *
805  * @param o view object to get current title
806  *
807  * @return current title on success or @c NULL on failure
808  */
809 EAPI const char *ewk_view_title_get(const Evas_Object *o);
810
811 /**
812  * Gets the current load progress of page.
813  *
814  * The progress estimation from 0.0 to 1.0.
815  *
816  * @param o view object to get the current progress
817  *
818  * @return the load progress of page, value from 0.0 to 1.0,
819  *         or @c -1.0 on failure
820  */
821 EAPI double ewk_view_load_progress_get(const Evas_Object *o);
822
823 /*
824  * Requests loading of the given request data.
825  *
826  * @param o view object to load
827  * @param url uniform resource identifier to load
828  * @param method http method
829  * @param headers http headers
830  * @param body http body data
831  *
832  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
833  */
834 EAPI Eina_Bool ewk_view_url_request_set(Evas_Object* o, const char* url, Ewk_Http_Method method, Eina_Hash* headers, const char* body);
835
836 /**
837  * Requests the specified plain text string into the view object
838  *
839  * @note The mime type of document will be "text/plain".
840  *
841  * @return the load progress of page, value from 0.0 to 1.0,
842  *         or @c -1.0 on failure
843  */
844 EAPI Eina_Bool ewk_view_plain_text_set(Evas_Object* o, const char* plain_text);
845
846 /**
847  * Requests loading the given contents by mime type into the view object.
848  *
849  * @param o view object to load
850  * @param contents what to load
851  * @param contents_size size of @a contents (in bytes),
852  * @param mime_type type of @a contents data, if @c 0 is given "text/html" is assumed
853  * @param encoding encoding for @a contents data, if @c 0 is given "UTF-8" is assumed
854  * @param base_uri base uri to use for relative resources, may be @c 0,
855  *        if provided @b must be an absolute uri
856  *
857  * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
858  */
859 EAPI Eina_Bool ewk_view_contents_set(Evas_Object* o, const char* contents, size_t contents_size, char* mime_type, char* encoding, char* base_uri);
860
861 /**
862  * Requests loading the given contents.
863  *
864  * @param o view object to load document
865  * @param html what to load
866  * @param base_uri base uri to use for relative resources, may be @c 0,
867  *        if provided @b must be an absolute uri
868  *
869  * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
870  */
871 EAPI Eina_Bool ewk_view_html_contents_set(Evas_Object* o, const char* html, const char* base_uri);
872
873 /**
874  * Requests for setting page visibility state.
875  *
876  * @param o view object to set the page visibility
877  * @param page_visibility_state visible state of the page to set
878  * @param initial_state @c EINA_TRUE if this function is called at page initialization time,
879  *                     @c EINA_FALSE otherwise
880  *
881  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
882  */
883 EAPI Eina_Bool ewk_view_page_visibility_state_set(Evas_Object* o, Ewk_Page_Visibility_State page_visibility_state, Eina_Bool initial_state);
884
885 /**
886 * Request to set the user agent string.
887 *
888 * @param o view object to set the user agent string
889 *
890 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
891 */
892 EAPI Eina_Bool ewk_view_user_agent_set(Evas_Object* o, const char* user_agent);
893
894 /**
895 * Returns user agent string.
896 *
897 * @param o view object to get the user agent string
898 *
899 * @return @c user agent string
900 */
901 EAPI const char* ewk_view_user_agent_get(const Evas_Object* o);
902 //#if ENABLE(TIZEN_CUSTOM_HEADERS)
903 /**
904 * add custom header
905 *
906 * @param o view object to add custom header
907 *
908 * @param name custom header name to add the custom header
909 *
910 * @param value custom header value to add the custom header
911 *
912 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
913 */
914 EAPI Eina_Bool ewk_view_custom_header_add(const Evas_Object* o, const char* name, const char* value);
915 /**
916 * remove custom header
917 *
918 * @param o view object to remove custom header
919 *
920 * @param name custom header name to remove the custom header
921 *
922 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
923 */
924 EAPI Eina_Bool ewk_view_custom_header_remove(const Evas_Object* o, const char* name);
925 /**
926 * clears all custom headers
927 *
928 * @param o view object to clear custom headers
929 *
930 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
931 */
932 EAPI Eina_Bool ewk_view_custom_header_clear(const Evas_Object* o);
933 //#endif
934
935 //#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
936 /**
937  * Request to set the current page's visibility.
938  *
939  * @param o view object to set the visibility.
940  * @param enable EINA_TRUE to set on the visibility of the page, EINA_FALSE otherwise.
941  *
942  * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
943  */
944 EAPI Eina_Bool ewk_view_visibility_set(Evas_Object* o, Eina_Bool enable);
945 //#endif
946
947 //#if ENABLE(TIZEN_BACKGROUND_DISK_CACHE)
948 /**
949  * Notify the foreground/background status of app.
950  *
951  * @param o view object that is in given status.
952  * @param enable EINA_TRUE to notify that page is foreground, EINA_FALSE otherwise.
953  *
954  * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
955  */
956 EAPI Eina_Bool ewk_view_foreground_set(Evas_Object* o, Eina_Bool enable);
957 //#endif
958
959 /**
960  * Returns the evas image object of the specified viewArea of page
961  *
962  * The returned evas image object @b should be freed after use.
963  *
964  * @param o view object to get specified rectangle of cairo surface.
965  * @param viewArea rectangle of cairo surface.
966  * @param scaleFactor scale factor of cairo surface.
967  * @param canvas canvas for creating evas image.
968  *
969  * @return newly allocated evas image object on sucess or @c 0 on failure.
970  */
971 EAPI Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* o, Eina_Rectangle viewArea, float scaleFactor, Evas* canvas);
972
973 // #if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
974 /**
975  * Start a server for inspecting web pages
976  * This server will be used by Remote Web Browser to transfer messages over network
977  *
978  * @param [o] view object to debug
979  * @param [in] port It is a port number for the server. A free port on system will be allocated if port is 0
980  *
981  * @return @c assigned port number on success or @c 0 on failure
982  */
983 EAPI unsigned int ewk_view_inspector_server_start(Evas_Object* o, unsigned int port);
984
985 /**
986  * Stop a server for inspecting web pages
987  *
988  * @param [o] view object to debug
989  *
990  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
991  */
992 EAPI Eina_Bool ewk_view_inspector_server_stop(Evas_Object* o);
993 // #endif
994 //
995 /**
996  * Scrolls webpage of view by dx and dy.
997  *
998  * @param o view object to scroll
999  * @param dx horizontal offset to scroll
1000  * @param dy vertical offset to scroll
1001  */
1002 EAPI void ewk_view_scroll_by(Evas_Object* o, int dx, int dy);
1003
1004 /**
1005  * Gets the current scroll position of given view.
1006  *
1007  * @param o view object to get the current scroll position
1008  * @param x the pointer to store the horizontal position, may be @c 0
1009  * @param y the pointer to store the vertical position, may be @c 0
1010  *
1011  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
1012  *         values are zeroed.
1013  */
1014 EAPI Eina_Bool ewk_view_scroll_pos_get(Evas_Object* o, int* x, int* y);
1015
1016 /**
1017  * Sets an absolute scroll of the given view.
1018  *
1019  * Both values are from zero to the contents size minus the viewport
1020  * size.
1021  *
1022  * @param o view object to scroll
1023  * @param x horizontal position to scroll
1024  * @param y vertical position to scroll
1025  *
1026  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
1027  */
1028 EAPI Eina_Bool ewk_view_scroll_set(Evas_Object* o, int x, int y);
1029
1030 /**
1031  * Gets the possible scroll size of the given view.
1032  *
1033  * Possible scroll size is contents size minus the viewport size.
1034  *
1035  * @param o view object to get scroll size
1036  * @param w the pointer to store the horizontal size that is possible to scroll,
1037  *        may be @c 0
1038  * @param h the pointer to store the vertical size that is possible to scroll,
1039  *        may be @c 0
1040  *
1041  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
1042  *         values are zeroed
1043  */
1044 EAPI Eina_Bool ewk_view_scroll_size_get(const Evas_Object* o, int* w, int* h);
1045
1046 /**
1047  * Requests for getting web application capable.
1048  *
1049  * @param callback result callback to get web database quota
1050  * @param user_data user_data will be passed when result_callback is called
1051  *    -I.e., user data will be kept until callback is called
1052  *
1053  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1054  */
1055 EAPI Eina_Bool ewk_view_web_application_capable_get(Evas_Object* o, Ewk_Web_App_Capable_Get_Callback callback, void* user_data);
1056
1057 /**
1058  * Requests for getting web application icon string.
1059  *
1060  * @param callback result callback to get web database quota
1061  * @param user_data user_data will be passed when result_callback is called
1062  *    -I.e., user data will be kept until callback is called
1063  *
1064  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1065  */
1066 EAPI Eina_Bool ewk_view_web_application_icon_url_get(Evas_Object* o, Ewk_Web_App_Icon_URL_Get_Callback callback, void* user_data);
1067
1068 /**
1069  * Requests for getting web application icon list of Ewk_Web_App_Icon_Data.
1070  *
1071  * @param callback result callback to get web application icon urls
1072  * @param user_data user_data will be passed when result_callback is called
1073  *    -I.e., user data will be kept until callback is called
1074  *
1075  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1076  */
1077 EAPI Eina_Bool ewk_view_web_application_icon_urls_get(Evas_Object *o, Ewk_Web_App_Icon_URLs_Get_Callback callback, void *user_data);
1078
1079 /**
1080  * Executes editor command.
1081  *
1082  * @param o view object to execute command
1083  * @param command editor command to execute
1084  * @param value the value to be passed into command
1085  *
1086  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1087  */
1088 EAPI Eina_Bool ewk_view_command_execute(Evas_Object* o, const char* command, const char* value);
1089
1090 /**
1091  * Gets last known contents size.
1092  *
1093  * @param o view object to get contents size
1094  * @param width pointer to store contents size width, may be @c 0
1095  * @param height pointer to store contents size height, may be @c 0
1096  *
1097  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure and
1098  *         @a width and @a height will be zeroed
1099  */
1100 EAPI Eina_Bool ewk_view_contents_size_get(Evas_Object* o, Evas_Coord* width, Evas_Coord* height);
1101
1102 /**
1103  * Create PDF file of page contents
1104  *
1105  * @param o view object to get page contents.
1106  * @param width the suface width of PDF file.
1107  * @param height the suface height of PDF file.
1108  * @param fileName the file name for creating PDF file.
1109  *
1110  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1111  */
1112 EAPI Eina_Bool ewk_view_contents_pdf_get_temp(Evas_Object* o, int width, int height, const char* fileName);
1113 EAPI Eina_Bool ewk_view_contents_pdf_get(Evas_Object* o, int width, int height, const char* fileName);
1114
1115 // #if ENABLE(TIZEN_WEB_STORAGE)
1116 /**
1117  * Callback for ewk_view_web_storage_quota_get
1118  *
1119  * @param quota web storage quota
1120  * @param user_data user_data will be passed when ewk_view_web_storage_quota_get is called
1121  */
1122 typedef void (*Ewk_Web_Storage_Quota_Get_Callback)(uint32_t quota, void* user_data);
1123
1124 /**
1125  * Requests for getting web storage quota.
1126  *
1127  * @param o view object to get web storage quota
1128  * @param result_cb callback to get web database origins
1129  * @param user_data user_data will be passed when result_cb is called
1130  *    -I.e., user data will be kept until callback is called
1131  *
1132  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1133  */
1134 EAPI Eina_Bool ewk_view_web_storage_quota_get(const Evas_Object* o, Ewk_Web_Storage_Quota_Get_Callback result_callback, void* user_data);
1135
1136 /**
1137  * Requests for setting web storage quota.
1138  *
1139  * @param o view object to set web storage quota
1140  * @param quota quota to store web storage db.
1141  *
1142  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1143  */
1144 EAPI Eina_Bool ewk_view_web_storage_quota_set(Evas_Object* o, uint32_t quota);
1145 // #endif // #if ENABLE(TIZEN_WEB_STORAGE)
1146
1147 /**
1148  * Requests execution of the given script.
1149  *
1150  * @note This allows to use NULL for the callback parameter.
1151  *       So, if the result data from the script is not required, NULL might be used for the callback parameter.
1152  *
1153  * @param o view object to execute script
1154  * @param script Java Script to execute
1155  * @param callback result callback
1156  * @param user_data user data
1157  *
1158  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1159  */
1160 EAPI Eina_Bool ewk_view_script_execute(Evas_Object* o, const char* script, Ewk_View_Script_Execute_Callback callback, void* user_data);
1161
1162 /**
1163  * Retrieve the contents in plain text.
1164  *
1165  * @param o view object whose contents to retrieve.
1166  * @param callback result callback
1167  * @param user_data user data
1168  *
1169  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1170  */
1171 EAPI Eina_Bool ewk_view_plain_text_get(Evas_Object* o, Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
1172
1173 // #if ENABLE(TIZEN_SUPPORT_MHTML)
1174 /**
1175  * Get page contents as MHTML data
1176  *
1177  * @param o view object to get the page contents
1178  * @param callback callback function to be called when the operation is finished
1179  * @param user_data user data to be passed to the callback function
1180  *
1181  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1182  */
1183 EAPI Eina_Bool ewk_view_mhtml_data_get(Evas_Object *o, Ewk_View_MHTML_Data_Get_Callback callback, void *user_data);
1184 // #endif // ENABLE(TIZEN_SUPPORT_MHTML)
1185
1186 // #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
1187 /**
1188  * Creates a new hit test for the given veiw object and point.
1189  *
1190  * The returned object should be freed by ewk_hit_test_free().
1191  *
1192  * @param o view object to do hit test on
1193  * @param x the horizontal position to query
1194  * @param y the vertical position to query
1195  * @param hit_test_mode the Ewk_Hit_Test_Mode enum value to query
1196  *
1197  * @return a newly allocated hit test on success, @c 0 otherwise
1198  */
1199 EAPI Ewk_Hit_Test* ewk_view_hit_test_new(Evas_Object* o, int x, int y, int hit_test_mode);
1200 // #endif // #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
1201
1202 /**
1203  * Get the whole history(whole back & forward list) associated with this view.
1204  *
1205  * @param o view object to get the history(whole back & forward list)
1206  *
1207  * @return a newly allocated history of @b newly allocated item
1208  *         instance. This memory of each item must be released with
1209  *         ewk_history_free() after use.
1210  *
1211  * @see ewk_history_free()
1212  */
1213 EAPI Ewk_History* ewk_view_history_get(Evas_Object* o);
1214
1215 /**
1216  * Requests to set recording surface.
1217  *
1218  * @param o view object to set recording surface
1219  * @param enable @c EINA_TRUE to enable recording surface
1220  *        @c EINA_FALSE to disable
1221  *
1222  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1223  */
1224 EINA_DEPRECATED EAPI Eina_Bool ewk_view_recording_surface_enable_set(Evas_Object* o, Eina_Bool enable);
1225
1226 /*
1227  * Notify that notification is closed.
1228  *
1229  * @param notification_list list of Ewk_Notification pointer
1230  *        notification_list is freed in this function.
1231  *
1232  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1233  */
1234 EAPI Eina_Bool ewk_view_notification_closed(Evas_Object* o, Eina_List* notification_list);
1235
1236 /*
1237  * Sends the orientation of the device.
1238  *
1239  * If orientation value is changed, orientationchanged event will occur.
1240  *
1241  * @param o view object to receive orientation event.
1242  * @param orientation the new orientation of the device. (degree)
1243  *
1244  * orientation will be 0 degrees when the device is oriented to natural position,
1245  *                     90 degrees when it's left side is at the top,
1246  *                    -90 degrees when it's right side is at the top,
1247  *                     180 degrees when it is upside down.
1248  */
1249 EAPI void ewk_view_orientation_send(Evas_Object *o, int orientation);
1250
1251 /**
1252  * Gets the current encoding.
1253  *
1254  * @param o view object to get the current encoding
1255  *
1256  * @return @c current encoding, or @c 0 if it's not setted
1257  */
1258 EAPI const char* ewk_view_encoding_custom_get(const Evas_Object* o);
1259
1260 /**
1261  * Sets the encoding and reloads the page.
1262  *
1263  * @param o view to set the encoding
1264  * @param encoding the new encoding to set or @c 0 to restore the default one
1265  */
1266 EAPI void ewk_view_encoding_custom_set(Evas_Object* o, const char* encoding);
1267
1268 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
1269 EINA_DEPRECATED EAPI Eina_Bool ewk_view_text_selection_enable_set(Evas_Object* o, Eina_Bool enable);
1270 EAPI Eina_Bool ewk_view_text_selection_range_get(Evas_Object* o, Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
1271 EAPI const char* ewk_view_text_selection_text_get(Evas_Object* o);
1272 EINA_DEPRECATED EAPI Eina_Bool ewk_view_auto_clear_text_selection_mode_set(Evas_Object* o, Eina_Bool enable);
1273 EINA_DEPRECATED EAPI Eina_Bool ewk_view_auto_clear_text_selection_mode_get(Evas_Object* o);
1274 EAPI void ewk_view_text_selection_range_clear(Evas_Object* o);
1275 // #endif // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
1276
1277 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1278 /**
1279  * Sets the focused input element value
1280  *
1281  * @param o view object to send the value
1282  * @param value the string value to be set
1283  */
1284 EAPI void ewk_view_focused_input_element_value_set(Evas_Object* o, const char* value);
1285 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1286
1287 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1288 /**
1289  * Gets the focused input element's value
1290  *
1291  * @param o view object to get the value
1292  *
1293  * @return focused input element's value on success or NULL on failure.
1294  */
1295 EAPI const char* ewk_view_focused_input_element_value_get(Evas_Object* o);
1296 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1297
1298 // #if ENABLE(TIZEN_DATALIST_ELEMENT)
1299 /**
1300  * Closes data list picker
1301  *
1302  * @param o view object contains data list element
1303  * @param value value to be set to the input element
1304  */
1305 EAPI void ewk_view_data_list_close(Evas_Object *o, const char *value);
1306 //#endif // ENABLE(TIZEN_DATALIST_ELEMENT)
1307
1308 /**
1309  * Selects index of current popup menu.
1310  *
1311  * @param o view object contains popup menu.
1312  * @param index index of item to select
1313  *
1314  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1315  *         popup menu is not selected or index is out of range)
1316  */
1317 EAPI Eina_Bool ewk_view_popup_menu_select(Evas_Object *o, unsigned int index);
1318
1319 //#if ENABLE(TIZEN_MULTIPLE_SELECT)
1320 /**
1321  * Selects Multiple indexes  of current popup menu.
1322  *
1323  * @param o view object contains popup menu.
1324  * @param changedlist  list of item selected and deselected
1325  *
1326  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1327  *         popup menu is not selected or index is out of range)
1328  */
1329 EAPI Eina_Bool ewk_view_popup_menu_multiple_select(Evas_Object *o, Eina_Inarray* changedlist);
1330 //l#endif
1331
1332 /**
1333  * Closes current popup menu.
1334  *
1335  * @param o view object contains popup menu.
1336  *
1337  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1338  *         popup menu is not selected)
1339  */
1340 EAPI Eina_Bool ewk_view_popup_menu_close(Evas_Object *o);
1341
1342 /**
1343  * Sets whether the ewk_view supports the mouse events or not.
1344  *
1345  * The ewk_view will support the mouse events if EINA_TRUE or not support the
1346  * mouse events otherwise. The default value is EINA_TRUE.
1347  *
1348  * @param o view object to enable/disable the mouse events
1349  * @param enabled a state to set
1350  *
1351  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1352  */
1353 EAPI Eina_Bool ewk_view_mouse_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
1354
1355 /**
1356  * Queries if the ewk_view supports the mouse events.
1357  *
1358  * @param o view object to query if the mouse events are enabled
1359  *
1360  * @return @c EINA_TRUE if the mouse events are enabled or @c EINA_FALSE otherwise
1361  */
1362 EAPI Eina_Bool ewk_view_mouse_events_enabled_get(const Evas_Object *o);
1363
1364 typedef Eina_Bool (*Ewk_Orientation_Lock_Cb)(Evas_Object* o, Eina_Bool need_lock, int orientation, void* user_data);
1365  /**
1366  * Deprecated
1367  * Sets callback of orientation lock function
1368  *
1369  * func will be called when screen lock is called or unlock is called.
1370  * When screen.lockOrientation is called, need_lock will be true and orientation
1371  * will be the flags which should be locked.
1372  * For example, when contents called 'screen.lockOrientation("portrait"), orientation
1373  * will be EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY | EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY
1374  * When screen.unlockOrientation is called, need_lock will be false.
1375  *
1376  * @param o view object to set the callback of orientation
1377  * @param func callback function to be called when screen orientation is locked or unlocked.
1378  * @param use_data user_data will be passsed when ewk_view_web_app_icon_get is called
1379  *
1380  * @return current URI on success or @c 0 on failure
1381  */
1382 EINA_DEPRECATED EAPI void ewk_view_orientation_lock_callback_set(Evas_Object *o, Ewk_Orientation_Lock_Cb func, void* user_data);
1383
1384  // #endif // #if OS(TIZEN)
1385
1386 /**
1387  * Loads the specified @a html string as the content of the view.
1388  *
1389  * External objects such as stylesheets or images referenced in the HTML
1390  * document are located relative to @a baseUrl.
1391  *
1392  * If an @a unreachableUrl is passed it is used as the url for the loaded
1393  * content. This is typically used to display error pages for a failed
1394  * load.
1395  *
1396  * @param o view object to load the HTML into
1397  * @param html HTML data to load
1398  * @param baseUrl Base URL used for relative paths to external objects (optional)
1399  * @param unreachableUrl URL that could not be reached (optional)
1400  *
1401  * @return @c EINA_TRUE if it the HTML was successfully loaded, @c EINA_FALSE otherwise
1402  */
1403 EAPI Eina_Bool ewk_view_html_string_load(Evas_Object *o, const char *html, const char *baseUrl, const char *unreachableUrl);
1404
1405 /**
1406  * Scales the current page, centered at the given point.
1407  *
1408  * @param o view object to set the zoom level
1409  * @param scale_factor a new level to set
1410  * @param cx x of center coordinate
1411  * @param cy y of center coordinate
1412  *
1413  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1414  */
1415 EAPI Eina_Bool ewk_view_scale_set(Evas_Object *o, double scaleFactor, int x, int y);
1416
1417 /**
1418  * Queries the current scale factor of the page.
1419  *
1420  * It returns previous scale factor after ewk_view_scale_set is called immediately
1421  * until scale factor of page is really changed.
1422  *
1423  * @param o view object to get the scale factor
1424  *
1425  * @return current scale factor in use on success or @c -1.0 on failure
1426  */
1427 EAPI double ewk_view_scale_get(const Evas_Object *o);
1428
1429 /**
1430  * Queries the ratio between the CSS units and device pixels when the content is unscaled.
1431  *
1432  * When designing touch-friendly contents, knowing the approximated target size on a device
1433  * is important for contents providers in order to get the intented layout and element
1434  * sizes.
1435  *
1436  * As most first generation touch devices had a PPI of approximately 160, this became a
1437  * de-facto value, when used in conjunction with the viewport meta tag.
1438  *
1439  * Devices with a higher PPI learning towards 240 or 320, applies a pre-scaling on all
1440  * content, of either 1.5 or 2.0, not affecting the CSS scale or pinch zooming.
1441  *
1442  * This value can be set using this property and it is exposed to CSS media queries using
1443  * the -webkit-device-pixel-ratio query.
1444  *
1445  * For instance, if you want to load an image without having it upscaled on a web view
1446  * using a device pixel ratio of 2.0 it can be done by loading an image of say 100x100
1447  * pixels but showing it at half the size.
1448  *
1449  * @media (-webkit-min-device-pixel-ratio: 1.5) {
1450  *     .icon {
1451  *         width: 50px;
1452  *         height: 50px;
1453  *         url: "/images/icon@2x.png"; // This is actually a 100x100 image
1454  *     }
1455  * }
1456  *
1457  * If the above is used on a device with device pixel ratio of 1.5, it will be scaled
1458  * down but still provide a better looking image.
1459  *
1460  * @param o view object to get device pixel ratio
1461  *
1462  * @return the ratio between the CSS units and device pixels,
1463  *         or @c -1.0 on failure
1464  */
1465 EAPI float ewk_view_device_pixel_ratio_get(const Evas_Object *o);
1466
1467 /**
1468  * Sets the ratio between the CSS units and device pixels when the content is unscaled.
1469  *
1470  * @param o view object to set device pixel ratio
1471  *
1472  * @return @c EINA_TRUE if the device pixel ratio was set, @c EINA_FALSE otherwise
1473  *
1474  * @see ewk_view_device_pixel_ratio_get()
1475  */
1476 EAPI Eina_Bool ewk_view_device_pixel_ratio_set(Evas_Object *o, float ratio);
1477
1478 /**
1479  * Sets the theme path that will be used by this view.
1480  *
1481  * This also sets the theme on the main frame. As frames inherit theme
1482  * from their parent, this will have all frames with unset theme to
1483  * use this one.
1484  *
1485  * @param o view object to change theme
1486  * @param path theme path
1487  */
1488 EAPI void ewk_view_theme_set(Evas_Object *o, const char *path);
1489
1490 /**
1491  * Gets the theme set on this view.
1492  *
1493  * This returns the value set by ewk_view_theme_set().
1494  *
1495  * @param o view object to get theme path
1496  *
1497  * @return the theme path, may be @c NULL if not set
1498  */
1499 EAPI const char *ewk_view_theme_get(const Evas_Object *o);
1500
1501 /**
1502  * Gets the current custom character encoding name.
1503  *
1504  * @param o view object to get the current encoding
1505  *
1506  * @return @c eina_strinshare containing the current encoding, or
1507  *         @c NULL if it's not set
1508  */
1509 EAPI const char  *ewk_view_custom_encoding_get(const Evas_Object *o);
1510
1511 /**
1512  * Sets the custom character encoding and reloads the page.
1513  *
1514  * @param o view to set the encoding
1515  * @param encoding the new encoding to set or @c NULL to restore the default one
1516  *
1517  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1518  */
1519 EAPI Eina_Bool    ewk_view_custom_encoding_set(Evas_Object *o, const char *encoding);
1520
1521 /**
1522  * Searches and hightlights the given string in the document.
1523  *
1524  * @param o view object to find text
1525  * @param text text to find, must @b not be @c NULL
1526  * @param options options to find
1527  * @param max_match_count maximum match count to find, unlimited if 0
1528  *
1529  * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
1530  */
1531 EAPI Eina_Bool ewk_view_text_find(Evas_Object *o, const char *text, Ewk_Find_Options options, unsigned max_match_count);
1532
1533 /**
1534  * Clears the highlight of searched text.
1535  *
1536  * @param o view object to find text
1537  *
1538  * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
1539  */
1540 EAPI Eina_Bool ewk_view_text_find_highlight_clear(Evas_Object *o);
1541
1542 /**
1543  * Counts the given string in the document.
1544  *
1545  * This does not highlight the matched string and just count the matched string.
1546  *
1547  * As the search is carried out through the whole document,
1548  * only the following EWK_FIND_OPTIONS are valid.
1549  *  - EWK_FIND_OPTIONS_NONE
1550  *  - EWK_FIND_OPTIONS_CASE_INSENSITIVE
1551  *  - EWK_FIND_OPTIONS_AT_WORD_START
1552  *  - EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START
1553  *
1554  * The "text,found" callback will be called with the number of matched string.
1555  *
1556  * @param o view object to find text
1557  * @param text text to find, must @b not be @c NULL
1558  * @param options options to find
1559  * @param max_match_count maximum match count to find, unlimited if 0
1560  *
1561  * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
1562  */
1563 EAPI Eina_Bool ewk_view_text_matches_count(Evas_Object *o, const char *text, Ewk_Find_Options options, unsigned max_match_count);
1564
1565 /*
1566  * Sets the user chosen color. To be used when implementing a color picker.
1567  *
1568  * The function should only be called when a color has been requested by the document.
1569  * If called when this is not the case or when the input picker has been dismissed, this
1570  * function will fail and return EINA_FALSE.
1571  *
1572  * @param o view object contains color picker
1573  * @param r red channel value to be set
1574  * @param g green channel value to be set
1575  * @param b blue channel value to be set
1576  * @param a alpha channel value to be set
1577  *
1578  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1579  */
1580 EAPI Eina_Bool ewk_view_color_picker_color_set(Evas_Object *o, int r, int g, int b, int a);
1581
1582 /**
1583  * Feeds the touch event to the view.
1584  *
1585  * @param o view object to feed touch event
1586  * @param type the type of touch event
1587  * @param points a list of points (Ewk_Touch_Point) to process
1588  * @param modifiers an Evas_Modifier handle to the list of modifier keys
1589  *        registered in the Evas. Users can get the Evas_Modifier from the Evas
1590  *        using evas_key_modifier_get() and can set each modifier key using
1591  *        evas_key_modifier_on() and evas_key_modifier_off()
1592  *
1593  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1594  */
1595 EAPI Eina_Bool ewk_view_feed_touch_event(Evas_Object *o, Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers);
1596
1597 /**
1598  * Sets whether the ewk_view supports the touch events or not.
1599  *
1600  * The ewk_view will support the touch events if @c EINA_TRUE or not support the
1601  * touch events otherwise. The default value is @c EINA_FALSE.
1602  *
1603  * @param o view object to enable/disable the touch events
1604  * @param enabled a state to set
1605  *
1606  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1607  */
1608 EAPI Eina_Bool ewk_view_touch_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
1609
1610 /**
1611  * Queries if the ewk_view supports the touch events.
1612  *
1613  * @param o view object to query if the touch events are enabled
1614  *
1615  * @return @c EINA_TRUE if the touch events are enabled or @c EINA_FALSE otherwise
1616  */
1617 EAPI Eina_Bool ewk_view_touch_events_enabled_get(const Evas_Object *o);
1618
1619 /**
1620  * Sets the visibility of main frame scrollbar.
1621  *
1622  * @param o view object
1623  * @param visible visibility of main frame scrollbar
1624  *
1625  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1626  */
1627 EAPI Eina_Bool ewk_view_main_frame_scrollbar_visible_set(Evas_Object *o, Eina_Bool visible);
1628
1629 /**
1630  * Gets the visibility of main frame scrollbar.
1631  *
1632  * @param o view object
1633  *
1634  * @return @c EINA_TRUE if scrollbar is visible or @c EINA_FALSE on failure
1635  */
1636 EAPI Eina_Bool ewk_view_main_frame_scrollbar_visible_get(const Evas_Object *o);
1637
1638 /**
1639  * Get contents of the current web page.
1640  *
1641  * @param o view object to get the page contents
1642  * @param context context of the page contents which has contents type and callback function
1643  *
1644  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1645  */
1646 EAPI Eina_Bool ewk_view_page_contents_get(const Evas_Object *o, Ewk_Page_Contents_Context *context);
1647
1648 /**
1649  * Scroll to the position of the given view with animation
1650  *
1651  * Both values are from zero to the contents size minus the viewport
1652  * size.
1653  *
1654  * @param o view object to scroll
1655  * @param x horizontal position to scroll
1656  * @param y vertical position to scroll
1657  *
1658  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
1659  */
1660 EAPI Eina_Bool ewk_view_animated_scroll_set(Evas_Object *o, int x, int y);
1661
1662 /**
1663  * Clear back forward list of a page.
1664  *
1665  * @param o view object to clear back forward list
1666  */
1667 EAPI void ewk_view_back_forward_list_clear(const Evas_Object *o);
1668
1669 /// Enum values containing Content Security Policy header types.
1670 enum _Ewk_CSP_Header_Type {
1671     EWK_REPORT_ONLY,
1672     EWK_ENFORCE_POLICY
1673 };
1674 typedef enum _Ewk_CSP_Header_Type Ewk_CSP_Header_Type;
1675
1676 /*
1677  * Set received Content Security Policy data from web app
1678  *
1679  * @param o view object
1680  * @param policy Content Security Policy data
1681  * @param type Content Security Policy header type
1682  *
1683  */
1684 EAPI void ewk_view_content_security_policy_set(Evas_Object* o, const char* policy, Ewk_CSP_Header_Type type);
1685
1686 /*
1687  * Starts offline page save.
1688  *
1689  * @param o view object to start offline page save
1690  * @param path directory path to save offline page
1691  *
1692  * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
1693  */
1694 EAPI Eina_Bool ewk_view_page_save(Evas_Object* o, const char* path);
1695
1696 /*
1697  * Prepare the rotation of the device.
1698  *
1699  * This function trigger prerendering first frame of new view size before target's angle is changed.
1700  * When prerendering is done, "rotate,prepared" event will occur.
1701  *
1702  * @param o view object to receive orientation event.
1703  * @param angle the new angle of the device. (degree)
1704  *
1705  * angle will be 0 degrees when the device is oriented to natural position,
1706  *               90 degrees when it's right side is at the top,
1707  *               180 degrees when it is upside down.
1708  *               270 degrees when it's left side is at the top,
1709  */
1710 EAPI void ewk_view_rotation_prepare(Evas_Object* ewkView, int angle);
1711
1712 /**
1713  * When font-family is "Tizen", use system's Settings font as default font-family
1714  *
1715  * @param o view object
1716  *
1717  */
1718 EAPI void ewk_view_use_settings_font(Evas_Object* o);
1719
1720 /*
1721  * Exit fullscreen when the back key is pressed.
1722  *
1723  * @param o view object to exit fullscreen mode
1724  *
1725  */
1726 EAPI void ewk_view_fullscreen_exit(Evas_Object* o);
1727
1728 #ifdef __cplusplus
1729 }
1730 #endif
1731 #endif // ewk_view_h