30eded5ac05cfe4e4fa85d6d40af579108fabdb3
[platform/framework/web/crosswalk-tizen.git] /
1 /*
2  * Copyright (C) 2011-2016 Samsung Electronics. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY SAMSUNG ELECTRONICS. AND ITS CONTRIBUTORS
14  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
15  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SAMSUNG ELECTRONICS. OR ITS
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 /**
27  * @file    ewk_view_internal.h
28  * @brief   Chromium main smart object.
29  *
30  * This object provides view related APIs of Chromium to EFL object.
31  */
32
33 #ifndef ewk_view_internal_h
34 #define ewk_view_internal_h
35
36 #include "ewk_app_installation_request_internal.h"
37 #include "ewk_auth_challenge_internal.h"
38 #include "ewk_context_internal.h"
39 #include "ewk_enums_internal.h"
40 #include "ewk_frame_internal.h"
41 #include "ewk_geolocation_internal.h"
42 #include "ewk_hit_test_internal.h"
43 #include "ewk_history_internal.h"
44 #include "ewk_page_group_internal.h"
45 #include "ewk_quota_permission_request_internal.h"
46 #include "ewk_touch_internal.h"
47 #include "ewk_user_media_internal.h"
48 #include "ewk_view.h"
49 #include "ewk_window_features_internal.h"
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55 /// Enum values containing text directionality values.
56 typedef enum {
57     EWK_TEXT_DIRECTION_RIGHT_TO_LEFT,
58     EWK_TEXT_DIRECTION_LEFT_TO_RIGHT
59 } Ewk_Text_Direction;
60
61 enum Ewk_Password_Popup_Option {
62     EWK_PASSWORD_POPUP_SAVE,
63     EWK_PASSWORD_POPUP_NOT_NOW,
64     EWK_PASSWORD_POPUP_NEVER,
65     EWK_PASSWORD_POPUP_OK = EWK_PASSWORD_POPUP_SAVE,
66     EWK_PASSWORD_POPUP_CANCEL =EWK_PASSWORD_POPUP_NOT_NOW
67 };
68 typedef enum Ewk_Password_Popup_Option Ewk_Password_Popup_Option;
69
70 typedef struct Ewk_View_Smart_Data Ewk_View_Smart_Data;
71 typedef struct Ewk_View_Smart_Class Ewk_View_Smart_Class;
72
73 // #if PLATFORM(TIZEN)
74 /// Creates a type name for _Ewk_Event_Gesture.
75 typedef struct Ewk_Event_Gesture Ewk_Event_Gesture;
76
77 /// Represents a gesture event.
78 struct Ewk_Event_Gesture {
79     Ewk_Gesture_Type type; /**< type of the gesture event */
80     Evas_Coord_Point position; /**< position of the gesture event */
81     Evas_Point velocity; /**< velocity of the gesture event. The unit is pixel per second. */
82     double scale; /**< scale of the gesture event */
83     int count; /**< count of the gesture */
84     unsigned int timestamp; /**< timestamp of the gesture */
85 };
86
87 // #if ENABLE(TIZEN_FOCUS_UI)
88 enum Ewk_Unfocus_Direction {
89     EWK_UNFOCUS_DIRECTION_NONE = 0,
90     EWK_UNFOCUS_DIRECTION_FORWARD,
91     EWK_UNFOCUS_DIRECTION_BACKWARD,
92     EWK_UNFOCUS_DIRECTION_UP,
93     EWK_UNFOCUS_DIRECTION_DOWN,
94     EWK_UNFOCUS_DIRECTION_LEFT,
95     EWK_UNFOCUS_DIRECTION_RIGHT,
96 };
97 typedef enum Ewk_Unfocus_Direction Ewk_Unfocus_Direction;
98 // #endif
99
100 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
101 /**
102  * \enum    Ewk_Input_Type
103  * @brief   Provides type of focused input element
104  */
105 enum Ewk_Input_Type {
106     EWK_INPUT_TYPE_TEXT,
107     EWK_INPUT_TYPE_TELEPHONE,
108     EWK_INPUT_TYPE_NUMBER,
109     EWK_INPUT_TYPE_EMAIL,
110     EWK_INPUT_TYPE_URL,
111     EWK_INPUT_TYPE_PASSWORD,
112     EWK_INPUT_TYPE_COLOR,
113     EWK_INPUT_TYPE_DATE,
114     EWK_INPUT_TYPE_DATETIME,
115     EWK_INPUT_TYPE_DATETIMELOCAL,
116     EWK_INPUT_TYPE_MONTH,
117     EWK_INPUT_TYPE_TIME,
118     EWK_INPUT_TYPE_WEEK
119 };
120 typedef enum Ewk_Input_Type Ewk_Input_Type;
121 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
122
123 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
124 /**
125  * \enum    Ewk_Selection_Handle_Type
126  * @brief   Provides type of selection handle
127  */
128 enum Ewk_Selection_Handle_Type {
129     EWK_SELECTION_HANDLE_TYPE_LEFT,
130     EWK_SELECTION_HANDLE_TYPE_RIGHT,
131     EWK_SELECTION_HANDLE_TYPE_LARGE
132 };
133 typedef enum Ewk_Selection_Handle_Type Ewk_Selection_Handle_Type;
134 // #endif // ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
135 // #endif // #if PLATFORM(TIZEN)
136
137 enum Ewk_View_Mode {
138     EWK_VIEW_MODE_WINDOWED = 0,
139     EWK_VIEW_MODE_FLOATING,
140     EWK_VIEW_MODE_FULLSCREEN,
141     EWK_VIEW_MODE_MAXIMIZED,
142     EWK_VIEW_MODE_MINIMIZED
143 };
144 typedef enum Ewk_View_Mode Ewk_View_Mode;
145
146 enum Ewk_Top_Control_State {
147     EWK_TOP_CONTROL_SHOWN = 1,
148     EWK_TOP_CONTROL_HIDDEN = 2,
149     EWK_TOP_CONTROL_BOTH = 3
150 };
151 typedef enum Ewk_Top_Control_State Ewk_Top_Control_State;
152
153 /// Ewk view's class, to be overridden by sub-classes.
154 struct Ewk_View_Smart_Class {
155     Evas_Smart_Class sc; /**< all but 'data' is free to be changed. */
156     unsigned long version;
157
158     Evas_Object* (*window_create)(Ewk_View_Smart_Data *sd, const Ewk_Window_Features *window_features); /**< creates a new window, requested by webkit */
159     void (*window_close)(Ewk_View_Smart_Data *sd); /**< closes a window */
160
161     Eina_Bool (*context_menu_show)(Ewk_View_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Ewk_Context_Menu *menu);
162     Eina_Bool (*context_menu_hide)(Ewk_View_Smart_Data *sd);
163
164     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);
165     Eina_Bool (*popup_menu_hide)(Ewk_View_Smart_Data *sd);
166     Eina_Bool (*popup_menu_update)(Ewk_View_Smart_Data *sd, Eina_Rectangle rect, Ewk_Text_Direction text_direction, Eina_List* items, int selected_index);
167
168     Eina_Bool (*text_selection_down)(Ewk_View_Smart_Data *sd, int x, int y);
169     Eina_Bool (*text_selection_up)(Ewk_View_Smart_Data *sd, int x, int y);
170
171     Eina_Bool (*input_picker_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, const char* inputValue);
172
173     Eina_Bool (*orientation_lock)(Ewk_View_Smart_Data* sd, int orientations);
174     void (*orientation_unlock)(Ewk_View_Smart_Data* sd);
175
176     // event handling:
177     //  - returns true if handled
178     //  - if overridden, have to call parent method if desired
179     Eina_Bool (*focus_in)(Ewk_View_Smart_Data *sd);
180     Eina_Bool (*focus_out)(Ewk_View_Smart_Data *sd);
181     Eina_Bool (*fullscreen_enter)(Ewk_View_Smart_Data *sd, Ewk_Security_Origin *origin);
182     Eina_Bool (*fullscreen_exit)(Ewk_View_Smart_Data *sd);
183     Eina_Bool (*mouse_wheel)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Wheel *ev);
184     Eina_Bool (*mouse_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Down *ev);
185     Eina_Bool (*mouse_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Up *ev);
186     Eina_Bool (*mouse_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Move *ev);
187     Eina_Bool (*key_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Down *ev);
188     Eina_Bool (*key_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Up *ev);
189
190     // color picker:
191     //   - Shows and hides color picker.
192     Eina_Bool (*input_picker_color_request)(Ewk_View_Smart_Data *sd, int r, int g, int b, int a);
193     Eina_Bool (*input_picker_color_dismiss)(Ewk_View_Smart_Data *sd);
194
195     // storage:
196     //   - Web database.
197     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);
198
199     Eina_Bool (*formdata_candidate_show)(Ewk_View_Smart_Data *sd, int x, int y, int w, int h);
200     Eina_Bool (*formdata_candidate_hide)(Ewk_View_Smart_Data *sd);
201     Eina_Bool (*formdata_candidate_update_data)(Ewk_View_Smart_Data *sd, Eina_List *dataList);
202     Eina_Bool (*formdata_candidate_is_showing)(Ewk_View_Smart_Data *sd);
203
204     Eina_Bool (*gesture_start)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
205     Eina_Bool (*gesture_end)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
206     Eina_Bool (*gesture_move)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
207
208     void (*selection_handle_down)(Ewk_View_Smart_Data *sd, Ewk_Selection_Handle_Type handleType, int x, int y);
209     void (*selection_handle_move)(Ewk_View_Smart_Data *sd, Ewk_Selection_Handle_Type handleType, int x, int y);
210     void (*selection_handle_up)(Ewk_View_Smart_Data *sd, Ewk_Selection_Handle_Type handleType, int x, int y);
211
212     Eina_Bool (*window_geometry_set)(Ewk_View_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height);
213     Eina_Bool (*window_geometry_get)(Ewk_View_Smart_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *width, Evas_Coord *height);
214 };
215
216 // #if PLATFORM(TIZEN)
217 /**
218  * Callback for ewk_view_web_app_capable_get
219  *
220  * @param capable web application capable
221  * @param user_data user_data will be passsed when ewk_view_web_app_capable_get is called
222  */
223 typedef void (*Ewk_Web_App_Capable_Get_Callback)(Eina_Bool capable, void* user_data);
224
225 /**
226  * Callback for ewk_view_web_app_icon_get
227  *
228  * @param icon_url web application icon
229  * @param user_data user_data will be passsed when ewk_view_web_app_icon_get is called
230  */
231 typedef void (*Ewk_Web_App_Icon_URL_Get_Callback)(const char* icon_url, void* user_data);
232
233 /**
234  * Callback for ewk_view_screenshot_contents_get_async
235  *
236  * @param image captured screenshot
237  * @param user_data user_data will be passsed when ewk_view_screenshot_contents_get_async is called
238  */
239 typedef void (*Ewk_Web_App_Screenshot_Captured_Callback)(Evas_Object* image, void* user_data);
240
241 /**
242  * Callback for ewk_view_web_app_icon_urls_get.
243  *
244  * @param icon_urls list of Ewk_Web_App_Icon_Data for web app
245  * @param user_data user_data will be passsed when ewk_view_web_app_icon_urls_get is called
246  */
247 typedef void (*Ewk_Web_App_Icon_URLs_Get_Callback)(Eina_List *icon_urls, void *user_data);
248 // #endif
249
250 /**
251  * Callback for ewk_view_notification_permission_callback_set
252  *
253  * @param o view object to request the notification permission
254  * @param request Ewk_Notification_Permission_Request object to get the information about notification permission request.
255  * @param user_data user data
256  *
257  * @return returned value is not used
258  */
259 typedef Eina_Bool (*Ewk_View_Notification_Permission_Callback)(Evas_Object *o, Ewk_Notification_Permission_Request *request, void *user_data);
260
261 /**
262  * Defines a callback for scale change.
263  *
264  * @param o view object to register on scale change
265  * @param scale_factor the scale applied to view
266  * @param user_data a pointer to data specified by ewk_view_scale_changed_callback_set
267  */
268 typedef void (*Ewk_View_Scale_Changed_Callback)(Evas_Object *o, double scale_factor, void *user_data);
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 1UL
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}
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     EwkViewImpl* priv; /**< should never be accessed, c++ stuff */
327     struct {
328         Evas_Coord x, y, w, h; /**< last used viewport */
329     } view;
330     struct { /**< what changed since last smart_calculate */
331         Eina_Bool any:1;
332
333         // WebKit use these but we don't. We should remove these if we are sure
334         // we do it right.
335         Eina_Bool size:1;
336         Eina_Bool position:1;
337     } changed;
338 };
339
340 /**
341  * Sets the smart class APIs, enabling view to be inherited.
342  *
343  * @param api class definition to set, all members with the
344  *        exception of @a Evas_Smart_Class->data may be overridden, must
345  *        @b not be @c NULL
346  *
347  * @note @a Evas_Smart_Class->data is used to implement type checking and
348  *       is not supposed to be changed/overridden. If you need extra
349  *       data for your smart class to work, just extend
350  *       Ewk_View_Smart_Class instead.
351  *       The Evas_Object which inherits the ewk_view should use
352  *       ewk_view_smart_add() to create Evas_Object instead of
353  *       evas_object_smart_add() because it performs additional initialization
354  *       for the ewk_view.
355  *
356  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
357  *         version mismatch)
358  *
359  * @see ewk_view_smart_add()
360  */
361 EXPORT_API Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class *api);
362
363 /**
364  * Creates a new EFL WebKit view object with Evas_Smart and Ewk_Context.
365  *
366  * @note The Evas_Object which inherits the ewk_view should create its
367  *       Evas_Object using this API instead of evas_object_smart_add()
368  *       because the default initialization for ewk_view is done in this API.
369  *
370  * @param e canvas object where to create the view object
371  * @param smart Evas_Smart object. Its type should be EWK_VIEW_TYPE_STR
372  * @param context Ewk_Context object which is used for initializing
373  * @param pageGroup Ewk_Page_Group object which is used for initializing
374  *
375  * @return view object on success or @c NULL on failure
376  */
377 EXPORT_API Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context, Ewk_Page_Group *pageGroup);
378
379 /**
380  * Creates a new EFL WebKit view object based on specific Ewk_Context.
381  *
382  * @note If used to created a new ewk_view object in response to a
383  *       "create,window" smart signal (emitted by the web engine), this
384  *       function must pass as context parameter the same context instance
385  *       as of the originating ewk_view object's context, e.g.:
386  *
387  *       - Scenario 1: parent view created with default context:
388  *
389  *         parent_view = ewk_view_add(evas); // uses the default context.
390  *                                 or
391  *         parent_view = ewk_view_add_with_context(evas, ewk_context_default_get());
392  *                                 then
393  *         // Valid cases:
394  *         child_view = ewk_view_add_with_context(evas, ewk_view_context_get(parent_view));
395  *                                 or
396  *         child_view = ewk_view_add_with_context(evas, ewk_context_default_get());
397  *
398  *         // Invalid case:
399  *         view_view = ewk_view_add_with_context(evas, ewk_context_new());
400  *
401  *       - Scenario 2: parent created with a new context:
402  *
403  *         parent_view = ewk_view_add_with_context(evas, ewk_context_new());
404  *                                 then
405  *         // Valid case:
406  *         child_view = ewk_view_add_with_context(evas, ewk_view_context_get(parent_view));
407  *
408  *         // Invalid cases:
409  *         child_view = ewk_view_add_with_context(evas, ewk_context_new());
410  *                                 or
411  *         child_view = ewk_view_add_with_context(evas, ewk_context_default_get());
412  *
413  * @param e canvas object where to create the view object
414  * @param context Ewk_Context object to declare process model
415  *
416  * @return view object on success or @c NULL on failure
417  */
418 EXPORT_API Evas_Object *ewk_view_add_with_context(Evas *e, Ewk_Context *context);
419
420 /**
421  * @brief Gets the widget of this view.
422  *
423  * @since_tizen 3.0
424  *
425  * @param[in] o The view object to get the widget
426  *
427  * @return widget on success or @c NULL on failure
428  */
429 EXPORT_API Evas_Object* ewk_view_widget_get(Evas_Object* view);
430
431 enum Ewk_Page_Visibility_State {
432     EWK_PAGE_VISIBILITY_STATE_VISIBLE,
433     EWK_PAGE_VISIBILITY_STATE_HIDDEN,
434     EWK_PAGE_VISIBILITY_STATE_PRERENDER
435 };
436 typedef enum Ewk_Page_Visibility_State Ewk_Page_Visibility_State;
437
438 /**
439  * Callback for ewk_view_script_execute
440  *
441  * @param o the view object
442  * @param result_value value returned by script
443  * @param user_data user data
444  */
445 typedef void (*Ewk_View_Script_Execute_Callback)(Evas_Object* o, const char* result_value, void* user_data);
446
447 /**
448  * Callback for ewk_view_plain_text_get
449  *
450  * @param o the view object
451  * @param plain_text the contents of the given frame converted to plain text
452  * @param user_data user data
453  */
454 typedef void (*Ewk_View_Plain_Text_Get_Callback)(Evas_Object* o, const char* plain_text, void* user_data);
455
456 /**
457  * Creates a type name for the callback function used to get the page contents.
458  *
459  * @param o view object
460  * @param data mhtml data of the page contents
461  * @param user_data user data will be passed when ewk_view_mhtml_data_get is called
462  */
463 typedef void (*Ewk_View_MHTML_Data_Get_Callback)(Evas_Object *o, const char *data, void *user_data);
464
465 /**
466  * @brief Gets whether horizontal panning is holding.
467  *
468  * @since_tizen 2.3
469  *
470  * @param[in] o view object to get whether horizontal panning is holding
471  *
472  * @return @c EINA_TRUE if horizontal panning is holding
473  *         @c EINA_FALSE if not or on failure
474  */
475 EXPORT_API Eina_Bool ewk_view_horizontal_panning_hold_get(Evas_Object* o);
476
477 /**
478  * @brief Sets to hold horizontal panning.
479  *
480  * @since_tizen 2.3
481  *
482  * @param[in] o view object to set to hold horizontal panning
483  * @param[in] hold @c EINA_TRUE to hold horizontal panning
484  *        @c EINA_FALSE not to hold
485  */
486 EXPORT_API void ewk_view_horizontal_panning_hold_set(Evas_Object* o, Eina_Bool hold);
487
488 /**
489  * @brief Gets whether vertical panning is holding.
490  *
491  * @since_tizen 2.3
492  *
493  * @param[in] o view object to get whether vertical panning is holding
494  *
495  * @return @c EINA_TRUE if vertical panning is holding
496  *         @c EINA_FALSE if not or on failure
497  */
498 EXPORT_API Eina_Bool ewk_view_vertical_panning_hold_get(Evas_Object* o);
499
500 /**
501   * Block/Release the vertical pan
502   *
503   * @param o view object on which pan is to be blocked/release
504   * @param hold status of pan
505   */
506 EXPORT_API void ewk_view_vertical_panning_hold_set(Evas_Object* o, Eina_Bool hold);
507
508 /**
509  * Gets the minimum and maximum value of the scale range or -1 on failure
510  *
511  * @param o view object to get the minimum and maximum value of the scale range
512  * @param min_scale Pointer to an double in which to store the minimum scale factor of the object.
513  * @param max_scale Pointer to an double in which to store the maximum scale factor of the object.
514  *
515  * @note Use @c NULL pointers on the scale components you're not
516  * interested in: they'll be ignored by the function.
517  */
518 EXPORT_API void ewk_view_scale_range_get(Evas_Object* o, double* min_scale, double* max_scale);
519
520 typedef Eina_Bool (*Ewk_View_Password_Confirm_Popup_Callback)(Evas_Object* o, const char* message, void* user_data);
521 EXPORT_API void ewk_view_password_confirm_popup_callback_set(Evas_Object* o, Ewk_View_Password_Confirm_Popup_Callback callback, void* user_data);
522 EXPORT_API void ewk_view_password_confirm_popup_reply(Evas_Object* o, Ewk_Password_Popup_Option result);
523
524 typedef Eina_Bool (*Ewk_View_JavaScript_Alert_Callback)(Evas_Object* o, const char* alert_text, void* user_data);
525 EXPORT_API void ewk_view_javascript_alert_callback_set(Evas_Object* o, Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
526 EXPORT_API void ewk_view_javascript_alert_reply(Evas_Object* o);
527
528
529 typedef Eina_Bool (*Ewk_View_JavaScript_Confirm_Callback)(Evas_Object* o, const char* message, void* user_data);
530 EXPORT_API void ewk_view_javascript_confirm_callback_set(Evas_Object* o, Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
531
532 /**
533  * Callback for ewk_view_javascript_prompt_callback_set
534  *
535  * @param o the view object
536  * @param message the text to be displayed on the prompt popup
537  * @param default_value default text to be entered in the prompt dialog
538  * @param user_data user data
539  */
540 typedef Eina_Bool (*Ewk_View_JavaScript_Prompt_Callback)(Evas_Object* o, const char* message, const char* default_value, void* user_data);
541
542 /**
543  * Display javascript prompt popup
544  *
545  * @param o view object
546  * @param callback callback function to be called when the prompt popup is to be opened
547  * @param user_data user data
548  *
549  */
550 EXPORT_API void ewk_view_javascript_prompt_callback_set(Evas_Object* o, Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
551
552 //#if ENABLE(TIZEN_APPLICATION_CACHE)
553 typedef Eina_Bool (*Ewk_View_Applicacion_Cache_Permission_Callback)(Evas_Object* o, Ewk_Security_Origin* origin,  void* user_data);
554 //#endif
555
556 typedef Eina_Bool (*Ewk_View_Exceeded_Indexed_Database_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, long long currentQuota, void* user_data);
557 EXPORT_API void ewk_view_exceeded_indexed_database_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback, void* user_data);
558 EXPORT_API void ewk_view_exceeded_indexed_database_quota_reply(Evas_Object* o, Eina_Bool allow);
559
560
561 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);
562 EXPORT_API void ewk_view_exceeded_database_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Database_Quota_Callback callback, void* user_data);
563 EXPORT_API void ewk_view_exceeded_database_quota_reply(Evas_Object* o, Eina_Bool allow);
564
565 typedef Eina_Bool (*Ewk_View_Exceeded_Local_File_System_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, long long currentQuota, void* user_data);
566 EXPORT_API 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);
567 EXPORT_API void ewk_view_exceeded_local_file_system_quota_reply(Evas_Object* o, Eina_Bool allow);
568 //#if ENABLE(TIZEN_FOCUS_UI)
569 typedef Eina_Bool (*Ewk_View_Unfocus_Allow_Callback)(Evas_Object* o, Ewk_Unfocus_Direction direction, void* user_data);
570 //#endif
571
572 /**
573  * Callback for geolocation permission request feature.
574  *
575  * @param ewk_view view object where geolocation permission was requested
576  * @param request geolocation permission request object
577  * @param user_data user data passed to
578  *        ewk_view_geolocation_permission_callback_set
579  *
580  * @return Unused
581  */
582 typedef Eina_Bool (*Ewk_View_Geolocation_Permission_Callback)(Evas_Object* ewk_view, Ewk_Geolocation_Permission_Request* request, void* user_data);
583
584 /**
585  * Sets callback which will be called upon geolocation permission request. This
586  * function can be used also to unset this callback. Do that by passing NULL as
587  * callback param.
588  *
589  * @param ewk_view view object to set the callback to
590  * @param callback callback function called upon geolocation permission request
591  * @param user_data user_data passsed to set callback when called
592  *
593  * @note When callback is set by this function, it will be called insted of
594  *       "geolocation,permission,request" smart callback.
595  */
596 EXPORT_API void ewk_view_geolocation_permission_callback_set(Evas_Object* ewk_view, Ewk_View_Geolocation_Permission_Callback callback, void* user_data);
597
598 typedef Eina_Bool (*Ewk_View_User_Media_Permission_Callback)(
599     Evas_Object* ewk_view,
600     Ewk_User_Media_Permission_Request* user_media_permission_request,
601     void* user_data);
602 EXPORT_API void ewk_view_user_media_permission_callback_set(
603     Evas_Object* ewk_view,
604     Ewk_View_User_Media_Permission_Callback callback,
605     void* user_data);
606
607 /**
608  * Callback for ewk_view_authentication_callback_set
609  *
610  * @param o the view object
611  * @param auth_challenge Ewk_Auth_Challenge object to get the information about authentication
612  * @param user_data user data
613  */
614 typedef void (*Ewk_View_Authentication_Callback)(Evas_Object* o, Ewk_Auth_Challenge* auth_challenge, void* user_data);
615
616 /**
617  * Sets the callback authentication.
618  *
619  * @param o the view object
620  * @param callback callback function to be called when the authentication is called
621  * @param user_data user data
622  *
623  * @note When callback is set by this function,
624  *       class of Ewk_Auth_Challenge is passed by callback function.
625  *
626  * @see Ewk_View_Authentication_Callback
627  */
628 EXPORT_API void ewk_view_authentication_callback_set(Evas_Object* o, Ewk_View_Authentication_Callback callback, void* user_data);
629
630 EXPORT_API Eina_Bool ewk_view_mode_set(Evas_Object* ewkView, Ewk_View_Mode view_mode);
631
632 /**
633  * Requests the specified plain text string into the view object
634  *
635  * @note The mime type of document will be "text/plain".
636  *
637  * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
638  */
639 EXPORT_API Eina_Bool ewk_view_plain_text_set(Evas_Object* o, const char* plain_text);
640
641 /**
642  * Requests for setting page visibility state.
643  *
644  * @param o view object to set the page visibility
645  * @param page_visibility_state visible state of the page to set
646  * @param initial_state @c EINA_TRUE if this function is called at page initialization time,
647  *                     @c EINA_FALSE otherwise
648  *
649  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
650  */
651 EXPORT_API Eina_Bool ewk_view_page_visibility_state_set(Evas_Object* o, Ewk_Page_Visibility_State page_visibility_state, Eina_Bool initial_state);
652
653 /**
654 * Request to set the user agent with application name.
655 *
656 * @param o view object to set the user agent with application name
657 *
658 * @param application_name string to set the user agent
659 *
660 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
661 */
662 EXPORT_API Eina_Bool ewk_view_application_name_for_user_agent_set(Evas_Object* o, const char* application_name);
663
664 /**
665 * Returns application name string.
666 *
667 * @param o view object to get the application name
668 *
669 * @return @c application name. The returned string @b should be freed by
670 *         eina_stringshare_del() after use.
671 */
672 EXPORT_API const char* ewk_view_application_name_for_user_agent_get(const Evas_Object* o);
673
674 /*
675 * add custom header
676 *
677 * @param o view object to add custom header
678 *
679 * @param name custom header name to add the custom header
680 *
681 * @param value custom header value to add the custom header
682 *
683 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
684 */
685 EXPORT_API Eina_Bool ewk_view_custom_header_add(const Evas_Object* o, const char* name, const char* value);
686 /**
687 * remove custom header
688 *
689 * @param o view object to remove custom header
690 *
691 * @param name custom header name to remove the custom header
692 *
693 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
694 */
695 EXPORT_API Eina_Bool ewk_view_custom_header_remove(const Evas_Object* o, const char* name);
696 /**
697 * clears all custom headers
698 *
699 * @param o view object to clear custom headers
700 *
701 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
702 */
703 EXPORT_API Eina_Bool ewk_view_custom_header_clear(const Evas_Object* o);
704
705 /**
706  * Returns the evas image object of the specified viewArea of page
707  *
708  * The returned evas image object @b should be freed after use.
709  *
710  * @param o view object to get specified rectangle of cairo surface.
711  * @param viewArea rectangle of cairo surface.
712  * @param scaleFactor scale factor of cairo surface.
713  * @param canvas canvas for creating evas image.
714  *
715  * @return newly allocated evas image object on sucess or @c 0 on failure.
716  */
717 EXPORT_API Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* o, Eina_Rectangle viewArea, float scaleFactor, Evas* canvas);
718
719 /**
720  * Makes request of evas image object of the specified viewArea of page asynchronously
721  *
722  * The returned evas image object through async callback @b should be freed after use.
723  *
724  * @param o view object to get specified rectangle of cairo surface.
725  * @param viewArea rectangle of cairo surface.
726  * @param scaleFactor scale factor of cairo surface.
727  * @param canvas canvas for creating evas image.
728  * @param callback result callback to get captured screenshot.
729  * @param user_data will be passed when result_callback is called
730  *    -I.e., user data will be kept until callback is called.
731  *
732  * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors.
733  */
734 EXPORT_API Eina_Bool ewk_view_screenshot_contents_get_async(const Evas_Object* o, Eina_Rectangle viewArea, float scaleFactor, Evas* canvas, Ewk_Web_App_Screenshot_Captured_Callback callback, void* user_data);
735
736 /**
737  * Start a server for inspecting web pages
738  * This server will be used by Remote Web Browser to transfer messages over network
739  *
740  * @param [o] view object to debug
741  * @param [in] port It is a port number for the server. A free port on system will be allocated if port is 0
742  *
743  * @return @c assigned port number on success or @c 0 on failure
744  */
745 EXPORT_API unsigned int ewk_view_inspector_server_start(Evas_Object* o, unsigned int port);
746
747 /**
748  * Stop a server for inspecting web pages
749  *
750  * @param [o] view object to debug
751  *
752  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
753  */
754 EXPORT_API Eina_Bool ewk_view_inspector_server_stop(Evas_Object* o);
755
756 /**
757  * Gets the possible scroll size of the given view.
758  *
759  * Possible scroll size is contents size minus the viewport size.
760  *
761  * @param o view object to get scroll size
762  * @param w the pointer to store the horizontal size that is possible to scroll,
763  *        may be @c 0
764  * @param h the pointer to store the vertical size that is possible to scroll,
765  *        may be @c 0
766  *
767  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
768  *         values are zeroed
769  */
770 EXPORT_API Eina_Bool ewk_view_scroll_size_get(const Evas_Object* o, int* w, int* h);
771
772 /**
773  * Executes editor command.
774  *
775  * @param o view object to execute command
776  * @param command editor command to execute
777  * @param value the value to be passed into command
778  *
779  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
780  */
781 EXPORT_API Eina_Bool ewk_view_command_execute(Evas_Object* o, const char* command, const char* value);
782
783 /**
784  * Retrieve the contents in plain text.
785  *
786  * @param o view object whose contents to retrieve.
787  * @param callback result callback
788  * @param user_data user data
789  *
790  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
791  */
792 EXPORT_API Eina_Bool ewk_view_plain_text_get(Evas_Object* o, Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
793
794 /**
795  * Get page contents as MHTML data
796  *
797  * @param o view object to get the page contents
798  * @param callback callback function to be called when the operation is finished
799  * @param user_data user data to be passed to the callback function
800  *
801  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
802  */
803 EXPORT_API Eina_Bool ewk_view_mhtml_data_get(Evas_Object *o, Ewk_View_MHTML_Data_Get_Callback callback, void *user_data);
804
805 typedef void (*Ewk_View_Hit_Test_Request_Callback)(Evas_Object* o, int x, int y, int hit_test_mode, Ewk_Hit_Test*, void* user_data);
806
807 /**
808  * Requests new hit test for given view object and point.
809  *
810  * @param o              view object to do hit test on
811  * @param x              the horizontal position to query
812  * @param y              the vertical position to query
813  * @param hit_test_mode  the Ewk_Hit_Test_Mode enum value to query
814  * @param callback       callback to be executed when hit test request was finished
815  *
816  * @return EINA_TRUE if hit test request was queued, otherwise EINA_FALSE
817  */
818 EXPORT_API Eina_Bool ewk_view_hit_test_request(Evas_Object* o, int x, int y, int hit_test_mode, Ewk_View_Hit_Test_Request_Callback, void* user_data);
819
820 /**
821  * Deprecated.
822  * Notify that notification is closed.
823  *
824  * @param notification_list list of Ewk_Notification pointer
825  *        notification_list is freed in this function.
826  *
827  * @return this function will always return EINA_FALSE since it is deprecated
828  *
829  * @deprecated
830  * @see ewk_notification_closed
831  */
832 EINA_DEPRECATED EXPORT_API Eina_Bool ewk_view_notification_closed(Evas_Object* o, Eina_List* notification_list);
833
834 /**
835  * Sets the encoding and reloads the page.
836  *
837  * @param ewkView view to set the encoding
838  * @param encoding the new encoding to set or @c 0 to restore the default one
839  */
840 EXPORT_API void ewk_view_encoding_custom_set(Evas_Object* ewkView, const char* encoding);
841
842 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
843
844 /**
845  * Sets whether the ewk_view supports the mouse events or not.
846  *
847  * The ewk_view will support the mouse events if EINA_TRUE or not support the
848  * mouse events otherwise. The default value is EINA_TRUE.
849  *
850  * @param o view object to enable/disable the mouse events
851  * @param enabled a state to set
852  *
853  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
854  */
855 EXPORT_API Eina_Bool ewk_view_mouse_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
856
857 /**
858  * Queries if the ewk_view supports the mouse events.
859  *
860  * @param o view object to query if the mouse events are enabled
861  *
862  * @return @c EINA_TRUE if the mouse events are enabled or @c EINA_FALSE otherwise
863  */
864 EXPORT_API Eina_Bool ewk_view_mouse_events_enabled_get(const Evas_Object *o);
865
866 typedef Eina_Bool (*Ewk_Orientation_Lock_Cb)(Evas_Object* o, Eina_Bool need_lock, int orientation, void* user_data);
867
868  /**
869  * Deprecated
870  * Sets callback of orientation lock function
871  *
872  * func will be called when screen lock is called or unlock is called.
873  * When screen.lockOrientation is called, need_lock will be true and orientation
874  * will be the flags which should be locked.
875  * For example, when contents called 'screen.lockOrientation("portrait"), orientation
876  * will be EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY | EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY
877  * When screen.unlockOrientation is called, need_lock will be false.
878  *
879  * @param o view object to set the callback of orientation
880  * @param func callback function to be called when screen orientation is locked or unlocked.
881  * @param use_data user_data will be passsed when ewk_view_web_app_icon_get is called
882  *
883  * @return current URI on success or @c 0 on failure
884  */
885 EINA_DEPRECATED EXPORT_API void ewk_view_orientation_lock_callback_set(Evas_Object *o, Ewk_Orientation_Lock_Cb func, void* user_data);
886
887 /**
888  * Sets the callback on the scale factor change.
889  *
890  * The given callback function will be called when the engine has successfully
891  * changed the scale factor. It happens, for example, after ewk_view_scale_set
892  * call but not only. The engine itself can change the scale while rendering
893  * the content, for example, when ewk_settings_auto_fitting is turned on.
894  *
895  * @param o view object to set the callback
896  * @param callback the callback funtion which will be called on scale change
897  * @param user_data pointer to the data which will be passed while calling the callback
898  */
899 EXPORT_API void ewk_view_scale_changed_callback_set(Evas_Object *o, Ewk_View_Scale_Changed_Callback callback, void *user_data);
900
901 /**
902  * Clears the highlight of searched text.
903  *
904  * @param o view object to find text
905  *
906  * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
907  */
908 EXPORT_API Eina_Bool ewk_view_text_find_highlight_clear(Evas_Object *o);
909
910 /**
911  * Sets whether the ewk_view supports the touch events or not.
912  *
913  * The ewk_view will support the touch events if @c EINA_TRUE or not support the
914  * touch events otherwise. The default value is @c EINA_FALSE.
915  *
916  * @param o view object to enable/disable the touch events
917  * @param enabled a state to set
918  *
919  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
920  */
921 EXPORT_API Eina_Bool ewk_view_touch_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
922
923 /**
924  * Queries if the ewk_view supports the touch events.
925  *
926  * @param o view object to query if the touch events are enabled
927  *
928  * @return @c EINA_TRUE if the touch events are enabled or @c EINA_FALSE otherwise
929  */
930 EXPORT_API Eina_Bool ewk_view_touch_events_enabled_get(const Evas_Object *o);
931
932 /// Enum values containing Content Security Policy header types.
933 enum _Ewk_CSP_Header_Type {
934   EWK_REPORT_ONLY,
935   EWK_ENFORCE_POLICY,
936   EWK_DEFAULT_POLICY
937 };
938 typedef enum _Ewk_CSP_Header_Type Ewk_CSP_Header_Type;
939
940 /**
941  * Set received Content Security Policy data from web app
942  *
943  * @param o view object
944  * @param policy Content Security Policy data
945  * @param type Content Security Policy header type
946  *
947  */
948 EXPORT_API void ewk_view_content_security_policy_set(Evas_Object* o, const char* policy, Ewk_CSP_Header_Type type);
949
950 /**
951  * When font-family is "Tizen", use system's Settings font as default font-family
952  *
953  * @param o view object
954  *
955  */
956 EXPORT_API void ewk_view_use_settings_font(Evas_Object* o);
957
958 /*
959  * Get cookies associated with an URL.
960  *
961  * @param o view object in which URL is opened.
962  * @param url the url for which cookies needs to be obtained.
963  *
964  * @return @c character array containing cookies, @c NULL if no cookies are found.
965  *
966  * The return character array has to be owned by the application and freed when not required.
967  */
968 EXPORT_API char* ewk_view_get_cookies_for_url(Evas_Object* o, const char* url);
969
970 /**
971  * Sets whether to draw transparent background or not.
972  *
973  * @param o view object to enable/disable transparent background
974  * @param enabled a state to set
975  *
976  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
977  */
978 EXPORT_API Eina_Bool ewk_view_draws_transparent_background_set(Evas_Object *o, Eina_Bool enabled);
979
980 /**
981 * @brief Queries if transparent background is enabled.
982 *
983 * @since_tizen 2.3
984 *
985 * @param[in] o view object to get whether transparent background is enabled or not
986 *
987 * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
988 */
989 EXPORT_API Eina_Bool ewk_view_draws_transparent_background_get(Evas_Object* o);
990
991 /**
992  * @brief Sets the background color and transparency of the view.
993  *
994  * @note Should be used after ewk_view_url_set().
995  *
996  * @param[in] o view object to change the background color
997  * @param[in] r red color component [0..255]
998  * @param[in] g green color component [0..255]
999  * @param[in] b blue color component [0..255]
1000  * @param[in] a transparency [0..255]
1001  *
1002  * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
1003  */
1004 EXPORT_API Eina_Bool ewk_view_bg_color_set(Evas_Object* o, int r, int g, int b, int a);
1005
1006 /**
1007  * set a font for browser application
1008  *
1009  * @param o view object
1010  *
1011  */
1012 EXPORT_API void ewk_view_browser_font_set(Evas_Object* o);
1013
1014 /**
1015  * Load the error page which web page is not found.
1016  *
1017  * @param ewkView view object whose session needs to be stored.
1018  * @param ErrorUrl that could not be found.
1019  *
1020  * @return void
1021  */
1022 EXPORT_API void ewk_view_not_found_error_page_load(Evas_Object* ewkView, const char* ErrorUrl);
1023
1024 /**
1025  * Enable or disable supporting of the split scrolling for overflow scroll.
1026  *
1027  * @param ewkView view object to set the support of the split scrolling for overflow scroll
1028  * @param enable @c EINA_TRUE to support split scrolling, @c EINA_FALSE not to support
1029  *
1030  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1031  */
1032 EXPORT_API Eina_Bool ewk_view_split_scroll_overflow_enabled_set(Evas_Object* ewkView, const Eina_Bool enabled);
1033
1034 /**
1035 * @brief Gets the staus of split scrolling supporting for overflow scroll.
1036 *
1037 * @since_tizen 2.3
1038 *
1039 * @param[in] o view object to get the status of split scrolling supporting
1040 *
1041 * @return the status of split scrolling supporting
1042 */
1043 EXPORT_API Eina_Bool ewk_view_split_scroll_overflow_enabled_get(const Evas_Object* o);
1044
1045 /**
1046  * Deprecated.
1047  * Enable/disable focus ring.
1048  *
1049  * @note Focus ring is enabled by default but disabled for wrt on TV profile
1050  *
1051  * @param ewkView view object
1052  * @param enabled @c EINA_TRUE to enable the focus ring, @c EINA_FALSE to disable
1053  *
1054  */
1055 EINA_DEPRECATED EXPORT_API void ewk_view_draw_focus_ring_enable_set(Evas_Object* ewkView, Eina_Bool enable);
1056
1057 /**
1058  * Queries the current zoom factor of the page.
1059  *
1060  * @param o view object to get the zoom factor
1061  *
1062  * @return current zoom factor in use on success or @c -1.0 on failure
1063  */
1064 EXPORT_API double ewk_view_page_zoom_get(const Evas_Object *o);
1065
1066 /**
1067  * Sets zoom factor of the current page.
1068  *
1069  * @param o view object to set the zoom level
1070  * @param zoom_factor a new level to set
1071  *
1072  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1073  */
1074 EXPORT_API Eina_Bool ewk_view_page_zoom_set(Evas_Object *o, double zoom_factor);
1075
1076 /**
1077  * Creates a new EFL WebKit view object with Evas_Smart and Ewk_Context.
1078  *
1079  * @note The Evas_Object which inherits the ewk_view should create its
1080  *       Evas_Object using this API instead of evas_object_smart_add()
1081  *       because the default initialization for ewk_view is done in this API.
1082  *
1083  * @param e canvas object where to create the view object
1084  * @param smart Evas_Smart object. Its type should be EWK_VIEW_TYPE_STR
1085  * @param context Ewk_Context object which is used for initializing
1086  * @param pageGroup Ewk_Page_Group object which is used for initializing
1087  *
1088  * @return view object on success or @c NULL on failure
1089  */
1090 EXPORT_API Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context, Ewk_Page_Group *pageGroup);
1091
1092 /**
1093  * Callback for quota permission request feature.
1094  *
1095  * @param ewkView view object where quota permission was requested
1096  * @param request quota permission request object
1097  * @param user_data user_data passed to ewk_view_quota_permission_request_callback_set
1098  */
1099 typedef void (*Ewk_Quota_Permission_Request_Callback)(Evas_Object* ewkView, const Ewk_Quota_Permission_Request* request, void* user_data);
1100
1101 /**
1102  * Sets callback quota permission request.
1103  *
1104  * func will be called when page requests increased storage quota.
1105  *
1106  * @param ewkView view object to set the callback
1107  * @param func callback function to be called when quota permission is requested
1108  * @param use_data user_data will be passsed to callback function
1109  *
1110  * @return void
1111  */
1112 EXPORT_API void ewk_view_quota_permission_request_callback_set(Evas_Object* ewkView, Ewk_Quota_Permission_Request_Callback callback, void* user_data);
1113
1114 /**
1115  * Set reply to quota permission request.
1116  *
1117  * Set @c EINA_TRUE if user accepts new quota size for origin
1118  * or @c EINA_FALSE if user doesn't accept new quota for origin.
1119  *
1120  * @param request view object to set the support of the split scrolling for overflow scroll
1121  * @param enable @c EINA_TRUE allow quota size, @c EINA_FALSE
1122  *
1123  * @return void
1124  */
1125 EXPORT_API void ewk_view_quota_permission_request_reply(const Ewk_Quota_Permission_Request* request, const Eina_Bool allow);
1126
1127 /**
1128  * Cancels quota permission request.
1129  *
1130  * @param request view object to set the support of the split scrolling for overflow scroll
1131  *
1132  * @return void
1133  */
1134 EXPORT_API void ewk_view_quota_permission_request_cancel(const Ewk_Quota_Permission_Request* request);
1135
1136 /*
1137  * Requests web login using password database.
1138  *
1139  * @param o view object
1140  *
1141  * @return void
1142  */
1143 EXPORT_API Eina_Bool ewk_view_web_login_request(Evas_Object* ewkView);
1144
1145 /**
1146  * Sets the notification permission callback.
1147  *
1148  * @param o view object to request the notification permission
1149  * @param callback Ewk_View_Notification_Permission_Callback function to notification permission
1150  * @param user_data user data
1151  */
1152 EXPORT_API void ewk_view_notification_permission_callback_set(Evas_Object *o, Ewk_View_Notification_Permission_Callback callback, void *user_data);
1153
1154 /**
1155  * @brief Callback invoked when theme color is changed
1156  *
1157  * @details Ewk_View_Did_Change_Theme_Color_Callback callback allows host\n
1158  *          application to receive information regarding theme color change.\n
1159  *          Callback will be called in following cases:\n
1160  *          - no "theme-color" meta tag => "theme-color" meta tag\n
1161  *          - "theme-color" meta tag => different "theme-color" meta tag\n
1162  *          - "theme-color" meta tag => no "theme-color" meta tag\n
1163  *          In case of no "theme-color" meta tag @a r, @a g, @a b and @a a\n
1164  *          equal 0.
1165  *
1166  * @since_tizen 3.0
1167  *
1168  * @param[in] o View object for which callback was set
1169  * @param[in] r Red color component ranged from 0 to 255
1170  * @param[in] g Green color component ranged from 0 to 255
1171  * @param[in] b Blue color component ranged from 0 to 255
1172  * @param[in] a Opacity value ranged from 0 to 255
1173  * @param[in] user_data User data passed to\n
1174  *                      ewk_view_did_change_theme_color_callback_set
1175  *
1176  * @see ewk_view_did_change_theme_color_callback_set
1177  */
1178 typedef void (*Ewk_View_Did_Change_Theme_Color_Callback)(Evas_Object* o, int r, int g, int b, int a, void* user_data);
1179
1180 /**
1181  * @brief Sets Ewk_View_Did_Change_Theme_Color_Callback
1182  *
1183  * @since_tizen 3.0
1184  *
1185  * @param[in] o View object to receive theme color change information
1186  * @param[in] callback New callback, NULL resets current callback
1187  * @param[in] user_data User data that will be passed to @a callback
1188  *
1189  * @return @c EINA_TRUE on success,\n
1190  *         otherwise @c EINA_FALSE
1191  *
1192  * @see Ewk_View_Did_Change_Theme_Color_Callback
1193  */
1194 EXPORT_API Eina_Bool ewk_view_did_change_theme_color_callback_set(Evas_Object* o, Ewk_View_Did_Change_Theme_Color_Callback callback, void* user_data);
1195
1196 /**
1197  * @brief Callback invoked when save page is done
1198  *
1199  * @since_tizen 3.0
1200  *
1201  * @param[in] o View object for which callback was set
1202  * @param[in] file_path File path of saved page on success or @c NULL on failure
1203  * @param[in] user_data User data passed to ewk_view_save_page
1204  *
1205  * @see ewk_view_save_page_as_mhtml
1206  */
1207 typedef void (*Ewk_View_Save_Page_Callback)(Evas_Object* o, const char* file_path, void* user_data);
1208
1209 /**
1210  * @brief Save current page as MHTML format
1211  *
1212  * @since_tizen 3.0
1213  *
1214  * @param[in] o View object which has page to save
1215  * @param[in] path File path where saved page should be placed\n
1216  *                 It can be full path of saved page or path of
1217  *                 existing directory\n
1218  *                 If path is existing directory, file name will be chosen\n
1219  *                 according to the title of the current page\n
1220  *                 (e.g. /path-to-directory/Google.mhtml)\n
1221  *                 If path has no extension, default extension(mhtml)\n
1222  *                 will be appended
1223  * @param[in] callback Callback to be called when the operation is finished
1224  * @param[in] user_data User data that will be passed to @a callback
1225  *
1226  * @return @c EINA_TRUE on successful request,\n
1227  *         otherwise @c EINA_FALSE
1228  *
1229  * @see Ewk_View_Save_Page_Callback
1230  */
1231 EXPORT_API Eina_Bool ewk_view_save_page_as_mhtml(Evas_Object* o, const char* path, Ewk_View_Save_Page_Callback callback, void* user_data);
1232
1233 /*
1234  * @brief Set Reader mode enable
1235  *
1236  * @since_tizen 3.0
1237  *
1238  * @param[in] ewk_view view object to enable/disable the Reader mode
1239  * @param[in] enable a state to set
1240  *
1241  * @note Reader Mode support or not will be known after the ewk_view object\n
1242  *       received "reader,mode" callback from evas_object smart callback.
1243  */
1244 EXPORT_API void ewk_view_reader_mode_set(Evas_Object* ewk_view, Eina_Bool enable);
1245
1246 /**
1247  * @brief Sets the height of top controls.
1248  *
1249  * @since_tizen 3.0
1250  *
1251  * @param[in] ewk_view view object to set height of top control
1252  * @param[in] top_height the height of the top controls in pixels
1253  * @param[in] bottom_height the height of the bottom controls in pixels
1254  *
1255  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1256  */
1257 EXPORT_API Eina_Bool ewk_view_top_controls_height_set(Evas_Object* ewk_view,
1258     size_t top_height, size_t bottom_height);
1259
1260 /**
1261  * @brief Sets the state of top controls.
1262  *
1263  * @since_tizen 3.0
1264  *
1265  * @note EWK_TOP_CONTROL_BOTH for current to preserve the current position.
1266  *
1267  * @param[in] ewk_view view object to set state of top control
1268  * @param[in] constraint constrain the top controls to being shown or hidden
1269  * @param[in] current set current state
1270  * @param[in] animate whether or not to animate to the proper state
1271  *
1272  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1273  */
1274 EXPORT_API Eina_Bool ewk_view_top_controls_state_set(Evas_Object* ewk_view, Ewk_Top_Control_State constraint,  Ewk_Top_Control_State current, Eina_Bool animation);
1275
1276 /**
1277  * @brief Sets the visibility of main frame scrollbar.
1278  *
1279  * @since_tizen 2.3
1280  *
1281  * @param[in] o view object
1282  * @param[in] visible visibility of main frame scrollbar
1283  *
1284  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1285  */
1286 EXPORT_API Eina_Bool ewk_view_main_frame_scrollbar_visible_set(Evas_Object* o, Eina_Bool visible);
1287
1288 /**
1289  * @brief Set Default XHR LongPolling Timeout.
1290  *
1291  * @details XML Http Request by default does not have a timeout value. The
1292  *          timeout can be set using "timeout" field during creation of XHR
1293  *          object. This API allows for setting the timeout globally for
1294  *          whole View. Request timeout value will be calculated as minimum
1295  *          of argument of the API and value set in XHR field. If XHR field
1296  *          value is 0, value from API will be used.
1297  *
1298  * @since_tizen 3.0
1299  *
1300  * @param[in] o view object
1301  * @param[in] timeout XHR LongPolling timeout value (in seconds)
1302  */
1303 EXPORT_API void ewk_view_session_timeout_set(Evas_Object* o, unsigned long timeout);
1304
1305 /**
1306  * @brief Enforces web page to close
1307  *
1308  * @since_tizen 3.0
1309  *
1310  * @param[in] o view
1311  *
1312  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1313  *
1314  */
1315 EXPORT_API Eina_Bool ewk_view_page_close(Evas_Object* o);
1316
1317 /**
1318  * @brief Requests the manifest data from a given URL.
1319  *
1320  * @since_tizen 3.0
1321  *
1322  * @param[in] o view object to request the manifest information
1323  * @param[in] callback Ewk_View_Request_Manifest_Callback function
1324  * @param[in] manifest_url a given URL
1325  * @param[in] host_url a host url used to resolve relative URLs
1326  *            located in manifest file
1327  *
1328  * @see Ewk_View_Request_Manifest_Callback
1329  */
1330 EXPORT_API void ewk_view_request_manifest_from_url(Evas_Object* o, Ewk_View_Request_Manifest_Callback callback, void* user_data, const char* host_url, const char* manifest_url);
1331
1332 /**
1333  * Callback for @a ewk_view_app_installation_request_callback_set api.
1334  *
1335  * @since_tizen 4.0
1336  *
1337  * @param[in] o view object
1338  * @param[in] request app installation request
1339  * @param[in] user_data user data passed to
1340  *                      @a ewk_view_app_installation_request_callback_set api
1341  */
1342 typedef void (*Ewk_App_Installation_Request_Callback)(Evas_Object* o, Ewk_App_Installation_Request* request, void* user_data);
1343
1344 /**
1345  * Set callback handling app installation request. It is called in reaction to
1346  * window.navigator.installApp() api being called.
1347  *
1348  * @since_tizen 4.0
1349  *
1350  * @param[in] o view object
1351  * @param[in] callback callback to be set; Can be null
1352  * @param[in] user_data user data to be passed to @a callback; Can be null
1353  */
1354 EXPORT_API void ewk_view_app_installation_request_callback_set(Evas_Object* o, Ewk_App_Installation_Request_Callback callback, void* user_data);
1355
1356
1357 #ifdef __cplusplus
1358 }
1359 #endif
1360 #endif // ewk_view_internal_h