2 * Copyright (C) 2011-2016 Samsung Electronics. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
27 * @file ewk_view_internal.h
28 * @brief Chromium main smart object.
30 * This object provides view related APIs of Chromium to EFL object.
33 #ifndef ewk_view_internal_h
34 #define ewk_view_internal_h
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"
51 #include "ewk_window_features_internal.h"
57 /// Enum values containing text directionality values.
59 EWK_TEXT_DIRECTION_RIGHT_TO_LEFT,
60 EWK_TEXT_DIRECTION_LEFT_TO_RIGHT
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
70 typedef enum Ewk_Password_Popup_Option Ewk_Password_Popup_Option;
72 typedef struct Ewk_View_Smart_Data Ewk_View_Smart_Data;
73 typedef struct Ewk_View_Smart_Class Ewk_View_Smart_Class;
75 // #if PLATFORM(TIZEN)
76 /// Creates a type name for _Ewk_Event_Gesture.
77 typedef struct Ewk_Event_Gesture Ewk_Event_Gesture;
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 */
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,
99 typedef enum Ewk_Unfocus_Direction Ewk_Unfocus_Direction;
102 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
104 * \enum Ewk_Input_Type
105 * @brief Provides type of focused input element
107 enum Ewk_Input_Type {
109 EWK_INPUT_TYPE_TELEPHONE,
110 EWK_INPUT_TYPE_NUMBER,
111 EWK_INPUT_TYPE_EMAIL,
113 EWK_INPUT_TYPE_PASSWORD,
114 EWK_INPUT_TYPE_COLOR,
116 EWK_INPUT_TYPE_DATETIME,
117 EWK_INPUT_TYPE_DATETIMELOCAL,
118 EWK_INPUT_TYPE_MONTH,
122 typedef enum Ewk_Input_Type Ewk_Input_Type;
123 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
125 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
127 * \enum Ewk_Selection_Handle_Type
128 * @brief Provides type of selection handle
130 enum Ewk_Selection_Handle_Type {
131 EWK_SELECTION_HANDLE_TYPE_LEFT,
132 EWK_SELECTION_HANDLE_TYPE_RIGHT,
133 EWK_SELECTION_HANDLE_TYPE_LARGE
135 typedef enum Ewk_Selection_Handle_Type Ewk_Selection_Handle_Type;
136 // #endif // ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
137 // #endif // #if PLATFORM(TIZEN)
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
146 typedef enum Ewk_View_Mode Ewk_View_Mode;
148 enum Ewk_Top_Control_State {
149 EWK_TOP_CONTROL_SHOWN = 1,
150 EWK_TOP_CONTROL_HIDDEN = 2,
151 EWK_TOP_CONTROL_BOTH = 3
153 typedef enum Ewk_Top_Control_State Ewk_Top_Control_State;
155 enum Ewk_Mouse_Button_Type {
156 EWK_Mouse_Button_Left = 1,
157 EWK_Mouse_Button_Middle = 2,
158 EWK_Mouse_Button_Right = 3
160 typedef enum Ewk_Mouse_Button_Type Ewk_Mouse_Button_Type;
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;
169 typedef struct _EwkMediaDeviceInfo{
170 const char* device_id;
172 EwkMediaDeviceType type;
174 } EwkMediaDeviceInfo;
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;
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 */
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);
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);
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);
194 Eina_Bool (*input_picker_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, const char* inputValue);
196 Eina_Bool (*orientation_lock)(Ewk_View_Smart_Data* sd, int orientations);
197 void (*orientation_unlock)(Ewk_View_Smart_Data* sd);
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);
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);
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);
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);
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);
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);
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);
239 // #if PLATFORM(TIZEN)
241 * Callback for ewk_view_web_app_capable_get
243 * @param capable web application capable
244 * @param user_data user_data will be passsed when ewk_view_web_app_capable_get is called
246 typedef void (*Ewk_Web_App_Capable_Get_Callback)(Eina_Bool capable, void* user_data);
249 * Callback for ewk_view_web_app_icon_get
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
254 typedef void (*Ewk_Web_App_Icon_URL_Get_Callback)(const char* icon_url, void* user_data);
257 * Callback for ewk_view_screenshot_contents_get_async
259 * @param image captured screenshot
260 * @param user_data user_data will be passsed when ewk_view_screenshot_contents_get_async is called
262 typedef void (*Ewk_Web_App_Screenshot_Captured_Callback)(Evas_Object* image, void* user_data);
265 * Callback for ewk_view_web_app_icon_urls_get.
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
270 typedef void (*Ewk_Web_App_Icon_URLs_Get_Callback)(Eina_List *icon_urls, void *user_data);
274 * Callback for ewk_view_notification_permission_callback_set
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
280 * @return returned value is not used
282 typedef Eina_Bool (*Ewk_View_Notification_Permission_Callback)(Evas_Object *o, Ewk_Notification_Permission_Request *request, void *user_data);
285 * Defines a callback for scale change.
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
291 typedef void (*Ewk_View_Scale_Changed_Callback)(Evas_Object *o, double scale_factor, void *user_data);
294 * Defines a callback for show or hide the notification to user.
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
302 typedef void (*Ewk_View_SmartRC_Mic_Notification_Callback)(Evas_Object *o, Eina_Bool show, void *user_data);
304 typedef void (*Ewk_Media_Device_List_Get_Callback)(EwkMediaDeviceInfo* device_list, int size, void* user_data);
307 * The version you have to put into the version field
308 * in the @a Ewk_View_Smart_Class structure.
310 #define EWK_VIEW_SMART_CLASS_VERSION 1UL
313 * Initializer for whole Ewk_View_Smart_Class structure.
315 * @param smart_class_init initializer to use for the "base" field
316 * (Evas_Smart_Class).
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
322 #define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION}
325 * Initializer to zero a whole Ewk_View_Smart_Class structure.
327 * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
328 * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
329 * @see EWK_VIEW_SMART_CLASS_INIT
331 #define EWK_VIEW_SMART_CLASS_INIT_NULL EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
334 * Initializer to zero a whole Ewk_View_Smart_Class structure and set
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.
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.
345 * @see EWK_VIEW_SMART_CLASS_INIT_NULL
346 * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
347 * @see EWK_VIEW_SMART_CLASS_INIT
349 #define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
351 typedef struct EwkViewImpl EwkViewImpl;
353 * @brief Contains an internal View data.
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).
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 */
364 Evas_Coord x, y, w, h; /**< last used viewport */
366 struct { /**< what changed since last smart_calculate */
369 // WebKit use these but we don't. We should remove these if we are sure
372 Eina_Bool position:1;
377 * Sets the smart class APIs, enabling view to be inherited.
379 * @param api class definition to set, all members with the
380 * exception of @a Evas_Smart_Class->data may be overridden, must
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
392 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
395 * @see ewk_view_smart_add()
397 EXPORT_API Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class *api);
400 * Creates a new EFL WebKit view object with Evas_Smart and Ewk_Context.
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.
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
411 * @return view object on success or @c NULL on failure
413 EXPORT_API Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context, Ewk_Page_Group *pageGroup);
416 * Creates a new EFL WebKit view object based on specific Ewk_Context.
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.:
423 * - Scenario 1: parent view created with default context:
425 * parent_view = ewk_view_add(evas); // uses the default context.
427 * parent_view = ewk_view_add_with_context(evas, ewk_context_default_get());
430 * child_view = ewk_view_add_with_context(evas, ewk_view_context_get(parent_view));
432 * child_view = ewk_view_add_with_context(evas, ewk_context_default_get());
435 * view_view = ewk_view_add_with_context(evas, ewk_context_new());
437 * - Scenario 2: parent created with a new context:
439 * parent_view = ewk_view_add_with_context(evas, ewk_context_new());
442 * child_view = ewk_view_add_with_context(evas, ewk_view_context_get(parent_view));
445 * child_view = ewk_view_add_with_context(evas, ewk_context_new());
447 * child_view = ewk_view_add_with_context(evas, ewk_context_default_get());
449 * @param e canvas object where to create the view object
450 * @param context Ewk_Context object to declare process model
452 * @return view object on success or @c NULL on failure
454 EXPORT_API Evas_Object *ewk_view_add_with_context(Evas *e, Ewk_Context *context);
457 * @brief Gets the widget of this view.
461 * @param[in] o The view object to get the widget
463 * @return widget on success or @c NULL on failure
465 EXPORT_API Evas_Object* ewk_view_widget_get(Evas_Object* view);
467 enum Ewk_Page_Visibility_State {
468 EWK_PAGE_VISIBILITY_STATE_VISIBLE,
469 EWK_PAGE_VISIBILITY_STATE_HIDDEN,
470 EWK_PAGE_VISIBILITY_STATE_PRERENDER
472 typedef enum Ewk_Page_Visibility_State Ewk_Page_Visibility_State;
475 * Callback for ewk_view_script_execute
477 * @param o the view object
478 * @param result_value value returned by script
479 * @param user_data user data
481 typedef void (*Ewk_View_Script_Execute_Callback)(Evas_Object* o, const char* result_value, void* user_data);
484 * Callback for ewk_view_plain_text_get
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
490 typedef void (*Ewk_View_Plain_Text_Get_Callback)(Evas_Object* o, const char* plain_text, void* user_data);
493 * Creates a type name for the callback function used to get the page contents.
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
499 typedef void (*Ewk_View_MHTML_Data_Get_Callback)(Evas_Object *o, const char *data, void *user_data);
502 * @brief Gets whether horizontal panning is holding.
506 * @param[in] o view object to get whether horizontal panning is holding
508 * @return @c EINA_TRUE if horizontal panning is holding
509 * @c EINA_FALSE if not or on failure
511 EXPORT_API Eina_Bool ewk_view_horizontal_panning_hold_get(Evas_Object* o);
514 * @brief Sets to hold horizontal panning.
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
522 EXPORT_API void ewk_view_horizontal_panning_hold_set(Evas_Object* o, Eina_Bool hold);
525 * @brief Gets whether vertical panning is holding.
529 * @param[in] o view object to get whether vertical panning is holding
531 * @return @c EINA_TRUE if vertical panning is holding
532 * @c EINA_FALSE if not or on failure
534 EXPORT_API Eina_Bool ewk_view_vertical_panning_hold_get(Evas_Object* o);
537 * Block/Release the vertical pan
539 * @param o view object on which pan is to be blocked/release
540 * @param hold status of pan
542 EXPORT_API void ewk_view_vertical_panning_hold_set(Evas_Object* o, Eina_Bool hold);
545 * Gets the minimum and maximum value of the scale range or -1 on failure
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.
551 * @note Use @c NULL pointers on the scale components you're not
552 * interested in: they'll be ignored by the function.
554 EXPORT_API void ewk_view_scale_range_get(Evas_Object* o, double* min_scale, double* max_scale);
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);
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);
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);
569 * Callback for ewk_view_javascript_prompt_callback_set
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
576 typedef Eina_Bool (*Ewk_View_JavaScript_Prompt_Callback)(Evas_Object* o, const char* message, const char* default_value, void* user_data);
579 * Display javascript prompt popup
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
586 EXPORT_API void ewk_view_javascript_prompt_callback_set(Evas_Object* o, Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
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);
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);
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);
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);
609 * Callback for geolocation permission request feature.
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
618 typedef Eina_Bool (*Ewk_View_Geolocation_Permission_Callback)(Evas_Object* ewk_view, Ewk_Geolocation_Permission_Request* request, void* user_data);
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
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
629 * @note When callback is set by this function, it will be called insted of
630 * "geolocation,permission,request" smart callback.
632 EXPORT_API void ewk_view_geolocation_permission_callback_set(Evas_Object* ewk_view, Ewk_View_Geolocation_Permission_Callback callback, void* user_data);
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,
638 EXPORT_API void ewk_view_user_media_permission_callback_set(
639 Evas_Object* ewk_view,
640 Ewk_View_User_Media_Permission_Callback callback,
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,
648 typedef enum _Ewk_User_Media_Permission_Query_Result
649 Ewk_User_Media_Permission_Query_Result;
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,
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,
662 * Callback for ewk_view_authentication_callback_set
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
668 typedef void (*Ewk_View_Authentication_Callback)(Evas_Object* o, Ewk_Auth_Challenge* auth_challenge, void* user_data);
671 * Sets the callback authentication.
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
677 * @note When callback is set by this function,
678 * class of Ewk_Auth_Challenge is passed by callback function.
680 * @see Ewk_View_Authentication_Callback
682 EXPORT_API void ewk_view_authentication_callback_set(Evas_Object* o, Ewk_View_Authentication_Callback callback, void* user_data);
684 EXPORT_API Eina_Bool ewk_view_mode_set(Evas_Object* ewkView, Ewk_View_Mode view_mode);
687 * Requests the specified plain text string into the view object
689 * @note The mime type of document will be "text/plain".
691 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
693 EXPORT_API Eina_Bool ewk_view_plain_text_set(Evas_Object* o, const char* plain_text);
696 * Requests for setting page visibility state.
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
703 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
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);
708 * Request to set the user agent with application name.
710 * @param o view object to set the user agent with application name
712 * @param application_name string to set the user agent
714 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
716 EXPORT_API Eina_Bool ewk_view_application_name_for_user_agent_set(Evas_Object* o, const char* application_name);
719 * Returns application name string.
721 * @param o view object to get the application name
723 * @return @c application name. The returned string @b should be freed by
724 * eina_stringshare_del() after use.
726 EXPORT_API const char* ewk_view_application_name_for_user_agent_get(const Evas_Object* o);
731 * @param o view object to add custom header
733 * @param name custom header name to add the custom header
735 * @param value custom header value to add the custom header
737 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
739 EXPORT_API Eina_Bool ewk_view_custom_header_add(const Evas_Object* o, const char* name, const char* value);
741 * remove custom header
743 * @param o view object to remove custom header
745 * @param name custom header name to remove the custom header
747 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
749 EXPORT_API Eina_Bool ewk_view_custom_header_remove(const Evas_Object* o, const char* name);
751 * clears all custom headers
753 * @param o view object to clear custom headers
755 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
757 EXPORT_API Eina_Bool ewk_view_custom_header_clear(const Evas_Object* o);
760 * Returns the evas image object of the specified viewArea of page
762 * The returned evas image object @b should be freed after use.
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.
769 * @return newly allocated evas image object on sucess or @c 0 on failure.
771 EXPORT_API Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* o, Eina_Rectangle viewArea, float scaleFactor, Evas* canvas);
774 * Makes request of evas image object of the specified viewArea of page asynchronously
776 * The returned evas image object through async callback @b should be freed after use.
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.
786 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors.
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);
791 * Start a server for inspecting web pages
792 * This server will be used by Remote Web Browser to transfer messages over network
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
797 * @return @c assigned port number on success or @c 0 on failure
799 EXPORT_API unsigned int ewk_view_inspector_server_start(Evas_Object* o, unsigned int port);
802 * Stop a server for inspecting web pages
804 * @param [o] view object to debug
806 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
808 EXPORT_API Eina_Bool ewk_view_inspector_server_stop(Evas_Object* o);
811 * Gets the possible scroll size of the given view.
813 * Possible scroll size is contents size minus the viewport size.
815 * @param o view object to get scroll size
816 * @param w the pointer to store the horizontal size that is possible to scroll,
818 * @param h the pointer to store the vertical size that is possible to scroll,
821 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
824 EXPORT_API Eina_Bool ewk_view_scroll_size_get(const Evas_Object* o, int* w, int* h);
827 * Executes editor command.
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
833 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
835 EXPORT_API Eina_Bool ewk_view_command_execute(Evas_Object* o, const char* command, const char* value);
838 * Retrieve the contents in plain text.
840 * @param o view object whose contents to retrieve.
841 * @param callback result callback
842 * @param user_data user data
844 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
846 EXPORT_API Eina_Bool ewk_view_plain_text_get(Evas_Object* o, Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
849 * Get page contents as MHTML data
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
855 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
857 EXPORT_API Eina_Bool ewk_view_mhtml_data_get(Evas_Object *o, Ewk_View_MHTML_Data_Get_Callback callback, void *user_data);
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);
862 * Requests new hit test for given view object and point.
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
870 * @return EINA_TRUE if hit test request was queued, otherwise EINA_FALSE
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);
876 * Notify that notification is closed.
878 * @param notification_list list of Ewk_Notification pointer
879 * notification_list is freed in this function.
881 * @return this function will always return EINA_FALSE since it is deprecated
884 * @see ewk_notification_closed
886 EINA_DEPRECATED EXPORT_API Eina_Bool ewk_view_notification_closed(Evas_Object* o, Eina_List* notification_list);
889 * @deprecated Deprecated since Tizen 5.0. Manual encoding selection is removed from upstream
890 * Sets the encoding and reloads the page.
892 * @param ewkView view to set the encoding
893 * @param encoding the new encoding to set or @c 0 to restore the default one
895 EINA_DEPRECATED EXPORT_API void ewk_view_encoding_custom_set(Evas_Object* ewkView, const char* encoding);
897 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
900 * Sets whether the ewk_view supports the mouse events or not.
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.
905 * @param o view object to enable/disable the mouse events
906 * @param enabled a state to set
908 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
910 EXPORT_API Eina_Bool ewk_view_mouse_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
913 * Queries if the ewk_view supports the mouse events.
915 * @param o view object to query if the mouse events are enabled
917 * @return @c EINA_TRUE if the mouse events are enabled or @c EINA_FALSE otherwise
919 EXPORT_API Eina_Bool ewk_view_mouse_events_enabled_get(const Evas_Object *o);
921 typedef Eina_Bool (*Ewk_Orientation_Lock_Cb)(Evas_Object* o, Eina_Bool need_lock, int orientation, void* user_data);
925 * Sets callback of orientation lock function
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.
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
938 * @return current URI on success or @c 0 on failure
940 EINA_DEPRECATED EXPORT_API void ewk_view_orientation_lock_callback_set(Evas_Object *o, Ewk_Orientation_Lock_Cb func, void* user_data);
943 * Sets the callback on the scale factor change.
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.
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
954 EXPORT_API void ewk_view_scale_changed_callback_set(Evas_Object *o, Ewk_View_Scale_Changed_Callback callback, void *user_data);
957 * Clears the highlight of searched text.
959 * @param o view object to find text
961 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
963 EXPORT_API Eina_Bool ewk_view_text_find_highlight_clear(Evas_Object *o);
966 * Sets whether the ewk_view supports the touch events or not.
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.
971 * @param o view object to enable/disable the touch events
972 * @param enabled a state to set
974 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
976 EXPORT_API Eina_Bool ewk_view_touch_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
979 * Queries if the ewk_view supports the touch events.
981 * @param o view object to query if the touch events are enabled
983 * @return @c EINA_TRUE if the touch events are enabled or @c EINA_FALSE otherwise
985 EXPORT_API Eina_Bool ewk_view_touch_events_enabled_get(const Evas_Object *o);
987 /// Enum values containing Content Security Policy header types.
988 enum _Ewk_CSP_Header_Type {
993 typedef enum _Ewk_CSP_Header_Type Ewk_CSP_Header_Type;
996 * Set received Content Security Policy data from web app
998 * @param o view object
999 * @param policy Content Security Policy data
1000 * @param type Content Security Policy header type
1003 EXPORT_API void ewk_view_content_security_policy_set(Evas_Object* o, const char* policy, Ewk_CSP_Header_Type type);
1006 * When font-family is "Tizen", use system's Settings font as default font-family
1008 * @param o view object
1011 EXPORT_API void ewk_view_use_settings_font(Evas_Object* o);
1014 * Get cookies associated with an URL.
1016 * @param o view object in which URL is opened.
1017 * @param url the url for which cookies needs to be obtained.
1019 * @return @c character array containing cookies, @c NULL if no cookies are found.
1021 * The return character array has to be owned by the application and freed when not required.
1023 EXPORT_API char* ewk_view_get_cookies_for_url(Evas_Object* o, const char* url);
1026 * Sets whether to draw transparent background or not.
1028 * @param o view object to enable/disable transparent background
1029 * @param enabled a state to set
1031 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1033 EXPORT_API Eina_Bool ewk_view_draws_transparent_background_set(Evas_Object *o, Eina_Bool enabled);
1036 * @brief Queries if transparent background is enabled.
1040 * @param[in] o view object to get whether transparent background is enabled or not
1042 * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
1044 EXPORT_API Eina_Bool ewk_view_draws_transparent_background_get(Evas_Object* o);
1047 * @brief Sets the background color and transparency of the view.
1049 * @note Should be used after ewk_view_url_set().
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]
1057 * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
1059 EXPORT_API Eina_Bool ewk_view_bg_color_set(Evas_Object* o, int r, int g, int b, int a);
1062 * set a font for browser application
1064 * @param o view object
1067 EXPORT_API void ewk_view_browser_font_set(Evas_Object* o);
1070 * Load the error page which web page is not found.
1072 * @param ewkView view object whose session needs to be stored.
1073 * @param ErrorUrl that could not be found.
1077 EXPORT_API void ewk_view_not_found_error_page_load(Evas_Object* ewkView, const char* ErrorUrl);
1080 * Enable or disable supporting of the split scrolling for overflow scroll.
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
1085 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1087 EXPORT_API Eina_Bool ewk_view_split_scroll_overflow_enabled_set(Evas_Object* ewkView, const Eina_Bool enabled);
1090 * @brief Gets the staus of split scrolling supporting for overflow scroll.
1094 * @param[in] o view object to get the status of split scrolling supporting
1096 * @return the status of split scrolling supporting
1098 EXPORT_API Eina_Bool ewk_view_split_scroll_overflow_enabled_get(const Evas_Object* o);
1102 * Enable/disable focus ring.
1104 * @note Focus ring is enabled by default but disabled for wrt on TV profile
1106 * @param ewkView view object
1107 * @param enabled @c EINA_TRUE to enable the focus ring, @c EINA_FALSE to disable
1110 EINA_DEPRECATED EXPORT_API void ewk_view_draw_focus_ring_enable_set(Evas_Object* ewkView, Eina_Bool enable);
1113 * Queries the current zoom factor of the page.
1115 * @param o view object to get the zoom factor
1117 * @return current zoom factor in use on success or @c -1.0 on failure
1119 EXPORT_API double ewk_view_page_zoom_get(const Evas_Object *o);
1122 * Sets zoom factor of the current page.
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.
1129 * @param o view object to set the zoom level
1130 * @param zoom_factor a new level to set
1132 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1134 EXPORT_API Eina_Bool ewk_view_page_zoom_set(Evas_Object *o, double zoom_factor);
1137 * Creates a new EFL WebKit view object with Evas_Smart and Ewk_Context.
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.
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
1148 * @return view object on success or @c NULL on failure
1150 EXPORT_API Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context, Ewk_Page_Group *pageGroup);
1153 * Callback for quota permission request feature.
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
1159 typedef void (*Ewk_Quota_Permission_Request_Callback)(Evas_Object* ewkView, const Ewk_Quota_Permission_Request* request, void* user_data);
1162 * Sets callback quota permission request.
1164 * func will be called when page requests increased storage quota.
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
1172 EXPORT_API void ewk_view_quota_permission_request_callback_set(Evas_Object* ewkView, Ewk_Quota_Permission_Request_Callback callback, void* user_data);
1175 * Set reply to quota permission request.
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.
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
1185 EXPORT_API void ewk_view_quota_permission_request_reply(const Ewk_Quota_Permission_Request* request, const Eina_Bool allow);
1188 * Cancels quota permission request.
1190 * @param request view object to set the support of the split scrolling for overflow scroll
1194 EXPORT_API void ewk_view_quota_permission_request_cancel(const Ewk_Quota_Permission_Request* request);
1197 * Requests web login using password database.
1199 * @param o view object
1203 EXPORT_API Eina_Bool ewk_view_web_login_request(Evas_Object* ewkView);
1206 * Sets the notification permission callback.
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
1212 EXPORT_API void ewk_view_notification_permission_callback_set(Evas_Object *o, Ewk_View_Notification_Permission_Callback callback, void *user_data);
1215 * @brief Callback invoked when theme color is changed
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
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
1236 * @see ewk_view_did_change_theme_color_callback_set
1238 typedef void (*Ewk_View_Did_Change_Theme_Color_Callback)(Evas_Object* o, int r, int g, int b, int a, void* user_data);
1241 * @brief Sets Ewk_View_Did_Change_Theme_Color_Callback
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
1249 * @return @c EINA_TRUE on success,\n
1250 * otherwise @c EINA_FALSE
1252 * @see Ewk_View_Did_Change_Theme_Color_Callback
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);
1257 * @brief Callback invoked when save page is done
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
1265 * @see ewk_view_save_page_as_mhtml
1267 typedef void (*Ewk_View_Save_Page_Callback)(Evas_Object* o, const char* file_path, void* user_data);
1270 * @brief Save current page as MHTML format
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
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
1286 * @return @c EINA_TRUE on successful request,\n
1287 * otherwise @c EINA_FALSE
1289 * @see Ewk_View_Save_Page_Callback
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);
1294 * @brief Set Reader mode enable
1298 * @param[in] ewk_view view object to enable/disable the Reader mode
1299 * @param[in] enable a state to set
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.
1304 EXPORT_API void ewk_view_reader_mode_set(Evas_Object* ewk_view, Eina_Bool enable);
1307 * @brief Sets the height of top controls.
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
1315 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1317 EXPORT_API Eina_Bool ewk_view_top_controls_height_set(Evas_Object* ewk_view,
1318 size_t top_height, size_t bottom_height);
1321 * @brief Sets the state of top controls.
1325 * @note EWK_TOP_CONTROL_BOTH for current to preserve the current position.
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
1332 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
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);
1337 * @brief Sets the visibility of main frame scrollbar.
1341 * @param[in] o view object
1342 * @param[in] visible visibility of main frame scrollbar
1344 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1346 EXPORT_API Eina_Bool ewk_view_main_frame_scrollbar_visible_set(Evas_Object* o, Eina_Bool visible);
1349 * @brief Set Default XHR LongPolling Timeout.
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.
1360 * @param[in] o view object
1361 * @param[in] timeout XHR LongPolling timeout value (in seconds)
1363 EXPORT_API void ewk_view_session_timeout_set(Evas_Object* o, unsigned long timeout);
1366 * @brief Enforces web page to close
1372 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1375 EXPORT_API Eina_Bool ewk_view_page_close(Evas_Object* o);
1378 * @brief Requests the manifest data from a given URL.
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
1388 * @see Ewk_View_Request_Manifest_Callback
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);
1393 * Callback for @a ewk_view_app_installation_request_callback_set api.
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
1402 typedef void (*Ewk_App_Installation_Request_Callback)(Evas_Object* o, Ewk_App_Installation_Request* request, void* user_data);
1405 * Set callback handling app installation request. It is called in reaction to
1406 * window.navigator.installApp() api being called.
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
1414 EXPORT_API void ewk_view_app_installation_request_callback_set(Evas_Object* o, Ewk_App_Installation_Request_Callback callback, void* user_data);
1417 * Sets the state to apply Blur Effect for widgets
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.
1428 EXPORT_API void ewk_view_mirrored_blur_set(Evas_Object* o, Eina_Bool state);
1431 * Sets whether the ewk_view renders to offscreen buffer or not.
1435 * @param[in] o view object
1436 * @param[in] enabled a state to set
1438 EXPORT_API void ewk_view_offscreen_rendering_enabled_set(Evas_Object* o, Eina_Bool enabled);
1441 * Sets the window object which is used for IME.
1445 * @param[in] o view object
1446 * @param[in] window the top-level window object
1448 EXPORT_API void ewk_view_ime_window_set(Evas_Object* o, void* window);
1451 * Sends mouse down event.
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
1460 EXPORT_API void ewk_view_feed_mouse_down(Evas_Object* o,
1461 Ewk_Mouse_Button_Type button,
1466 * Sends mouse up event.
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
1475 EXPORT_API void ewk_view_feed_mouse_up(Evas_Object* o,
1476 Ewk_Mouse_Button_Type button,
1481 * Sends mouse move event.
1485 * @param[in] o view object
1486 * @param[in] x horizontal position of mouse event
1487 * @param[in] y vertical position of mouse event
1489 EXPORT_API void ewk_view_feed_mouse_move(Evas_Object* o, int x, int y);
1492 * Sends mouse wheel event.
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
1502 EXPORT_API void ewk_view_feed_mouse_wheel(Evas_Object* o,
1503 Eina_Bool y_direction,
1509 * @brief Sends key event.
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
1518 EXPORT_API Eina_Bool ewk_view_send_key_event(Evas_Object* o,
1520 Eina_Bool is_press);
1522 EXPORT_API void ewk_view_media_device_list_get(Evas_Object* o, Ewk_Media_Device_List_Get_Callback callback, void* user_data);
1527 #endif // ewk_view_internal_h