2 Copyright (C) 2011 Samsung Electronics
3 Copyright (C) 2012 Intel Corporation. All rights reserved.
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
23 * @brief WebKit main smart object.
25 * This object provides view related APIs of WebKit2 to EFL object.
27 * The following signals (see evas_object_smart_callback_add()) are emitted:
29 * - "back,forward,list,changed", void: reports that the view's back / forward list had changed.
30 * - "close,window", void: window is closed.
31 * - "create,window", Evas_Object**: a new window is created.
32 * - "download,cancelled", Ewk_Download_Job*: reports that a download was effectively cancelled.
33 * - "download,failed", Ewk_Download_Job_Error*: reports that a download failed with the given error.
34 * - "download,finished", Ewk_Download_Job*: reports that a download completed successfully.
35 * - "download,request", Ewk_Download_Job*: reports that a new download has been requested. The client should set the
36 * destination path by calling ewk_download_job_destination_set() or the download will fail.
37 * - "form,submission,request", Ewk_Form_Submission_Request*: Reports that a form request is about to be submitted.
38 * The Ewk_Form_Submission_Request passed contains information about the text fields of the form. This
39 * is typically used to store login information that can be used later to pre-fill the form.
40 * The form will not be submitted until ewk_form_submission_request_submit() is called.
41 * It is possible to handle the form submission request asynchronously, by simply calling
42 * ewk_form_submission_request_ref() on the request and calling ewk_form_submission_request_submit()
43 * when done to continue with the form submission. If the last reference is removed on a
44 * #Ewk_Form_Submission_Request and the form has not been submitted yet,
45 * ewk_form_submission_request_submit() will be called automatically.
46 * - "icon,changed", void: reports that the view's favicon has changed.
47 * - "intent,request,new", Ewk_Intent*: reports new Web intent request.
48 * - "intent,service,register", Ewk_Intent_Service*: reports new Web intent service registration.
49 * - "load,error", const Ewk_Error*: reports main frame load failed.
50 * - "load,finished", void: reports load finished.
51 * - "load,progress", double*: load progress has changed (value from 0.0 to 1.0).
52 * - "load,provisional,failed", const Ewk_Error*: view provisional load failed.
53 * - "load,provisional,redirect", void: view received redirect for provisional load.
54 * - "load,provisional,started", void: view started provisional load.
55 * - "pageSave,success", void: page save operation was success.
56 * - "pageSave,error", void: page save operation has failed.
57 * - "policy,decision,navigation", Ewk_Navigation_Policy_Decision*: a navigation policy decision should be taken.
58 * To make a policy decision asynchronously, simply increment the reference count of the
59 * #Ewk_Navigation_Policy_Decision object using ewk_navigation_policy_decision_ref().
60 * - "policy,decision,new,window", Ewk_Navigation_Policy_Decision*: a new window policy decision should be taken.
61 * To make a policy decision asynchronously, simply increment the reference count of the
62 * #Ewk_Navigation_Policy_Decision object using ewk_navigation_policy_decision_ref().
63 * - "resource,request,failed", const Ewk_Resource_Load_Error*: a resource failed loading.
64 * - "resource,request,finished", const Ewk_Resource*: a resource finished loading.
65 * - "resource,request,new", const Ewk_Resource_Request*: a resource request was initiated.
66 * - "resource,request,response", Ewk_Resource_Load_Response*: a response to a resource request was received.
67 * - "resource,request,sent", const Ewk_Resource_Request*: a resource request was sent.
68 * - "text,found", unsigned int*: the requested text was found and it gives the number of matches.
69 * - "title,changed", const char*: title of the main frame was changed.
70 * - "tooltip,text,set", const char*: tooltip was set.
71 * - "tooltip,text,unset", void: tooltip was unset.
72 * - "url,changed", const char*: url of the main frame was changed.
73 * - "webprocess,crashed", Eina_Bool*: expects a @c EINA_TRUE if web process crash is handled; @c EINA_FALSE, otherwise.
76 * Tizen specific signals
77 * - "magnifier,show", void: magifier of text selection was showed.
78 * - "magnifier,hide", void: magifier of text selection was hidden.
84 #include "ewk_back_forward_list.h"
85 #include "ewk_context.h"
86 #include "ewk_download_job.h"
87 #include "ewk_error.h"
88 #include "ewk_intent.h"
89 #include "ewk_resource.h"
90 #include "ewk_settings.h"
91 #include "ewk_touch.h"
92 #include "ewk_url_request.h"
93 #include "ewk_url_response.h"
97 #include "ewk_frame.h"
100 #include "ewk_history.h"
102 //#if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
103 #include "ewk_hit_test.h"
106 //#if ENABLE(TIZEN_WEBKIT2_POPUP_INTERNAL)
107 #include "ewk_enums.h"
110 // #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
111 #include "ewk_web_application_icon_data.h"
118 /// Enum values containing text directionality values.
120 EWK_TEXT_DIRECTION_RIGHT_TO_LEFT,
121 EWK_TEXT_DIRECTION_LEFT_TO_RIGHT
122 } Ewk_Text_Direction;
124 typedef struct Ewk_View_Smart_Data Ewk_View_Smart_Data;
125 typedef struct Ewk_View_Smart_Class Ewk_View_Smart_Class;
128 /// Creates a type name for _Ewk_Event_Gesture.
129 typedef struct Ewk_Event_Gesture Ewk_Event_Gesture;
131 /// Represents a gesture event.
132 struct Ewk_Event_Gesture {
133 Ewk_Gesture_Type type; /**< type of the gesture event */
134 Evas_Coord_Point position; /**< position of the gesture event */
135 Evas_Point velocity; /**< velocity of the gesture event. The unit is pixel per second. */
136 double scale; /**< scale of the gesture event */
137 int count; /**< count of the gesture */
138 unsigned int timestamp; /**< timestamp of the gesture */
141 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
143 * \enum Ewk_Input_Type
144 * @brief Provides type of focused input element
146 enum Ewk_Input_Type {
148 EWK_INPUT_TYPE_TELEPHONE,
149 EWK_INPUT_TYPE_NUMBER,
150 EWK_INPUT_TYPE_EMAIL,
152 EWK_INPUT_TYPE_PASSWORD,
153 EWK_INPUT_TYPE_COLOR,
155 EWK_INPUT_TYPE_DATETIME,
156 EWK_INPUT_TYPE_DATETIMELOCAL,
157 EWK_INPUT_TYPE_MONTH,
161 typedef enum Ewk_Input_Type Ewk_Input_Type;
162 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
163 // #endif // #if OS(TIZEN)
165 /// Ewk view's class, to be overridden by sub-classes.
166 struct Ewk_View_Smart_Class {
167 Evas_Smart_Class sc; /**< all but 'data' is free to be changed. */
168 unsigned long version;
170 Eina_Bool (*popup_menu_show)(Ewk_View_Smart_Data *sd, Eina_Rectangle rect, Ewk_Text_Direction text_direction, double page_scale_factor, Eina_List* items, int selected_index);
171 //#if ENABLE(TIZEN_MULTIPLE_SELECT)
172 Eina_Bool (*multiple_popup_menu_show)(Ewk_View_Smart_Data *sd, Eina_Rectangle rect,Ewk_Text_Direction text_direction, double page_scale_factor, Eina_List* items);
174 Eina_Bool (*popup_menu_hide)(Ewk_View_Smart_Data *sd);
175 Eina_Bool (*popup_menu_update)(Ewk_View_Smart_Data *sd, Eina_Rectangle rect, Ewk_Text_Direction text_direction, Eina_List* items, int selected_index);
177 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
178 Eina_Bool (*text_selection_down)(Ewk_View_Smart_Data *sd, int x, int y);
179 Eina_Bool (*text_selection_move)(Ewk_View_Smart_Data *sd, int x, int y);
180 Eina_Bool (*text_selection_up)(Ewk_View_Smart_Data *sd, int x, int y);
183 //#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
184 Eina_Bool (*input_picker_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, const char* inputValue);
187 //#if ENABLE(TIZEN_DATALIST_ELEMENT)
188 Eina_Bool (*data_list_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, Eina_List *optionList);
189 Eina_Bool (*data_list_hide)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType);
192 // #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
193 Eina_Bool (*orientation_lock)(Ewk_View_Smart_Data *sd, int orientations);
194 void (*orientation_unlock)(Ewk_View_Smart_Data *sd);
198 // - returns true if handled
199 // - if overridden, have to call parent method if desired
200 Eina_Bool (*focus_in)(Ewk_View_Smart_Data *sd);
201 Eina_Bool (*focus_out)(Ewk_View_Smart_Data *sd);
202 Eina_Bool (*fullscreen_enter)(Ewk_View_Smart_Data *sd);
203 Eina_Bool (*fullscreen_exit)(Ewk_View_Smart_Data *sd);
204 Eina_Bool (*mouse_wheel)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Wheel *ev);
205 Eina_Bool (*mouse_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Down *ev);
206 Eina_Bool (*mouse_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Up *ev);
207 Eina_Bool (*mouse_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Move *ev);
208 Eina_Bool (*key_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Down *ev);
209 Eina_Bool (*key_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Up *ev);
212 // - All strings should be guaranteed to be stringshared.
213 void (*run_javascript_alert)(Ewk_View_Smart_Data *sd, const char *message);
214 Eina_Bool (*run_javascript_confirm)(Ewk_View_Smart_Data *sd, const char *message);
215 const char *(*run_javascript_prompt)(Ewk_View_Smart_Data *sd, const char *message, const char *default_value); /**< return string should be stringshared. */
218 // - Shows and hides color picker.
219 Eina_Bool (*input_picker_color_request)(Ewk_View_Smart_Data *sd, int r, int g, int b, int a);
220 Eina_Bool (*input_picker_color_dismiss)(Ewk_View_Smart_Data *sd);
224 unsigned long long (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, const char *databaseName, const char *displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage);
226 // #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
227 Eina_Bool (*formdata_candidate_show)(Ewk_View_Smart_Data *sd, int x, int y, int w, int h);
228 Eina_Bool (*formdata_candidate_hide)(Ewk_View_Smart_Data *sd);
229 Eina_Bool (*formdata_candidate_update_data)(Ewk_View_Smart_Data *sd, Eina_List *dataList);
230 Eina_Bool (*formdata_candidate_is_showing)(Ewk_View_Smart_Data *sd);
234 Eina_Bool (*gesture_start)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
235 Eina_Bool (*gesture_end)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
236 Eina_Bool (*gesture_move)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
239 //#if ENABLE(TIZEN_SCREEN_READER)
240 Eina_Bool (*screen_reader_action_execute)(Ewk_View_Smart_Data *sd, void *elmAccessActionInfo);
246 * Callback for ewk_view_web_app_capable_get
248 * @param capable web application capable
249 * @param user_data user_data will be passsed when ewk_view_web_app_capable_get is called
251 typedef void (*Ewk_Web_App_Capable_Get_Callback)(Eina_Bool capable, void* user_data);
254 * Callback for ewk_view_web_app_icon_get
256 * @param icon_url web application icon
257 * @param user_data user_data will be passsed when ewk_view_web_app_icon_get is called
259 typedef void (*Ewk_Web_App_Icon_URL_Get_Callback)(const char* icon_url, void* user_data);
262 * Callback for ewk_view_web_app_icon_urls_get.
264 * @param icon_urls list of Ewk_Web_App_Icon_Data for web app
265 * @param user_data user_data will be passsed when ewk_view_web_app_icon_urls_get is called
267 typedef void (*Ewk_Web_App_Icon_URLs_Get_Callback)(Eina_List *icon_urls, 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 6UL
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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
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 Evas_Object* image; /**< reference to evas_object_image for drawing web contents */
327 EwkViewImpl* priv; /**< should never be accessed, c++ stuff */
329 Evas_Coord x, y, w, h; /**< last used viewport */
331 struct { /**< what changed since last smart_calculate */
334 Eina_Bool position:1;
338 /// Creates a type name for Ewk_Resource_Request.
339 typedef struct Ewk_Resource_Request Ewk_Resource_Request;
342 * @brief Structure containing details about a resource request.
344 struct Ewk_Resource_Request {
345 Ewk_Resource *resource; /**< resource being requested */
346 Ewk_Url_Request *request; /**< URL request for the resource */
347 Ewk_Url_Response *redirect_response; /**< Possible redirect response for the resource or @c NULL */
350 /// Creates a type name for Ewk_Resource_Load_Response.
351 typedef struct Ewk_Resource_Load_Response Ewk_Resource_Load_Response;
354 * @brief Structure containing details about a response to a resource request.
356 struct Ewk_Resource_Load_Response {
357 Ewk_Resource *resource; /**< resource requested */
358 Ewk_Url_Response *response; /**< resource load response */
361 /// Creates a type name for Ewk_Resource_Load_Error.
362 typedef struct Ewk_Resource_Load_Error Ewk_Resource_Load_Error;
365 * @brief Structure containing details about a resource load error.
367 * Details given about a resource load failure.
369 struct Ewk_Resource_Load_Error {
370 Ewk_Resource *resource; /**< resource that failed loading */
371 Ewk_Error *error; /**< load error */
374 /// Creates a type name for Ewk_Download_Job_Error.
375 typedef struct Ewk_Download_Job_Error Ewk_Download_Job_Error;
378 * @brief Structure containing details about a download failure.
380 struct Ewk_Download_Job_Error {
381 Ewk_Download_Job *download_job; /**< download that failed */
382 Ewk_Error *error; /**< download error */
385 /// Enum values containing page contents type values.
387 EWK_PAGE_CONTENTS_TYPE_MHTML,
388 EWK_PAGE_CONTENTS_TYPE_STRING
389 } Ewk_Page_Contents_Type;
392 * Creates a type name for the callback function used to get the page contents.
394 * @param type type of the contents
395 * @param data string buffer of the contents
397 typedef void (*Ewk_Page_Contents_Cb)(Ewk_Page_Contents_Type type, const char *data);
399 /// Creates a type name for Ewk_Page_Contents_Context.
400 typedef struct Ewk_Page_Contents_Context Ewk_Page_Contents_Context;
403 * @brief Structure containing page contents context used for ewk_view_page_contents_get() API.
405 struct Ewk_Page_Contents_Context {
406 Ewk_Page_Contents_Type type;
407 Ewk_Page_Contents_Cb callback;
411 * Sets the smart class APIs, enabling view to be inherited.
413 * @param api class definition to set, all members with the
414 * exception of @a Evas_Smart_Class->data may be overridden, must
417 * @note @a Evas_Smart_Class->data is used to implement type checking and
418 * is not supposed to be changed/overridden. If you need extra
419 * data for your smart class to work, just extend
420 * Ewk_View_Smart_Class instead.
421 * The Evas_Object which inherits the ewk_view should use
422 * ewk_view_smart_add() to create Evas_Object instead of
423 * evas_object_smart_add() because it performs additional initialization
426 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
429 * @see ewk_view_smart_add()
431 EAPI Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class *api);
434 * Creates a new EFL WebKit view object with Evas_Smart and Ewk_Context.
436 * @note The Evas_Object which inherits the ewk_view should create its
437 * Evas_Object using this API instead of evas_object_smart_add()
438 * because the default initialization for ewk_view is done in this API.
440 * @param e canvas object where to create the view object
441 * @param smart Evas_Smart object. Its type should be EWK_VIEW_TYPE_STR
442 * @param context Ewk_Context object which is used for initializing
444 * @return view object on success or @c NULL on failure
446 EAPI Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context);
449 * Enum values used to specify search options.
450 * @brief Provides option to find text
451 * @info Keep this in sync with WKFindOptions.h
453 enum Ewk_Find_Options {
454 EWK_FIND_OPTIONS_NONE, /**< no search flags, this means a case sensitive, no wrap, forward only search. */
455 EWK_FIND_OPTIONS_CASE_INSENSITIVE = 1 << 0, /**< case insensitive search. */
456 EWK_FIND_OPTIONS_AT_WORD_STARTS = 1 << 1, /**< search text only at the beginning of the words. */
457 EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START = 1 << 2, /**< treat capital letters in the middle of words as word start. */
458 EWK_FIND_OPTIONS_BACKWARDS = 1 << 3, /**< search backwards. */
459 EWK_FIND_OPTIONS_WRAP_AROUND = 1 << 4, /**< if not present search will stop at the end of the document. */
460 EWK_FIND_OPTIONS_SHOW_OVERLAY = 1 << 5, /**< show overlay */
461 EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR = 1 << 6, /**< show indicator */
462 EWK_FIND_OPTIONS_SHOW_HIGHLIGHT = 1 << 7 /**< show highlight */
464 typedef enum Ewk_Find_Options Ewk_Find_Options;
467 * Creates a new EFL WebKit view object.
469 * @param e canvas object where to create the view object
471 * @return view object on success or @c NULL on failure
473 EAPI Evas_Object *ewk_view_add(Evas *e);
476 * Creates a new EFL WebKit view object based on specific Ewk_Context.
478 * @param e canvas object where to create the view object
479 * @param context Ewk_Context object to declare process model
481 * @return view object on success or @c NULL on failure
483 EAPI Evas_Object *ewk_view_add_with_context(Evas *e, Ewk_Context *context);
486 * Gets the Ewk_Context of this view.
488 * @param o the view object to get the Ewk_Context
490 * @return the Ewk_Context of this view or @c NULL on failure
492 EAPI Ewk_Context *ewk_view_context_get(const Evas_Object *o);
495 * Asks the object to load the given URL.
497 * @param o view object to load @a URL
498 * @param url uniform resource identifier to load
500 * @return @c EINA_TRUE is returned if @a o is valid, irrespective of load,
501 * or @c EINA_FALSE on failure
503 EAPI Eina_Bool ewk_view_url_set(Evas_Object *o, const char *url);
506 * Returns the current URL string of view object.
508 * It returns an internal string and should not
509 * be modified. The string is guaranteed to be stringshared.
511 * @param o view object to get current URL
513 * @return current URL on success or @c NULL on failure
515 EAPI const char *ewk_view_url_get(const Evas_Object *o);
518 * Returns the current icon URL of view object.
520 * It returns an internal string and should not
521 * be modified. The string is guaranteed to be stringshared.
523 * @param o view object to get current icon URL
525 * @return current icon URL on success or @c NULL if unavailable or on failure
527 EAPI const char *ewk_view_icon_url_get(const Evas_Object *o);
530 * Asks the main frame to reload the current document.
532 * @param o view object to reload current document
534 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
536 * @see ewk_view_reload_bypass_cache()
538 EAPI Eina_Bool ewk_view_reload(Evas_Object *o);
541 * Reloads the current page's document without cache.
543 * @param o view object to reload current document
545 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
547 EAPI Eina_Bool ewk_view_reload_bypass_cache(Evas_Object *o);
550 * Asks the main frame to stop loading.
552 * @param o view object to stop loading
554 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
556 EAPI Eina_Bool ewk_view_stop(Evas_Object* o);
559 * Gets the Ewk_Settings of this view.
561 * @param o view object to get Ewk_Settings
563 * @return the Ewk_Settings of this view or @c NULL on failure
565 EAPI Ewk_Settings *ewk_view_settings_get(const Evas_Object *o);
569 enum Ewk_Page_Visibility_State {
570 EWK_PAGE_VISIBILITY_STATE_VISIBLE,
571 EWK_PAGE_VISIBILITY_STATE_HIDDEN,
572 EWK_PAGE_VISIBILITY_STATE_PRERENDER
574 typedef enum Ewk_Page_Visibility_State Ewk_Page_Visibility_State;
576 enum Ewk_Http_Method {
578 EWK_HTTP_METHOD_HEAD,
579 EWK_HTTP_METHOD_POST,
581 EWK_HTTP_METHOD_DELETE,
583 typedef enum Ewk_Http_Method Ewk_Http_Method;
586 * Callback for ewk_view_script_execute
588 * @param o the view object
589 * @param result_value value returned by script
590 * @param user_data user data
592 typedef void (*Ewk_View_Script_Execute_Callback)(Evas_Object* o, const char* result_value, void* user_data);
595 * Callback for ewk_view_plain_text_get
597 * @param o the view object
598 * @param plain_text the contents of the given frame converted to plain text
599 * @param user_data user data
601 typedef void (*Ewk_View_Plain_Text_Get_Callback)(Evas_Object* o, const char* plain_text, void* user_data);
603 // #if ENABLE(TIZEN_SUPPORT_MHTML)
605 * Creates a type name for the callback function used to get the page contents.
607 * @param o view object
608 * @param data mhtml data of the page contents
609 * @param user_data user data will be passed when ewk_view_mhtml_data_get is called
611 typedef void (*Ewk_View_MHTML_Data_Get_Callback)(Evas_Object *o, const char *data, void *user_data);
612 // #endif // ENABLE(TIZEN_SUPPORT_MHTML)
615 * Gets the Ewk_Context of this view.
617 * @param o the view object to get the WKPageRef
619 * @return the Ewk_Context of this view
621 EAPI Ewk_Context* ewk_view_context_get(const Evas_Object* o);
624 * Gets the reference object for frame that represents the main frame.
626 * @param o view object to get main frame
628 * @return frame reference of frame object on success, or NULL on failure
630 EAPI Ewk_Frame_Ref ewk_view_main_frame_get(Evas_Object* o);
633 * Gets the reference obect for the currently focused frame.
635 * @param o view object to get main frame
637 * @return frame reference of frame object on success, or NULL on failure
639 EAPI Ewk_Frame_Ref ewk_view_focused_frame_get(Evas_Object* o);
641 EAPI Eina_Bool ewk_view_horizontal_panning_hold_get(Evas_Object* o);
642 EAPI void ewk_view_horizontal_panning_hold_set(Evas_Object* o, Eina_Bool hold);
643 EAPI Eina_Bool ewk_view_vertical_panning_hold_get(Evas_Object* o);
644 EAPI void ewk_view_vertical_panning_hold_set(Evas_Object* o, Eina_Bool hold);
647 * Gets the minimum and maximum value of the scale range or -1 on failure
649 * @param o view object to get the minimum and maximum value of the scale range
650 * @param min_scale Pointer to an double in which to store the minimum scale factor of the object.
651 * @param max_scale Pointer to an double in which to store the maximum scale factor of the object.
653 * @note Use @c NULL pointers on the scale components you're not
654 * interested in: they'll be ignored by the function.
656 EAPI void ewk_view_scale_range_get(Evas_Object* o, double* min_scale, double* max_scale);
659 * Gets the current text zoom level.
661 * @param o view object to get the zoom level
663 * @return current zoom level in use on success or @c -1.0 on failure
665 EAPI double ewk_view_text_zoom_get(const Evas_Object* o);
668 * Sets the current text zoom level.
670 * @param o view object to set the zoom level
671 * @param textZoomFactor a new level to set
673 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
675 EAPI Eina_Bool ewk_view_text_zoom_set(Evas_Object* o, double text_zoom_factor);
677 EAPI void ewk_view_suspend(Evas_Object* o);
678 EAPI void ewk_view_resume(Evas_Object* o);
680 typedef Eina_Bool (*Ewk_View_JavaScript_Alert_Callback)(Evas_Object* o, const char* alert_text, void* user_data);
681 EAPI void ewk_view_javascript_alert_callback_set(Evas_Object* o, Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
682 EAPI void ewk_view_javascript_alert_reply(Evas_Object* o);
684 typedef Eina_Bool (*Ewk_View_JavaScript_Confirm_Callback)(Evas_Object* o, const char* message, void* user_data);
685 EAPI void ewk_view_javascript_confirm_callback_set(Evas_Object* o, Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
686 EAPI void ewk_view_javascript_confirm_reply(Evas_Object* o, Eina_Bool result);
688 typedef Eina_Bool (*Ewk_View_JavaScript_Prompt_Callback)(Evas_Object* o, const char* message, const char* default_value, void* user_data);
689 EAPI void ewk_view_javascript_prompt_callback_set(Evas_Object* o, Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
690 EAPI void ewk_view_javascript_prompt_reply(Evas_Object* o, const char* result);
692 //#if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
693 typedef Eina_Bool (*Ewk_View_Before_Unload_Confirm_Panel_Callback)(Evas_Object* o, const char* message, void* user_data);
694 EAPI void ewk_view_before_unload_confirm_panel_callback_set(Evas_Object* o, Ewk_View_Before_Unload_Confirm_Panel_Callback callback, void* user_data);
695 EAPI void ewk_view_before_unload_confirm_panel_reply(Evas_Object* o, Eina_Bool result);
698 typedef Eina_Bool (*Ewk_View_Open_Panel_Callback)(Evas_Object* o, Eina_Bool allow_multiple_files, Eina_List* accepted_mime_types, const char* capture, void* user_data);
699 EAPI void ewk_view_open_panel_callback_set(Evas_Object* o, Ewk_View_Open_Panel_Callback callback, void* user_data);
700 EAPI void ewk_view_open_panel_reply(Evas_Object* o, Eina_List* file_url, Eina_Bool result);
702 //#if ENABLE(TIZEN_APPLICATION_CACHE)
703 typedef Eina_Bool (*Ewk_View_Applicacion_Cache_Permission_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, void* user_data);
704 EAPI void ewk_view_application_cache_permission_callback_set(Evas_Object* o, Ewk_View_Applicacion_Cache_Permission_Callback callback, void* user_data);
705 EAPI void ewk_view_application_cache_permission_reply(Evas_Object* o, Eina_Bool allow);
708 //#if ENABLE(TIZEN_INDEXED_DATABASE)
709 typedef Eina_Bool (*Ewk_View_Exceeded_Indexed_Database_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, long long currentQuota, void* user_data);
710 EAPI void ewk_view_exceeded_indexed_database_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback, void* user_data);
711 EAPI void ewk_view_exceeded_indexed_database_quota_reply(Evas_Object* o, Eina_Bool allow);
714 // #if ENABLE(TIZEN_SQL_DATABASE)
715 typedef Eina_Bool (*Ewk_View_Exceeded_Database_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, const char* database_name, unsigned long long expectedQuota, void* user_data);
716 EAPI void ewk_view_exceeded_database_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Database_Quota_Callback callback, void* user_data);
717 EAPI void ewk_view_exceeded_database_quota_reply(Evas_Object* o, Eina_Bool allow);
720 //#if ENABLE(TIZEN_FILE_SYSTEM)
721 typedef Eina_Bool (*Ewk_View_Exceeded_Local_File_System_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, long long currentQuota, void* user_data);
722 EAPI void ewk_view_exceeded_local_file_system_quota_callback_set(Evas_Object* o, Ewk_View_Exceeded_Local_File_System_Quota_Callback callback, void* user_data);
723 EAPI void ewk_view_exceeded_local_file_system_quota_reply(Evas_Object* o, Eina_Bool allow);
727 * Gets the Ewk_Settings of this view.
729 * @param o view object to get Ewk_Settings
731 * @return the Ewk_Settings of this view or @c NULL on failure
733 EAPI Ewk_Settings *ewk_view_settings_get(const Evas_Object *o);
736 * Delivers a Web intent to the view's main frame.
738 * @param o view object to deliver the intent to
740 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
742 EAPI Eina_Bool ewk_view_intent_deliver(Evas_Object *o, Ewk_Intent *intent);
745 * Asks the main frame to navigate back in the history.
747 * @param o view object to navigate back
749 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
751 * @see ewk_frame_back()
753 EAPI Eina_Bool ewk_view_back(Evas_Object *o);
756 * Asks the main frame to navigate forward in the history.
758 * @param o view object to navigate forward
760 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
762 * @see ewk_frame_forward()
764 EAPI Eina_Bool ewk_view_forward(Evas_Object *o);
767 * Queries if it is possible to navigate backwards one item in the history.
769 * @param o view object to query if backward navigation is possible
771 * @return @c EINA_TRUE if it is possible to navigate backwards in the history, @c EINA_FALSE otherwise
773 EAPI Eina_Bool ewk_view_back_possible(Evas_Object *o);
776 * Queries if it is possible to navigate forwards one item in the history.
778 * @param o view object to query if forward navigation is possible
780 * @return @c EINA_TRUE if it is possible to navigate forwards in the history, @c EINA_FALSE otherwise
782 EAPI Eina_Bool ewk_view_forward_possible(Evas_Object *o);
785 * Gets the back-forward list associated with this view.
787 * The returned instance is unique for this view and thus multiple calls
788 * to this function with the same view as parameter returns the same
789 * handle. This handle is alive while view is alive, thus one
790 * might want to listen for EVAS_CALLBACK_DEL on given view
791 * (@a o) to know when to stop using returned handle.
793 * @param o view object to get navigation back-forward list
795 * @return the back-forward list instance handle associated with this view
797 EAPI Ewk_Back_Forward_List *ewk_view_back_forward_list_get(const Evas_Object *o);
800 * Gets the current title of the main frame.
802 * It returns an internal string and should not
803 * be modified. The string is guaranteed to be stringshared.
805 * @param o view object to get current title
807 * @return current title on success or @c NULL on failure
809 EAPI const char *ewk_view_title_get(const Evas_Object *o);
812 * Gets the current load progress of page.
814 * The progress estimation from 0.0 to 1.0.
816 * @param o view object to get the current progress
818 * @return the load progress of page, value from 0.0 to 1.0,
819 * or @c -1.0 on failure
821 EAPI double ewk_view_load_progress_get(const Evas_Object *o);
824 * Requests loading of the given request data.
826 * @param o view object to load
827 * @param url uniform resource identifier to load
828 * @param method http method
829 * @param headers http headers
830 * @param body http body data
832 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
834 EAPI Eina_Bool ewk_view_url_request_set(Evas_Object* o, const char* url, Ewk_Http_Method method, Eina_Hash* headers, const char* body);
837 * Requests the specified plain text string into the view object
839 * @note The mime type of document will be "text/plain".
841 * @return the load progress of page, value from 0.0 to 1.0,
842 * or @c -1.0 on failure
844 EAPI Eina_Bool ewk_view_plain_text_set(Evas_Object* o, const char* plain_text);
847 * Requests loading the given contents by mime type into the view object.
849 * @param o view object to load
850 * @param contents what to load
851 * @param contents_size size of @a contents (in bytes),
852 * @param mime_type type of @a contents data, if @c 0 is given "text/html" is assumed
853 * @param encoding encoding for @a contents data, if @c 0 is given "UTF-8" is assumed
854 * @param base_uri base uri to use for relative resources, may be @c 0,
855 * if provided @b must be an absolute uri
857 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
859 EAPI Eina_Bool ewk_view_contents_set(Evas_Object* o, const char* contents, size_t contents_size, char* mime_type, char* encoding, char* base_uri);
862 * Requests loading the given contents.
864 * @param o view object to load document
865 * @param html what to load
866 * @param base_uri base uri to use for relative resources, may be @c 0,
867 * if provided @b must be an absolute uri
869 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
871 EAPI Eina_Bool ewk_view_html_contents_set(Evas_Object* o, const char* html, const char* base_uri);
874 * Requests for setting page visibility state.
876 * @param o view object to set the page visibility
877 * @param page_visibility_state visible state of the page to set
878 * @param initial_state @c EINA_TRUE if this function is called at page initialization time,
879 * @c EINA_FALSE otherwise
881 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
883 EAPI Eina_Bool ewk_view_page_visibility_state_set(Evas_Object* o, Ewk_Page_Visibility_State page_visibility_state, Eina_Bool initial_state);
886 * Request to set the user agent string.
888 * @param o view object to set the user agent string
890 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
892 EAPI Eina_Bool ewk_view_user_agent_set(Evas_Object* o, const char* user_agent);
895 * Returns user agent string.
897 * @param o view object to get the user agent string
899 * @return @c user agent string
901 EAPI const char* ewk_view_user_agent_get(const Evas_Object* o);
902 //#if ENABLE(TIZEN_CUSTOM_HEADERS)
906 * @param o view object to add custom header
908 * @param name custom header name to add the custom header
910 * @param value custom header value to add the custom header
912 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
914 EAPI Eina_Bool ewk_view_custom_header_add(const Evas_Object* o, const char* name, const char* value);
916 * remove custom header
918 * @param o view object to remove custom header
920 * @param name custom header name to remove the custom header
922 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
924 EAPI Eina_Bool ewk_view_custom_header_remove(const Evas_Object* o, const char* name);
926 * clears all custom headers
928 * @param o view object to clear custom headers
930 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
932 EAPI Eina_Bool ewk_view_custom_header_clear(const Evas_Object* o);
935 //#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
937 * Request to set the current page's visibility.
939 * @param o view object to set the visibility.
940 * @param enable EINA_TRUE to set on the visibility of the page, EINA_FALSE otherwise.
942 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
944 EAPI Eina_Bool ewk_view_visibility_set(Evas_Object* o, Eina_Bool enable);
947 //#if ENABLE(TIZEN_BACKGROUND_DISK_CACHE)
949 * Notify the foreground/background status of app.
951 * @param o view object that is in given status.
952 * @param enable EINA_TRUE to notify that page is foreground, EINA_FALSE otherwise.
954 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
956 EAPI Eina_Bool ewk_view_foreground_set(Evas_Object* o, Eina_Bool enable);
960 * Returns the evas image object of the specified viewArea of page
962 * The returned evas image object @b should be freed after use.
964 * @param o view object to get specified rectangle of cairo surface.
965 * @param viewArea rectangle of cairo surface.
966 * @param scaleFactor scale factor of cairo surface.
967 * @param canvas canvas for creating evas image.
969 * @return newly allocated evas image object on sucess or @c 0 on failure.
971 EAPI Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* o, Eina_Rectangle viewArea, float scaleFactor, Evas* canvas);
973 // #if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
975 * Start a server for inspecting web pages
976 * This server will be used by Remote Web Browser to transfer messages over network
978 * @param [o] view object to debug
979 * @param [in] port It is a port number for the server. A free port on system will be allocated if port is 0
981 * @return @c assigned port number on success or @c 0 on failure
983 EAPI unsigned int ewk_view_inspector_server_start(Evas_Object* o, unsigned int port);
986 * Stop a server for inspecting web pages
988 * @param [o] view object to debug
990 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
992 EAPI Eina_Bool ewk_view_inspector_server_stop(Evas_Object* o);
996 * Scrolls webpage of view by dx and dy.
998 * @param o view object to scroll
999 * @param dx horizontal offset to scroll
1000 * @param dy vertical offset to scroll
1002 EAPI void ewk_view_scroll_by(Evas_Object* o, int dx, int dy);
1005 * Gets the current scroll position of given view.
1007 * @param o view object to get the current scroll position
1008 * @param x the pointer to store the horizontal position, may be @c 0
1009 * @param y the pointer to store the vertical position, may be @c 0
1011 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
1012 * values are zeroed.
1014 EAPI Eina_Bool ewk_view_scroll_pos_get(Evas_Object* o, int* x, int* y);
1017 * Sets an absolute scroll of the given view.
1019 * Both values are from zero to the contents size minus the viewport
1022 * @param o view object to scroll
1023 * @param x horizontal position to scroll
1024 * @param y vertical position to scroll
1026 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
1028 EAPI Eina_Bool ewk_view_scroll_set(Evas_Object* o, int x, int y);
1031 * Gets the possible scroll size of the given view.
1033 * Possible scroll size is contents size minus the viewport size.
1035 * @param o view object to get scroll size
1036 * @param w the pointer to store the horizontal size that is possible to scroll,
1038 * @param h the pointer to store the vertical size that is possible to scroll,
1041 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
1044 EAPI Eina_Bool ewk_view_scroll_size_get(const Evas_Object* o, int* w, int* h);
1047 * Requests for getting web application capable.
1049 * @param callback result callback to get web database quota
1050 * @param user_data user_data will be passed when result_callback is called
1051 * -I.e., user data will be kept until callback is called
1053 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1055 EAPI Eina_Bool ewk_view_web_application_capable_get(Evas_Object* o, Ewk_Web_App_Capable_Get_Callback callback, void* user_data);
1058 * Requests for getting web application icon string.
1060 * @param callback result callback to get web database quota
1061 * @param user_data user_data will be passed when result_callback is called
1062 * -I.e., user data will be kept until callback is called
1064 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1066 EAPI Eina_Bool ewk_view_web_application_icon_url_get(Evas_Object* o, Ewk_Web_App_Icon_URL_Get_Callback callback, void* user_data);
1069 * Requests for getting web application icon list of Ewk_Web_App_Icon_Data.
1071 * @param callback result callback to get web application icon urls
1072 * @param user_data user_data will be passed when result_callback is called
1073 * -I.e., user data will be kept until callback is called
1075 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1077 EAPI Eina_Bool ewk_view_web_application_icon_urls_get(Evas_Object *o, Ewk_Web_App_Icon_URLs_Get_Callback callback, void *user_data);
1080 * Executes editor command.
1082 * @param o view object to execute command
1083 * @param command editor command to execute
1084 * @param value the value to be passed into command
1086 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1088 EAPI Eina_Bool ewk_view_command_execute(Evas_Object* o, const char* command, const char* value);
1091 * Gets last known contents size.
1093 * @param o view object to get contents size
1094 * @param width pointer to store contents size width, may be @c 0
1095 * @param height pointer to store contents size height, may be @c 0
1097 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure and
1098 * @a width and @a height will be zeroed
1100 EAPI Eina_Bool ewk_view_contents_size_get(Evas_Object* o, Evas_Coord* width, Evas_Coord* height);
1103 * Create PDF file of page contents
1105 * @param o view object to get page contents.
1106 * @param width the suface width of PDF file.
1107 * @param height the suface height of PDF file.
1108 * @param fileName the file name for creating PDF file.
1110 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1112 EAPI Eina_Bool ewk_view_contents_pdf_get_temp(Evas_Object* o, int width, int height, const char* fileName);
1113 EAPI Eina_Bool ewk_view_contents_pdf_get(Evas_Object* o, int width, int height, const char* fileName);
1115 // #if ENABLE(TIZEN_WEB_STORAGE)
1117 * Callback for ewk_view_web_storage_quota_get
1119 * @param quota web storage quota
1120 * @param user_data user_data will be passed when ewk_view_web_storage_quota_get is called
1122 typedef void (*Ewk_Web_Storage_Quota_Get_Callback)(uint32_t quota, void* user_data);
1125 * Requests for getting web storage quota.
1127 * @param o view object to get web storage quota
1128 * @param result_cb callback to get web database origins
1129 * @param user_data user_data will be passed when result_cb is called
1130 * -I.e., user data will be kept until callback is called
1132 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1134 EAPI Eina_Bool ewk_view_web_storage_quota_get(const Evas_Object* o, Ewk_Web_Storage_Quota_Get_Callback result_callback, void* user_data);
1137 * Requests for setting web storage quota.
1139 * @param o view object to set web storage quota
1140 * @param quota quota to store web storage db.
1142 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1144 EAPI Eina_Bool ewk_view_web_storage_quota_set(Evas_Object* o, uint32_t quota);
1145 // #endif // #if ENABLE(TIZEN_WEB_STORAGE)
1148 * Requests execution of the given script.
1150 * @note This allows to use NULL for the callback parameter.
1151 * So, if the result data from the script is not required, NULL might be used for the callback parameter.
1153 * @param o view object to execute script
1154 * @param script Java Script to execute
1155 * @param callback result callback
1156 * @param user_data user data
1158 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1160 EAPI Eina_Bool ewk_view_script_execute(Evas_Object* o, const char* script, Ewk_View_Script_Execute_Callback callback, void* user_data);
1163 * Retrieve the contents in plain text.
1165 * @param o view object whose contents to retrieve.
1166 * @param callback result callback
1167 * @param user_data user data
1169 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1171 EAPI Eina_Bool ewk_view_plain_text_get(Evas_Object* o, Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
1173 // #if ENABLE(TIZEN_SUPPORT_MHTML)
1175 * Get page contents as MHTML data
1177 * @param o view object to get the page contents
1178 * @param callback callback function to be called when the operation is finished
1179 * @param user_data user data to be passed to the callback function
1181 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1183 EAPI Eina_Bool ewk_view_mhtml_data_get(Evas_Object *o, Ewk_View_MHTML_Data_Get_Callback callback, void *user_data);
1184 // #endif // ENABLE(TIZEN_SUPPORT_MHTML)
1186 // #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
1188 * Creates a new hit test for the given veiw object and point.
1190 * The returned object should be freed by ewk_hit_test_free().
1192 * @param o view object to do hit test on
1193 * @param x the horizontal position to query
1194 * @param y the vertical position to query
1195 * @param hit_test_mode the Ewk_Hit_Test_Mode enum value to query
1197 * @return a newly allocated hit test on success, @c 0 otherwise
1199 EAPI Ewk_Hit_Test* ewk_view_hit_test_new(Evas_Object* o, int x, int y, int hit_test_mode);
1200 // #endif // #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
1203 * Get the whole history(whole back & forward list) associated with this view.
1205 * @param o view object to get the history(whole back & forward list)
1207 * @return a newly allocated history of @b newly allocated item
1208 * instance. This memory of each item must be released with
1209 * ewk_history_free() after use.
1211 * @see ewk_history_free()
1213 EAPI Ewk_History* ewk_view_history_get(Evas_Object* o);
1216 * Requests to set recording surface.
1218 * @param o view object to set recording surface
1219 * @param enable @c EINA_TRUE to enable recording surface
1220 * @c EINA_FALSE to disable
1222 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1224 EINA_DEPRECATED EAPI Eina_Bool ewk_view_recording_surface_enable_set(Evas_Object* o, Eina_Bool enable);
1227 * Notify that notification is closed.
1229 * @param notification_list list of Ewk_Notification pointer
1230 * notification_list is freed in this function.
1232 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1234 EAPI Eina_Bool ewk_view_notification_closed(Evas_Object* o, Eina_List* notification_list);
1237 * Sends the orientation of the device.
1239 * If orientation value is changed, orientationchanged event will occur.
1241 * @param o view object to receive orientation event.
1242 * @param orientation the new orientation of the device. (degree)
1244 * orientation will be 0 degrees when the device is oriented to natural position,
1245 * 90 degrees when it's left side is at the top,
1246 * -90 degrees when it's right side is at the top,
1247 * 180 degrees when it is upside down.
1249 EAPI void ewk_view_orientation_send(Evas_Object *o, int orientation);
1252 * Gets the current encoding.
1254 * @param o view object to get the current encoding
1256 * @return @c current encoding, or @c 0 if it's not setted
1258 EAPI const char* ewk_view_encoding_custom_get(const Evas_Object* o);
1261 * Sets the encoding and reloads the page.
1263 * @param o view to set the encoding
1264 * @param encoding the new encoding to set or @c 0 to restore the default one
1266 EAPI void ewk_view_encoding_custom_set(Evas_Object* o, const char* encoding);
1268 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
1269 EINA_DEPRECATED EAPI Eina_Bool ewk_view_text_selection_enable_set(Evas_Object* o, Eina_Bool enable);
1270 EAPI Eina_Bool ewk_view_text_selection_range_get(Evas_Object* o, Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
1271 EAPI const char* ewk_view_text_selection_text_get(Evas_Object* o);
1272 EINA_DEPRECATED EAPI Eina_Bool ewk_view_auto_clear_text_selection_mode_set(Evas_Object* o, Eina_Bool enable);
1273 EINA_DEPRECATED EAPI Eina_Bool ewk_view_auto_clear_text_selection_mode_get(Evas_Object* o);
1274 EAPI void ewk_view_text_selection_range_clear(Evas_Object* o);
1275 // #endif // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
1277 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1279 * Sets the focused input element value
1281 * @param o view object to send the value
1282 * @param value the string value to be set
1284 EAPI void ewk_view_focused_input_element_value_set(Evas_Object* o, const char* value);
1285 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1287 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1289 * Gets the focused input element's value
1291 * @param o view object to get the value
1293 * @return focused input element's value on success or NULL on failure.
1295 EAPI const char* ewk_view_focused_input_element_value_get(Evas_Object* o);
1296 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1298 // #if ENABLE(TIZEN_DATALIST_ELEMENT)
1300 * Closes data list picker
1302 * @param o view object contains data list element
1303 * @param value value to be set to the input element
1305 EAPI void ewk_view_data_list_close(Evas_Object *o, const char *value);
1306 //#endif // ENABLE(TIZEN_DATALIST_ELEMENT)
1309 * Selects index of current popup menu.
1311 * @param o view object contains popup menu.
1312 * @param index index of item to select
1314 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1315 * popup menu is not selected or index is out of range)
1317 EAPI Eina_Bool ewk_view_popup_menu_select(Evas_Object *o, unsigned int index);
1319 //#if ENABLE(TIZEN_MULTIPLE_SELECT)
1321 * Selects Multiple indexes of current popup menu.
1323 * @param o view object contains popup menu.
1324 * @param changedlist list of item selected and deselected
1326 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1327 * popup menu is not selected or index is out of range)
1329 EAPI Eina_Bool ewk_view_popup_menu_multiple_select(Evas_Object *o, Eina_Inarray* changedlist);
1333 * Closes current popup menu.
1335 * @param o view object contains popup menu.
1337 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1338 * popup menu is not selected)
1340 EAPI Eina_Bool ewk_view_popup_menu_close(Evas_Object *o);
1343 * Sets whether the ewk_view supports the mouse events or not.
1345 * The ewk_view will support the mouse events if EINA_TRUE or not support the
1346 * mouse events otherwise. The default value is EINA_TRUE.
1348 * @param o view object to enable/disable the mouse events
1349 * @param enabled a state to set
1351 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1353 EAPI Eina_Bool ewk_view_mouse_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
1356 * Queries if the ewk_view supports the mouse events.
1358 * @param o view object to query if the mouse events are enabled
1360 * @return @c EINA_TRUE if the mouse events are enabled or @c EINA_FALSE otherwise
1362 EAPI Eina_Bool ewk_view_mouse_events_enabled_get(const Evas_Object *o);
1364 typedef Eina_Bool (*Ewk_Orientation_Lock_Cb)(Evas_Object* o, Eina_Bool need_lock, int orientation, void* user_data);
1367 * Sets callback of orientation lock function
1369 * func will be called when screen lock is called or unlock is called.
1370 * When screen.lockOrientation is called, need_lock will be true and orientation
1371 * will be the flags which should be locked.
1372 * For example, when contents called 'screen.lockOrientation("portrait"), orientation
1373 * will be EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY | EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY
1374 * When screen.unlockOrientation is called, need_lock will be false.
1376 * @param o view object to set the callback of orientation
1377 * @param func callback function to be called when screen orientation is locked or unlocked.
1378 * @param use_data user_data will be passsed when ewk_view_web_app_icon_get is called
1380 * @return current URI on success or @c 0 on failure
1382 EINA_DEPRECATED EAPI void ewk_view_orientation_lock_callback_set(Evas_Object *o, Ewk_Orientation_Lock_Cb func, void* user_data);
1384 // #endif // #if OS(TIZEN)
1387 * Loads the specified @a html string as the content of the view.
1389 * External objects such as stylesheets or images referenced in the HTML
1390 * document are located relative to @a baseUrl.
1392 * If an @a unreachableUrl is passed it is used as the url for the loaded
1393 * content. This is typically used to display error pages for a failed
1396 * @param o view object to load the HTML into
1397 * @param html HTML data to load
1398 * @param baseUrl Base URL used for relative paths to external objects (optional)
1399 * @param unreachableUrl URL that could not be reached (optional)
1401 * @return @c EINA_TRUE if it the HTML was successfully loaded, @c EINA_FALSE otherwise
1403 EAPI Eina_Bool ewk_view_html_string_load(Evas_Object *o, const char *html, const char *baseUrl, const char *unreachableUrl);
1406 * Scales the current page, centered at the given point.
1408 * @param o view object to set the zoom level
1409 * @param scale_factor a new level to set
1410 * @param cx x of center coordinate
1411 * @param cy y of center coordinate
1413 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1415 EAPI Eina_Bool ewk_view_scale_set(Evas_Object *o, double scaleFactor, int x, int y);
1418 * Queries the current scale factor of the page.
1420 * It returns previous scale factor after ewk_view_scale_set is called immediately
1421 * until scale factor of page is really changed.
1423 * @param o view object to get the scale factor
1425 * @return current scale factor in use on success or @c -1.0 on failure
1427 EAPI double ewk_view_scale_get(const Evas_Object *o);
1430 * Queries the ratio between the CSS units and device pixels when the content is unscaled.
1432 * When designing touch-friendly contents, knowing the approximated target size on a device
1433 * is important for contents providers in order to get the intented layout and element
1436 * As most first generation touch devices had a PPI of approximately 160, this became a
1437 * de-facto value, when used in conjunction with the viewport meta tag.
1439 * Devices with a higher PPI learning towards 240 or 320, applies a pre-scaling on all
1440 * content, of either 1.5 or 2.0, not affecting the CSS scale or pinch zooming.
1442 * This value can be set using this property and it is exposed to CSS media queries using
1443 * the -webkit-device-pixel-ratio query.
1445 * For instance, if you want to load an image without having it upscaled on a web view
1446 * using a device pixel ratio of 2.0 it can be done by loading an image of say 100x100
1447 * pixels but showing it at half the size.
1449 * @media (-webkit-min-device-pixel-ratio: 1.5) {
1453 * url: "/images/icon@2x.png"; // This is actually a 100x100 image
1457 * If the above is used on a device with device pixel ratio of 1.5, it will be scaled
1458 * down but still provide a better looking image.
1460 * @param o view object to get device pixel ratio
1462 * @return the ratio between the CSS units and device pixels,
1463 * or @c -1.0 on failure
1465 EAPI float ewk_view_device_pixel_ratio_get(const Evas_Object *o);
1468 * Sets the ratio between the CSS units and device pixels when the content is unscaled.
1470 * @param o view object to set device pixel ratio
1472 * @return @c EINA_TRUE if the device pixel ratio was set, @c EINA_FALSE otherwise
1474 * @see ewk_view_device_pixel_ratio_get()
1476 EAPI Eina_Bool ewk_view_device_pixel_ratio_set(Evas_Object *o, float ratio);
1479 * Sets the theme path that will be used by this view.
1481 * This also sets the theme on the main frame. As frames inherit theme
1482 * from their parent, this will have all frames with unset theme to
1485 * @param o view object to change theme
1486 * @param path theme path
1488 EAPI void ewk_view_theme_set(Evas_Object *o, const char *path);
1491 * Gets the theme set on this view.
1493 * This returns the value set by ewk_view_theme_set().
1495 * @param o view object to get theme path
1497 * @return the theme path, may be @c NULL if not set
1499 EAPI const char *ewk_view_theme_get(const Evas_Object *o);
1502 * Gets the current custom character encoding name.
1504 * @param o view object to get the current encoding
1506 * @return @c eina_strinshare containing the current encoding, or
1507 * @c NULL if it's not set
1509 EAPI const char *ewk_view_custom_encoding_get(const Evas_Object *o);
1512 * Sets the custom character encoding and reloads the page.
1514 * @param o view to set the encoding
1515 * @param encoding the new encoding to set or @c NULL to restore the default one
1517 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1519 EAPI Eina_Bool ewk_view_custom_encoding_set(Evas_Object *o, const char *encoding);
1522 * Searches and hightlights the given string in the document.
1524 * @param o view object to find text
1525 * @param text text to find, must @b not be @c NULL
1526 * @param options options to find
1527 * @param max_match_count maximum match count to find, unlimited if 0
1529 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
1531 EAPI Eina_Bool ewk_view_text_find(Evas_Object *o, const char *text, Ewk_Find_Options options, unsigned max_match_count);
1534 * Clears the highlight of searched text.
1536 * @param o view object to find text
1538 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
1540 EAPI Eina_Bool ewk_view_text_find_highlight_clear(Evas_Object *o);
1543 * Counts the given string in the document.
1545 * This does not highlight the matched string and just count the matched string.
1547 * As the search is carried out through the whole document,
1548 * only the following EWK_FIND_OPTIONS are valid.
1549 * - EWK_FIND_OPTIONS_NONE
1550 * - EWK_FIND_OPTIONS_CASE_INSENSITIVE
1551 * - EWK_FIND_OPTIONS_AT_WORD_START
1552 * - EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START
1554 * The "text,found" callback will be called with the number of matched string.
1556 * @param o view object to find text
1557 * @param text text to find
1558 * @param options options to find
1559 * @param max_match_count maximum match count to find, unlimited if 0
1561 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
1563 EAPI Eina_Bool ewk_view_text_matches_count(Evas_Object *o, const char *text, Ewk_Find_Options options, unsigned max_match_count);
1566 * Sets the user chosen color. To be used when implementing a color picker.
1568 * The function should only be called when a color has been requested by the document.
1569 * If called when this is not the case or when the input picker has been dismissed, this
1570 * function will fail and return EINA_FALSE.
1572 * @param o view object contains color picker
1573 * @param r red channel value to be set
1574 * @param g green channel value to be set
1575 * @param b blue channel value to be set
1576 * @param a alpha channel value to be set
1578 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1580 EAPI Eina_Bool ewk_view_color_picker_color_set(Evas_Object *o, int r, int g, int b, int a);
1583 * Feeds the touch event to the view.
1585 * @param o view object to feed touch event
1586 * @param type the type of touch event
1587 * @param points a list of points (Ewk_Touch_Point) to process
1588 * @param modifiers an Evas_Modifier handle to the list of modifier keys
1589 * registered in the Evas. Users can get the Evas_Modifier from the Evas
1590 * using evas_key_modifier_get() and can set each modifier key using
1591 * evas_key_modifier_on() and evas_key_modifier_off()
1593 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1595 EAPI Eina_Bool ewk_view_feed_touch_event(Evas_Object *o, Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers);
1598 * Sets whether the ewk_view supports the touch events or not.
1600 * The ewk_view will support the touch events if @c EINA_TRUE or not support the
1601 * touch events otherwise. The default value is @c EINA_FALSE.
1603 * @param o view object to enable/disable the touch events
1604 * @param enabled a state to set
1606 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1608 EAPI Eina_Bool ewk_view_touch_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
1611 * Queries if the ewk_view supports the touch events.
1613 * @param o view object to query if the touch events are enabled
1615 * @return @c EINA_TRUE if the touch events are enabled or @c EINA_FALSE otherwise
1617 EAPI Eina_Bool ewk_view_touch_events_enabled_get(const Evas_Object *o);
1620 * Sets the visibility of main frame scrollbar.
1622 * @param o view object
1623 * @param visible visibility of main frame scrollbar
1625 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1627 EAPI Eina_Bool ewk_view_main_frame_scrollbar_visible_set(Evas_Object *o, Eina_Bool visible);
1630 * Gets the visibility of main frame scrollbar.
1632 * @param o view object
1634 * @return @c EINA_TRUE if scrollbar is visible or @c EINA_FALSE on failure
1636 EAPI Eina_Bool ewk_view_main_frame_scrollbar_visible_get(const Evas_Object *o);
1639 * Get contents of the current web page.
1641 * @param o view object to get the page contents
1642 * @param context context of the page contents which has contents type and callback function
1644 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1646 EAPI Eina_Bool ewk_view_page_contents_get(const Evas_Object *o, Ewk_Page_Contents_Context *context);
1649 * Scroll to the position of the given view with animation
1651 * Both values are from zero to the contents size minus the viewport
1654 * @param o view object to scroll
1655 * @param x horizontal position to scroll
1656 * @param y vertical position to scroll
1658 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
1660 EAPI Eina_Bool ewk_view_animated_scroll_set(Evas_Object *o, int x, int y);
1663 * Clear back forward list of a page.
1665 * @param o view object to clear back forward list
1667 EAPI void ewk_view_back_forward_list_clear(const Evas_Object *o);
1669 /// Enum values containing Content Security Policy header types.
1670 enum _Ewk_CSP_Header_Type {
1674 typedef enum _Ewk_CSP_Header_Type Ewk_CSP_Header_Type;
1677 * Set received Content Security Policy data from web app
1679 * @param o view object
1680 * @param policy Content Security Policy data
1681 * @param type Content Security Policy header type
1684 EAPI void ewk_view_content_security_policy_set(Evas_Object* o, const char* policy, Ewk_CSP_Header_Type type);
1687 * Starts offline page save.
1689 * @param o view object to start offline page save
1690 * @param path directory path to save offline page
1692 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
1694 EAPI Eina_Bool ewk_view_page_save(Evas_Object* o, const char* path);
1697 * Prepare the rotation of the device.
1699 * This function trigger prerendering first frame of new view size before target's angle is changed.
1700 * When prerendering is done, "rotate,prepared" event will occur.
1702 * @param o view object to receive orientation event.
1703 * @param angle the new angle of the device. (degree)
1705 * angle will be 0 degrees when the device is oriented to natural position,
1706 * 90 degrees when it's right side is at the top,
1707 * 180 degrees when it is upside down.
1708 * 270 degrees when it's left side is at the top,
1710 EAPI void ewk_view_rotation_prepare(Evas_Object* ewkView, int angle);
1713 * When font-family is "Tizen", use system's Settings font as default font-family
1715 * @param o view object
1718 EAPI void ewk_view_use_settings_font(Evas_Object* o);
1723 #endif // ewk_view_h