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
36 #include "ewk_app_installation_request_internal.h"
37 #include "ewk_auth_challenge_internal.h"
38 #include "ewk_context_internal.h"
39 #include "ewk_enums_internal.h"
40 #include "ewk_frame_internal.h"
41 #include "ewk_geolocation_internal.h"
42 #include "ewk_hit_test_internal.h"
43 #include "ewk_history_internal.h"
44 #include "ewk_page_group_internal.h"
45 #include "ewk_quota_permission_request_internal.h"
46 #include "ewk_touch_internal.h"
47 #include "ewk_user_media_internal.h"
49 #include "ewk_window_features_internal.h"
55 /// Enum values containing text directionality values.
57 EWK_TEXT_DIRECTION_RIGHT_TO_LEFT,
58 EWK_TEXT_DIRECTION_LEFT_TO_RIGHT
61 enum Ewk_Password_Popup_Option {
62 EWK_PASSWORD_POPUP_SAVE,
63 EWK_PASSWORD_POPUP_NOT_NOW,
64 EWK_PASSWORD_POPUP_NEVER,
65 EWK_PASSWORD_POPUP_OK = EWK_PASSWORD_POPUP_SAVE,
66 EWK_PASSWORD_POPUP_CANCEL =EWK_PASSWORD_POPUP_NOT_NOW
68 typedef enum Ewk_Password_Popup_Option Ewk_Password_Popup_Option;
70 typedef struct Ewk_View_Smart_Data Ewk_View_Smart_Data;
71 typedef struct Ewk_View_Smart_Class Ewk_View_Smart_Class;
73 // #if PLATFORM(TIZEN)
74 /// Creates a type name for _Ewk_Event_Gesture.
75 typedef struct Ewk_Event_Gesture Ewk_Event_Gesture;
77 /// Represents a gesture event.
78 struct Ewk_Event_Gesture {
79 Ewk_Gesture_Type type; /**< type of the gesture event */
80 Evas_Coord_Point position; /**< position of the gesture event */
81 Evas_Point velocity; /**< velocity of the gesture event. The unit is pixel per second. */
82 double scale; /**< scale of the gesture event */
83 int count; /**< count of the gesture */
84 unsigned int timestamp; /**< timestamp of the gesture */
87 // #if ENABLE(TIZEN_FOCUS_UI)
88 enum Ewk_Unfocus_Direction {
89 EWK_UNFOCUS_DIRECTION_NONE = 0,
90 EWK_UNFOCUS_DIRECTION_FORWARD,
91 EWK_UNFOCUS_DIRECTION_BACKWARD,
92 EWK_UNFOCUS_DIRECTION_UP,
93 EWK_UNFOCUS_DIRECTION_DOWN,
94 EWK_UNFOCUS_DIRECTION_LEFT,
95 EWK_UNFOCUS_DIRECTION_RIGHT,
97 typedef enum Ewk_Unfocus_Direction Ewk_Unfocus_Direction;
100 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
102 * \enum Ewk_Input_Type
103 * @brief Provides type of focused input element
105 enum Ewk_Input_Type {
107 EWK_INPUT_TYPE_TELEPHONE,
108 EWK_INPUT_TYPE_NUMBER,
109 EWK_INPUT_TYPE_EMAIL,
111 EWK_INPUT_TYPE_PASSWORD,
112 EWK_INPUT_TYPE_COLOR,
114 EWK_INPUT_TYPE_DATETIME,
115 EWK_INPUT_TYPE_DATETIMELOCAL,
116 EWK_INPUT_TYPE_MONTH,
120 typedef enum Ewk_Input_Type Ewk_Input_Type;
121 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
123 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
125 * \enum Ewk_Selection_Handle_Type
126 * @brief Provides type of selection handle
128 enum Ewk_Selection_Handle_Type {
129 EWK_SELECTION_HANDLE_TYPE_LEFT,
130 EWK_SELECTION_HANDLE_TYPE_RIGHT,
131 EWK_SELECTION_HANDLE_TYPE_LARGE
133 typedef enum Ewk_Selection_Handle_Type Ewk_Selection_Handle_Type;
134 // #endif // ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
135 // #endif // #if PLATFORM(TIZEN)
138 EWK_VIEW_MODE_WINDOWED = 0,
139 EWK_VIEW_MODE_FLOATING,
140 EWK_VIEW_MODE_FULLSCREEN,
141 EWK_VIEW_MODE_MAXIMIZED,
142 EWK_VIEW_MODE_MINIMIZED
144 typedef enum Ewk_View_Mode Ewk_View_Mode;
146 enum Ewk_Top_Control_State {
147 EWK_TOP_CONTROL_SHOWN = 1,
148 EWK_TOP_CONTROL_HIDDEN = 2,
149 EWK_TOP_CONTROL_BOTH = 3
151 typedef enum Ewk_Top_Control_State Ewk_Top_Control_State;
153 /// Ewk view's class, to be overridden by sub-classes.
154 struct Ewk_View_Smart_Class {
155 Evas_Smart_Class sc; /**< all but 'data' is free to be changed. */
156 unsigned long version;
158 Evas_Object* (*window_create)(Ewk_View_Smart_Data *sd, const Ewk_Window_Features *window_features); /**< creates a new window, requested by webkit */
159 void (*window_close)(Ewk_View_Smart_Data *sd); /**< closes a window */
161 Eina_Bool (*context_menu_show)(Ewk_View_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Ewk_Context_Menu *menu);
162 Eina_Bool (*context_menu_hide)(Ewk_View_Smart_Data *sd);
164 Eina_Bool (*popup_menu_show)(Ewk_View_Smart_Data *sd, Eina_Rectangle rect, Ewk_Text_Direction text_direction, double page_scale_factor, Eina_List* items, int selected_index);
165 Eina_Bool (*popup_menu_hide)(Ewk_View_Smart_Data *sd);
166 Eina_Bool (*popup_menu_update)(Ewk_View_Smart_Data *sd, Eina_Rectangle rect, Ewk_Text_Direction text_direction, Eina_List* items, int selected_index);
168 Eina_Bool (*text_selection_down)(Ewk_View_Smart_Data *sd, int x, int y);
169 Eina_Bool (*text_selection_up)(Ewk_View_Smart_Data *sd, int x, int y);
171 Eina_Bool (*input_picker_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, const char* inputValue);
173 Eina_Bool (*orientation_lock)(Ewk_View_Smart_Data* sd, int orientations);
174 void (*orientation_unlock)(Ewk_View_Smart_Data* sd);
177 // - returns true if handled
178 // - if overridden, have to call parent method if desired
179 Eina_Bool (*focus_in)(Ewk_View_Smart_Data *sd);
180 Eina_Bool (*focus_out)(Ewk_View_Smart_Data *sd);
181 Eina_Bool (*fullscreen_enter)(Ewk_View_Smart_Data *sd, Ewk_Security_Origin *origin);
182 Eina_Bool (*fullscreen_exit)(Ewk_View_Smart_Data *sd);
183 Eina_Bool (*mouse_wheel)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Wheel *ev);
184 Eina_Bool (*mouse_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Down *ev);
185 Eina_Bool (*mouse_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Up *ev);
186 Eina_Bool (*mouse_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Move *ev);
187 Eina_Bool (*key_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Down *ev);
188 Eina_Bool (*key_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Up *ev);
191 // - Shows and hides color picker.
192 Eina_Bool (*input_picker_color_request)(Ewk_View_Smart_Data *sd, int r, int g, int b, int a);
193 Eina_Bool (*input_picker_color_dismiss)(Ewk_View_Smart_Data *sd);
197 unsigned long long (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, const char *databaseName, const char *displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage);
199 Eina_Bool (*formdata_candidate_show)(Ewk_View_Smart_Data *sd, int x, int y, int w, int h);
200 Eina_Bool (*formdata_candidate_hide)(Ewk_View_Smart_Data *sd);
201 Eina_Bool (*formdata_candidate_update_data)(Ewk_View_Smart_Data *sd, Eina_List *dataList);
202 Eina_Bool (*formdata_candidate_is_showing)(Ewk_View_Smart_Data *sd);
204 Eina_Bool (*gesture_start)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
205 Eina_Bool (*gesture_end)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
206 Eina_Bool (*gesture_move)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
208 void (*selection_handle_down)(Ewk_View_Smart_Data *sd, Ewk_Selection_Handle_Type handleType, int x, int y);
209 void (*selection_handle_move)(Ewk_View_Smart_Data *sd, Ewk_Selection_Handle_Type handleType, int x, int y);
210 void (*selection_handle_up)(Ewk_View_Smart_Data *sd, Ewk_Selection_Handle_Type handleType, int x, int y);
212 Eina_Bool (*window_geometry_set)(Ewk_View_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height);
213 Eina_Bool (*window_geometry_get)(Ewk_View_Smart_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *width, Evas_Coord *height);
216 // #if PLATFORM(TIZEN)
218 * Callback for ewk_view_web_app_capable_get
220 * @param capable web application capable
221 * @param user_data user_data will be passsed when ewk_view_web_app_capable_get is called
223 typedef void (*Ewk_Web_App_Capable_Get_Callback)(Eina_Bool capable, void* user_data);
226 * Callback for ewk_view_web_app_icon_get
228 * @param icon_url web application icon
229 * @param user_data user_data will be passsed when ewk_view_web_app_icon_get is called
231 typedef void (*Ewk_Web_App_Icon_URL_Get_Callback)(const char* icon_url, void* user_data);
234 * Callback for ewk_view_screenshot_contents_get_async
236 * @param image captured screenshot
237 * @param user_data user_data will be passsed when ewk_view_screenshot_contents_get_async is called
239 typedef void (*Ewk_Web_App_Screenshot_Captured_Callback)(Evas_Object* image, void* user_data);
242 * Callback for ewk_view_web_app_icon_urls_get.
244 * @param icon_urls list of Ewk_Web_App_Icon_Data for web app
245 * @param user_data user_data will be passsed when ewk_view_web_app_icon_urls_get is called
247 typedef void (*Ewk_Web_App_Icon_URLs_Get_Callback)(Eina_List *icon_urls, void *user_data);
251 * Callback for ewk_view_notification_permission_callback_set
253 * @param o view object to request the notification permission
254 * @param request Ewk_Notification_Permission_Request object to get the information about notification permission request.
255 * @param user_data user data
257 * @return returned value is not used
259 typedef Eina_Bool (*Ewk_View_Notification_Permission_Callback)(Evas_Object *o, Ewk_Notification_Permission_Request *request, void *user_data);
262 * Defines a callback for scale change.
264 * @param o view object to register on scale change
265 * @param scale_factor the scale applied to view
266 * @param user_data a pointer to data specified by ewk_view_scale_changed_callback_set
268 typedef void (*Ewk_View_Scale_Changed_Callback)(Evas_Object *o, double scale_factor, void *user_data);
271 * The version you have to put into the version field
272 * in the @a Ewk_View_Smart_Class structure.
274 #define EWK_VIEW_SMART_CLASS_VERSION 1UL
277 * Initializer for whole Ewk_View_Smart_Class structure.
279 * @param smart_class_init initializer to use for the "base" field
280 * (Evas_Smart_Class).
282 * @see EWK_VIEW_SMART_CLASS_INIT_NULL
283 * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
284 * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
286 #define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION}
289 * Initializer to zero a whole Ewk_View_Smart_Class structure.
291 * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
292 * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
293 * @see EWK_VIEW_SMART_CLASS_INIT
295 #define EWK_VIEW_SMART_CLASS_INIT_NULL EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
298 * Initializer to zero a whole Ewk_View_Smart_Class structure and set
301 * Similar to EWK_VIEW_SMART_CLASS_INIT_NULL, but will set version field of
302 * Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION and name
303 * to the specific value.
305 * It will keep a reference to name field as a "const char *", that is,
306 * name must be available while the structure is used (hint: static or global!)
307 * and will not be modified.
309 * @see EWK_VIEW_SMART_CLASS_INIT_NULL
310 * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
311 * @see EWK_VIEW_SMART_CLASS_INIT
313 #define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
315 typedef struct EwkViewImpl EwkViewImpl;
317 * @brief Contains an internal View data.
319 * It is to be considered private by users, but may be extended or
320 * changed by sub-classes (that's why it's in public header file).
322 struct Ewk_View_Smart_Data {
323 Evas_Object_Smart_Clipped_Data base;
324 const Ewk_View_Smart_Class* api; /**< reference to casted class instance */
325 Evas_Object* self; /**< reference to owner object */
326 EwkViewImpl* priv; /**< should never be accessed, c++ stuff */
328 Evas_Coord x, y, w, h; /**< last used viewport */
330 struct { /**< what changed since last smart_calculate */
333 // WebKit use these but we don't. We should remove these if we are sure
336 Eina_Bool position:1;
341 * Sets the smart class APIs, enabling view to be inherited.
343 * @param api class definition to set, all members with the
344 * exception of @a Evas_Smart_Class->data may be overridden, must
347 * @note @a Evas_Smart_Class->data is used to implement type checking and
348 * is not supposed to be changed/overridden. If you need extra
349 * data for your smart class to work, just extend
350 * Ewk_View_Smart_Class instead.
351 * The Evas_Object which inherits the ewk_view should use
352 * ewk_view_smart_add() to create Evas_Object instead of
353 * evas_object_smart_add() because it performs additional initialization
356 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
359 * @see ewk_view_smart_add()
361 EXPORT_API Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class *api);
364 * Creates a new EFL WebKit view object with Evas_Smart and Ewk_Context.
366 * @note The Evas_Object which inherits the ewk_view should create its
367 * Evas_Object using this API instead of evas_object_smart_add()
368 * because the default initialization for ewk_view is done in this API.
370 * @param e canvas object where to create the view object
371 * @param smart Evas_Smart object. Its type should be EWK_VIEW_TYPE_STR
372 * @param context Ewk_Context object which is used for initializing
373 * @param pageGroup Ewk_Page_Group object which is used for initializing
375 * @return view object on success or @c NULL on failure
377 EXPORT_API Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context, Ewk_Page_Group *pageGroup);
380 * Creates a new EFL WebKit view object based on specific Ewk_Context.
382 * @note If used to created a new ewk_view object in response to a
383 * "create,window" smart signal (emitted by the web engine), this
384 * function must pass as context parameter the same context instance
385 * as of the originating ewk_view object's context, e.g.:
387 * - Scenario 1: parent view created with default context:
389 * parent_view = ewk_view_add(evas); // uses the default context.
391 * parent_view = ewk_view_add_with_context(evas, ewk_context_default_get());
394 * child_view = ewk_view_add_with_context(evas, ewk_view_context_get(parent_view));
396 * child_view = ewk_view_add_with_context(evas, ewk_context_default_get());
399 * view_view = ewk_view_add_with_context(evas, ewk_context_new());
401 * - Scenario 2: parent created with a new context:
403 * parent_view = ewk_view_add_with_context(evas, ewk_context_new());
406 * child_view = ewk_view_add_with_context(evas, ewk_view_context_get(parent_view));
409 * child_view = ewk_view_add_with_context(evas, ewk_context_new());
411 * child_view = ewk_view_add_with_context(evas, ewk_context_default_get());
413 * @param e canvas object where to create the view object
414 * @param context Ewk_Context object to declare process model
416 * @return view object on success or @c NULL on failure
418 EXPORT_API Evas_Object *ewk_view_add_with_context(Evas *e, Ewk_Context *context);
421 * @brief Gets the widget of this view.
425 * @param[in] o The view object to get the widget
427 * @return widget on success or @c NULL on failure
429 EXPORT_API Evas_Object* ewk_view_widget_get(Evas_Object* view);
431 enum Ewk_Page_Visibility_State {
432 EWK_PAGE_VISIBILITY_STATE_VISIBLE,
433 EWK_PAGE_VISIBILITY_STATE_HIDDEN,
434 EWK_PAGE_VISIBILITY_STATE_PRERENDER
436 typedef enum Ewk_Page_Visibility_State Ewk_Page_Visibility_State;
439 * Callback for ewk_view_script_execute
441 * @param o the view object
442 * @param result_value value returned by script
443 * @param user_data user data
445 typedef void (*Ewk_View_Script_Execute_Callback)(Evas_Object* o, const char* result_value, void* user_data);
448 * Callback for ewk_view_plain_text_get
450 * @param o the view object
451 * @param plain_text the contents of the given frame converted to plain text
452 * @param user_data user data
454 typedef void (*Ewk_View_Plain_Text_Get_Callback)(Evas_Object* o, const char* plain_text, void* user_data);
457 * Creates a type name for the callback function used to get the page contents.
459 * @param o view object
460 * @param data mhtml data of the page contents
461 * @param user_data user data will be passed when ewk_view_mhtml_data_get is called
463 typedef void (*Ewk_View_MHTML_Data_Get_Callback)(Evas_Object *o, const char *data, void *user_data);
466 * @brief Gets whether horizontal panning is holding.
470 * @param[in] o view object to get whether horizontal panning is holding
472 * @return @c EINA_TRUE if horizontal panning is holding
473 * @c EINA_FALSE if not or on failure
475 EXPORT_API Eina_Bool ewk_view_horizontal_panning_hold_get(Evas_Object* o);
478 * @brief Sets to hold horizontal panning.
482 * @param[in] o view object to set to hold horizontal panning
483 * @param[in] hold @c EINA_TRUE to hold horizontal panning
484 * @c EINA_FALSE not to hold
486 EXPORT_API void ewk_view_horizontal_panning_hold_set(Evas_Object* o, Eina_Bool hold);
489 * @brief Gets whether vertical panning is holding.
493 * @param[in] o view object to get whether vertical panning is holding
495 * @return @c EINA_TRUE if vertical panning is holding
496 * @c EINA_FALSE if not or on failure
498 EXPORT_API Eina_Bool ewk_view_vertical_panning_hold_get(Evas_Object* o);
501 * Block/Release the vertical pan
503 * @param o view object on which pan is to be blocked/release
504 * @param hold status of pan
506 EXPORT_API void ewk_view_vertical_panning_hold_set(Evas_Object* o, Eina_Bool hold);
509 * Gets the minimum and maximum value of the scale range or -1 on failure
511 * @param o view object to get the minimum and maximum value of the scale range
512 * @param min_scale Pointer to an double in which to store the minimum scale factor of the object.
513 * @param max_scale Pointer to an double in which to store the maximum scale factor of the object.
515 * @note Use @c NULL pointers on the scale components you're not
516 * interested in: they'll be ignored by the function.
518 EXPORT_API void ewk_view_scale_range_get(Evas_Object* o, double* min_scale, double* max_scale);
520 typedef Eina_Bool (*Ewk_View_Password_Confirm_Popup_Callback)(Evas_Object* o, const char* message, void* user_data);
521 EXPORT_API void ewk_view_password_confirm_popup_callback_set(Evas_Object* o, Ewk_View_Password_Confirm_Popup_Callback callback, void* user_data);
522 EXPORT_API void ewk_view_password_confirm_popup_reply(Evas_Object* o, Ewk_Password_Popup_Option result);
524 typedef Eina_Bool (*Ewk_View_JavaScript_Alert_Callback)(Evas_Object* o, const char* alert_text, void* user_data);
525 EXPORT_API void ewk_view_javascript_alert_callback_set(Evas_Object* o, Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
526 EXPORT_API void ewk_view_javascript_alert_reply(Evas_Object* o);
529 typedef Eina_Bool (*Ewk_View_JavaScript_Confirm_Callback)(Evas_Object* o, const char* message, void* user_data);
530 EXPORT_API void ewk_view_javascript_confirm_callback_set(Evas_Object* o, Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
533 * Callback for ewk_view_javascript_prompt_callback_set
535 * @param o the view object
536 * @param message the text to be displayed on the prompt popup
537 * @param default_value default text to be entered in the prompt dialog
538 * @param user_data user data
540 typedef Eina_Bool (*Ewk_View_JavaScript_Prompt_Callback)(Evas_Object* o, const char* message, const char* default_value, void* user_data);
543 * Display javascript prompt popup
545 * @param o view object
546 * @param callback callback function to be called when the prompt popup is to be opened
547 * @param user_data user data
550 EXPORT_API void ewk_view_javascript_prompt_callback_set(Evas_Object* o, Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
552 //#if ENABLE(TIZEN_APPLICATION_CACHE)
553 typedef Eina_Bool (*Ewk_View_Applicacion_Cache_Permission_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, void* user_data);
556 typedef Eina_Bool (*Ewk_View_Exceeded_Indexed_Database_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, long long currentQuota, void* user_data);
557 EXPORT_API void ewk_view_exceeded_indexed_database_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback, void* user_data);
558 EXPORT_API void ewk_view_exceeded_indexed_database_quota_reply(Evas_Object* o, Eina_Bool allow);
561 typedef Eina_Bool (*Ewk_View_Exceeded_Database_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, const char* database_name, unsigned long long expectedQuota, void* user_data);
562 EXPORT_API void ewk_view_exceeded_database_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Database_Quota_Callback callback, void* user_data);
563 EXPORT_API void ewk_view_exceeded_database_quota_reply(Evas_Object* o, Eina_Bool allow);
565 typedef Eina_Bool (*Ewk_View_Exceeded_Local_File_System_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, long long currentQuota, void* user_data);
566 EXPORT_API void ewk_view_exceeded_local_file_system_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Local_File_System_Quota_Callback callback, void* user_data);
567 EXPORT_API void ewk_view_exceeded_local_file_system_quota_reply(Evas_Object* o, Eina_Bool allow);
568 //#if ENABLE(TIZEN_FOCUS_UI)
569 typedef Eina_Bool (*Ewk_View_Unfocus_Allow_Callback)(Evas_Object* o, Ewk_Unfocus_Direction direction, void* user_data);
573 * Callback for geolocation permission request feature.
575 * @param ewk_view view object where geolocation permission was requested
576 * @param request geolocation permission request object
577 * @param user_data user data passed to
578 * ewk_view_geolocation_permission_callback_set
582 typedef Eina_Bool (*Ewk_View_Geolocation_Permission_Callback)(Evas_Object* ewk_view, Ewk_Geolocation_Permission_Request* request, void* user_data);
585 * Sets callback which will be called upon geolocation permission request. This
586 * function can be used also to unset this callback. Do that by passing NULL as
589 * @param ewk_view view object to set the callback to
590 * @param callback callback function called upon geolocation permission request
591 * @param user_data user_data passsed to set callback when called
593 * @note When callback is set by this function, it will be called insted of
594 * "geolocation,permission,request" smart callback.
596 EXPORT_API void ewk_view_geolocation_permission_callback_set(Evas_Object* ewk_view, Ewk_View_Geolocation_Permission_Callback callback, void* user_data);
598 typedef Eina_Bool (*Ewk_View_User_Media_Permission_Callback)(
599 Evas_Object* ewk_view,
600 Ewk_User_Media_Permission_Request* user_media_permission_request,
602 EXPORT_API void ewk_view_user_media_permission_callback_set(
603 Evas_Object* ewk_view,
604 Ewk_View_User_Media_Permission_Callback callback,
608 * Callback for ewk_view_authentication_callback_set
610 * @param o the view object
611 * @param auth_challenge Ewk_Auth_Challenge object to get the information about authentication
612 * @param user_data user data
614 typedef void (*Ewk_View_Authentication_Callback)(Evas_Object* o, Ewk_Auth_Challenge* auth_challenge, void* user_data);
617 * Sets the callback authentication.
619 * @param o the view object
620 * @param callback callback function to be called when the authentication is called
621 * @param user_data user data
623 * @note When callback is set by this function,
624 * class of Ewk_Auth_Challenge is passed by callback function.
626 * @see Ewk_View_Authentication_Callback
628 EXPORT_API void ewk_view_authentication_callback_set(Evas_Object* o, Ewk_View_Authentication_Callback callback, void* user_data);
630 EXPORT_API Eina_Bool ewk_view_mode_set(Evas_Object* ewkView, Ewk_View_Mode view_mode);
633 * Requests the specified plain text string into the view object
635 * @note The mime type of document will be "text/plain".
637 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
639 EXPORT_API Eina_Bool ewk_view_plain_text_set(Evas_Object* o, const char* plain_text);
642 * Requests for setting page visibility state.
644 * @param o view object to set the page visibility
645 * @param page_visibility_state visible state of the page to set
646 * @param initial_state @c EINA_TRUE if this function is called at page initialization time,
647 * @c EINA_FALSE otherwise
649 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
651 EXPORT_API Eina_Bool ewk_view_page_visibility_state_set(Evas_Object* o, Ewk_Page_Visibility_State page_visibility_state, Eina_Bool initial_state);
654 * Request to set the user agent with application name.
656 * @param o view object to set the user agent with application name
658 * @param application_name string to set the user agent
660 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
662 EXPORT_API Eina_Bool ewk_view_application_name_for_user_agent_set(Evas_Object* o, const char* application_name);
665 * Returns application name string.
667 * @param o view object to get the application name
669 * @return @c application name. The returned string @b should be freed by
670 * eina_stringshare_del() after use.
672 EXPORT_API const char* ewk_view_application_name_for_user_agent_get(const Evas_Object* o);
677 * @param o view object to add custom header
679 * @param name custom header name to add the custom header
681 * @param value custom header value to add the custom header
683 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
685 EXPORT_API Eina_Bool ewk_view_custom_header_add(const Evas_Object* o, const char* name, const char* value);
687 * remove custom header
689 * @param o view object to remove custom header
691 * @param name custom header name to remove the custom header
693 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
695 EXPORT_API Eina_Bool ewk_view_custom_header_remove(const Evas_Object* o, const char* name);
697 * clears all custom headers
699 * @param o view object to clear custom headers
701 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
703 EXPORT_API Eina_Bool ewk_view_custom_header_clear(const Evas_Object* o);
706 * Returns the evas image object of the specified viewArea of page
708 * The returned evas image object @b should be freed after use.
710 * @param o view object to get specified rectangle of cairo surface.
711 * @param viewArea rectangle of cairo surface.
712 * @param scaleFactor scale factor of cairo surface.
713 * @param canvas canvas for creating evas image.
715 * @return newly allocated evas image object on sucess or @c 0 on failure.
717 EXPORT_API Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* o, Eina_Rectangle viewArea, float scaleFactor, Evas* canvas);
720 * Makes request of evas image object of the specified viewArea of page asynchronously
722 * The returned evas image object through async callback @b should be freed after use.
724 * @param o view object to get specified rectangle of cairo surface.
725 * @param viewArea rectangle of cairo surface.
726 * @param scaleFactor scale factor of cairo surface.
727 * @param canvas canvas for creating evas image.
728 * @param callback result callback to get captured screenshot.
729 * @param user_data will be passed when result_callback is called
730 * -I.e., user data will be kept until callback is called.
732 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors.
734 EXPORT_API Eina_Bool ewk_view_screenshot_contents_get_async(const Evas_Object* o, Eina_Rectangle viewArea, float scaleFactor, Evas* canvas, Ewk_Web_App_Screenshot_Captured_Callback callback, void* user_data);
737 * Start a server for inspecting web pages
738 * This server will be used by Remote Web Browser to transfer messages over network
740 * @param [o] view object to debug
741 * @param [in] port It is a port number for the server. A free port on system will be allocated if port is 0
743 * @return @c assigned port number on success or @c 0 on failure
745 EXPORT_API unsigned int ewk_view_inspector_server_start(Evas_Object* o, unsigned int port);
748 * Stop a server for inspecting web pages
750 * @param [o] view object to debug
752 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
754 EXPORT_API Eina_Bool ewk_view_inspector_server_stop(Evas_Object* o);
757 * Gets the possible scroll size of the given view.
759 * Possible scroll size is contents size minus the viewport size.
761 * @param o view object to get scroll size
762 * @param w the pointer to store the horizontal size that is possible to scroll,
764 * @param h the pointer to store the vertical size that is possible to scroll,
767 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
770 EXPORT_API Eina_Bool ewk_view_scroll_size_get(const Evas_Object* o, int* w, int* h);
773 * Executes editor command.
775 * @param o view object to execute command
776 * @param command editor command to execute
777 * @param value the value to be passed into command
779 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
781 EXPORT_API Eina_Bool ewk_view_command_execute(Evas_Object* o, const char* command, const char* value);
784 * Retrieve the contents in plain text.
786 * @param o view object whose contents to retrieve.
787 * @param callback result callback
788 * @param user_data user data
790 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
792 EXPORT_API Eina_Bool ewk_view_plain_text_get(Evas_Object* o, Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
795 * Get page contents as MHTML data
797 * @param o view object to get the page contents
798 * @param callback callback function to be called when the operation is finished
799 * @param user_data user data to be passed to the callback function
801 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
803 EXPORT_API Eina_Bool ewk_view_mhtml_data_get(Evas_Object *o, Ewk_View_MHTML_Data_Get_Callback callback, void *user_data);
805 typedef void (*Ewk_View_Hit_Test_Request_Callback)(Evas_Object* o, int x, int y, int hit_test_mode, Ewk_Hit_Test*, void* user_data);
808 * Requests new hit test for given view object and point.
810 * @param o view object to do hit test on
811 * @param x the horizontal position to query
812 * @param y the vertical position to query
813 * @param hit_test_mode the Ewk_Hit_Test_Mode enum value to query
814 * @param callback callback to be executed when hit test request was finished
816 * @return EINA_TRUE if hit test request was queued, otherwise EINA_FALSE
818 EXPORT_API Eina_Bool ewk_view_hit_test_request(Evas_Object* o, int x, int y, int hit_test_mode, Ewk_View_Hit_Test_Request_Callback, void* user_data);
822 * Notify that notification is closed.
824 * @param notification_list list of Ewk_Notification pointer
825 * notification_list is freed in this function.
827 * @return this function will always return EINA_FALSE since it is deprecated
830 * @see ewk_notification_closed
832 EINA_DEPRECATED EXPORT_API Eina_Bool ewk_view_notification_closed(Evas_Object* o, Eina_List* notification_list);
835 * Sets the encoding and reloads the page.
837 * @param ewkView view to set the encoding
838 * @param encoding the new encoding to set or @c 0 to restore the default one
840 EXPORT_API void ewk_view_encoding_custom_set(Evas_Object* ewkView, const char* encoding);
842 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
845 * Sets whether the ewk_view supports the mouse events or not.
847 * The ewk_view will support the mouse events if EINA_TRUE or not support the
848 * mouse events otherwise. The default value is EINA_TRUE.
850 * @param o view object to enable/disable the mouse events
851 * @param enabled a state to set
853 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
855 EXPORT_API Eina_Bool ewk_view_mouse_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
858 * Queries if the ewk_view supports the mouse events.
860 * @param o view object to query if the mouse events are enabled
862 * @return @c EINA_TRUE if the mouse events are enabled or @c EINA_FALSE otherwise
864 EXPORT_API Eina_Bool ewk_view_mouse_events_enabled_get(const Evas_Object *o);
866 typedef Eina_Bool (*Ewk_Orientation_Lock_Cb)(Evas_Object* o, Eina_Bool need_lock, int orientation, void* user_data);
870 * Sets callback of orientation lock function
872 * func will be called when screen lock is called or unlock is called.
873 * When screen.lockOrientation is called, need_lock will be true and orientation
874 * will be the flags which should be locked.
875 * For example, when contents called 'screen.lockOrientation("portrait"), orientation
876 * will be EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY | EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY
877 * When screen.unlockOrientation is called, need_lock will be false.
879 * @param o view object to set the callback of orientation
880 * @param func callback function to be called when screen orientation is locked or unlocked.
881 * @param use_data user_data will be passsed when ewk_view_web_app_icon_get is called
883 * @return current URI on success or @c 0 on failure
885 EINA_DEPRECATED EXPORT_API void ewk_view_orientation_lock_callback_set(Evas_Object *o, Ewk_Orientation_Lock_Cb func, void* user_data);
888 * Sets the callback on the scale factor change.
890 * The given callback function will be called when the engine has successfully
891 * changed the scale factor. It happens, for example, after ewk_view_scale_set
892 * call but not only. The engine itself can change the scale while rendering
893 * the content, for example, when ewk_settings_auto_fitting is turned on.
895 * @param o view object to set the callback
896 * @param callback the callback funtion which will be called on scale change
897 * @param user_data pointer to the data which will be passed while calling the callback
899 EXPORT_API void ewk_view_scale_changed_callback_set(Evas_Object *o, Ewk_View_Scale_Changed_Callback callback, void *user_data);
902 * Clears the highlight of searched text.
904 * @param o view object to find text
906 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
908 EXPORT_API Eina_Bool ewk_view_text_find_highlight_clear(Evas_Object *o);
911 * Sets whether the ewk_view supports the touch events or not.
913 * The ewk_view will support the touch events if @c EINA_TRUE or not support the
914 * touch events otherwise. The default value is @c EINA_FALSE.
916 * @param o view object to enable/disable the touch events
917 * @param enabled a state to set
919 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
921 EXPORT_API Eina_Bool ewk_view_touch_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
924 * Queries if the ewk_view supports the touch events.
926 * @param o view object to query if the touch events are enabled
928 * @return @c EINA_TRUE if the touch events are enabled or @c EINA_FALSE otherwise
930 EXPORT_API Eina_Bool ewk_view_touch_events_enabled_get(const Evas_Object *o);
932 /// Enum values containing Content Security Policy header types.
933 enum _Ewk_CSP_Header_Type {
938 typedef enum _Ewk_CSP_Header_Type Ewk_CSP_Header_Type;
941 * Set received Content Security Policy data from web app
943 * @param o view object
944 * @param policy Content Security Policy data
945 * @param type Content Security Policy header type
948 EXPORT_API void ewk_view_content_security_policy_set(Evas_Object* o, const char* policy, Ewk_CSP_Header_Type type);
951 * When font-family is "Tizen", use system's Settings font as default font-family
953 * @param o view object
956 EXPORT_API void ewk_view_use_settings_font(Evas_Object* o);
959 * Get cookies associated with an URL.
961 * @param o view object in which URL is opened.
962 * @param url the url for which cookies needs to be obtained.
964 * @return @c character array containing cookies, @c NULL if no cookies are found.
966 * The return character array has to be owned by the application and freed when not required.
968 EXPORT_API char* ewk_view_get_cookies_for_url(Evas_Object* o, const char* url);
971 * Sets whether to draw transparent background or not.
973 * @param o view object to enable/disable transparent background
974 * @param enabled a state to set
976 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
978 EXPORT_API Eina_Bool ewk_view_draws_transparent_background_set(Evas_Object *o, Eina_Bool enabled);
981 * @brief Queries if transparent background is enabled.
985 * @param[in] o view object to get whether transparent background is enabled or not
987 * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
989 EXPORT_API Eina_Bool ewk_view_draws_transparent_background_get(Evas_Object* o);
992 * @brief Sets the background color and transparency of the view.
994 * @note Should be used after ewk_view_url_set().
996 * @param[in] o view object to change the background color
997 * @param[in] r red color component [0..255]
998 * @param[in] g green color component [0..255]
999 * @param[in] b blue color component [0..255]
1000 * @param[in] a transparency [0..255]
1002 * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
1004 EXPORT_API Eina_Bool ewk_view_bg_color_set(Evas_Object* o, int r, int g, int b, int a);
1007 * set a font for browser application
1009 * @param o view object
1012 EXPORT_API void ewk_view_browser_font_set(Evas_Object* o);
1015 * Load the error page which web page is not found.
1017 * @param ewkView view object whose session needs to be stored.
1018 * @param ErrorUrl that could not be found.
1022 EXPORT_API void ewk_view_not_found_error_page_load(Evas_Object* ewkView, const char* ErrorUrl);
1025 * Enable or disable supporting of the split scrolling for overflow scroll.
1027 * @param ewkView view object to set the support of the split scrolling for overflow scroll
1028 * @param enable @c EINA_TRUE to support split scrolling, @c EINA_FALSE not to support
1030 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1032 EXPORT_API Eina_Bool ewk_view_split_scroll_overflow_enabled_set(Evas_Object* ewkView, const Eina_Bool enabled);
1035 * @brief Gets the staus of split scrolling supporting for overflow scroll.
1039 * @param[in] o view object to get the status of split scrolling supporting
1041 * @return the status of split scrolling supporting
1043 EXPORT_API Eina_Bool ewk_view_split_scroll_overflow_enabled_get(const Evas_Object* o);
1047 * Enable/disable focus ring.
1049 * @note Focus ring is enabled by default but disabled for wrt on TV profile
1051 * @param ewkView view object
1052 * @param enabled @c EINA_TRUE to enable the focus ring, @c EINA_FALSE to disable
1055 EINA_DEPRECATED EXPORT_API void ewk_view_draw_focus_ring_enable_set(Evas_Object* ewkView, Eina_Bool enable);
1058 * Queries the current zoom factor of the page.
1060 * @param o view object to get the zoom factor
1062 * @return current zoom factor in use on success or @c -1.0 on failure
1064 EXPORT_API double ewk_view_page_zoom_get(const Evas_Object *o);
1067 * Sets zoom factor of the current page.
1069 * @param o view object to set the zoom level
1070 * @param zoom_factor a new level to set
1072 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1074 EXPORT_API Eina_Bool ewk_view_page_zoom_set(Evas_Object *o, double zoom_factor);
1077 * Creates a new EFL WebKit view object with Evas_Smart and Ewk_Context.
1079 * @note The Evas_Object which inherits the ewk_view should create its
1080 * Evas_Object using this API instead of evas_object_smart_add()
1081 * because the default initialization for ewk_view is done in this API.
1083 * @param e canvas object where to create the view object
1084 * @param smart Evas_Smart object. Its type should be EWK_VIEW_TYPE_STR
1085 * @param context Ewk_Context object which is used for initializing
1086 * @param pageGroup Ewk_Page_Group object which is used for initializing
1088 * @return view object on success or @c NULL on failure
1090 EXPORT_API Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context, Ewk_Page_Group *pageGroup);
1093 * Callback for quota permission request feature.
1095 * @param ewkView view object where quota permission was requested
1096 * @param request quota permission request object
1097 * @param user_data user_data passed to ewk_view_quota_permission_request_callback_set
1099 typedef void (*Ewk_Quota_Permission_Request_Callback)(Evas_Object* ewkView, const Ewk_Quota_Permission_Request* request, void* user_data);
1102 * Sets callback quota permission request.
1104 * func will be called when page requests increased storage quota.
1106 * @param ewkView view object to set the callback
1107 * @param func callback function to be called when quota permission is requested
1108 * @param use_data user_data will be passsed to callback function
1112 EXPORT_API void ewk_view_quota_permission_request_callback_set(Evas_Object* ewkView, Ewk_Quota_Permission_Request_Callback callback, void* user_data);
1115 * Set reply to quota permission request.
1117 * Set @c EINA_TRUE if user accepts new quota size for origin
1118 * or @c EINA_FALSE if user doesn't accept new quota for origin.
1120 * @param request view object to set the support of the split scrolling for overflow scroll
1121 * @param enable @c EINA_TRUE allow quota size, @c EINA_FALSE
1125 EXPORT_API void ewk_view_quota_permission_request_reply(const Ewk_Quota_Permission_Request* request, const Eina_Bool allow);
1128 * Cancels quota permission request.
1130 * @param request view object to set the support of the split scrolling for overflow scroll
1134 EXPORT_API void ewk_view_quota_permission_request_cancel(const Ewk_Quota_Permission_Request* request);
1137 * Requests web login using password database.
1139 * @param o view object
1143 EXPORT_API Eina_Bool ewk_view_web_login_request(Evas_Object* ewkView);
1146 * Sets the notification permission callback.
1148 * @param o view object to request the notification permission
1149 * @param callback Ewk_View_Notification_Permission_Callback function to notification permission
1150 * @param user_data user data
1152 EXPORT_API void ewk_view_notification_permission_callback_set(Evas_Object *o, Ewk_View_Notification_Permission_Callback callback, void *user_data);
1155 * @brief Callback invoked when theme color is changed
1157 * @details Ewk_View_Did_Change_Theme_Color_Callback callback allows host\n
1158 * application to receive information regarding theme color change.\n
1159 * Callback will be called in following cases:\n
1160 * - no "theme-color" meta tag => "theme-color" meta tag\n
1161 * - "theme-color" meta tag => different "theme-color" meta tag\n
1162 * - "theme-color" meta tag => no "theme-color" meta tag\n
1163 * In case of no "theme-color" meta tag @a r, @a g, @a b and @a a\n
1168 * @param[in] o View object for which callback was set
1169 * @param[in] r Red color component ranged from 0 to 255
1170 * @param[in] g Green color component ranged from 0 to 255
1171 * @param[in] b Blue color component ranged from 0 to 255
1172 * @param[in] a Opacity value ranged from 0 to 255
1173 * @param[in] user_data User data passed to\n
1174 * ewk_view_did_change_theme_color_callback_set
1176 * @see ewk_view_did_change_theme_color_callback_set
1178 typedef void (*Ewk_View_Did_Change_Theme_Color_Callback)(Evas_Object* o, int r, int g, int b, int a, void* user_data);
1181 * @brief Sets Ewk_View_Did_Change_Theme_Color_Callback
1185 * @param[in] o View object to receive theme color change information
1186 * @param[in] callback New callback, NULL resets current callback
1187 * @param[in] user_data User data that will be passed to @a callback
1189 * @return @c EINA_TRUE on success,\n
1190 * otherwise @c EINA_FALSE
1192 * @see Ewk_View_Did_Change_Theme_Color_Callback
1194 EXPORT_API Eina_Bool ewk_view_did_change_theme_color_callback_set(Evas_Object* o, Ewk_View_Did_Change_Theme_Color_Callback callback, void* user_data);
1197 * @brief Callback invoked when save page is done
1201 * @param[in] o View object for which callback was set
1202 * @param[in] file_path File path of saved page on success or @c NULL on failure
1203 * @param[in] user_data User data passed to ewk_view_save_page
1205 * @see ewk_view_save_page_as_mhtml
1207 typedef void (*Ewk_View_Save_Page_Callback)(Evas_Object* o, const char* file_path, void* user_data);
1210 * @brief Save current page as MHTML format
1214 * @param[in] o View object which has page to save
1215 * @param[in] path File path where saved page should be placed\n
1216 * It can be full path of saved page or path of
1217 * existing directory\n
1218 * If path is existing directory, file name will be chosen\n
1219 * according to the title of the current page\n
1220 * (e.g. /path-to-directory/Google.mhtml)\n
1221 * If path has no extension, default extension(mhtml)\n
1223 * @param[in] callback Callback to be called when the operation is finished
1224 * @param[in] user_data User data that will be passed to @a callback
1226 * @return @c EINA_TRUE on successful request,\n
1227 * otherwise @c EINA_FALSE
1229 * @see Ewk_View_Save_Page_Callback
1231 EXPORT_API Eina_Bool ewk_view_save_page_as_mhtml(Evas_Object* o, const char* path, Ewk_View_Save_Page_Callback callback, void* user_data);
1234 * @brief Set Reader mode enable
1238 * @param[in] ewk_view view object to enable/disable the Reader mode
1239 * @param[in] enable a state to set
1241 * @note Reader Mode support or not will be known after the ewk_view object\n
1242 * received "reader,mode" callback from evas_object smart callback.
1244 EXPORT_API void ewk_view_reader_mode_set(Evas_Object* ewk_view, Eina_Bool enable);
1247 * @brief Sets the height of top controls.
1251 * @param[in] ewk_view view object to set height of top control
1252 * @param[in] top_height the height of the top controls in pixels
1253 * @param[in] bottom_height the height of the bottom controls in pixels
1255 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1257 EXPORT_API Eina_Bool ewk_view_top_controls_height_set(Evas_Object* ewk_view,
1258 size_t top_height, size_t bottom_height);
1261 * @brief Sets the state of top controls.
1265 * @note EWK_TOP_CONTROL_BOTH for current to preserve the current position.
1267 * @param[in] ewk_view view object to set state of top control
1268 * @param[in] constraint constrain the top controls to being shown or hidden
1269 * @param[in] current set current state
1270 * @param[in] animate whether or not to animate to the proper state
1272 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1274 EXPORT_API Eina_Bool ewk_view_top_controls_state_set(Evas_Object* ewk_view, Ewk_Top_Control_State constraint, Ewk_Top_Control_State current, Eina_Bool animation);
1277 * @brief Sets the visibility of main frame scrollbar.
1281 * @param[in] o view object
1282 * @param[in] visible visibility of main frame scrollbar
1284 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1286 EXPORT_API Eina_Bool ewk_view_main_frame_scrollbar_visible_set(Evas_Object* o, Eina_Bool visible);
1289 * @brief Set Default XHR LongPolling Timeout.
1291 * @details XML Http Request by default does not have a timeout value. The
1292 * timeout can be set using "timeout" field during creation of XHR
1293 * object. This API allows for setting the timeout globally for
1294 * whole View. Request timeout value will be calculated as minimum
1295 * of argument of the API and value set in XHR field. If XHR field
1296 * value is 0, value from API will be used.
1300 * @param[in] o view object
1301 * @param[in] timeout XHR LongPolling timeout value (in seconds)
1303 EXPORT_API void ewk_view_session_timeout_set(Evas_Object* o, unsigned long timeout);
1306 * @brief Enforces web page to close
1312 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1315 EXPORT_API Eina_Bool ewk_view_page_close(Evas_Object* o);
1318 * @brief Requests the manifest data from a given URL.
1322 * @param[in] o view object to request the manifest information
1323 * @param[in] callback Ewk_View_Request_Manifest_Callback function
1324 * @param[in] manifest_url a given URL
1325 * @param[in] host_url a host url used to resolve relative URLs
1326 * located in manifest file
1328 * @see Ewk_View_Request_Manifest_Callback
1330 EXPORT_API void ewk_view_request_manifest_from_url(Evas_Object* o, Ewk_View_Request_Manifest_Callback callback, void* user_data, const char* host_url, const char* manifest_url);
1333 * Callback for @a ewk_view_app_installation_request_callback_set api.
1337 * @param[in] o view object
1338 * @param[in] request app installation request
1339 * @param[in] user_data user data passed to
1340 * @a ewk_view_app_installation_request_callback_set api
1342 typedef void (*Ewk_App_Installation_Request_Callback)(Evas_Object* o, Ewk_App_Installation_Request* request, void* user_data);
1345 * Set callback handling app installation request. It is called in reaction to
1346 * window.navigator.installApp() api being called.
1350 * @param[in] o view object
1351 * @param[in] callback callback to be set; Can be null
1352 * @param[in] user_data user data to be passed to @a callback; Can be null
1354 EXPORT_API void ewk_view_app_installation_request_callback_set(Evas_Object* o, Ewk_App_Installation_Request_Callback callback, void* user_data);
1360 #endif // ewk_view_internal_h