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