[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.24
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_view.h
1 /*
2    Copyright (C) 2011 Samsung Electronics
3    Copyright (C) 2012 Intel Corporation. All rights reserved.
4
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.
9
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.
14
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.
19 */
20
21 /**
22  * @file    ewk_view.h
23  * @brief   WebKit main smart object.
24  *
25  * This object provides view related APIs of WebKit2 to EFL object.
26  */
27
28 #ifndef ewk_view_h
29 #define ewk_view_h
30
31 #include "ewk_context.h"
32 #include <Evas.h>
33 #include "ewk_frame.h"
34 #include "ewk_setting.h"
35
36 // #if OS(TIZEN)
37 #include <WebKit2/WKGeometry.h>
38 // #endif
39
40 #include "ewk_history.h"
41
42 //#if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
43 #include "ewk_hit_test.h"
44 //#endif
45
46 //#if ENABLE(TIZEN_WEBKIT2_POPUP)
47 #include "ewk_enums.h"
48 //#endif
49
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53
54 typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data;
55 typedef struct _Ewk_View_Smart_Class Ewk_View_Smart_Class;
56
57 // #if OS(TIZEN)
58 /// Creates a type name for _Ewk_Event_Gesture.
59 typedef struct _Ewk_Event_Gesture Ewk_Event_Gesture;
60
61 /// Represents a gesture event.
62 struct _Ewk_Event_Gesture {
63     Ewk_Gesture_Type type; /**< type of the gesture event */
64     Evas_Coord_Point position; /**< position of the gesture event */
65     Evas_Point velocity; /**< velocity of the gesture event. The unit is pixel per second. */
66     double scale; /**< scale of the gesture event */
67     int count; /**< count of the gesture */
68     unsigned int timestamp; /**< timestamp of the gesture */
69 };
70
71 /// Represents types of touch event.
72 typedef enum {
73     EWK_TOUCH_START,
74     EWK_TOUCH_MOVE,
75     EWK_TOUCH_END,
76     EWK_TOUCH_CANCEL
77 } Ewk_Touch_Event_Type;
78
79 /// Creates a type name for _Ewk_Touch_Point.
80 typedef struct _Ewk_Touch_Point Ewk_Touch_Point;
81
82 /// Represents a touch point.
83 struct _Ewk_Touch_Point {
84     int id; /**< identifier of the touch event */
85     int x; /**< the horizontal position of the touch event */
86     int y; /**< the vertical position of the touch event */
87     Evas_Touch_Point_State state; /**< state of the touch event */
88 };
89
90 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
91 /**
92  * \enum    Ewk_Input_Type
93  * @brief   Provides type of focused input element
94  */
95 enum _Ewk_Input_Type {
96     EWK_INPUT_TYPE_TEXT,
97     EWK_INPUT_TYPE_TELEPHONE,
98     EWK_INPUT_TYPE_NUMBER,
99     EWK_INPUT_TYPE_EMAIL,
100     EWK_INPUT_TYPE_URL,
101     EWK_INPUT_TYPE_PASSWORD,
102     EWK_INPUT_TYPE_COLOR,
103     EWK_INPUT_TYPE_DATE,
104     EWK_INPUT_TYPE_DATETIME,
105     EWK_INPUT_TYPE_DATETIMELOCAL,
106     EWK_INPUT_TYPE_MONTH,
107     EWK_INPUT_TYPE_TIME,
108     EWK_INPUT_TYPE_WEEK
109 };
110 typedef enum _Ewk_Input_Type Ewk_Input_Type;
111 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
112 // #endif // #if OS(TIZEN)
113
114 /// Ewk view's class, to be overridden by sub-classes.
115 struct _Ewk_View_Smart_Class {
116     Evas_Smart_Class sc; /**< all but 'data' is free to be changed. */
117     unsigned long version;
118
119 //#if ENABLE(TIZEN_WEBKIT2_POPUP)
120     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);
121     Eina_Bool (*popup_menu_hide)(Ewk_View_Smart_Data *sd);
122 //#endif
123
124 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
125     Eina_Bool (*text_selection_down)(Ewk_View_Smart_Data *sd, int x, int y);
126     Eina_Bool (*text_selection_move)(Ewk_View_Smart_Data *sd, int x, int y);
127     Eina_Bool (*text_selection_up)(Ewk_View_Smart_Data *sd, int x, int y);
128 // #endif
129
130 //#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
131     Eina_Bool (*input_picker_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, const char* inputValue);
132 //#endif
133
134 //#if ENABLE(TIZEN_DATALIST_ELEMENT)
135     Eina_Bool (*data_list_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, Eina_List *optionList);
136     Eina_Bool (*data_list_hide)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType);
137 // #endif
138
139 // #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
140     Eina_Bool (*orientation_lock)(Ewk_View_Smart_Data *sd, int orientations);
141     void (*orientation_unlock)(Ewk_View_Smart_Data *sd);
142 // #endif
143
144     // event handling:
145     //  - returns true if handled
146     //  - if overridden, have to call parent method if desired
147     Eina_Bool (*focus_in)(Ewk_View_Smart_Data *sd);
148     Eina_Bool (*focus_out)(Ewk_View_Smart_Data *sd);
149     Eina_Bool (*mouse_wheel)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Wheel *ev);
150     Eina_Bool (*mouse_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Down *ev);
151     Eina_Bool (*mouse_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Up *ev);
152     Eina_Bool (*mouse_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Move *ev);
153     Eina_Bool (*key_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Down *ev);
154     Eina_Bool (*key_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Up *ev);
155 //#if OS(TIZEN)
156     Eina_Bool (*initialize)(Ewk_View_Smart_Data *sd, Ewk_Context *context);
157     Eina_Bool (*multi_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Multi_Down *ev);
158     Eina_Bool (*multi_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Multi_Up *ev);
159     Eina_Bool (*multi_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Multi_Move *ev);
160     Eina_Bool (*gesture_start)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
161     Eina_Bool (*gesture_end)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
162     Eina_Bool (*gesture_move)(Ewk_View_Smart_Data *sd, const Ewk_Event_Gesture *ev);
163 //#endif
164 };
165
166 // #if OS(TIZEN)
167 /**
168  * Callback for ewk_view_web_app_capable_get
169  *
170  * @param capable web application capable
171  * @param user_data user_data will be passsed when ewk_view_web_app_capable_get is called
172  */
173 typedef void (*Ewk_Web_App_Capable_Get_Callback)(Eina_Bool capable, void* user_data);
174
175 /**
176  * Callback for ewk_view_web_app_icon_get
177  *
178  * @param icon_url web application icon
179  * @param user_data user_data will be passsed when ewk_view_web_app_icon_get is called
180  */
181 typedef void (*Ewk_Web_App_Icon_URL_Get_Callback)(const char* icon_url, void* user_data);
182 // #endif
183
184 /**
185  * The version you have to put into the version field
186  * in the @a Ewk_View_Smart_Class structure.
187  */
188 #define EWK_VIEW_SMART_CLASS_VERSION 1UL
189
190 /**
191  * Initializer for whole Ewk_View_Smart_Class structure.
192  *
193  * @param smart_class_init initializer to use for the "base" field
194  * (Evas_Smart_Class).
195  *
196  * @see EWK_VIEW_SMART_CLASS_INIT_NULL
197  * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
198  * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
199  */
200 #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}
201
202 /**
203  * Initializer to zero a whole Ewk_View_Smart_Class structure.
204  *
205  * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
206  * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
207  * @see EWK_VIEW_SMART_CLASS_INIT
208  */
209 #define EWK_VIEW_SMART_CLASS_INIT_NULL EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
210
211 /**
212  * Initializer to zero a whole Ewk_View_Smart_Class structure and set
213  * name and version.
214  *
215  * Similar to EWK_VIEW_SMART_CLASS_INIT_NULL, but will set version field of
216  * Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION and name
217  * to the specific value.
218  *
219  * It will keep a reference to name field as a "const char *", that is,
220  * name must be available while the structure is used (hint: static or global!)
221  * and will not be modified.
222  *
223  * @see EWK_VIEW_SMART_CLASS_INIT_NULL
224  * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
225  * @see EWK_VIEW_SMART_CLASS_INIT
226  */
227 #define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
228
229 typedef struct _Ewk_View_Private_Data Ewk_View_Private_Data;
230
231 //#if ENABLE(TIZEN_WEBKIT2_POPUP)
232 /**
233  * Structure do contain data of each menu item
234  */
235 typedef struct _Ewk_Popup_Menu_Item Ewk_Popup_Menu_Item;
236 /// Contains data of each menu item.
237 struct _Ewk_Popup_Menu_Item {
238     const char *text; /**< Text of the item. */
239     Ewk_Popup_Menu_Item_Type type; /** Type of the item. */
240 };
241 //#endif
242
243 // #if OS(TIZEN)
244 // #if ENABLE(TIZEN_MM_PLAYER)
245 typedef struct _Ewk_View_Html5_Video_Data Ewk_View_Html5_Video_Data;
246 // #endif
247 // #endif // #if OS(TIZEN)
248
249 /**
250  * @brief Contains an internal View data.
251  *
252  * It is to be considered private by users, but may be extended or
253  * changed by sub-classes (that's why it's in public header file).
254  */
255 struct _Ewk_View_Smart_Data {
256     Evas_Object_Smart_Clipped_Data base;
257     const Ewk_View_Smart_Class* api; /**< reference to casted class instance */
258     Evas_Object* self; /**< reference to owner object */
259     Evas_Object* image; /**< reference to evas_object_image for drawing web contents */
260 // #if OS(TIZEN)
261     Evas_Object* bg_rect; /**< rectangle for webview's background */
262     Evas_Object* events_rect; /**< rectangle that should receive mouse events */
263 // #endif
264     Ewk_View_Private_Data* priv; /**< should never be accessed, c++ stuff */
265     struct {
266         Evas_Coord x, y, w, h; /**< last used viewport */
267     } view;
268     struct { /**< what changed since last smart_calculate */
269         Eina_Bool any:1;
270         Eina_Bool size:1;
271         Eina_Bool position:1;
272     } changed;
273 };
274
275 // #if OS(TIZEN)
276 /**
277  * Sets the smart class APIs, enabling view to be inherited.
278  *
279  * @param api class definition to set, all members with the
280  *        exception of @a Evas_Smart_Class->data may be overridden, must
281  *        @b not be @c NULL
282  *
283  * @note @a Evas_Smart_Class->data is used to implement type checking and
284  *       is not supposed to be changed/overridden. If you need extra
285  *       data for your smart class to work, just extend
286  *       Ewk_View_Smart_Class instead.
287  *
288  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
289  *         version mismatch)
290  */
291 EAPI Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class *api);
292 //#endif
293
294 /**
295  * Creates a new EFL WebKit view object.
296  *
297  * @param e canvas object where to create the view object
298  *
299  * @return view object on success or @c 0 on failure
300  */
301 EAPI Evas_Object* ewk_view_add(Evas* canvas);
302
303 /**
304  * Creates a new EFL WebKit view object based on specific Ewk_Context.
305  *
306  * @param e canvas object where to create the view object
307  * @param context Ewk_Context object to declare process model
308  *
309  * @return view object on success or @c 0 on failure
310  */
311 EAPI Evas_Object *ewk_view_add_with_context(Evas *e, Ewk_Context *context);
312
313 /**
314  * Asks the object to load the given URI.
315  *
316  * @param o view object to load @a URI
317  * @param uri uniform resource identifier to load
318  *
319  * @return @c EINA_TRUE is returned if @a o is valid, irrespective of load.
320  */
321 EAPI Eina_Bool ewk_view_uri_set(Evas_Object *o, const char *uri);
322
323 /**
324  * Returns the current URI string of view object.
325  *
326  * It returns an internal string and should not
327  * be modified. The string is guaranteed to be stringshared.
328  *
329  * @param o view object to get current URI
330  *
331  * @return current URI on success or @c 0 on failure
332  */
333 EAPI const char *ewk_view_uri_get(const Evas_Object *o);
334
335 /**
336  * Asks the main frame to reload the current document.
337  *
338  * @param o view object to reload current document
339  *
340  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
341  *
342  * @see ewk_view_reload_full()
343  */
344 EAPI Eina_Bool    ewk_view_reload(Evas_Object *o);
345
346 /**
347  * Reloads the current page's document without cache.
348  *
349  * @param o view object to reload current document
350  *
351  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
352  */
353 EAPI Eina_Bool ewk_view_reload_bypass_cache(Evas_Object *o);
354
355 /**
356  * Asks the main frame to stop loading.
357  *
358  * @param o view object to stop loading
359  *
360  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
361  */
362 EAPI Eina_Bool ewk_view_stop(Evas_Object* o);
363
364 // #if OS(TIZEN)
365 EINA_DEPRECATED EAPI WKPageRef ewk_view_WKPage_get(Evas_Object* o);
366
367 enum _Ewk_Page_Visibility_State {
368     EWK_PAGE_VISIBILITY_STATE_VISIBLE,
369     EWK_PAGE_VISIBILITY_STATE_HIDDEN,
370     EWK_PAGE_VISIBILITY_STATE_PRERENDER
371 };
372 typedef enum _Ewk_Page_Visibility_State Ewk_Page_Visibility_State;
373
374 enum _Ewk_Http_Method {
375     EWK_HTTP_METHOD_GET,
376     EWK_HTTP_METHOD_HEAD,
377     EWK_HTTP_METHOD_POST,
378     EWK_HTTP_METHOD_PUT,
379     EWK_HTTP_METHOD_DELETE,
380 };
381 typedef enum _Ewk_Http_Method Ewk_Http_Method;
382
383 /**
384  * Callback for ewk_view_rss_items_get
385  *
386  * @param o view object to get RSS items
387  * @param items RSS items on success, or NULL on failure
388  * @param user_data user data
389  */
390 typedef void (*Ewk_View_Rss_Items_Get_Callback)(Evas_Object* o, const Eina_List* items, void* user_data);
391
392 /**
393  * \enum    EwkFindOptions
394  * @brief   Provides option to find word
395  * @info    Keep this in sync with WKFindOptions.h
396  */
397 enum {
398     EWK_FIND_OPTIONS_CASE_INSENSITIVE = 1 << 0,
399     EWK_FIND_OPTIONS_AT_WORD_STARTS = 1 << 1,
400     EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START = 1 << 2,
401     EWK_FIND_OPTIONS_BACKWARDS = 1 << 3,
402     EWK_FIND_OPTIONS_WRAP_AROUND = 1 << 4,
403     EWK_FIND_OPTIONS_SHOW_OVERLAY = 1 << 5,
404     EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR = 1 << 6,
405     EWK_FIND_OPTIONS_SHOW_HIGHLIGHT = 1 << 7
406 };
407 typedef uint32_t EwkFindOptions;
408
409 /**
410 * @brief ewk_view_find_string callback.
411 *
412 * @param o view object to get reader article
413 * @param string string to find.
414 * @param match_count count to match
415 * @param user_data user data
416 */
417 typedef void (*Ewk_View_String_Find_Callback)(Evas_Object* o, const char* string, int match_count, void* user_data);
418
419 /**
420  * Callback for ewk_view_script_execute
421  *
422  * @param o the view object
423  * @param result_value value returned by script
424  * @param user_data user data
425  */
426 typedef void (*Ewk_View_Script_Execute_Callback)(Evas_Object* o, const char* result_value, void* user_data);
427
428 /**
429  * Callback for ewk_view_plain_text_get
430  *
431  * @param o the view object
432  * @param plain_text the contents of the given frame converted to plain text
433  * @param user_data user data
434  */
435 typedef void (*Ewk_View_Plain_Text_Get_Callback)(Evas_Object* o, const char* plain_text, void* user_data);
436
437 // #if OS(TIZEN)
438 /**
439  * Sets whether the ewk_view supports the mouse events or not.
440  *
441  * The ewk_view will support the mouse events if EINA_TRUE or not support the
442  * mouse events otherwise. The default value is EINA_TRUE.
443  *
444  * @param o view object to enable/disable the mouse events
445  * @param enabled a state to set
446  *
447  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
448  */
449 EAPI Eina_Bool ewk_view_mouse_events_enabled_set(Evas_Object *o, Eina_Bool enabled);
450
451 /**
452  * Queries if the ewk_view supports the mouse events.
453  *
454  * @param o view object to query if the mouse events are enabled
455  *
456  * @return @c EINA_TRUE if the mouse events are enabled or @c EINA_FALSE otherwise
457  */
458 EAPI Eina_Bool ewk_view_mouse_events_enabled_get(const Evas_Object *o);
459
460 /**
461  * Feeds the touch event to the view.
462  *
463  * @param o view object to feed touch event
464  * @param type the type of touch event
465  * @param points a list of points (Ewk_Touch_Point) to process
466  * @param modifiers modifiers state of touch event. Users are expected to pass
467  *        ORed values of the ECORE_EVENT_MODIFIER macros in Ecore_Input.h such
468  *        as ECORE_EVENT_MODIFIER_ALT or ECORE_EVENT_MODIFIER_SHIFT
469  *
470  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
471  */
472 EAPI Eina_Bool ewk_view_feed_touch_event(Evas_Object *o, Ewk_Touch_Event_Type type, Eina_List *points, const Evas_Modifier *modifiers);
473 // #endif // #if OS(TIZEN)
474
475 /**
476  * Creates a new EFL WebKit View object with Ewk_Context.
477  *
478  * @param e canvas object where to create the view object
479  * @param context context object
480  *
481  * @return view object on success or @c 0 on failure
482  */
483 EAPI Evas_Object* ewk_view_add_with_context(Evas* canvas, Ewk_Context* context);
484
485 /**
486  * Gets the Ewk_Context of this view.
487  *
488  * @param o the view object to get the WKPageRef
489  *
490  * @return the Ewk_Context of this view
491  */
492 EAPI Ewk_Context* ewk_view_context_get(const Evas_Object* o);
493
494 /**
495  * Gets the reference object for frame that represents the main frame.
496  *
497  * @param o view object to get main frame
498  *
499  * @return frame reference of frame object on success, or NULL on failure
500  */
501 EAPI Ewk_Frame_Ref ewk_view_main_frame_get(Evas_Object* o);
502
503 /**
504  * Gets the reference obect for the currently focused frame.
505  *
506  * @param o view object to get main frame
507  *
508  * @return frame reference of frame object on success, or NULL on failure
509  */
510 EAPI Ewk_Frame_Ref ewk_view_focused_frame_get(Evas_Object* o);
511
512 /**
513  * Gets the Ewk_Setting of this view.
514  *
515  * @param o the view object to get Ewk_Setting
516  *
517  * @return the Ewk_Setting of this view
518  */
519 EAPI Ewk_Setting* ewk_view_setting_get(Evas_Object* o);
520
521 EAPI Eina_Bool ewk_view_horizontal_panning_hold_get(Evas_Object* o);
522 EAPI void ewk_view_horizontal_panning_hold_set(Evas_Object* o, Eina_Bool hold);
523 EAPI Eina_Bool ewk_view_vertical_panning_hold_get(Evas_Object* o);
524 EAPI void ewk_view_vertical_panning_hold_set(Evas_Object* o, Eina_Bool hold);
525 EAPI void ewk_view_top_of_contents_go(Evas_Object* ewkView);
526 EINA_DEPRECATED EAPI Eina_Bool ewk_view_enable_specified_plugin_set(Evas_Object* ewkView, Eina_Bool enable, const char* mimeType);
527
528 /**
529  * Gets the current scale factor.
530  *
531  * @param o view object to get the scale factor
532  *
533  * @return current scale factor on success or @c -1.0 on failure
534  */
535 EAPI double ewk_view_scale_get(Evas_Object* o);
536
537 /**
538  * Scales the current page, centered at the given point.
539  *
540  * @param o view object to set the scale factor
541  * @param scale_factor a new level to set
542  * @param cx x of center coordinate
543  * @param cy y of center coordinate
544  *
545  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
546  */
547 EAPI Eina_Bool ewk_view_scale_set(Evas_Object* o, double scale_factor, Evas_Coord cx, Evas_Coord cy);
548
549 /**
550  * Gets the minimum and maximum value of the scale range or -1 on failure
551  *
552  * @param o view object to get the minimum and maximum value of the scale range
553  * @param min_scale Pointer to an double in which to store the minimum scale factor of the object.
554  * @param max_scale Pointer to an double in which to store the maximum scale factor of the object.
555  *
556  * @note Use @c NULL pointers on the scale components you're not
557  * interested in: they'll be ignored by the function.
558  */
559 EAPI void ewk_view_scale_range_get(Evas_Object* o, double* min_scale, double* max_scale);
560
561 /**
562  * Gets the current text zoom level.
563  *
564  * @param o view object to get the zoom level
565  *
566  * @return current zoom level in use on success or @c -1.0 on failure
567  */
568 EAPI double ewk_view_text_zoom_get(const Evas_Object* o);
569
570 /**
571  * Sets the current text zoom level.
572  *
573  * @param o view object to set the zoom level
574  * @param textZoomFactor a new level to set
575  *
576  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
577  */
578 EAPI Eina_Bool ewk_view_text_zoom_set(Evas_Object* o, double text_zoom_factor);
579
580 EAPI void ewk_view_suspend(Evas_Object* o);
581 EAPI void ewk_view_resume(Evas_Object* o);
582
583 typedef Eina_Bool (*Ewk_View_JavaScript_Alert_Callback)(Evas_Object* o, const char* alert_text, void* user_data);
584 EAPI void ewk_view_javascript_alert_callback_set(Evas_Object* o, Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
585 EAPI void ewk_view_javascript_alert_reply(Evas_Object* o);
586
587 typedef Eina_Bool (*Ewk_View_JavaScript_Confirm_Callback)(Evas_Object* o, const char* message, void* user_data);
588 EAPI void ewk_view_javascript_confirm_callback_set(Evas_Object* o, Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
589 EAPI void ewk_view_javascript_confirm_reply(Evas_Object* o, Eina_Bool result);
590
591 typedef Eina_Bool (*Ewk_View_JavaScript_Prompt_Callback)(Evas_Object* o, const char* message, const char* default_value, void* user_data);
592 EAPI void ewk_view_javascript_prompt_callback_set(Evas_Object* o, Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
593 EAPI void ewk_view_javascript_prompt_reply(Evas_Object* o, const char* result);
594
595 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);
596 EAPI void ewk_view_open_panel_callback_set(Evas_Object* o, Ewk_View_Open_Panel_Callback callback, void* user_data);
597 EAPI void ewk_view_open_panel_reply(Evas_Object* o, Eina_List* file_url, Eina_Bool result);
598
599 /*
600  * Asks the main frame to navigate back in the history.
601  *
602  * @param o view object to navigate back
603  *
604  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
605  *
606  * @see ewk_frame_back()
607  */
608 EAPI Eina_Bool    ewk_view_back(Evas_Object *o);
609
610 /**
611  * Asks the main frame to navigate forward in the history.
612  *
613  * @param o view object to navigate forward
614  *
615  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
616  *
617  * @see ewk_frame_forward()
618  */
619 EAPI Eina_Bool    ewk_view_forward(Evas_Object *o);
620
621 /**
622  * Queries if it is possible to navigate backwards one item in the history.
623  *
624  * @param o view object to query if backward navigation is possible
625  *
626  * @return @c EINA_TRUE if it is possible to navigate backwards in the history, @c EINA_FALSE otherwise
627  */
628 EAPI Eina_Bool    ewk_view_back_possible(Evas_Object *o);
629
630 /**
631  * Queries if it is possible to navigate forwards one item in the history.
632  *
633  * @param o view object to query if forward navigation is possible
634  *
635  * @return @c EINA_TRUE if it is possible to navigate forwards in the history, @c EINA_FALSE otherwise
636  */
637 EAPI Eina_Bool    ewk_view_forward_possible(Evas_Object *o);
638
639 /**
640  * Requests loading of the given request data.
641  *
642  * @param o view object to load
643  * @param url uniform resource identifier to load
644  * @param method http method
645  * @param headers http headers
646  * @param body http body data
647  *
648  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
649  */
650 EAPI Eina_Bool ewk_view_url_request_set(Evas_Object* o, const char* url, Ewk_Http_Method method, Eina_Hash* headers, const char* body);
651
652 /**
653  * Requests the specified plain text string into the view object
654  *
655  * @note The mime type of document will be "text/plain".
656  *
657  * @param o view object to load
658  * @param plain_text the plain text to load
659  *
660  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
661  */
662 EAPI Eina_Bool ewk_view_plain_text_set(Evas_Object* o, const char* plain_text);
663
664 /**
665  * Requests loading the given contents by mime type into the view object.
666  *
667  * @param o view object to load
668  * @param contents what to load
669  * @param contents_size size of @a contents (in bytes),
670  * @param mime_type type of @a contents data, if @c 0 is given "text/html" is assumed
671  * @param encoding encoding for @a contents data, if @c 0 is given "UTF-8" is assumed
672  * @param base_uri base uri to use for relative resources, may be @c 0,
673  *        if provided @b must be an absolute uri
674  *
675  * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
676  */
677 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);
678
679 /**
680  * Returns the current title string of page.
681  *
682  * @param o view object to get current title
683  *
684  * @return current title string on success or @c 0 on failure
685  */
686 EAPI const char* ewk_view_title_get(const Evas_Object* o);
687
688 /**
689 * Gets the current load progress of page.
690 *
691 * The progress estimates from 0.0 to 1.0.
692 *
693 * @param o view object to get the current progress
694 *
695 * @return the load progres of page, value from 0.0 to 1.0 on success
696 *       or -1.0 on failure
697 */
698 EAPI double ewk_view_load_progress_get(const Evas_Object* o);
699
700 /**
701  * Requests loading the given contents.
702  *
703  * @param o view object to load document
704  * @param html what to load
705  * @param base_uri base uri to use for relative resources, may be @c 0,
706  *        if provided @b must be an absolute uri
707  *
708  * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
709  */
710 EAPI Eina_Bool ewk_view_html_contents_set(Evas_Object* o, const char* html, const char* base_uri);
711
712 /**
713  * Requests for setting page visibility state.
714  *
715  * @param o view object to set the page visibility
716  * @param page_visibility_state visible state of the page to set
717  * @param initial_state @c EINA_TRUE if this function is called at page initialization time,
718  *                     @c EINA_FALSE otherwise
719  *
720  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
721  */
722 EAPI Eina_Bool ewk_view_page_visibility_state_set(Evas_Object* o, Ewk_Page_Visibility_State page_visibility_state, Eina_Bool initial_state);
723
724 /**
725 * Request to set the user agent string.
726 *
727 * @param o view object to set the user agent string
728 *
729 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
730 */
731 EAPI Eina_Bool ewk_view_user_agent_set(Evas_Object* o, const char* user_agent);
732
733 /**
734 * Returns user agent string.
735 *
736 * @param o view object to get the user agent string
737 *
738 * @return @c user agent string
739 */
740 EAPI const char* ewk_view_user_agent_get(const Evas_Object* o);
741 //#if ENABLE(TIZEN_CUSTOM_HEADERS)
742 /**
743 * add custom header
744 *
745 * @param o view object to add custom header
746 *
747 * @param name custom header name to add the custom header
748 *
749 * @param value custom header value to add the custom header
750 *
751 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
752 */
753 EAPI Eina_Bool ewk_view_custom_header_add(const Evas_Object* o, const char* name, const char* value);
754 //#endif
755
756 // #if ENABLE(TIZEN_MM_PLAYER)
757 /**
758 * Returns url of video data.
759 *
760 * @param video_data video data to get the url
761 *
762 * @return @c url of video data or empty string on failure
763 */
764 EAPI const char* ewk_view_video_data_url_get(const Ewk_View_Html5_Video_Data* video_data);
765
766 /**
767 * Returns cookie of video data.
768 *
769 * @param video_data video data to get the cookie
770 *
771 * @return @c cookie of video data or empty string on failure
772 */
773 EAPI const char* ewk_view_video_data_cookie_get(const Ewk_View_Html5_Video_Data* video_data);
774 // #endif // #if ENABLE(TIZEN_MM_PLAYER)
775
776 /**
777 * Request to find string
778 *
779 * @param o view object to find string
780 * @param string text to find
781 * @param options options to find
782 * @param max_match_count max count to find
783 * @param result_cb result callback
784 * @param user_data user data
785 *
786 * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
787 */
788 EAPI Eina_Bool ewk_view_string_find(Evas_Object* o, const char* string, EwkFindOptions options, unsigned max_match_count, Ewk_View_String_Find_Callback callback, void* user_data);
789
790 //#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
791 /**
792  * Request to set the current page's visibility.
793  *
794  * @param o view object to set the visibility.
795  * @param enable EINA_TRUE to set on the visibility of the page, EINA_FALSE otherwise.
796  *
797  * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
798  */
799 EAPI Eina_Bool ewk_view_visibility_set(Evas_Object* o, Eina_Bool enable);
800 //#endif
801
802 /**
803  * Returns the evas image object of the specified viewArea of page
804  *
805  * The returned evas image object @b should be freed after use.
806  *
807  * @param o view object to get specified rectangle of cairo surface.
808  * @param viewArea rectangle of cairo surface.
809  * @param scaleFactor scale factor of cairo surface.
810  * @param canvas canvas for creating evas image.
811  *
812  * @return newly allocated evas image object on sucess or @c 0 on failure.
813  */
814 EAPI Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* o, Eina_Rectangle viewArea, float scaleFactor, Evas* canvas);
815
816 // #if ENABLE(TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR)
817 /**
818  * Start a server for inspecting web pages
819  * This server will be used by Remote Web Browser to transfer messages over network
820  *
821  * @param [o] view object to debug
822  * @param [in] port It is a port number for the server. A free port on system will be allocated if port is 0
823  *
824  * @return @c assigned port number on success or @c 0 on failure
825  */
826 EAPI unsigned int ewk_view_inspector_server_start(Evas_Object* o, unsigned int port);
827
828 /**
829  * Stop a server for inspecting web pages
830  *
831  * @param [o] view object to debug
832  *
833  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
834  */
835 EAPI Eina_Bool ewk_view_inspector_server_stop(Evas_Object* o);
836 // #endif
837 //
838 /**
839  * Scrolls webpage of view by dx and dy.
840  *
841  * @param o view object to scroll
842  * @param dx horizontal offset to scroll
843  * @param dy vertical offset to scroll
844  */
845 EAPI void ewk_view_scroll_by(Evas_Object* o, int dx, int dy);
846
847 /**
848  * Gets the current scroll position of given view.
849  *
850  * @param o view object to get the current scroll position
851  * @param x the pointer to store the horizontal position, may be @c 0
852  * @param y the pointer to store the vertical position, may be @c 0
853  *
854  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
855  *         values are zeroed.
856  */
857 EAPI Eina_Bool ewk_view_scroll_pos_get(Evas_Object* o, int* x, int* y);
858
859 /**
860  * Sets an absolute scroll of the given view.
861  *
862  * Both values are from zero to the contents size minus the viewport
863  * size.
864  *
865  * @param o view object to scroll
866  * @param x horizontal position to scroll
867  * @param y vertical position to scroll
868  *
869  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
870  */
871 EAPI Eina_Bool ewk_view_scroll_set(Evas_Object* o, int x, int y);
872
873 /**
874  * Gets the possible scroll size of the given view.
875  *
876  * Possible scroll size is contents size minus the viewport size.
877  *
878  * @param o view object to get scroll size
879  * @param w the pointer to store the horizontal size that is possible to scroll,
880  *        may be @c 0
881  * @param h the pointer to store the vertical size that is possible to scroll,
882  *        may be @c 0
883  *
884  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise and
885  *         values are zeroed
886  */
887 EAPI Eina_Bool ewk_view_scroll_size_get(const Evas_Object* o, int* w, int* h);
888
889 /**
890  * Gets RSS items.
891  *
892  * @param o view object to get rss items.
893  * @param callback result callback
894  * @param user_data user data
895  *
896  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
897  */
898 EAPI Eina_Bool ewk_view_rss_items_get(Evas_Object* o, Ewk_View_Rss_Items_Get_Callback callback, void* user_data);
899
900 /**
901  * Requests for getting web application capable.
902  *
903  * @param callback result callback to get web database quota
904  * @param user_data user_data will be passed when result_callback is called
905  *    -I.e., user data will be kept until callback is called
906  *
907  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
908  */
909 EAPI Eina_Bool ewk_view_web_application_capable_get(Evas_Object* o, Ewk_Web_App_Capable_Get_Callback callback, void* user_data);
910
911 /**
912  * Requests for getting web application icon string.
913  *
914  * @param callback result callback to get web database quota
915  * @param user_data user_data will be passed when result_callback is called
916  *    -I.e., user data will be kept until callback is called
917  *
918  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
919  */
920 EAPI Eina_Bool ewk_view_web_application_icon_url_get(Evas_Object* o, Ewk_Web_App_Icon_URL_Get_Callback callback, void* user_data);
921
922 /**
923  * Executes editor command.
924  *
925  * @param o view object to execute command
926  * @param command editor command to execute
927  * @param value the value to be passed into command
928  *
929  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
930  */
931 EAPI Eina_Bool ewk_view_command_execute(Evas_Object* o, const char* command, const char* value);
932
933 /**
934  * Gets last known contents size.
935  *
936  * @param o view object to get contents size
937  * @param width pointer to store contents size width, may be @c 0
938  * @param height pointer to store contents size height, may be @c 0
939  *
940  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure and
941  *         @a width and @a height will be zeroed
942  */
943 EAPI Eina_Bool ewk_view_contents_size_get(Evas_Object* o, Evas_Coord* width, Evas_Coord* height);
944
945 /**
946  * Create PDF file of page contents
947  *
948  * @param o view object to get page contents.
949  * @param fileName the file name for creating PDF file.
950  *
951  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
952  */
953 EAPI Eina_Bool ewk_view_contents_pdf_get(Evas_Object* ewkView, const char* fileName);
954
955 // #if ENABLE(TIZEN_WEB_STORAGE)
956 /**
957  * Callback for ewk_view_web_storage_quota_get
958  *
959  * @param quota web storage quota
960  * @param user_data user_data will be passed when ewk_view_web_storage_quota_get is called
961  */
962 typedef void (*Ewk_Web_Storage_Quota_Get_Callback)(uint32_t quota, void* user_data);
963
964 /**
965  * Requests for getting web storage quota.
966  *
967  * @param o view object to get web storage quota
968  * @param result_cb callback to get web database origins
969  * @param user_data user_data will be passed when result_cb is called
970  *    -I.e., user data will be kept until callback is called
971  *
972  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
973  */
974 EAPI Eina_Bool ewk_view_web_storage_quota_get(const Evas_Object* o, Ewk_Web_Storage_Quota_Get_Callback result_callback, void* user_data);
975
976 /**
977  * Requests for setting web storage quota.
978  *
979  * @param o view object to set web storage quota
980  * @param quota quota to store web storage db.
981  *
982  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
983  */
984 EAPI Eina_Bool ewk_view_web_storage_quota_set(Evas_Object* o, uint32_t quota);
985 // #endif // #if ENABLE(TIZEN_WEB_STORAGE)
986
987 /**
988  * Requests execution of the given script.
989  *
990  * @note This allows to use NULL for the callback parameter.
991  *       So, if the result data from the script is not required, NULL might be used for the callback parameter.
992  *
993  * @param o view object to execute script
994  * @param script Java Script to execute
995  * @param callback result callback
996  * @param user_data user data
997  *
998  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
999  */
1000 EAPI Eina_Bool ewk_view_script_execute(Evas_Object* o, const char* script, Ewk_View_Script_Execute_Callback callback, void* user_data);
1001
1002 /**
1003  * Retrieve the contents in plain text.
1004  *
1005  * @param o view object whose contents to retrieve.
1006  * @param callback result callback
1007  * @param user_data user data
1008  *
1009  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1010  */
1011 EAPI Eina_Bool ewk_view_plain_text_get(Evas_Object* o, Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
1012
1013 // #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
1014 /**
1015  * Creates a new hit test for the given veiw object and point.
1016  *
1017  * The returned object should be freed by ewk_hit_test_free().
1018  *
1019  * @param o view object to do hit test on
1020  * @param x the horizontal position to query
1021  * @param y the vertical position to query
1022  * @param hit_test_mode the Ewk_Hit_Test_Mode enum value to query
1023  *
1024  * @return a newly allocated hit test on success, @c 0 otherwise
1025  */
1026 EAPI Ewk_Hit_Test* ewk_view_hit_test_new(Evas_Object* o, int x, int y, int hit_test_mode);
1027 // #endif // #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
1028
1029 /**
1030  * Get the whole history(whole back & forward list) associated with this view.
1031  *
1032  * @param o view object to get the history(whole back & forward list)
1033  *
1034  * @return a newly allocated history of @b newly allocated item
1035  *         instance. This memory of each item must be released with
1036  *         ewk_history_free() after use.
1037  *
1038  * @see ewk_history_free()
1039  */
1040 EAPI Ewk_History* ewk_view_history_get(Evas_Object* o);
1041
1042 /**
1043  * Requests to set recording surface.
1044  *
1045  * @param o view object to set recording surface
1046  * @param enable @c EINA_TRUE to enable recording surface
1047  *        @c EINA_FALSE to disable
1048  *
1049  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1050  */
1051 EINA_DEPRECATED EAPI Eina_Bool ewk_view_recording_surface_enable_set(Evas_Object* o, Eina_Bool enable);
1052
1053 /*
1054  * Notify that notification is closed.
1055  *
1056  * @param notification_list list of Ewk_Notification pointer
1057  *        notification_list is freed in this function.
1058  *
1059  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
1060  */
1061 EAPI Eina_Bool ewk_view_notification_closed(Evas_Object* o, Eina_List* notification_list);
1062
1063 /*
1064  * Sends the orientation of the device to send orientationchanged javascript event.
1065  *
1066  * @param o view object to receive orientation event.
1067  * @param orientation the new orientation of the device. (degree)
1068  *
1069  * orientation will be 0 degrees when the device is oriented to natural position,
1070  *                     90 degrees when it's left side is at the top,
1071  *                    -90 degrees when it's right side is at the top,
1072  *                     180 degrees when it is upside down.
1073  */
1074 EAPI void ewk_view_orientation_send(Evas_Object *o, int orientation);
1075
1076 /**
1077  * Sets the theme path that will be used by this view.
1078  *
1079  * This also sets the theme on the main frame. As frames inherit theme
1080  * from their parent, this will have all frames with unset theme to
1081  * use this one.
1082  *
1083  * @param o view object to change theme
1084  * @param path theme path, may be @c 0 to reset to the default theme
1085  */
1086 EAPI void ewk_view_theme_set(Evas_Object *o, const char *path);
1087
1088 /**
1089  * Gets the theme set on this view.
1090  *
1091  * This returns the value set by ewk_view_theme_set().
1092  *
1093  * @param o view object to get theme path
1094  *
1095  * @return the theme path, may be @c 0 if not set
1096  */
1097 EAPI const char *ewk_view_theme_get(const Evas_Object *o);
1098
1099 /**
1100  * Gets the current encoding.
1101  *
1102  * @param o view object to get the current encoding
1103  *
1104  * @return @c current encoding, or @c 0 if it's not setted
1105  */
1106 EAPI const char* ewk_view_encoding_custom_get(const Evas_Object* o);
1107
1108 /**
1109  * Sets the encoding and reloads the page.
1110  *
1111  * @param o view to set the encoding
1112  * @param encoding the new encoding to set or @c 0 to restore the default one
1113  */
1114 EAPI void ewk_view_encoding_custom_set(Evas_Object* o, const char* encoding);
1115
1116 // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
1117 EAPI Eina_Bool ewk_view_text_selection_enable_set(Evas_Object* o, Eina_Bool enable);
1118 EAPI Eina_Bool ewk_view_text_selection_range_get(Evas_Object* o, Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
1119 EAPI const char* ewk_view_text_selection_text_get(Evas_Object* o);
1120 // #endif // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
1121
1122 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1123 /**
1124  * Sets the focused input element value
1125  *
1126  * @param o view object to send the value
1127  * @param value the string value to be set
1128  */
1129 EAPI void ewk_view_focused_input_element_value_set(Evas_Object* o, const char* value);
1130 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1131
1132 // #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1133 /**
1134  * Gets the focused input element's value
1135  *
1136  * @param o view object to get the value
1137  *
1138  * @return focused input element's value on success or NULL on failure.
1139  */
1140 EAPI const char* ewk_view_focused_input_element_value_get(Evas_Object* o);
1141 // #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
1142
1143
1144 // #if ENABLE(TIZEN_INPUT_COLOR_PICKER)
1145 /**
1146  * Sets the color value of color chooser
1147  *
1148  * @param o view object contains color chooser
1149  * @param color the color value to be set (ex: #000000)
1150  */
1151 EAPI void ewk_view_color_chooser_color_set(Evas_Object* o, const char* color);
1152
1153 /**
1154  * Closes color chooser
1155  *
1156  * @param o view object contains color chooser
1157  */
1158 EAPI void ewk_view_color_chooser_close(Evas_Object* o);
1159 // #endif // ENABLE(TIZEN_INPUT_COLOR_PICKER)
1160
1161 // #if ENABLE(TIZEN_DATALIST_ELEMENT)
1162 /**
1163  * Closes data list picker
1164  *
1165  * @param o view object contains data list element
1166  * @param value value to be set to the input element
1167  */
1168 void ewk_view_data_list_close(Evas_Object *o, const char *value);
1169 //#endif // ENABLE(TIZEN_DATALIST_ELEMENT)
1170
1171 // #endif // #if OS(TIZEN)
1172
1173 /**
1174  * Queries the ratio between the CSS units and device pixels when the content is unscaled.
1175  *
1176  * When designing touch-friendly contents, knowing the approximated target size on a device
1177  * is important for contents providers in order to get the intented layout and element
1178  * sizes.
1179  *
1180  * As most first generation touch devices had a PPI of approximately 160, this became a
1181  * de-facto value, when used in conjunction with the viewport meta tag.
1182  *
1183  * Devices with a higher PPI learning towards 240 or 320, applies a pre-scaling on all
1184  * content, of either 1.5 or 2.0, not affecting the CSS scale or pinch zooming.
1185  *
1186  * This value can be set using this property and it is exposed to CSS media queries using
1187  * the -webkit-device-pixel-ratio query.
1188  *
1189  * For instance, if you want to load an image without having it upscaled on a web view
1190  * using a device pixel ratio of 2.0 it can be done by loading an image of say 100x100
1191  * pixels but showing it at half the size.
1192  *
1193  * @media (-webkit-min-device-pixel-ratio: 1.5) {
1194  *     .icon {
1195  *         width: 50px;
1196  *         height: 50px;
1197  *         url: "/images/icon@2x.png"; // This is actually a 100x100 image
1198  *     }
1199  * }
1200  *
1201  * If the above is used on a device with device pixel ratio of 1.5, it will be scaled
1202  * down but still provide a better looking image.
1203  *
1204  * @param o view object to get device pixel ratio
1205  *
1206  * @return the ratio between the CSS units and device pixels.
1207  */
1208 EAPI float ewk_view_device_pixel_ratio_get(const Evas_Object *o);
1209
1210 /**
1211  * Sets the ratio between the CSS units and device pixels when the content is unscaled.
1212  *
1213  * @param o view object to set device pixel ratio
1214  *
1215  * @return @c EINA_TRUE if the device pixel ratio was set, @c EINA_FALSE otherwise
1216  *
1217  * @see ewk_view_device_pixel_ratio_get()
1218  */
1219 EAPI Eina_Bool ewk_view_device_pixel_ratio_set(Evas_Object *o, float ratio);
1220
1221 /**
1222  * Selects index of current popup menu.
1223  *
1224  * @param o view object contains popup menu.
1225  * @param index index of item to select
1226  *
1227  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1228  *         popup menu is not selected or index is out of range)
1229  */
1230 EAPI Eina_Bool ewk_view_popup_menu_select(Evas_Object *o, unsigned int index);
1231
1232 /**
1233  * Closes current popup menu.
1234  *
1235  * @param o view object contains popup menu.
1236  *
1237  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
1238  *         popup menu is not selected)
1239  */
1240 EAPI Eina_Bool ewk_view_popup_menu_close(Evas_Object *o);
1241
1242 typedef Eina_Bool (*Ewk_Orientation_Lock_Cb)(Evas_Object* o, Eina_Bool need_lock, int orientation, void* user_data);
1243  /**
1244  * Deprecated
1245  * Sets callback of orientation lock function
1246  *
1247  * func will be called when screen lock is called or unlock is called.
1248  * When screen.lockOrientation is called, need_lock will be true and orientation
1249  * will be the flags which should be locked.
1250  * For example, when contents called 'screen.lockOrientation("portrait"), orientation
1251  * will be EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY | EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY
1252  * When screen.unlockOrientation is called, need_lock will be false.
1253  *
1254  * @param o view object to set the callback of orientation
1255  * @param func callback function to be called when screen orientation is locked or unlocked.
1256  * @param use_data user_data will be passsed when ewk_view_web_app_icon_get is called
1257  *
1258  * @return current URI on success or @c 0 on failure
1259  */
1260 EINA_DEPRECATED EAPI void ewk_view_orientation_lock_callback_set(Evas_Object *o, Ewk_Orientation_Lock_Cb func, void* user_data);
1261
1262 #ifdef __cplusplus
1263 }
1264 #endif
1265 #endif // ewk_view_h