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 * - "download,cancelled", Ewk_Download_Job*: reports that a download was effectively cancelled.
30 * - "download,failed", Ewk_Download_Job_Error*: reports that a download failed with the given error.
31 * - "download,finished", Ewk_Download_Job*: reports that a download completed successfully.
32 * - "download,request", Ewk_Download_Job*: reports that a new download has been requested. The client should set the
33 * destination path by calling ewk_download_job_destination_set() or the download will fail.
34 * - "form,submission,request", Ewk_Form_Submission_Request*: Reports that a form request is about to be submitted.
35 * The Ewk_Form_Submission_Request passed contains information about the text fields of the form. This
36 * is typically used to store login information that can be used later to pre-fill the form.
37 * The form will not be submitted until ewk_form_submission_request_submit() is called.
38 * It is possible to handle the form submission request asynchronously, by simply calling
39 * ewk_form_submission_request_ref() on the request and calling ewk_form_submission_request_submit()
40 * when done to continue with the form submission. If the last reference is removed on a
41 * #Ewk_Form_Submission_Request and the form has not been submitted yet,
42 * ewk_form_submission_request_submit() will be called automatically.
43 * - "intent,request,new", Ewk_Intent_Request*: reports new Web intent request.
44 * - "intent,service,register", Ewk_Intent_Service*: reports new Web intent service registration.
45 * - "load,error", const Ewk_Web_Error*: reports main frame load failed.
46 * - "load,finished", void: reports load finished.
47 * - "load,progress", double*: load progress has changed (value from 0.0 to 1.0).
48 * - "load,provisional,failed", const Ewk_Web_Error*: view provisional load failed.
49 * - "load,provisional,redirect", void: view received redirect for provisional load.
50 * - "load,provisional,started", void: view started provisional load.
51 * - "policy,decision,navigation", Ewk_Navigation_Policy_Decision*: a navigation policy decision should be taken.
52 * To make a policy decision asynchronously, simply increment the reference count of the
53 * #Ewk_Navigation_Policy_Decision object using ewk_navigation_policy_decision_ref().
54 * - "policy,decision,new,window", Ewk_Navigation_Policy_Decision*: a new window policy decision should be taken.
55 * To make a policy decision asynchronously, simply increment the reference count of the
56 * #Ewk_Navigation_Policy_Decision object using ewk_navigation_policy_decision_ref().
57 * - "resource,request,failed", const Ewk_Web_Resource_Load_Error*: a resource failed loading.
58 * - "resource,request,finished", const Ewk_Web_Resource*: a resource finished loading.
59 * - "resource,request,new", const Ewk_Web_Resource_Request*: a resource request was initiated.
60 * - "resource,request,response", Ewk_Web_Resource_Load_Response*: a response to a resource request was received.
61 * - "resource,request,sent", const Ewk_Web_Resource_Request*: a resource request was sent.
62 * - "text,found", unsigned int*: the requested text was found and it gives the number of matches.
63 * - "title,changed", const char*: title of the main frame was changed.
64 * - "uri,changed", const char*: uri of the main frame was changed.
65 * - "pageSave,success", void: page save operation was success.
66 * - "pageSave,error", void: page save operation has failed.
69 * Tizen specific signals
70 * - "magnifier,show", void: magifier of text selection was showed.
71 * - "magnifier,hide", void: magifier of text selection was hidden.
77 #include "ewk_context.h"
78 #include "ewk_download_job.h"
79 #include "ewk_intent.h"
80 #include "ewk_touch.h"
81 #include "ewk_settings.h"
82 #include "ewk_url_request.h"
83 #include "ewk_url_response.h"
84 #include "ewk_web_error.h"
85 #include "ewk_web_resource.h"
89 #include "ewk_frame.h"
92 #include "ewk_history.h"
94 //#if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
95 #include "ewk_hit_test.h"
98 //#if ENABLE(TIZEN_WEBKIT2_POPUP_INTERNAL)
99 #include "ewk_enums.h"
106 /// Enum values containing text directionality values.
108 EWK_TEXT_DIRECTION_RIGHT_TO_LEFT,
109 EWK_TEXT_DIRECTION_LEFT_TO_RIGHT
110 } Ewk_Text_Direction;
112 typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data;
113 typedef struct _Ewk_View_Smart_Class Ewk_View_Smart_Class;
116 /// Creates a type name for _Ewk_Event_Gesture.
117 typedef struct _Ewk_Event_Gesture Ewk_Event_Gesture;
119 /// Represents a gesture event.
120 struct _Ewk_Event_Gesture {
121 Ewk_Gesture_Type type; /**< type of the gesture event */
122 Evas_Coord_Point position; /**< position of the gesture event */
123 Evas_Point velocity; /**< velocity of the gesture event. The unit is pixel per second. */
124 double scale; /**< scale of the gesture event */
125 int count; /**< count of the gesture */
126 unsigned int timestamp; /**< timestamp of the gesture */
129 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
131 * \enum Ewk_Input_Type
132 * @brief Provides type of focused input element
134 enum _Ewk_Input_Type {
136 EWK_INPUT_TYPE_TELEPHONE,
137 EWK_INPUT_TYPE_NUMBER,
138 EWK_INPUT_TYPE_EMAIL,
140 EWK_INPUT_TYPE_PASSWORD,
141 EWK_INPUT_TYPE_COLOR,
143 EWK_INPUT_TYPE_DATETIME,
144 EWK_INPUT_TYPE_DATETIMELOCAL,
145 EWK_INPUT_TYPE_MONTH,
149 typedef enum _Ewk_Input_Type Ewk_Input_Type;
150 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
151 // #endif // #if OS(TIZEN)
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 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);
159 //#if ENABLE(TIZEN_MULTIPLE_SELECT)
160 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);
162 Eina_Bool (*popup_menu_hide)(Ewk_View_Smart_Data *sd);
163 Eina_Bool (*popup_menu_update)(Ewk_View_Smart_Data *sd, Eina_Rectangle rect, Ewk_Text_Direction text_direction, Eina_List* items, int selected_index);
165 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
166 Eina_Bool (*text_selection_down)(Ewk_View_Smart_Data *sd, int x, int y);
167 Eina_Bool (*text_selection_move)(Ewk_View_Smart_Data *sd, int x, int y);
168 Eina_Bool (*text_selection_up)(Ewk_View_Smart_Data *sd, int x, int y);
171 //#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
172 Eina_Bool (*input_picker_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, const char* inputValue);
175 //#if ENABLE(TIZEN_DATALIST_ELEMENT)
176 Eina_Bool (*data_list_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, Eina_List *optionList);
177 Eina_Bool (*data_list_hide)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType);
180 // #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
181 Eina_Bool (*orientation_lock)(Ewk_View_Smart_Data *sd, int orientations);
182 void (*orientation_unlock)(Ewk_View_Smart_Data *sd);
186 // - returns true if handled
187 // - if overridden, have to call parent method if desired
188 Eina_Bool (*focus_in)(Ewk_View_Smart_Data *sd);
189 Eina_Bool (*focus_out)(Ewk_View_Smart_Data *sd);
190 Eina_Bool (*mouse_wheel)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Wheel *ev);
191 Eina_Bool (*mouse_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Down *ev);
192 Eina_Bool (*mouse_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Up *ev);
193 Eina_Bool (*mouse_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Move *ev);
194 Eina_Bool (*key_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Down *ev);
195 Eina_Bool (*key_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Up *ev);
197 // #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
199 // - Shows and hides color picker.
200 Eina_Bool (*input_picker_color_request)(Ewk_View_Smart_Data *sd, int r, int g, int b, int a);
201 Eina_Bool (*input_picker_color_dismiss)(Ewk_View_Smart_Data *sd);
204 // #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
205 Eina_Bool (*formdata_candidate_show)(Ewk_View_Smart_Data *sd, int x, int y, int w, int h);
206 Eina_Bool (*formdata_candidate_hide)(Ewk_View_Smart_Data *sd);
207 Eina_Bool (*formdata_candidate_update_data)(Ewk_View_Smart_Data *sd, Eina_List *dataList);
208 Eina_Bool (*formdata_candidate_is_showing)(Ewk_View_Smart_Data *sd);
212 Eina_Bool (*gesture_start)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
213 Eina_Bool (*gesture_end)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
214 Eina_Bool (*gesture_move)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
217 //#if ENABLE(TIZEN_SCREEN_READER)
218 Eina_Bool (*screen_reader_command_execute)(Ewk_View_Smart_Data *sd, unsigned int command, int data1, int data2);
224 * Callback for ewk_view_web_app_capable_get
226 * @param capable web application capable
227 * @param user_data user_data will be passsed when ewk_view_web_app_capable_get is called
229 typedef void (*Ewk_Web_App_Capable_Get_Callback)(Eina_Bool capable, void* user_data);
232 * Callback for ewk_view_web_app_icon_get
234 * @param icon_url web application icon
235 * @param user_data user_data will be passsed when ewk_view_web_app_icon_get is called
237 typedef void (*Ewk_Web_App_Icon_URL_Get_Callback)(const char* icon_url, void* user_data);
241 * The version you have to put into the version field
242 * in the @a Ewk_View_Smart_Class structure.
244 #define EWK_VIEW_SMART_CLASS_VERSION 1UL
247 * Initializer for whole Ewk_View_Smart_Class structure.
249 * @param smart_class_init initializer to use for the "base" field
250 * (Evas_Smart_Class).
252 * @see EWK_VIEW_SMART_CLASS_INIT_NULL
253 * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
254 * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
256 #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}
259 * Initializer to zero a whole Ewk_View_Smart_Class structure.
261 * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
262 * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
263 * @see EWK_VIEW_SMART_CLASS_INIT
265 #define EWK_VIEW_SMART_CLASS_INIT_NULL EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
268 * Initializer to zero a whole Ewk_View_Smart_Class structure and set
271 * Similar to EWK_VIEW_SMART_CLASS_INIT_NULL, but will set version field of
272 * Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION and name
273 * to the specific value.
275 * It will keep a reference to name field as a "const char *", that is,
276 * name must be available while the structure is used (hint: static or global!)
277 * and will not be modified.
279 * @see EWK_VIEW_SMART_CLASS_INIT_NULL
280 * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
281 * @see EWK_VIEW_SMART_CLASS_INIT
283 #define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
285 typedef struct _Ewk_View_Private_Data Ewk_View_Private_Data;
286 typedef struct EwkViewImpl EwkViewImpl;
289 * @brief Contains an internal View data.
291 * It is to be considered private by users, but may be extended or
292 * changed by sub-classes (that's why it's in public header file).
294 struct _Ewk_View_Smart_Data {
295 Evas_Object_Smart_Clipped_Data base;
296 const Ewk_View_Smart_Class* api; /**< reference to casted class instance */
297 Evas_Object* self; /**< reference to owner object */
298 Evas_Object* image; /**< reference to evas_object_image for drawing web contents */
299 // FIXME: Ewk_View_Private_Data was replaced with EwkViewImpl in the webkit opensource.
300 // So, we have both Ewk_View_Private_Data and EwkViewImpl now,
301 // but Ewk_View_Private_Data should be removed later.
302 Ewk_View_Private_Data* priv; /**< should never be accessed, c++ stuff */
303 EwkViewImpl* ewkViewImpl; /**< should never be accessed, c++ stuff */
305 Evas_Coord x, y, w, h; /**< last used viewport */
307 struct { /**< what changed since last smart_calculate */
310 Eina_Bool position:1;
314 /// Creates a type name for _Ewk_Web_Resource_Request.
315 typedef struct _Ewk_Web_Resource_Request Ewk_Web_Resource_Request;
318 * @brief Structure containing details about a resource request.
320 struct _Ewk_Web_Resource_Request {
321 Ewk_Web_Resource *resource; /**< resource being requested */
322 Ewk_Url_Request *request; /**< URL request for the resource */
323 Ewk_Url_Response *redirect_response; /**< Possible redirect response for the resource or @c NULL */
326 /// Creates a type name for _Ewk_Web_Resource_Load_Response.
327 typedef struct _Ewk_Web_Resource_Load_Response Ewk_Web_Resource_Load_Response;
330 * @brief Structure containing details about a response to a resource request.
332 struct _Ewk_Web_Resource_Load_Response {
333 Ewk_Web_Resource *resource; /**< resource requested */
334 Ewk_Url_Response *response; /**< resource load response */
337 /// Creates a type name for _Ewk_Web_Resource_Load_Error.
338 typedef struct _Ewk_Web_Resource_Load_Error Ewk_Web_Resource_Load_Error;
341 * @brief Structure containing details about a resource load error.
343 * Details given about a resource load failure.
345 struct _Ewk_Web_Resource_Load_Error {
346 Ewk_Web_Resource *resource; /**< resource that failed loading */
347 Ewk_Web_Error *error; /**< load error */
350 /// Creates a type name for _Ewk_Download_Job_Error.
351 typedef struct _Ewk_Download_Job_Error Ewk_Download_Job_Error;
354 * @brief Structure containing details about a download failure.
356 struct _Ewk_Download_Job_Error {
357 Ewk_Download_Job *download_job; /**< download that failed */
358 Ewk_Web_Error *error; /**< download error */
361 /// Enum values containing page contents type values.
363 EWK_PAGE_CONTENTS_TYPE_MHTML,
364 EWK_PAGE_CONTENTS_TYPE_STRING
365 } Ewk_Page_Contents_Type;
368 * Creates a type name for the callback function used to get the page contents.
370 * @param type type of the contents
371 * @param data string buffer of the contents
373 typedef void (*Ewk_Page_Contents_Cb)(Ewk_Page_Contents_Type type, const char *data);
375 /// Creates a type name for Ewk_Page_Contents_Context.
376 typedef struct Ewk_Page_Contents_Context Ewk_Page_Contents_Context;
379 * @brief Structure containing page contents context used for ewk_view_page_contents_get() API.
381 struct Ewk_Page_Contents_Context {
382 Ewk_Page_Contents_Type type;
383 Ewk_Page_Contents_Cb callback;
387 * Sets the smart class APIs, enabling view to be inherited.
389 * @param api class definition to set, all members with the
390 * exception of @a Evas_Smart_Class->data may be overridden, must
393 * @note @a Evas_Smart_Class->data is used to implement type checking and
394 * is not supposed to be changed/overridden. If you need extra
395 * data for your smart class to work, just extend
396 * Ewk_View_Smart_Class instead.
397 * The Evas_Object which inherits the ewk_view should use
398 * ewk_view_smart_add() to create Evas_Object instead of
399 * evas_object_smart_add() because it performs additional initialization
402 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
405 * @see ewk_view_smart_add()
407 EAPI Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class *api);
410 * Creates a new EFL WebKit view object with Evas_Smart and Ewk_Context.
412 * @note The Evas_Object which inherits the ewk_view should create its
413 * Evas_Object using this API instead of evas_object_smart_add()
414 * because the default initialization for ewk_view is done in this API.
416 * @param e canvas object where to create the view object
417 * @param smart Evas_Smart object. Its type should be EWK_VIEW_TYPE_STR
418 * @param context Ewk_Context object which is used for initializing
420 * @return view object on success or @c NULL on failure
422 EAPI Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context);
425 * Creates a new EFL WebKit view object.
427 * @param e canvas object where to create the view object
429 * @return view object on success or @c NULL on failure
431 EAPI Evas_Object *ewk_view_add(Evas *e);
434 * Creates a new EFL WebKit view object based on specific Ewk_Context.
436 * @param e canvas object where to create the view object
437 * @param context Ewk_Context object to declare process model
439 * @return view object on success or @c NULL on failure
441 EAPI Evas_Object *ewk_view_add_with_context(Evas *e, Ewk_Context *context);
444 * Asks the object to load the given URI.
446 * @param o view object to load @a URI
447 * @param uri uniform resource identifier to load
449 * @return @c EINA_TRUE is returned if @a o is valid, irrespective of load,
450 * or @c EINA_FALSE on failure
452 EAPI Eina_Bool ewk_view_url_set(Evas_Object *o, const char *uri);
455 * Returns the current URI string of view object.
457 * It returns an internal string and should not
458 * be modified. The string is guaranteed to be stringshared.
460 * @param o view object to get current URI
462 * @return current URI on success or @c NULL on failure
464 EAPI const char *ewk_view_url_get(const Evas_Object *o);
467 * Asks the main frame to reload the current document.
469 * @param o view object to reload current document
471 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
473 * @see ewk_view_reload_bypass_cache()
475 EAPI Eina_Bool ewk_view_reload(Evas_Object *o);
478 * Reloads the current page's document without cache.
480 * @param o view object to reload current document
482 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
484 EAPI Eina_Bool ewk_view_reload_bypass_cache(Evas_Object *o);
487 * Asks the main frame to stop loading.
489 * @param o view object to stop loading
491 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
493 EAPI Eina_Bool ewk_view_stop(Evas_Object* o);
496 * Gets the Ewk_Settings of this view.
498 * @param o view object to get Ewk_Settings
500 * @return the Ewk_Settings of this view or @c NULL on failure
502 EAPI Ewk_Settings *ewk_view_settings_get(const Evas_Object *o);
506 enum _Ewk_Page_Visibility_State {
507 EWK_PAGE_VISIBILITY_STATE_VISIBLE,
508 EWK_PAGE_VISIBILITY_STATE_HIDDEN,
509 EWK_PAGE_VISIBILITY_STATE_PRERENDER
511 typedef enum _Ewk_Page_Visibility_State Ewk_Page_Visibility_State;
513 enum _Ewk_Http_Method {
515 EWK_HTTP_METHOD_HEAD,
516 EWK_HTTP_METHOD_POST,
518 EWK_HTTP_METHOD_DELETE,
520 typedef enum _Ewk_Http_Method Ewk_Http_Method;
523 * Enum values used to specify search options.
524 * @brief Provides option to find text
525 * @info Keep this in sync with WKFindOptions.h
527 enum _Ewk_Find_Options {
528 EWK_FIND_OPTIONS_NONE, /**< no search flags, this means a case sensitive, no wrap, forward only search. */
529 EWK_FIND_OPTIONS_CASE_INSENSITIVE = 1 << 0, /**< case insensitive search. */
530 EWK_FIND_OPTIONS_AT_WORD_STARTS = 1 << 1, /**< search text only at the beginning of the words. */
531 EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START = 1 << 2, /**< treat capital letters in the middle of words as word start. */
532 EWK_FIND_OPTIONS_BACKWARDS = 1 << 3, /**< search backwards. */
533 EWK_FIND_OPTIONS_WRAP_AROUND = 1 << 4, /**< if not present search will stop at the end of the document. */
534 EWK_FIND_OPTIONS_SHOW_OVERLAY = 1 << 5, /**< show overlay */
535 EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR = 1 << 6, /**< show indicator */
536 EWK_FIND_OPTIONS_SHOW_HIGHLIGHT = 1 << 7 /**< show highlight */
538 typedef enum _Ewk_Find_Options Ewk_Find_Options;
541 * Callback for ewk_view_script_execute
543 * @param o the view object
544 * @param result_value value returned by script
545 * @param user_data user data
547 typedef void (*Ewk_View_Script_Execute_Callback)(Evas_Object* o, const char* result_value, void* user_data);
550 * Callback for ewk_view_plain_text_get
552 * @param o the view object
553 * @param plain_text the contents of the given frame converted to plain text
554 * @param user_data user data
556 typedef void (*Ewk_View_Plain_Text_Get_Callback)(Evas_Object* o, const char* plain_text, void* user_data);
558 // #if ENABLE(TIZEN_SUPPORT_MHTML)
560 * Creates a type name for the callback function used to get the page contents.
562 * @param o view object
563 * @param data mhtml data of the page contents
564 * @param user_data user data will be passed when ewk_view_mhtml_data_get is called
566 typedef void (*Ewk_View_MHTML_Data_Get_Callback)(Evas_Object *o, const char *data, void *user_data);
567 // #endif // ENABLE(TIZEN_SUPPORT_MHTML)
571 * Sets whether the ewk_view supports the mouse events or not.
573 * The ewk_view will support the mouse events if EINA_TRUE or not support the
574 * mouse events otherwise. The default value is EINA_TRUE.
576 * @param o view object to enable/disable the mouse events
577 * @param enabled a state to set
579 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
581 EAPI Eina_Bool ewk_view_mouse_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
584 * Queries if the ewk_view supports the mouse events.
586 * @param o view object to query if the mouse events are enabled
588 * @return @c EINA_TRUE if the mouse events are enabled or @c EINA_FALSE otherwise
590 EAPI Eina_Bool ewk_view_mouse_events_enabled_get(const Evas_Object *o);
591 // #endif // #if OS(TIZEN)
594 * Gets the Ewk_Context of this view.
596 * @param o the view object to get the WKPageRef
598 * @return the Ewk_Context of this view
600 EAPI Ewk_Context* ewk_view_context_get(const Evas_Object* o);
603 * Gets the reference object for frame that represents the main frame.
605 * @param o view object to get main frame
607 * @return frame reference of frame object on success, or NULL on failure
609 EAPI Ewk_Frame_Ref ewk_view_main_frame_get(Evas_Object* o);
612 * Gets the reference obect for the currently focused frame.
614 * @param o view object to get main frame
616 * @return frame reference of frame object on success, or NULL on failure
618 EAPI Ewk_Frame_Ref ewk_view_focused_frame_get(Evas_Object* o);
620 EAPI Eina_Bool ewk_view_horizontal_panning_hold_get(Evas_Object* o);
621 EAPI void ewk_view_horizontal_panning_hold_set(Evas_Object* o, Eina_Bool hold);
622 EAPI Eina_Bool ewk_view_vertical_panning_hold_get(Evas_Object* o);
623 EAPI void ewk_view_vertical_panning_hold_set(Evas_Object* o, Eina_Bool hold);
624 // #if ENABLE(TIZEN_GESTURE)
625 EAPI void ewk_view_use_smart_selection_set(Evas_Object* ewkView, Eina_Bool use);
627 EAPI void ewk_view_top_of_contents_go(Evas_Object* ewkView);
630 * Gets the minimum and maximum value of the scale range or -1 on failure
632 * @param o view object to get the minimum and maximum value of the scale range
633 * @param min_scale Pointer to an double in which to store the minimum scale factor of the object.
634 * @param max_scale Pointer to an double in which to store the maximum scale factor of the object.
636 * @note Use @c NULL pointers on the scale components you're not
637 * interested in: they'll be ignored by the function.
639 EAPI void ewk_view_scale_range_get(Evas_Object* o, double* min_scale, double* max_scale);
642 * Gets the current text zoom level.
644 * @param o view object to get the zoom level
646 * @return current zoom level in use on success or @c -1.0 on failure
648 EAPI double ewk_view_text_zoom_get(const Evas_Object* o);
651 * Sets the current text zoom level.
653 * @param o view object to set the zoom level
654 * @param textZoomFactor a new level to set
656 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
658 EAPI Eina_Bool ewk_view_text_zoom_set(Evas_Object* o, double text_zoom_factor);
660 EAPI void ewk_view_suspend(Evas_Object* o);
661 EAPI void ewk_view_resume(Evas_Object* o);
663 typedef Eina_Bool (*Ewk_View_JavaScript_Alert_Callback)(Evas_Object* o, const char* alert_text, void* user_data);
664 EAPI void ewk_view_javascript_alert_callback_set(Evas_Object* o, Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
665 EAPI void ewk_view_javascript_alert_reply(Evas_Object* o);
667 typedef Eina_Bool (*Ewk_View_JavaScript_Confirm_Callback)(Evas_Object* o, const char* message, void* user_data);
668 EAPI void ewk_view_javascript_confirm_callback_set(Evas_Object* o, Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
669 EAPI void ewk_view_javascript_confirm_reply(Evas_Object* o, Eina_Bool result);
671 typedef Eina_Bool (*Ewk_View_JavaScript_Prompt_Callback)(Evas_Object* o, const char* message, const char* default_value, void* user_data);
672 EAPI void ewk_view_javascript_prompt_callback_set(Evas_Object* o, Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
673 EAPI void ewk_view_javascript_prompt_reply(Evas_Object* o, const char* result);
675 //#if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
676 typedef Eina_Bool (*Ewk_View_Before_Unload_Confirm_Panel_Callback)(Evas_Object* o, const char* message, void* user_data);
677 EAPI void ewk_view_before_unload_confirm_panel_callback_set(Evas_Object* o, Ewk_View_Before_Unload_Confirm_Panel_Callback callback, void* user_data);
678 EAPI void ewk_view_before_unload_confirm_panel_reply(Evas_Object* o, Eina_Bool result);
681 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);
682 EAPI void ewk_view_open_panel_callback_set(Evas_Object* o, Ewk_View_Open_Panel_Callback callback, void* user_data);
683 EAPI void ewk_view_open_panel_reply(Evas_Object* o, Eina_List* file_url, Eina_Bool result);
686 * Delivers a Web intent to the view's main frame.
688 * @param o view object to deliver the intent to
690 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
692 EAPI Eina_Bool ewk_view_intent_deliver(Evas_Object *o, Ewk_Intent *intent);
695 * Asks the main frame to navigate back in the history.
697 * @param o view object to navigate back
699 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
701 * @see ewk_frame_back()
703 EAPI Eina_Bool ewk_view_back(Evas_Object *o);
706 * Asks the main frame to navigate forward in the history.
708 * @param o view object to navigate forward
710 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
712 * @see ewk_frame_forward()
714 EAPI Eina_Bool ewk_view_forward(Evas_Object *o);
717 * Queries if it is possible to navigate backwards one item in the history.
719 * @param o view object to query if backward navigation is possible
721 * @return @c EINA_TRUE if it is possible to navigate backwards in the history, @c EINA_FALSE otherwise
723 EAPI Eina_Bool ewk_view_back_possible(Evas_Object *o);
726 * Queries if it is possible to navigate forwards one item in the history.
728 * @param o view object to query if forward navigation is possible
730 * @return @c EINA_TRUE if it is possible to navigate forwards in the history, @c EINA_FALSE otherwise
732 EAPI Eina_Bool ewk_view_forward_possible(Evas_Object *o);
735 * Gets the current title of the main frame.
737 * It returns an internal string and should not
738 * be modified. The string is guaranteed to be stringshared.
740 * @param o view object to get current title
742 * @return current title on success or @c NULL on failure
744 EAPI const char *ewk_view_title_get(const Evas_Object *o);
747 * Gets the current load progress of page.
749 * The progress estimation from 0.0 to 1.0.
751 * @param o view object to get the current progress
753 * @return the load progress of page, value from 0.0 to 1.0,
754 * or @c -1.0 on failure
756 EAPI double ewk_view_load_progress_get(const Evas_Object *o);
759 * Requests loading of the given request data.
761 * @param o view object to load
762 * @param url uniform resource identifier to load
763 * @param method http method
764 * @param headers http headers
765 * @param body http body data
767 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
769 EAPI Eina_Bool ewk_view_url_request_set(Evas_Object* o, const char* url, Ewk_Http_Method method, Eina_Hash* headers, const char* body);
772 * Requests the specified plain text string into the view object
774 * @note The mime type of document will be "text/plain".
776 * @return the load progress of page, value from 0.0 to 1.0,
777 * or @c -1.0 on failure
779 EAPI Eina_Bool ewk_view_plain_text_set(Evas_Object* o, const char* plain_text);
782 * Requests loading the given contents by mime type into the view object.
784 * @param o view object to load
785 * @param contents what to load
786 * @param contents_size size of @a contents (in bytes),
787 * @param mime_type type of @a contents data, if @c 0 is given "text/html" is assumed
788 * @param encoding encoding for @a contents data, if @c 0 is given "UTF-8" is assumed
789 * @param base_uri base uri to use for relative resources, may be @c 0,
790 * if provided @b must be an absolute uri
792 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
794 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);
797 * Requests loading the given contents.
799 * @param o view object to load document
800 * @param html what to load
801 * @param base_uri base uri to use for relative resources, may be @c 0,
802 * if provided @b must be an absolute uri
804 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
806 EAPI Eina_Bool ewk_view_html_contents_set(Evas_Object* o, const char* html, const char* base_uri);
809 * Requests for setting page visibility state.
811 * @param o view object to set the page visibility
812 * @param page_visibility_state visible state of the page to set
813 * @param initial_state @c EINA_TRUE if this function is called at page initialization time,
814 * @c EINA_FALSE otherwise
816 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
818 EAPI Eina_Bool ewk_view_page_visibility_state_set(Evas_Object* o, Ewk_Page_Visibility_State page_visibility_state, Eina_Bool initial_state);
821 * Request to set the user agent string.
823 * @param o view object to set the user agent string
825 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
827 EAPI Eina_Bool ewk_view_user_agent_set(Evas_Object* o, const char* user_agent);
830 * Returns user agent string.
832 * @param o view object to get the user agent string
834 * @return @c user agent string
836 EAPI const char* ewk_view_user_agent_get(const Evas_Object* o);
837 //#if ENABLE(TIZEN_CUSTOM_HEADERS)
841 * @param o view object to add custom header
843 * @param name custom header name to add the custom header
845 * @param value custom header value to add the custom header
847 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
849 EAPI Eina_Bool ewk_view_custom_header_add(const Evas_Object* o, const char* name, const char* value);
851 * remove custom header
853 * @param o view object to remove custom header
855 * @param name custom header name to remove the custom header
857 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
859 EAPI Eina_Bool ewk_view_custom_header_remove(const Evas_Object* o, const char* name);
861 * clears all custom headers
863 * @param o view object to clear custom headers
865 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
867 EAPI Eina_Bool ewk_view_custom_header_clear(const Evas_Object* o);
871 * Searches and hightlights the given string in the document.
873 * @param o view object to find text
874 * @param text text to find
875 * @param options options to find
876 * @param max_match_count maximum match count to find, unlimited if 0
878 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
880 EAPI Eina_Bool ewk_view_text_find(Evas_Object *o, const char *text, Ewk_Find_Options options, unsigned max_match_count);
883 * Clears the highlight of searched text.
885 * @param o view object to find text
887 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
889 EAPI Eina_Bool ewk_view_text_find_highlight_clear(Evas_Object *o);
891 //#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
893 * Request to set the current page's visibility.
895 * @param o view object to set the visibility.
896 * @param enable EINA_TRUE to set on the visibility of the page, EINA_FALSE otherwise.
898 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
900 EAPI Eina_Bool ewk_view_visibility_set(Evas_Object* o, Eina_Bool enable);
904 * Returns the evas image object of the specified viewArea of page
906 * The returned evas image object @b should be freed after use.
908 * @param o view object to get specified rectangle of cairo surface.
909 * @param viewArea rectangle of cairo surface.
910 * @param scaleFactor scale factor of cairo surface.
911 * @param canvas canvas for creating evas image.
913 * @return newly allocated evas image object on sucess or @c 0 on failure.
915 EAPI Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* o, Eina_Rectangle viewArea, float scaleFactor, Evas* canvas);
917 // #if ENABLE(TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR)
919 * Start a server for inspecting web pages
920 * This server will be used by Remote Web Browser to transfer messages over network
922 * @param [o] view object to debug
923 * @param [in] port It is a port number for the server. A free port on system will be allocated if port is 0
925 * @return @c assigned port number on success or @c 0 on failure
927 EAPI unsigned int ewk_view_inspector_server_start(Evas_Object* o, unsigned int port);
930 * Stop a server for inspecting web pages
932 * @param [o] view object to debug
934 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
936 EAPI Eina_Bool ewk_view_inspector_server_stop(Evas_Object* o);
940 * Scrolls webpage of view by dx and dy.
942 * @param o view object to scroll
943 * @param dx horizontal offset to scroll
944 * @param dy vertical offset to scroll
946 EAPI void ewk_view_scroll_by(Evas_Object* o, int dx, int dy);
949 * Gets the current scroll position of given view.
951 * @param o view object to get the current scroll position
952 * @param x the pointer to store the horizontal position, may be @c 0
953 * @param y the pointer to store the vertical position, may be @c 0
955 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
958 EAPI Eina_Bool ewk_view_scroll_pos_get(Evas_Object* o, int* x, int* y);
961 * Sets an absolute scroll of the given view.
963 * Both values are from zero to the contents size minus the viewport
966 * @param o view object to scroll
967 * @param x horizontal position to scroll
968 * @param y vertical position to scroll
970 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
972 EAPI Eina_Bool ewk_view_scroll_set(Evas_Object* o, int x, int y);
975 * Gets the possible scroll size of the given view.
977 * Possible scroll size is contents size minus the viewport size.
979 * @param o view object to get scroll size
980 * @param w the pointer to store the horizontal size that is possible to scroll,
982 * @param h the pointer to store the vertical size that is possible to scroll,
985 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
988 EAPI Eina_Bool ewk_view_scroll_size_get(const Evas_Object* o, int* w, int* h);
991 * Requests for getting web application capable.
993 * @param callback result callback to get web database quota
994 * @param user_data user_data will be passed when result_callback is called
995 * -I.e., user data will be kept until callback is called
997 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
999 EAPI Eina_Bool ewk_view_web_application_capable_get(Evas_Object* o, Ewk_Web_App_Capable_Get_Callback callback, void* user_data);
1002 * Requests for getting web application icon string.
1004 * @param callback result callback to get web database quota
1005 * @param user_data user_data will be passed when result_callback is called
1006 * -I.e., user data will be kept until callback is called
1008 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1010 EAPI Eina_Bool ewk_view_web_application_icon_url_get(Evas_Object* o, Ewk_Web_App_Icon_URL_Get_Callback callback, void* user_data);
1013 * Executes editor command.
1015 * @param o view object to execute command
1016 * @param command editor command to execute
1017 * @param value the value to be passed into command
1019 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1021 EAPI Eina_Bool ewk_view_command_execute(Evas_Object* o, const char* command, const char* value);
1024 * Gets last known contents size.
1026 * @param o view object to get contents size
1027 * @param width pointer to store contents size width, may be @c 0
1028 * @param height pointer to store contents size height, may be @c 0
1030 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure and
1031 * @a width and @a height will be zeroed
1033 EAPI Eina_Bool ewk_view_contents_size_get(Evas_Object* o, Evas_Coord* width, Evas_Coord* height);
1036 * Create PDF file of page contents
1038 * @param o view object to get page contents.
1039 * @param width the suface width of PDF file.
1040 * @param height the suface height of PDF file.
1041 * @param fileName the file name for creating PDF file.
1043 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1045 EAPI Eina_Bool ewk_view_contents_pdf_get_temp(Evas_Object* o, int width, int height, const char* fileName);
1046 EAPI Eina_Bool ewk_view_contents_pdf_get(Evas_Object* o, int width, int height, const char* fileName);
1048 // #if ENABLE(TIZEN_WEB_STORAGE)
1050 * Callback for ewk_view_web_storage_quota_get
1052 * @param quota web storage quota
1053 * @param user_data user_data will be passed when ewk_view_web_storage_quota_get is called
1055 typedef void (*Ewk_Web_Storage_Quota_Get_Callback)(uint32_t quota, void* user_data);
1058 * Requests for getting web storage quota.
1060 * @param o view object to get web storage quota
1061 * @param result_cb callback to get web database origins
1062 * @param user_data user_data will be passed when result_cb is called
1063 * -I.e., user data will be kept until callback is called
1065 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1067 EAPI Eina_Bool ewk_view_web_storage_quota_get(const Evas_Object* o, Ewk_Web_Storage_Quota_Get_Callback result_callback, void* user_data);
1070 * Requests for setting web storage quota.
1072 * @param o view object to set web storage quota
1073 * @param quota quota to store web storage db.
1075 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1077 EAPI Eina_Bool ewk_view_web_storage_quota_set(Evas_Object* o, uint32_t quota);
1078 // #endif // #if ENABLE(TIZEN_WEB_STORAGE)
1081 * Requests execution of the given script.
1083 * @note This allows to use NULL for the callback parameter.
1084 * So, if the result data from the script is not required, NULL might be used for the callback parameter.
1086 * @param o view object to execute script
1087 * @param script Java Script to execute
1088 * @param callback result callback
1089 * @param user_data user data
1091 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1093 EAPI Eina_Bool ewk_view_script_execute(Evas_Object* o, const char* script, Ewk_View_Script_Execute_Callback callback, void* user_data);
1096 * Retrieve the contents in plain text.
1098 * @param o view object whose contents to retrieve.
1099 * @param callback result callback
1100 * @param user_data user data
1102 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1104 EAPI Eina_Bool ewk_view_plain_text_get(Evas_Object* o, Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
1106 // #if ENABLE(TIZEN_SUPPORT_MHTML)
1108 * Get page contents as MHTML data
1110 * @param o view object to get the page contents
1111 * @param callback callback function to be called when the operation is finished
1112 * @param user_data user data to be passed to the callback function
1114 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1116 EAPI Eina_Bool ewk_view_mhtml_data_get(Evas_Object *o, Ewk_View_MHTML_Data_Get_Callback callback, void *user_data);
1117 // #endif // ENABLE(TIZEN_SUPPORT_MHTML)
1119 // #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
1121 * Creates a new hit test for the given veiw object and point.
1123 * The returned object should be freed by ewk_hit_test_free().
1125 * @param o view object to do hit test on
1126 * @param x the horizontal position to query
1127 * @param y the vertical position to query
1128 * @param hit_test_mode the Ewk_Hit_Test_Mode enum value to query
1130 * @return a newly allocated hit test on success, @c 0 otherwise
1132 EAPI Ewk_Hit_Test* ewk_view_hit_test_new(Evas_Object* o, int x, int y, int hit_test_mode);
1133 // #endif // #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
1136 * Get the whole history(whole back & forward list) associated with this view.
1138 * @param o view object to get the history(whole back & forward list)
1140 * @return a newly allocated history of @b newly allocated item
1141 * instance. This memory of each item must be released with
1142 * ewk_history_free() after use.
1144 * @see ewk_history_free()
1146 EAPI Ewk_History* ewk_view_history_get(Evas_Object* o);
1149 * Requests to set recording surface.
1151 * @param o view object to set recording surface
1152 * @param enable @c EINA_TRUE to enable recording surface
1153 * @c EINA_FALSE to disable
1155 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1157 EINA_DEPRECATED EAPI Eina_Bool ewk_view_recording_surface_enable_set(Evas_Object* o, Eina_Bool enable);
1160 * Notify that notification is closed.
1162 * @param notification_list list of Ewk_Notification pointer
1163 * notification_list is freed in this function.
1165 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1167 EAPI Eina_Bool ewk_view_notification_closed(Evas_Object* o, Eina_List* notification_list);
1170 * Sends the orientation of the device.
1172 * If orientation value is changed, orientationchanged event will occur.
1174 * @param o view object to receive orientation event.
1175 * @param orientation the new orientation of the device. (degree)
1177 * orientation will be 0 degrees when the device is oriented to natural position,
1178 * 90 degrees when it's left side is at the top,
1179 * -90 degrees when it's right side is at the top,
1180 * 180 degrees when it is upside down.
1182 EAPI void ewk_view_orientation_send(Evas_Object *o, int orientation);
1185 * Gets the current encoding.
1187 * @param o view object to get the current encoding
1189 * @return @c current encoding, or @c 0 if it's not setted
1191 EAPI const char* ewk_view_encoding_custom_get(const Evas_Object* o);
1194 * Sets the encoding and reloads the page.
1196 * @param o view to set the encoding
1197 * @param encoding the new encoding to set or @c 0 to restore the default one
1199 EAPI void ewk_view_encoding_custom_set(Evas_Object* o, const char* encoding);
1201 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
1202 EINA_DEPRECATED EAPI Eina_Bool ewk_view_text_selection_enable_set(Evas_Object* o, Eina_Bool enable);
1203 EAPI Eina_Bool ewk_view_text_selection_range_get(Evas_Object* o, Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
1204 EAPI const char* ewk_view_text_selection_text_get(Evas_Object* o);
1205 EINA_DEPRECATED EAPI Eina_Bool ewk_view_auto_clear_text_selection_mode_set(Evas_Object* o, Eina_Bool enable);
1206 EINA_DEPRECATED EAPI Eina_Bool ewk_view_auto_clear_text_selection_mode_get(Evas_Object* o);
1207 // #endif // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
1209 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1211 * Sets the focused input element value
1213 * @param o view object to send the value
1214 * @param value the string value to be set
1216 EAPI void ewk_view_focused_input_element_value_set(Evas_Object* o, const char* value);
1217 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1219 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1221 * Gets the focused input element's value
1223 * @param o view object to get the value
1225 * @return focused input element's value on success or NULL on failure.
1227 EAPI const char* ewk_view_focused_input_element_value_get(Evas_Object* o);
1228 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1230 // #if ENABLE(TIZEN_DATALIST_ELEMENT)
1232 * Closes data list picker
1234 * @param o view object contains data list element
1235 * @param value value to be set to the input element
1237 EAPI void ewk_view_data_list_close(Evas_Object *o, const char *value);
1238 //#endif // ENABLE(TIZEN_DATALIST_ELEMENT)
1241 * Selects index of current popup menu.
1243 * @param o view object contains popup menu.
1244 * @param index index of item to select
1246 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1247 * popup menu is not selected or index is out of range)
1249 EAPI Eina_Bool ewk_view_popup_menu_select(Evas_Object *o, unsigned int index);
1251 //#if ENABLE(TIZEN_MULTIPLE_SELECT)
1253 * Selects Multiple indexes of current popup menu.
1255 * @param o view object contains popup menu.
1256 * @param changedlist list of item selected and deselected
1258 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1259 * popup menu is not selected or index is out of range)
1261 EAPI Eina_Bool ewk_view_popup_menu_multiple_select(Evas_Object *o, Eina_Inarray* changedlist);
1265 * Closes current popup menu.
1267 * @param o view object contains popup menu.
1269 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1270 * popup menu is not selected)
1272 EAPI Eina_Bool ewk_view_popup_menu_close(Evas_Object *o);
1274 typedef Eina_Bool (*Ewk_Orientation_Lock_Cb)(Evas_Object* o, Eina_Bool need_lock, int orientation, void* user_data);
1277 * Sets callback of orientation lock function
1279 * func will be called when screen lock is called or unlock is called.
1280 * When screen.lockOrientation is called, need_lock will be true and orientation
1281 * will be the flags which should be locked.
1282 * For example, when contents called 'screen.lockOrientation("portrait"), orientation
1283 * will be EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY | EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY
1284 * When screen.unlockOrientation is called, need_lock will be false.
1286 * @param o view object to set the callback of orientation
1287 * @param func callback function to be called when screen orientation is locked or unlocked.
1288 * @param use_data user_data will be passsed when ewk_view_web_app_icon_get is called
1290 * @return current URI on success or @c 0 on failure
1292 EINA_DEPRECATED EAPI void ewk_view_orientation_lock_callback_set(Evas_Object *o, Ewk_Orientation_Lock_Cb func, void* user_data);
1294 // #endif // #if OS(TIZEN)
1297 * Loads the specified @a html string as the content of the view.
1299 * External objects such as stylesheets or images referenced in the HTML
1300 * document are located relative to @a baseUrl.
1302 * If an @a unreachableUrl is passed it is used as the url for the loaded
1303 * content. This is typically used to display error pages for a failed
1306 * @param o view object to load the HTML into
1307 * @param html HTML data to load
1308 * @param baseUrl Base URL used for relative paths to external objects (optional)
1309 * @param unreachableUrl URL that could not be reached (optional)
1311 * @return @c EINA_TRUE if it the HTML was successfully loaded, @c EINA_FALSE otherwise
1313 EAPI Eina_Bool ewk_view_html_string_load(Evas_Object *o, const char *html, const char *baseUrl, const char *unreachableUrl);
1316 * Scales the current page, centered at the given point.
1318 * @param o view object to set the zoom level
1319 * @param scale_factor a new level to set
1320 * @param cx x of center coordinate
1321 * @param cy y of center coordinate
1323 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1325 EAPI Eina_Bool ewk_view_scale_set(Evas_Object *o, double scaleFactor, int x, int y);
1328 * Queries the current scale factor of the page.
1330 * It returns previous scale factor after ewk_view_scale_set is called immediately
1331 * until scale factor of page is really changed.
1333 * @param o view object to get the scale factor
1335 * @return current scale factor in use on success or @c -1.0 on failure
1337 EAPI double ewk_view_scale_get(const Evas_Object *o);
1340 * Queries the ratio between the CSS units and device pixels when the content is unscaled.
1342 * When designing touch-friendly contents, knowing the approximated target size on a device
1343 * is important for contents providers in order to get the intented layout and element
1346 * As most first generation touch devices had a PPI of approximately 160, this became a
1347 * de-facto value, when used in conjunction with the viewport meta tag.
1349 * Devices with a higher PPI learning towards 240 or 320, applies a pre-scaling on all
1350 * content, of either 1.5 or 2.0, not affecting the CSS scale or pinch zooming.
1352 * This value can be set using this property and it is exposed to CSS media queries using
1353 * the -webkit-device-pixel-ratio query.
1355 * For instance, if you want to load an image without having it upscaled on a web view
1356 * using a device pixel ratio of 2.0 it can be done by loading an image of say 100x100
1357 * pixels but showing it at half the size.
1359 * @media (-webkit-min-device-pixel-ratio: 1.5) {
1363 * url: "/images/icon@2x.png"; // This is actually a 100x100 image
1367 * If the above is used on a device with device pixel ratio of 1.5, it will be scaled
1368 * down but still provide a better looking image.
1370 * @param o view object to get device pixel ratio
1372 * @return the ratio between the CSS units and device pixels,
1373 * or @c -1.0 on failure
1375 EAPI float ewk_view_device_pixel_ratio_get(const Evas_Object *o);
1378 * Sets the ratio between the CSS units and device pixels when the content is unscaled.
1380 * @param o view object to set device pixel ratio
1382 * @return @c EINA_TRUE if the device pixel ratio was set, @c EINA_FALSE otherwise
1384 * @see ewk_view_device_pixel_ratio_get()
1386 EAPI Eina_Bool ewk_view_device_pixel_ratio_set(Evas_Object *o, float ratio);
1389 * Sets the theme path that will be used by this view.
1391 * This also sets the theme on the main frame. As frames inherit theme
1392 * from their parent, this will have all frames with unset theme to
1395 * @param o view object to change theme
1396 * @param path theme path, may be @c NULL to reset to the default theme
1398 EAPI void ewk_view_theme_set(Evas_Object *o, const char *path);
1401 * Gets the theme set on this view.
1403 * This returns the value set by ewk_view_theme_set().
1405 * @param o view object to get theme path
1407 * @return the theme path, may be @c NULL if not set
1409 EAPI const char *ewk_view_theme_get(const Evas_Object *o);
1412 * Gets the current custom character encoding name.
1414 * @param o view object to get the current encoding
1416 * @return @c eina_strinshare containing the current encoding, or
1417 * @c NULL if it's not set
1419 EAPI const char *ewk_view_custom_encoding_get(const Evas_Object *o);
1422 * Sets the custom character encoding and reloads the page.
1424 * @param o view to set the encoding
1425 * @param encoding the new encoding to set or @c NULL to restore the default one
1427 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1429 EAPI Eina_Bool ewk_view_custom_encoding_set(Evas_Object *o, const char *encoding);
1431 // #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
1433 * Sets the user chosen color. To be used when implementing a color picker.
1435 * The function should only be called when a color has been requested by the document.
1436 * If called when this is not the case or when the input picker has been dismissed, this
1437 * function will fail and return EINA_FALSE.
1439 * @param o view object contains color picker
1440 * @param r red channel value to be set
1441 * @param g green channel value to be set
1442 * @param b blue channel value to be set
1443 * @param a alpha channel value to be set
1445 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1447 EAPI Eina_Bool ewk_view_color_picker_color_set(Evas_Object *o, int r, int g, int b, int a);
1451 * Feeds the touch event to the view.
1453 * @param o view object to feed touch event
1454 * @param type the type of touch event
1455 * @param points a list of points (Ewk_Touch_Point) to process
1456 * @param modifiers an Evas_Modifier handle to the list of modifier keys
1457 * registered in the Evas. Users can get the Evas_Modifier from the Evas
1458 * using evas_key_modifier_get() and can set each modifier key using
1459 * evas_key_modifier_on() and evas_key_modifier_off()
1461 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1463 EAPI Eina_Bool ewk_view_feed_touch_event(Evas_Object *o, Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers);
1466 * Sets whether the ewk_view supports the touch events or not.
1468 * The ewk_view will support the touch events if @c EINA_TRUE or not support the
1469 * touch events otherwise. The default value is @c EINA_FALSE.
1471 * @param o view object to enable/disable the touch events
1472 * @param enabled a state to set
1474 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1476 EAPI Eina_Bool ewk_view_touch_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
1479 * Queries if the ewk_view supports the touch events.
1481 * @param o view object to query if the touch events are enabled
1483 * @return @c EINA_TRUE if the touch events are enabled or @c EINA_FALSE otherwise
1485 EAPI Eina_Bool ewk_view_touch_events_enabled_get(const Evas_Object *o);
1488 * Sets the visibility of main frame scrollbar.
1490 * @param o view object
1491 * @param visible visibility of main frame scrollbar
1493 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1495 Eina_Bool ewk_view_main_frame_scrollbar_visible_set(Evas_Object *o, Eina_Bool visible);
1498 * Gets the visibility of main frame scrollbar.
1500 * @param o view object
1502 * @return @c EINA_TRUE if scrollbar is visible or @c EINA_FALSE on failure
1504 Eina_Bool ewk_view_main_frame_scrollbar_visible_get(const Evas_Object *o);
1507 * Get contents of the current web page.
1509 * @param o view object to get the page contents
1510 * @param context context of the page contents which has contents type and callback function
1512 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1514 EAPI Eina_Bool ewk_view_page_contents_get(const Evas_Object *o, Ewk_Page_Contents_Context *context);
1517 * Scroll to the position of the given view with animation
1519 * Both values are from zero to the contents size minus the viewport
1522 * @param o view object to scroll
1523 * @param x horizontal position to scroll
1524 * @param y vertical position to scroll
1526 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
1528 EAPI Eina_Bool ewk_view_animated_scroll_set(Evas_Object *o, int x, int y);
1531 * Clear back forward list of a page.
1533 * @param o view object to clear back forward list
1535 EAPI void ewk_view_back_forward_list_clear(const Evas_Object *o);
1537 /// Enum values containing Content Security Policy header types.
1538 enum _Ewk_CSP_Header_Type {
1542 typedef enum _Ewk_CSP_Header_Type Ewk_CSP_Header_Type;
1545 * Set received Content Security Policy data from web app
1547 * @param o view object
1548 * @param policy Content Security Policy data
1549 * @param type Content Security Policy header type
1552 EAPI void ewk_view_content_security_policy_set(Evas_Object* o, const char* policy, Ewk_CSP_Header_Type type);
1555 * Starts offline page save.
1557 * @param o view object to start offline page save
1558 * @param path directory path to save offline page
1560 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
1562 EAPI Eina_Bool ewk_view_page_save(Evas_Object* o, const char* path);
1567 #endif // ewk_view_h