Revert "[CherryPick] Input Method upversion"
[framework/web/webkit-efl.git] / Source / WebKit / efl / ewk / ewk_view.h
1 /*
2     Copyright (C) 2009-2010 ProFUSION embedded systems
3     Copyright (C) 2009-2012 Samsung Electronics
4     Copyright (C) 2012 Intel Corporation
5
6     This library is free software; you can redistribute it and/or
7     modify it under the terms of the GNU Library General Public
8     License as published by the Free Software Foundation; either
9     version 2 of the License, or (at your option) any later version.
10
11     This library is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14     Library General Public License for more details.
15
16     You should have received a copy of the GNU Library General Public License
17     along with this library; see the file COPYING.LIB.  If not, write to
18     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19     Boston, MA 02110-1301, USA.
20 */
21
22 /**
23  * @file    ewk_view.h
24  * @brief   WebKit main smart object.
25  *
26  * This object allows the high level access to WebKit-EFL component.
27  * It is responsible for managing the main frame and other
28  * critical resources.
29  *
30  * Every ewk_view has at least one frame, called "main frame" and
31  * retrieved with ewk_view_frame_main_get(). Direct frame access is
32  * often discouraged, it is recommended to use ewk_view functions
33  * instead.
34  *
35  * The following signals (see evas_object_smart_callback_add()) are emitted:
36  *
37  *  - "colorchooser,create", Ewk_Color: a new color chooser should be created.
38  *  - "colorchooser,willdelete", void: reports that a previously created color
39  *    chooser will be deleted.
40  *  - "colorchooser,color,changed", Ewk_Color: the value at the color input widget
41  *    corresponding to the color chooser has changed.
42  *  - "download,request", Ewk_Download: reports a download is being requested
43  *  - "editorclient,contents,changed", void: reports to the view that editor
44  *    client's contents were changed
45  *  - "frame,created", Evas_Object*: a new frame is created.
46  *  - "icon,received", void: main frame received an icon.
47  *  - "inputmethod,changed", Eina_Bool: reports that input method was changed and
48  *    it gives a boolean value whether it's enabled or not as an argument.
49  *  - "inspector,view,close", Evas_Object*: request to close the view for web inspector.
50  *  - "inspector,view,create", void: request to create the new view for web inspector.
51  *  - "js,windowobject,clear", void: Report that the JS window object has been cleared.
52  *  - "link,hover,in", const char *link[2]: reports mouse is over a link.
53  *    It gives the url in link[0] and link's title in link[1] as an argument.
54  *  - "link,hover,out", void: reports mouse moved out from a link.
55  *  - "load,document,finished", Evas_Object*: a DOM document object in a frame has finished loading.
56  *  - "load,error", const Ewk_Frame_Load_Error*: reports load failed
57  *  - "load,finished", const Ewk_Frame_Load_Error*: reports load
58  *    finished and it gives @c NULL on success or pointer to
59  *    structure defining the error.
60  *  - "load,newwindow,show", void: reports that a new window was created and can be shown.
61  *    and it gives a pointer to structure defining the error as an argument.
62  *  - "load,progress", double*: load progress is changed (overall value
63  *    from 0.0 to 1.0, connect to individual frames for fine grained).
64  *  - "load,provisional", void: view started provisional load.
65  *  - "load,provisional,failed", Ewk_Frame_Load_Error*: view provisional load failed.
66  *  - "load,resource,finished", unsigned long*: reports resource load finished and it gives
67  *    a pointer to its identifier.
68  *  - "load,resource,failed", Ewk_Frame_Load_Error*: reports resource load failure and it
69  *    gives a pointer to structure defining the error as an argument.
70  *  - "load,started", Evas_Object*: frame started loading the document.
71  *  - "menubar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if menubar is
72  *    visible; @c EINA_FALSE, otherwise.
73  *  - "menubar,visible,set", Eina_Bool: sets menubar visibility.
74  *  - "mixedcontent,displayed", void: any of the containing frames has loaded and displayed mixed content.
75  *  - "mixedcontent,run", void: any of the containing frames has loaded and run mixed content.
76  *  - "navigate,with,data", Ewk_View_Navigation_Data*: reports that view did navigation and gives the navigation details.
77  *  - "perform,client,redirect", Ewk_View_Redirection_Data*: reports that view performed a client redirect and gives the redirection details.
78  *  - "perform,server,redirect", Ewk_View_Redirection_Data*: reports that view performed a server redirect and gives the redirection details.
79  *  - "protocolhandler,registration,requested", Ewk_Custom_Handler_Data: add a handler url for the given protocol.
80  *  - "protocolhandler,isregistered", Ewk_Custom_Handler_Data: query whether the handler is registered or not.
81  *  - "protocolhandler,unregistration,requested", Ewk_Custom_Handler_Data: remove a handler url for the given protocol.
82  *  - "onload,event", Evas_Object*: a frame onload event has been received.
83  *  - "populate,visited,links": tells the client to fill the visited links set.
84  *  - "ready", void: page is fully loaded.
85  *  - "resource,request,new", Ewk_Frame_Resource_Request*: reports that
86  *    there's a new resource request.
87  *  - "resource,request,willsend", Ewk_Frame_Resource_Messages*: a resource will be requested.
88  *    and the possible redirect response.
89  *  - "resource,response,received", Ewk_Frame_Resource_Response*: the network response for a resource.
90  *  - "scrollbars,visible,get", Eina_Bool *: expects a @c EINA_TRUE if scrollbars
91  *    are visible; @c EINA_FALSE, otherwise.
92  *  - "scrollbars,visible,set", Eina_Bool: sets scrollbars visibility.
93  *  - "statusbar,text,set", const char *: sets statusbar text.
94  *  - "statusbar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if statusbar is
95  *    visible; @c EINA_FALSE, otherwise.
96  *  - "statusbar,visible,set", Eina_Bool: sets statusbar visibility.
97  *  - "title,changed", Ewk_Text_With_Direction*: title of the main frame was changed.
98  *  - "toolbars,visible,get", Eina_Bool *: expects a @c EINA_TRUE if toolbar
99  *    is visible; @c EINA_FALSE, otherwise.
100  *  - "toolbars,visible,set", Eina_Bool: sets toolbar visibility.
101  *  - "popup,create", Ewk_Menu: reports that a new menu was created.
102  *  - "popup,willdeleted", Ewk_Menu: reports that a previously created menu
103  *    will be deleted.
104  *  - "restore", Evas_Object *: reports that view should be restored to default conditions
105  *    and it gives a frame that originated restore as an argument.
106  *  - "tooltip,text,set", const char*: sets tooltip text and displays if it is currently hidden.
107  *  - "uri,changed", const char*: uri of the main frame was changed.
108  *  - "view,resized", void: view object's size was changed.
109  *  - "viewport,changed", void: reports that viewport was changed.
110  *  - "zoom,animated,end", void: requested animated zoom is finished.
111  */
112
113 #ifndef ewk_view_h
114 #define ewk_view_h
115
116 #include "ewk_file_chooser.h"
117 #include "ewk_frame.h"
118 #include "ewk_history.h"
119 #include "ewk_js.h"
120 #include "ewk_window_features.h"
121
122 #include <Evas.h>
123 #include <cairo.h>
124 #include <libsoup/soup-session.h>
125
126 #ifdef __cplusplus
127 extern "C" {
128 #endif
129
130 /// Creates a type name for @a _Ewk_View_Smart_Data.
131 typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data;
132
133 /// Creates a type name for a Resource Handler Callback
134 typedef void* (*Ewk_View_Resource_Handler_Cb)(const char *, size_t *, char **, void *);
135
136 /// Creates a type name for @a _Ewk_View_Smart_Class.
137 typedef struct _Ewk_View_Smart_Class Ewk_View_Smart_Class;
138
139 // Defines the direction of focus change. Keep in sync with
140 // WebCore::FocusDirection.
141 enum _Ewk_Focus_Direction {
142     EWK_FOCUS_DIRECTION_FORWARD = 1,
143     EWK_FOCUS_DIRECTION_BACKWARD,
144 };
145 typedef enum _Ewk_Focus_Direction Ewk_Focus_Direction;
146
147 /// Ewk view's class, to be overridden by sub-classes.
148 struct _Ewk_View_Smart_Class {
149     Evas_Smart_Class sc; /**< All but 'data' is free to be changed. */
150     unsigned long version;
151
152     Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd, Eina_Bool javascript, const Ewk_Window_Features *window_features); /**< creates a new window, requested by webkit */
153     void (*window_close)(Ewk_View_Smart_Data *sd); /**< closes a window */
154     // hooks to allow different backing stores
155     Evas_Object *(*backing_store_add)(Ewk_View_Smart_Data *sd); /**< must be defined */
156     Eina_Bool (*scrolls_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
157     Eina_Bool (*repaints_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
158     Eina_Bool (*contents_resize)(Ewk_View_Smart_Data *sd, int w, int h);
159     Eina_Bool (*zoom_set)(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy);
160     Eina_Bool (*zoom_weak_set)(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy);
161     void (*zoom_weak_smooth_scale_set)(Ewk_View_Smart_Data *sd, Eina_Bool smooth_scale);
162     void (*bg_color_set)(Ewk_View_Smart_Data *sd, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha);
163     void (*flush)(Ewk_View_Smart_Data *sd);
164     Eina_Bool (*pre_render_region)(Ewk_View_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom);
165     Eina_Bool (*pre_render_relative_radius)(Ewk_View_Smart_Data *sd, unsigned int n, float zoom);
166     Eina_Bool (*pre_render_start)(Ewk_View_Smart_Data *sd);
167     void (*pre_render_cancel)(Ewk_View_Smart_Data *sd);
168     Eina_Bool (*disable_render)(Ewk_View_Smart_Data *sd);
169     Eina_Bool (*enable_render)(Ewk_View_Smart_Data *sd);
170
171     // event handling:
172     //  - returns true if handled
173     //  - if overridden, have to call parent method if desired
174     Eina_Bool (*focus_in)(Ewk_View_Smart_Data *sd);
175     Eina_Bool (*focus_out)(Ewk_View_Smart_Data *sd);
176     Eina_Bool (*mouse_wheel)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Wheel *ev);
177     Eina_Bool (*mouse_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Down *ev);
178     Eina_Bool (*mouse_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Up *ev);
179     Eina_Bool (*mouse_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Move *ev);
180     Eina_Bool (*key_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Down *ev);
181     Eina_Bool (*key_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Up *ev);
182
183     void (*add_console_message)(Ewk_View_Smart_Data *sd, const char *message, unsigned int lineNumber, const char *sourceID);
184     void (*run_javascript_alert)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message);
185     Eina_Bool (*run_javascript_confirm)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message);
186     Eina_Bool (*run_javascript_prompt)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message, const char *defaultValue, const char **value);
187     Eina_Bool (*should_interrupt_javascript)(Ewk_View_Smart_Data *sd);
188     int64_t (*exceeded_application_cache_quota)(Ewk_View_Smart_Data *sd, Ewk_Security_Origin* origin, int64_t defaultOriginQuota, int64_t totalSpaceNeeded);
189     uint64_t (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);
190
191     Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Ewk_File_Chooser *file_chooser, Eina_List **selected_filenames);
192
193     Eina_Bool (*navigation_policy_decision)(Ewk_View_Smart_Data *sd, Ewk_Frame_Resource_Request *request, Ewk_Navigation_Type navigation_type);
194     Eina_Bool (*focus_can_cycle)(Ewk_View_Smart_Data *sd, Ewk_Focus_Direction direction);
195 };
196
197 /**
198  * The version you have to put into the version field
199  * in the @a Ewk_View_Smart_Class structure.
200  */
201 #define EWK_VIEW_SMART_CLASS_VERSION 6UL
202
203 /**
204  * Initializes a whole @a Ewk_View_Smart_Class structure.
205  *
206  * @param smart_class_init initializer to use for the "base" field
207  * @a Evas_Smart_Class
208  *
209  * @see EWK_VIEW_SMART_CLASS_INIT_NULL
210  * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
211  * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
212  */
213 #define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
214
215 /**
216  * Initializes to zero a whole @a Ewk_View_Smart_Class structure.
217  *
218  * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
219  * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
220  * @see EWK_VIEW_SMART_CLASS_INIT
221  */
222 #define EWK_VIEW_SMART_CLASS_INIT_NULL EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
223
224 /**
225  * Initializes to zero a whole @a Ewk_View_Smart_Class structure
226  * and sets the version.
227  *
228  * Similar to @a EWK_VIEW_SMART_CLASS_INIT_NULL, but it sets the version field of
229  * @a Evas_Smart_Class (base field) to latest @a EVAS_SMART_CLASS_VERSION.
230  *
231  * @see EWK_VIEW_SMART_CLASS_INIT_NULL
232  * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
233  * @see EWK_VIEW_SMART_CLASS_INIT
234  */
235 #define EWK_VIEW_SMART_CLASS_INIT_VERSION EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_VERSION)
236
237 /**
238  * Initializes to zero a whole @a Ewk_View_Smart_Class structure
239  * and sets the name and version.
240  *
241  * Similar to @a EWK_VIEW_SMART_CLASS_INIT_NULL, but it sets the version field of
242  * @a Evas_Smart_Class (base field) to latest @a EVAS_SMART_CLASS_VERSION
243  * and the name to the specific value.
244  *
245  * It will keep a reference to the name field as a "const char *", that is,
246  * name must be available while the structure is used (hint: static or global!)
247  * and it will not be modified.
248  *
249  * @see EWK_VIEW_SMART_CLASS_INIT_NULL
250  * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
251  * @see EWK_VIEW_SMART_CLASS_INIT
252  */
253 #define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
254
255 /// Defines the input method hints.
256 enum _Ewk_Imh {
257     EWK_IMH_TELEPHONE = (1 << 0),
258     EWK_IMH_NUMBER = (1 << 1),
259     EWK_IMH_EMAIL = (1 << 2),
260     EWK_IMH_URL = (1 << 3),
261     EWK_IMH_PASSWORD = (1 << 4)
262 };
263 /// Creates a type name for @a _Ewk_Imh.
264 typedef enum _Ewk_Imh Ewk_Imh;
265
266 /// Creates a type name for @a _Ewk_View_Private_Data.
267 typedef struct _Ewk_View_Private_Data Ewk_View_Private_Data;
268
269 /// Defines the types of the items for the context menu.
270 enum _Ewk_Menu_Item_Type {
271     EWK_MENU_SEPARATOR,
272     EWK_MENU_GROUP,
273     EWK_MENU_OPTION
274 };
275 /// Creates a type name for @a _Ewk_Menu_Item_Type.
276 typedef enum _Ewk_Menu_Item_Type Ewk_Menu_Item_Type;
277
278 /// Creates a type name for @a _Ewk_Menu_Item.
279 typedef struct _Ewk_Menu_Item Ewk_Menu_Item;
280 /// Contains data of each menu item.
281 struct _Ewk_Menu_Item {
282     const char *text; /**< Text of the item. */
283     Ewk_Menu_Item_Type type; /** Type of the item. */
284 };
285
286 /// Creates a type name for @a _Ewk_Menu.
287 typedef struct _Ewk_Menu Ewk_Menu;
288 /// Contains Popup menu data.
289 struct _Ewk_Menu {
290         Eina_List *items; /**< List of items. */
291         int x; /**< The horizontal position of Popup menu. */
292         int y; /**< The vertical position of Popup menu. */
293         int width; /**< Popup menu width. */
294         int height; /**< Popup menu height. */
295 };
296
297 /// Creates a type name for @a _Ewk_Download.
298 typedef struct _Ewk_Download Ewk_Download;
299 /// Contains Download data.
300 struct _Ewk_Download {
301     const char *url; /**< URL of resource. */
302     /* to be extended */
303 };
304
305 /// Creates a type name for @a _Ewk_View_Navigation_Data.
306 typedef struct _Ewk_View_Navigation_Data Ewk_View_Navigation_Data;
307
308 /**
309  * @brief Structure containing details about a view navigation.
310  *
311  * Details of a view navigation. It is used in "navigate,with,data" signal.
312  */
313 struct _Ewk_View_Navigation_Data {
314     const char *url;  /**< URL for the history. */
315     const char *title;  /**< Title of the navigated page. */
316     Ewk_Frame_Resource_Request *request;  /**< Navigation request. */
317     Ewk_Frame_Resource_Response *response;  /**< Navigation response. */
318     Eina_Bool has_substitute_data;  /**< Data substitution flag. */
319     const char *client_redirect_source;  /**< Client redirect source URL. */
320 };
321
322
323 /// Creates a type name for @a _Ewk_View_Redirection_Data.
324 typedef struct _Ewk_View_Redirection_Data Ewk_View_Redirection_Data;
325
326 /**
327  * @brief Structure containing details about a view redirection.
328  *
329  * Details of a client or server redirection. It is used in "perform,client,redirect" and "perform,server,redirect" signals.
330  */
331 struct _Ewk_View_Redirection_Data {
332     const char *source_url;  /**< Redirect source URL. */
333     const char *destination_url;  /**< Redirect destination URL. */ 
334 };
335 /// Creates a type name for @a _Ewk_Scroll_Request.
336 typedef struct _Ewk_Scroll_Request Ewk_Scroll_Request;
337 /// Contains the scroll request that should be processed by subclass implementations.
338 struct _Ewk_Scroll_Request {
339     Evas_Coord dx, dy;
340     Evas_Coord x, y, w, h, x2, y2;
341 };
342
343 /// Creates a type name for @a _Ewk_Color.
344 typedef struct _Ewk_Color Ewk_Color;
345 /// Represents a color using the RGBA format.
346 struct _Ewk_Color {
347     unsigned char r; /**< Red channel. */
348     unsigned char g; /**< Green channel. */
349     unsigned char b; /**< Blue channel. */
350     unsigned char a; /**< Alpha channel. */
351 };
352
353 /// Defines the handler states.
354 enum _Ewk_Custom_Handlers_State {
355     EWK_CUSTOM_HANDLERS_NEW,
356     EWK_CUSTOM_HANDLERS_REGISTERED,
357     EWK_CUSTOM_HANDLERS_DECLINED
358 };
359 /// Creates a type name for @a _Ewk_Custom_Handlers_State.
360 typedef enum _Ewk_Custom_Handlers_State Ewk_Custom_Handlers_State;
361
362 /// Creates a type name for @a _Ewk_Custom_Handler_Data.
363 typedef struct _Ewk_Custom_Handler_Data Ewk_Custom_Handler_Data;
364 /// Contains the target scheme and the url which take care of the target.
365 struct _Ewk_Custom_Handler_Data {
366     Evas_Object *ewkView; /**< Reference to the view object. */
367     const char *scheme; /**< Reference to the scheme that will be handled. (eg. "application/x-soup") */
368     const char *base_url; /**< Reference to the resolved url if the url is relative url. (eg. "https://www.example.com/") */
369     const char *url; /**< Reference to the url which will handle the given protocol. (eg. "soup?url=%s") */
370     const char *title; /**< Reference to the descriptive title of the handler. (eg. "SoupWeb") */
371     Ewk_Custom_Handlers_State result; /**< Result of the query that the protocol handler is registered or not. */
372 };
373
374 /**
375  * @brief Contains an internal View data.
376  *
377  * It is to be considered private by users, but may be extended or
378  * changed by sub-classes (that's why it's in the public header file).
379  */
380 struct _Ewk_View_Smart_Data {
381     Evas_Object_Smart_Clipped_Data base;
382     const Ewk_View_Smart_Class *api; /**< Reference to casted class instance. */
383     Evas_Object *self; /**< Reference to owner object. */
384     Evas_Object *main_frame; /**< Reference to main frame object. */
385     Evas_Object *backing_store; /**< Reference to backing store. */
386     Evas_Object *events_rect; /**< The rectangle that receives mouse events. */
387     Ewk_View_Private_Data *_priv; /**< Should @b never be accessed, c++ stuff. */
388     struct {
389         Evas_Coord x, y, w, h;
390     } view; /**< Contains the position and size of last used viewport. */
391     struct {
392         struct {
393             float start;
394             float end;
395             float current; /**< if > 0.0, then doing animated zoom. */
396         } zoom;
397     } animated_zoom;
398     struct {
399         unsigned char r, g, b, a;
400     } bg_color; /**< Keeps the background color. */
401     Eina_Bool zoom_weak_smooth_scale:1;
402     struct {
403         Eina_Bool any:1;
404         Eina_Bool size:1;
405         Eina_Bool position:1;
406         Eina_Bool frame_rect:1;
407     } changed; /**< Keeps what changed since last smart_calculate. */
408     struct {
409         Evas_Coord x, y;
410         float zoom;
411     } previousView;
412 };
413
414 /// Defines the modes of view.
415 enum _Ewk_View_Mode {
416     EWK_VIEW_MODE_INVALID,
417     EWK_VIEW_MODE_WINDOWED,
418     EWK_VIEW_MODE_FLOATING,
419     EWK_VIEW_MODE_FULLSCREEN,
420     EWK_VIEW_MODE_MAXIMIZED,
421     EWK_VIEW_MODE_MINIMIZED
422 };
423 /// Creates a type name for @a _Ewk_View_Mode.
424 typedef enum _Ewk_View_Mode Ewk_View_Mode;
425
426 /// Defines the font families.
427 enum _Ewk_Font_Family {
428     EWK_FONT_FAMILY_STANDARD = 0,
429     EWK_FONT_FAMILY_CURSIVE,
430     EWK_FONT_FAMILY_FANTASY,
431     EWK_FONT_FAMILY_MONOSPACE,
432     EWK_FONT_FAMILY_SERIF,
433     EWK_FONT_FAMILY_SANS_SERIF
434 };
435 /// Creates a type name for @a _Ewk_Font_Family.
436 typedef enum _Ewk_Font_Family Ewk_Font_Family;
437
438 /// Contains commands to execute.
439 enum _Ewk_Editor_Command {
440     EWK_EDITOR_COMMAND_NONE = -1,
441     EWK_EDITOR_COMMAND_UNDO = 0,
442     EWK_EDITOR_COMMAND_REDO,
443     EWK_EDITOR_COMMAND_TOGGLE_BOLD,
444     EWK_EDITOR_COMMAND_TOGGLE_ITALIC,
445     EWK_EDITOR_COMMAND_TOGGLE_UNDERLINE,
446     EWK_EDITOR_COMMAND_TOGGLE_STRIKETHROUGH,
447     EWK_EDITOR_COMMAND_TOGGLE_SUBSCRIPT,
448     EWK_EDITOR_COMMAND_TOGGLE_SUPERSCRIPT,
449     EWK_EDITOR_COMMAND_INDENT,
450     EWK_EDITOR_COMMAND_OUTDENT,
451     EWK_EDITOR_COMMAND_INSERT_ORDEREDLIST,
452     EWK_EDITOR_COMMAND_INSERT_UNORDEREDLIST,
453     EWK_EDITOR_COMMAND_INSERT_IMAGE,
454     EWK_EDITOR_COMMAND_INSERT_TEXT,
455     EWK_EDITOR_COMMAND_INSERT_HTML,
456     EWK_EDITOR_COMMAND_INSERT_PARAGRAPH,
457     EWK_EDITOR_COMMAND_INSERT_PARAGRAPH_SEPARATOR,
458     EWK_EDITOR_COMMAND_INSERT_LINE_SEPARATOR,
459     EWK_EDITOR_COMMAND_BACK_COLOR,
460     EWK_EDITOR_COMMAND_FORE_COLOR,
461     EWK_EDITOR_COMMAND_HILITE_COLOR,
462     EWK_EDITOR_COMMAND_FONT_SIZE,
463     EWK_EDITOR_COMMAND_ALIGN_CENTER,
464     EWK_EDITOR_COMMAND_ALIGN_JUSTIFIED,
465     EWK_EDITOR_COMMAND_ALIGN_LEFT,
466     EWK_EDITOR_COMMAND_ALIGN_RIGHT,
467     EWK_EDITOR_COMMAND_MOVE_TO_NEXT_CHAR,
468     EWK_EDITOR_COMMAND_MOVE_TO_PREVIOUS_CHAR,
469     EWK_EDITOR_COMMAND_MOVE_TO_NEXT_WORD,
470     EWK_EDITOR_COMMAND_MOVE_TO_PREVIOUS_WORD,
471     EWK_EDITOR_COMMAND_MOVE_TO_NEXT_LINE,
472     EWK_EDITOR_COMMAND_MOVE_TO_PREVIOUS_LINE,
473     EWK_EDITOR_COMMAND_MOVE_TO_BEGINNING_OF_LINE,
474     EWK_EDITOR_COMMAND_MOVE_TO_END_OF_LINE,
475     EWK_EDITOR_COMMAND_MOVE_TO_BEGINNING_OF_PARAGRAPH,
476     EWK_EDITOR_COMMAND_MOVE_TO_END_OF_PARAGRAPH,
477     EWK_EDITOR_COMMAND_MOVE_TO_BEGINNING_OF_DOCUMENT,
478     EWK_EDITOR_COMMAND_MOVE_TO_END_OF_DOCUMENT,
479     EWK_EDITOR_COMMAND_SELECT_NONE,
480     EWK_EDITOR_COMMAND_SELECT_ALL,
481     EWK_EDITOR_COMMAND_SELECT_PARAGRAPH,
482     EWK_EDITOR_COMMAND_SELECT_SENTENCE,
483     EWK_EDITOR_COMMAND_SELECT_LINE,
484     EWK_EDITOR_COMMAND_SELECT_WORD,
485     EWK_EDITOR_COMMAND_SELECT_NEXT_CHAR,
486     EWK_EDITOR_COMMAND_SELECT_PREVIOUS_CHAR,
487     EWK_EDITOR_COMMAND_SELECT_NEXT_WORD,
488     EWK_EDITOR_COMMAND_SELECT_PREVIOUS_WORD,
489     EWK_EDITOR_COMMAND_SELECT_NEXT_LINE,
490     EWK_EDITOR_COMMAND_SELECT_PREVIOUS_LINE,
491     EWK_EDITOR_COMMAND_SELECT_START_OF_LINE,
492     EWK_EDITOR_COMMAND_SELECT_END_OF_LINE,
493     EWK_EDITOR_COMMAND_SELECT_START_OF_PARAGRAPH,
494     EWK_EDITOR_COMMAND_SELECT_END_OF_PARAGRAPH,
495     EWK_EDITOR_COMMAND_SELECT_START_OF_DOCUMENT,
496     EWK_EDITOR_COMMAND_SELECT_END_OF_DOCUMENT,
497     EWK_EDITOR_COMMAND_DELETE_WORD_BACKWARD,
498     EWK_EDITOR_COMMAND_DELETE_WORD_FORWARD
499 };
500
501 /// Creates a type name for @a _Ewk_Editor_Command.
502 typedef enum _Ewk_Editor_Command Ewk_Editor_Command;
503
504 /**
505  * @brief Creates a type name for @a _Ewk_Tile_Unused_Cache.
506  *
507  * Cache (pool) that contains unused tiles for ewk_view_tiled.
508  *
509  * This cache will maintain unused tiles and flush them when the total
510  * memory exceeds the set amount when
511  * ewk_tile_unused_cache_auto_flush() or explicitly set value when
512  * ewk_tile_unused_cache_flush() is called.
513  *
514  * The tile may be shared among different ewk_view_tiled instances to
515  * group maximum unused memory resident in the system.
516  */
517 typedef struct _Ewk_Tile_Unused_Cache Ewk_Tile_Unused_Cache;
518
519 /**
520  * Changes cache capacity of unused tiles.
521  *
522  * @param tuc cache of unused tiles to set a new capacity of unused tiles
523  *
524  * @param max a new capacity of cache, in bytes
525  *
526  * @note This will not flush cache, use ewk_tile_unused_cache_flush() or
527  * ewk_tile_unused_cache_auto_flush() to do so.
528  */
529 EAPI void   ewk_tile_unused_cache_max_set(Ewk_Tile_Unused_Cache *tuc, size_t max);
530
531 /**
532  * Retrieves maximum cache capacity of unused tiles.
533  *
534  * @param tuc cache of unused tiles to get maximum cache capacity of unused tiles
535  *
536  * @return maximum cache capacity, in bytes on success or @c 0 on failure
537  */
538 EAPI size_t ewk_tile_unused_cache_max_get(const Ewk_Tile_Unused_Cache *tuc);
539
540 /**
541  * Retrieves the used cache capacity of unused tiles.
542  *
543  * @param tuc cache of unused tiles to get used cache capacity of unused tiles
544  *
545  * @return used cache capacity, in bytes on success or @c 0 on failure
546  */
547 EAPI size_t ewk_tile_unused_cache_used_get(const Ewk_Tile_Unused_Cache *tuc);
548
549 /**
550  * Flushes given amount of bytes from cache of unused tiles.
551  *
552  * After calling this function, near @a bytes are freed from cache. It
553  * may be less if cache did not contain that amount of bytes (ie: an
554  * empty cache has nothing to free!) or more if the cache just
555  * contained objects that were larger than the requested amount (this
556  * is usually the case).
557  *
558  * @param tuc cache of unused tiles to flush @bytes from cache
559  * @param bytes amount bytes to free
560  *
561  * @return amount really freed bytes
562  *
563  * @see ewk_tile_unused_cache_used_get()
564  */
565 EAPI size_t ewk_tile_unused_cache_flush(Ewk_Tile_Unused_Cache *tuc, size_t bytes);
566
567 /**
568  * Flushes enough bytes to make cache of unused tiles usage lower than maximum.
569  *
570  * Just like ewk_tile_unused_cache_flush(), but this will make the cache
571  * free enough tiles to respect maximum cache size as defined with
572  * ewk_tile_unused_cache_max_set().
573  *
574  * This function is usually called when system becomes idle. This way
575  * we keep memory low but do not impact performance when
576  * creating/deleting tiles.
577  *
578  * @param tuc cache of unused tiles to flush cache of unused tiles
579  */
580 EAPI void   ewk_tile_unused_cache_auto_flush(Ewk_Tile_Unused_Cache *tuc);
581
582 /**
583  * Sets the smart class api without any backing store, enabling view
584  * to be inherited.
585  *
586  * @param api class definition to set, all members with the
587  *        exception of @a Evas_Smart_Class->data may be overridden, must
588  *        @b not be @c NULL
589  *
590  * @note @a Evas_Smart_Class->data is used to implement type checking and
591  *       is not supposed to be changed/overridden. If you need extra
592  *       data for your smart class to work, just extend
593  *       Ewk_View_Smart_Class instead.
594  *
595  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
596  *         version mismatch)
597  *
598  * @see ewk_view_single_smart_set()
599  * @see ewk_view_tiled_smart_set()
600  */
601 EAPI Eina_Bool    ewk_view_base_smart_set(Ewk_View_Smart_Class *api);
602
603 /**
604  * Sets the smart class api using single backing store, enabling view
605  * to be inherited.
606  *
607  * @param api class definition to set, all members with the
608  *        exception of @a Evas_Smart_Class->data may be overridden, must
609  *        @b not be @c NULL
610  *
611  * @note @a Evas_Smart_Class->data is used to implement type checking and
612  *       is not supposed to be changed/overridden. If you need extra
613  *       data for your smart class to work, just extend
614  *       @a Ewk_View_Smart_Class instead.
615  *
616  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
617  *         version mismatch)
618  *
619  * @see ewk_view_base_smart_set()
620  */
621 EAPI Eina_Bool    ewk_view_single_smart_set(Ewk_View_Smart_Class *api);
622
623 /**
624  * Sets the smart class api using tiled backing store, enabling view
625  * to be inherited.
626  *
627  * @param api class definition to set, all members with the
628  *        exception of @a Evas_Smart_Class->data may be overridden, must
629  *        @b not be @c NULL
630  *
631  * @note @a Evas_Smart_Class->data is used to implement type checking and
632  *       is not supposed to be changed/overridden. If you need extra
633  *       data for your smart class to work, just extend
634  *       Ewk_View_Smart_Class instead.
635  *
636  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
637  *         version mismatch)
638  *
639  * @see ewk_view_base_smart_set()
640  */
641 EAPI Eina_Bool    ewk_view_tiled_smart_set(Ewk_View_Smart_Class *api);
642
643 /**
644  * Creates a new EFL WebKit View object.
645  *
646  * View objects are the recommended way to deal with EFL WebKit as it
647  * abstracts the complex pieces of the process.
648  *
649  * Each view is composed by a set of frames. The set has at least one
650  * frame, called 'main_frame'. See ewk_view_frame_main_get() and
651  * ewk_view_frame_focused_get().
652  *
653  * @param e canvas object where to create the view object
654  *
655  * @return view object on success or @c NULL on failure
656  *
657  * @see ewk_view_uri_set()
658  */
659 EAPI Evas_Object *ewk_view_single_add(Evas *e);
660
661 /**
662  * Creates a new EFL WebKit View object using tiled backing store.
663  *
664  * View objects are the recommended way to deal with EFL WebKit as it
665  * abstracts the complex pieces of the process.
666  *
667  * This object is almost the same as the one returned by the ewk_view_single_add()
668  * function, but it uses the tiled backing store instead of the default
669  * backing store.
670  *
671  * @param e canvas object where to create the view object
672  *
673  * @return the view object on success or @c NULL on failure
674  *
675  * @see ewk_view_uri_set()
676  */
677 EAPI Evas_Object *ewk_view_tiled_add(Evas *e);
678
679 /**
680  * Gets the cache object of unused tiles used by this view.
681  *
682  * @param o the view object to get the cache object
683  *
684  * @return the cache object of unused tiles or @c NULL on failure
685  */
686 EAPI Ewk_Tile_Unused_Cache *ewk_view_tiled_unused_cache_get(const Evas_Object *o);
687
688 /**
689  * Sets the cache object of unused tiles used by this view.
690  *
691  * It can be used to share a single cache amongst different views.
692  * The tiles from one view will not be used by the other!
693  * This is just to limit the group with amount of unused memory.
694  *
695  * @note If @c NULL is provided as a @a cache, then a new one is created.
696  *
697  * @param o the view object to set the cache object
698  * @param the cache object of unused tiles
699  */
700 EAPI void                   ewk_view_tiled_unused_cache_set(Evas_Object *o, Ewk_Tile_Unused_Cache *cache);
701
702 /**
703  * Sets a fixed layout size to be used, dissociating it from viewport size.
704  *
705  * Setting a width different than zero enables fixed layout on that
706  * size. It's automatically scaled based on zoom, but will not change
707  * if viewport changes.
708  *
709  * Setting both @a w and @a h to zero will disable fixed layout.
710  *
711  * @param o view object to change fixed layout
712  * @param w fixed width to use, this size will be automatically scaled
713  *        based on zoom level
714  * @param h fixed height to use, this size will be automatically scaled
715  *        based on zoom level
716  */
717 EAPI void         ewk_view_fixed_layout_size_set(Evas_Object *o, Evas_Coord w, Evas_Coord h);
718
719 /**
720  * Gets fixed layout size.
721  *
722  * @param o view object to get fixed layout size
723  * @param w the pointer to store fixed width, returns @c NULL on failure or if there is no
724  *        fixed layout in use
725  * @param h the pointer to store fixed height, returns @c NULL on failure or if there is no
726  *        fixed layout in use
727  */
728 EAPI void         ewk_view_fixed_layout_size_get(const Evas_Object *o, Evas_Coord *w, Evas_Coord *h);
729
730 /**
731  * Sets the theme path that will be used by this view.
732  *
733  * This also sets the theme on the main frame. As frames inherit theme
734  * from their parent, this will have all frames with unset theme to
735  * use this one.
736  *
737  * @param o view object to change theme
738  * @param path theme path, may be @c NULL to reset to the default theme
739  */
740 EAPI void         ewk_view_theme_set(Evas_Object *o, const char *path);
741
742 /**
743  * Gets the theme set on this view.
744  *
745  * This returns the value set by ewk_view_theme_set().
746  *
747  * @param o view object to get theme path
748  *
749  * @return the theme path, may be @c NULL if not set
750  */
751 EAPI const char  *ewk_view_theme_get(const Evas_Object *o);
752
753 /**
754  * Gets the object that represents the main frame.
755  *
756  * @param o view object to get main frame
757  *
758  * @return frame smart object or @c NULL if none yet
759  */
760 EAPI Evas_Object *ewk_view_frame_main_get(const Evas_Object *o);
761
762 /**
763  * Gets the currently focused frame object.
764  *
765  * @param o view object to get focused frame
766  *
767  * @return frame smart object or @c NULL if none yet
768  */
769 EAPI Evas_Object *ewk_view_frame_focused_get(const Evas_Object *o);
770
771 /**
772  * Asks the main frame to load the given URI.
773  *
774  * @param o view object to load @a uri
775  * @param uri uniform resource identifier to load
776  *
777  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
778  */
779 EAPI Eina_Bool    ewk_view_uri_set(Evas_Object *o, const char *uri);
780
781 /**
782  * Gets the current uri loaded by main frame.
783  *
784  * It returns a internal string and should not
785  * be modified. The string is guaranteed to be stringshared.
786  *
787  * @param o view object to get current uri.
788  *
789  * @return current uri on success or @c NULL on failure
790  */
791 EAPI const char  *ewk_view_uri_get(const Evas_Object *o);
792
793 /**
794  * Gets the current title of the main frame.
795  *
796  * It returns a internal string and should not
797  * be modified. The string is guaranteed to be stringshared.
798  *
799  * @param o view object to get current title
800  *
801  * @return current title on success or @c NULL on failure
802  */
803 EAPI const Ewk_Text_With_Direction  *ewk_view_title_get(const Evas_Object *o);
804
805 /**
806  * Queries if the main frame is editable.
807  *
808  * @param o view object to query editable state
809  *
810  * @return @c EINA_TRUE if the main frame is editable, @c EINA_FALSE otherwise
811  */
812 EAPI Eina_Bool    ewk_view_editable_get(const Evas_Object *o);
813
814 /**
815  * Sets if main frame is editable.
816  *
817  * @param o view object to set editable state
818  * @param editable a new state to set
819  *
820  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
821  */
822 EAPI Eina_Bool    ewk_view_editable_set(Evas_Object *o, Eina_Bool editable);
823
824 /**
825  * Sets the background color and transparency of the view.
826  *
827  * Just as in Evas, colors are pre-multiplied, so 50% red is
828  * (128, 0, 0, 128) and not (255, 0, 0, 128)!
829  *
830  * @warning Watch out performance issues with transparency! Object
831  *          will be handled as transparent image by evas even if the
832  *          webpage specifies a background color. That mean you'll pay
833  *          a price even if it's not really transparent, thus
834  *          scrolling/panning and zooming will be likely slower than
835  *          if transparency is off.
836  *
837  * @param o view object to change the background color
838  * @param r red color component
839  * @param g green color component
840  * @param b blue color component
841  * @param a transparency
842  */
843 EAPI void         ewk_view_bg_color_set(Evas_Object *o, int r, int g, int b, int a);
844
845 /**
846  * Gets the background color of the view.
847  *
848  * Just as in Evas, colors are pre-multiplied, so 50% red is
849  * (128, 0, 0, 128) and not (255, 0, 0, 128)!
850  *
851  * @param o view object to get the background color
852  * @param r the pointer to store red color component
853  * @param g the pointer to store green color component
854  * @param b the pointer to store blue color component
855  * @param a the pointer to store alpha value
856  */
857 EAPI void         ewk_view_bg_color_get(const Evas_Object *o, int *r, int *g, int *b, int *a);
858
859 /**
860  * Gets the copy of the selected text.
861  *
862  * The returned string @b should be freed by eina_stringshare_del() after use.
863  *
864  * @param o view object to get selected text
865  *
866  * @return a newly allocated string or @c NULL if nothing is selected or on failure
867  */
868 EAPI const char        *ewk_view_selection_get(const Evas_Object *o);
869
870 /**
871  * Forwards a request of a new Context Menu to WebCore.
872  *
873  * @param o view object to forward a request of a new Context Menu
874  * @param ev mouse down event data
875  *
876  * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise
877  */
878 EAPI Eina_Bool    ewk_view_context_menu_forward_event(Evas_Object *o, const Evas_Event_Mouse_Down *ev);
879
880 /**
881  * Executes editor command.
882  *
883  * @param o view object to execute command
884  * @param command editor command to execute
885  * @param value the value to be passed into command
886  *
887  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
888  */
889 EAPI Eina_Bool    ewk_view_editor_command_execute(const Evas_Object *o, const Ewk_Editor_Command command, const char *value);
890
891 /**
892  * Destroys a previously created color chooser.
893  *
894  * Before destroying, it informs client that color chooser's data is ready to be
895  * destroyed by sending a "colorchooser,willdelete". Then it removes any reference
896  * to the color chooser inside webkit. It's safe to call this function either from
897  * inside webkit or from browser.
898  *
899  * @param o view object
900  *
901  * @return @c EINA_TRUE in case color chooser was successfully destroyed or @c EINA_TRUE in
902  * case there wasn't any color chooser to be destroyed
903  */
904 EAPI Eina_Bool    ewk_view_color_chooser_destroy(Evas_Object* o);
905
906 /**
907  * Changes the selected color.
908  *
909  * Changes the color selected in the color input widget. The browser should call
910  * this when the user chooses a new color. It's likely that ewk_view_color_chooser_destroy
911  * will be called afterwards.
912  *
913  * @param o view object
914  * @param r red color component
915  * @param g green color component
916  * @param b blue color component
917  */
918 EAPI void         ewk_view_color_chooser_color_set(Evas_Object* o, int r, int g, int b);
919
920 /**
921  * Changes currently selected item.
922  *
923  * Changes the option selected in select widget. This is called by browser
924  * whenever user has chosen a different item. Most likely after calling this, a
925  * call to ewk_view_popup_destroy might be made in order to close the popup.
926  *
927  * @param o view object to change currently selected item
928  * @index index a new index to set
929  */
930 EAPI void         ewk_view_popup_selected_set(Evas_Object *o, int index);
931
932 /**
933  * Destroys a previously created menu.
934  *
935  * Before destroying, it informs client that menu's data is ready to be
936  * destroyed by sending a "popup,willdelete" with a list of menu items. Then it
937  * removes any reference to menu inside webkit. It's safe to call this
938  * function either from inside webkit or from browser.
939  *
940  * @param o view object
941  *
942  * @return @c EINA_TRUE in case menu was successfully destroyed or @c EINA_TRUE in
943  * case there wasn't any menu to be destroyed
944  */
945 EAPI Eina_Bool    ewk_view_popup_destroy(Evas_Object *o);
946
947 /**
948  * Searches the given string in a document.
949  *
950  * @param o view object where to search the text
951  * @param string reference string to search
952  * @param case_sensitive if search should be case sensitive or not
953  * @param forward if search is from cursor and on or backwards
954  * @param wrap if search should wrap at the end
955  *
956  * @return @c EINA_TRUE if the given string was found, @c EINA_FALSE if not or failure
957  */
958 EAPI Eina_Bool    ewk_view_text_search(const Evas_Object *o, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap);
959
960 /**
961  * Marks matches the given string in a document.
962  *
963  * @param o view object where to search text
964  * @param string reference string to match
965  * @param case_sensitive if match should be case sensitive or not
966  * @param highlight if matches should be highlighted
967  * @param limit maximum amount of matches, or zero to unlimited
968  *
969  * @return number of matched @a string
970  */
971 EAPI unsigned int ewk_view_text_matches_mark(Evas_Object *o, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit);
972
973 /**
974  * Unmarks all marked matches in a document.
975  *
976  * Reverses the effect of ewk_frame_text_matches_mark().
977  *
978  * @param o view object where to unmark matches
979  *
980  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
981  */
982 EAPI Eina_Bool    ewk_view_text_matches_unmark_all(Evas_Object *o);
983
984 /**
985  * Sets if should highlight matches marked with ewk_frame_text_matches_mark().
986  *
987  * @param o view object where to set if matches are highlighted or not
988  * @param highlight @c EINA_TRUE if matches are highlighted, @c EINA_FALSE if not
989  *
990  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
991  */
992 EAPI Eina_Bool    ewk_view_text_matches_highlight_set(Evas_Object *o, Eina_Bool highlight);
993
994 /**
995  * Gets if should highlight matches marked with ewk_frame_text_matches_mark().
996  *
997  * @param o view object to query if matches are highlighted or not
998  *
999  * @return @c EINA_TRUE if matches are highlighted, @c EINA_FALSE otherwise
1000  */
1001 EAPI Eina_Bool    ewk_view_text_matches_highlight_get(const Evas_Object *o);
1002
1003 /**
1004  * Gets the current load progress of page.
1005  *
1006  * The progress estimates from 0.0 to 1.0.
1007  *
1008  * @param o view object to get the current progress
1009  *
1010  * @return the load progres of page, value from 0.0 to 1.0 on success
1011  *       or -1.0 on failure
1012  */
1013 EAPI double       ewk_view_load_progress_get(const Evas_Object *o);
1014
1015 /**
1016  * Asks the main frame to stop loading.
1017  *
1018  * @param o view object to stop loading
1019  *
1020  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
1021  */
1022 EAPI Eina_Bool    ewk_view_stop(Evas_Object *o);
1023
1024 /**
1025  * Asks the main frame to reload the current document.
1026  *
1027  * @param o view object to reload current document
1028  *
1029  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1030  *
1031  * @see ewk_view_reload_full()
1032  */
1033 EAPI Eina_Bool    ewk_view_reload(Evas_Object *o);
1034
1035 /**
1036  * Asks the main frame to fully reload the current document, using no caches.
1037  *
1038  * @param o view object to reload current document
1039  *
1040  * @return @c EINA_TRUE on success o r@c EINA_FALSE otherwise
1041  *
1042  * @see ewk_view_reload()
1043  */
1044 EAPI Eina_Bool    ewk_view_reload_full(Evas_Object *o);
1045
1046 /**
1047  * Asks the frame to navigate back in the history.
1048  *
1049  * @param o view object to navigate back
1050  *
1051  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1052  *
1053  * @see ewk_frame_back()
1054  */
1055 EAPI Eina_Bool    ewk_view_back(Evas_Object *o);
1056
1057 /**
1058  * Asks frame to navigate forward in the history.
1059  *
1060  * @param o view object to navigate forward
1061  *
1062  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1063  *
1064  * @see ewk_frame_forward()
1065  */
1066 EAPI Eina_Bool    ewk_view_forward(Evas_Object *o);
1067
1068 /**
1069  * Navigates back or forward in the history.
1070  *
1071  * @param o view object to navigate in the history
1072  * @param steps if positive navigates that amount forwards, if negative
1073  *        does backwards
1074  *
1075  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1076  *
1077  * @see ewk_frame_navigate()
1078  */
1079 EAPI Eina_Bool    ewk_view_navigate(Evas_Object *o, int steps);
1080
1081 /**
1082  * Queries if it's possible to navigate backwards one item in the history.
1083  *
1084  * @param o view object to query if backward navigation is possible
1085  *
1086  * @return @c EINA_TRUE if it's possible to navigate backward one item in the history, @c EINA_FALSE otherwise
1087  * @see ewk_view_navigate_possible()
1088  */
1089 EAPI Eina_Bool    ewk_view_back_possible(Evas_Object *o);
1090
1091 /**
1092  * Queries if it's possible to navigate forwards one item in the history.
1093  *
1094  * @param o view object to query if forward navigation is possible
1095  *
1096  * @return @c EINA_TRUE if it's possible to navigate forwards in the history, @c EINA_FALSE otherwise
1097  *
1098  * @see ewk_view_navigate_possible()
1099  */
1100 EAPI Eina_Bool    ewk_view_forward_possible(Evas_Object *o);
1101
1102 /**
1103  * Queries if it's possible to navigate given @a steps in the history.
1104  *
1105  * @param o view object to query if it's possible to navigate @a steps in the history
1106  * @param steps if positive navigates that amount forwards, if negative
1107  *        does backwards
1108  *
1109  * @return @c EINA_TRUE if it's possible to navigate @a steps in the history, @c EINA_FALSE otherwise
1110  */
1111 EAPI Eina_Bool    ewk_view_navigate_possible(Evas_Object *o, int steps);
1112
1113 /**
1114  * Queries if navigation in the history (back-forward lists) is enabled.
1115  *
1116  * @param o view object to query if navigation history is enabled
1117  *
1118  * @return @c EINA_TRUE if view keeps history, @c EINA_FALSE otherwise
1119  */
1120 EAPI Eina_Bool    ewk_view_history_enable_get(const Evas_Object *o);
1121
1122 /**
1123  * Enables/disables navigation in the history (back-forward lists).
1124  *
1125  * @param o view object to enable/disable navigation in the history
1126  * @param enable @c EINA_TRUE to enable navigation in the history,
1127  *        @c EINA_FALSE to disable
1128  *
1129  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1130  */
1131 EAPI Eina_Bool    ewk_view_history_enable_set(Evas_Object *o, Eina_Bool enable);
1132
1133 /**
1134  * Gets the history (back-forward list) associated with this view.
1135  *
1136  * The returned instance is unique for this view and thus multiple calls
1137  * to this function with the same view as parameter returns the same
1138  * handle. This handle is alive while view is alive, thus one
1139  * might want to listen for EVAS_CALLBACK_DEL on given view
1140  * (@a o) to know when to stop using returned handle.
1141  *
1142  * @param o view object to get navigation history
1143  *
1144  * @return the history instance handle associated with this
1145  *         view on succes or @c NULL on failure (including when the history
1146  *         navigation is not enabled with ewk_view_history_enable_set())
1147  *
1148  * @see ewk_view_history_enable_set()
1149  */
1150 EAPI Ewk_History *ewk_view_history_get(const Evas_Object *o);
1151
1152 /**
1153  * Adds @a visited_url to the view's visited links cache.
1154  *
1155  * This function is to be invoked by the client managing persistent history storage
1156  * when "populate,visited,links" signal is received.
1157  *
1158  * @param o view object to add visited links data.
1159  * @param visited_url visited url.
1160  *
1161  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
1162  */
1163 EAPI Eina_Bool  ewk_view_visited_link_add(Evas_Object *o, const char *visited_url);
1164
1165 /**
1166  * Gets the current page zoom level of the main frame.
1167  *
1168  * @param o view object to get the zoom level
1169  *
1170  * @return current zoom level in use on success or @c -1.0 on failure
1171  */
1172 EAPI float        ewk_view_page_zoom_get(const Evas_Object *o);
1173
1174 /**
1175  * Sets the current page zoom level of the main frame.
1176  *
1177  * @param o view object to set the zoom level
1178  * @param page_zoom_factor a new level to set
1179  *
1180  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1181  */
1182 EAPI Eina_Bool    ewk_view_page_zoom_set(Evas_Object *o, float page_zoom_factor);
1183
1184 /**
1185  * Gets the current scale factor of the page.
1186  *
1187  * @param o view object to get the scale factor 
1188  *
1189  * @return current scale factor in use on success or @c -1.0 on failure
1190  */
1191 EAPI float        ewk_view_scale_get(const Evas_Object *o);
1192
1193 /**
1194  * Scales the current page, centered at the given point.
1195  *
1196  * @param o view object to set the zoom level
1197  * @param scale_factor a new level to set
1198  * @param cx x of center coordinate
1199  * @param cy y of center coordinate
1200  *
1201  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1202  */
1203 EAPI Eina_Bool    ewk_view_scale_set(Evas_Object *o, float scale_factor, Evas_Coord cx, Evas_Coord cy);
1204
1205 /**
1206  * Gets the current text zoom level of the main frame.
1207  *
1208  * @param o view object to get the zoom level
1209  *
1210  * @return current zoom level in use on success or @c -1.0 on failure
1211  */
1212 EAPI float        ewk_view_text_zoom_get(const Evas_Object *o);
1213
1214 /**
1215  * Sets the current text zoom level of the main frame.
1216  *
1217  * @param o view object to set the zoom level
1218  * @param textZoomFactor a new level to set
1219  *
1220  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1221  */
1222 EAPI Eina_Bool    ewk_view_text_zoom_set(Evas_Object *o, float text_zoom_factor);
1223
1224 /**
1225  * Gets the current zoom level of the main frame.
1226  *
1227  * @param o view object to get the zoom level
1228  *
1229  * @return current zoom level in use on success or @c -1.0 on failure
1230  */
1231 EAPI float        ewk_view_zoom_get(const Evas_Object *o);
1232
1233 /**
1234  * Sets the current zoom level of the main frame, centered at the given point.
1235  *
1236  * @param o view object to set the zoom level
1237  * @param zoom a new level to set
1238  * @param cx x of center coordinate
1239  * @param cy y of center coordinate
1240  *
1241  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1242  */
1243 EAPI Eina_Bool    ewk_view_zoom_set(Evas_Object *o, float zoom, Evas_Coord cx, Evas_Coord cy);
1244
1245 /**
1246  * Queries if the smooth scale is enabled while the weak zoom.
1247  *
1248  * @param o view object to query if the smooth scale is enabled while the weak zoom
1249  *
1250  * @return @c EINA_TRUE if the smooth scale is enabled while the weak zoom, or
1251  *         @c EINA_FALSE if not or on failure
1252  */
1253 EAPI Eina_Bool    ewk_view_zoom_weak_smooth_scale_get(const Evas_Object *o);
1254
1255 /**
1256  * Enables/disables the smooth scale while the weak zoom.
1257  *
1258  * @param o view object to set the smooth scale while the weak zoom
1259  * @param smooth_scale @c EINA_TRUE to enable the smooth scale
1260  *        @c EINA_FALSE to disable
1261  */
1262 EAPI void         ewk_view_zoom_weak_smooth_scale_set(Evas_Object *o, Eina_Bool smooth_scale);
1263
1264 /**
1265  * Sets the current zoom level of backing store, centered at given point.
1266  *
1267  * Unlike ewk_view_zoom_set(), this call do not ask WebKit to render
1268  * at new size, but scale what is already rendered, being much faster
1269  * but worse quality.
1270  *
1271  * Often one should use ewk_view_zoom_animated_set(), it will call the
1272  * same machinery internally.
1273  *
1274  * @note this will set variables used by ewk_view_zoom_animated_set()
1275  *       so sub-classes will not reset internal state on their
1276  *       "calculate" phase. To unset those and enable sub-classes to
1277  *       reset their internal state, call
1278  *       ewk_view_zoom_animated_mark_stop(). Namely, this call will
1279  *       set ewk_view_zoom_animated_mark_start() to actual webkit zoom
1280  *       level, ewk_view_zoom_animated_mark_end() and
1281  *       ewk_view_zoom_animated_mark_current() to given zoom level.
1282  *
1283  * @param o view object to set the weak zoom level
1284  * @param zoom a new level to scale backing store
1285  * @param cx horizontal center offset, relative to object (w/2 is middle)
1286  * @param cy vertical center offset, relative to object (h/2 is middle)
1287  *
1288  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1289  */
1290 EAPI Eina_Bool    ewk_view_zoom_weak_set(Evas_Object *o, float zoom, Evas_Coord cx, Evas_Coord cy);
1291
1292 /**
1293  * Sets start of an internal zoom animation state to the given zoom.
1294  *
1295  * This does not modify any actual zoom in WebKit or backing store,
1296  * just set needed flag so sub-classes knows they should not reset
1297  * their an internal state.
1298  *
1299  * @param o view object to set start of an internal zoom animation
1300  * @param zoom a new start value
1301  *
1302  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1303  *
1304  * @see ewk_view_zoom_animated_set()
1305  * @see ewk_view_zoom_weak_set()
1306  * @see ewk_view_zoom_animated_mark_stop()
1307  * @see ewk_view_zoom_animated_mark_end()
1308  * @see ewk_view_zoom_animated_mark_current()
1309  */
1310 EAPI Eina_Bool    ewk_view_zoom_animated_mark_start(Evas_Object *o, float zoom);
1311
1312 /**
1313  * Sets end of an internal zoom animation state to given zoom.
1314  *
1315  * This does not modify any actual zoom in WebKit or backing store,
1316  * just set needed flag so sub-classes knows they should not reset
1317  * their an internal state.
1318  *
1319  * @param o view object to set end of an internal zoom animation
1320  * @param zoom a new end value
1321  *
1322  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1323  *
1324  * @see ewk_view_zoom_animated_set()
1325  * @see ewk_view_zoom_weak_set()
1326  * @see ewk_view_zoom_animated_mark_stop()
1327  * @see ewk_view_zoom_animated_mark_start()
1328  * @see ewk_view_zoom_animated_mark_current()
1329  */
1330 EAPI Eina_Bool    ewk_view_zoom_animated_mark_end(Evas_Object *o, float zoom);
1331
1332 /**
1333  * Sets an internal current zoom animation state to given zoom.
1334  *
1335  * This does not modify any actual zoom in WebKit or backing store,
1336  * just set needed flag so sub-classes knows they should not reset
1337  * their an internal state.
1338  *
1339  * @param o view object to set an internal current zoom animation
1340  * @param zoom a new current value
1341  *
1342  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1343  *
1344  * @see ewk_view_zoom_animated_set()
1345  * @see ewk_view_zoom_weak_set()
1346  * @see ewk_view_zoom_animated_mark_stop()
1347  * @see ewk_view_zoom_animated_mark_start()
1348  * @see ewk_view_zoom_animated_mark_end()
1349  */
1350 EAPI Eina_Bool    ewk_view_zoom_animated_mark_current(Evas_Object *o, float zoom);
1351
1352 /**
1353  * Unmarks an internal zoom animation state.
1354  *
1355  * The start, end and current values of an internal zoom animation are zeroed.
1356  *
1357  * @param o view object to unmark an internal zoom animation state
1358  *
1359  * @see ewk_view_zoom_animated_mark_start()
1360  * @see ewk_view_zoom_animated_mark_end()
1361  * @see ewk_view_zoom_animated_mark_current()
1362  * @see ewk_view_zoom_weak_set()
1363  */
1364 EAPI Eina_Bool    ewk_view_zoom_animated_mark_stop(Evas_Object *o);
1365
1366 /**
1367  * Sets the current zoom level while animating.
1368  *
1369  * If the view was already animating to another zoom, it will start
1370  * from current point to the next provided zoom (@a zoom parameter)
1371  * and duration (@a duration parameter).
1372  *
1373  * This is the recommended way to do transitions from one level to
1374  * another. However, one may wish to do those from outside, in that
1375  * case use ewk_view_zoom_weak_set() and later control intermediate
1376  * states with ewk_view_zoom_animated_mark_current(),
1377  * ewk_view_zoom_animated_mark_end() and
1378  * ewk_view_zoom_animated_mark_stop().
1379  *
1380  * @param o view object to animate
1381  * @param zoom final zoom level to use
1382  * @param duration time in seconds the animation should take.
1383  * @param cx offset inside object that defines zoom center. 0 is left side
1384  * @param cy offset inside object that defines zoom center. 0 is top side
1385  * @return @c EINA_TRUE if animation will be started, @c EINA_FALSE if not
1386  *            because zoom is too small/big
1387  */
1388 EAPI Eina_Bool    ewk_view_zoom_animated_set(Evas_Object *o, float zoom, float duration, Evas_Coord cx, Evas_Coord cy);
1389
1390 /**
1391  * Asks engine to pre-render region.
1392  *
1393  * Engines and backing store might be able to pre-render regions in
1394  * order to speed up zooming or scrolling to that region. Not all
1395  * engines might implement that and they will return @c EINA_FALSE
1396  * in that case.
1397  *
1398  * The given region is a hint. Engines might do bigger or smaller area
1399  * that covers that region. Pre-render might not be immediate, it may
1400  * be postponed to a thread, operated cooperatively in the main loop
1401  * and may be even ignored or cancelled afterwards.
1402  *
1403  * Multiple requests might be queued by engines. One can clear/forget
1404  * about them with ewk_view_pre_render_cancel().
1405  *
1406  * @param o view to ask pre-render of given region
1407  * @param x absolute coordinate (0=left) to pre-render at zoom
1408  * @param y absolute coordinate (0=top) to pre-render at zoom
1409  * @param w width to pre-render starting from @a x at zoom
1410  * @param h height to pre-render starting from @a y at zoom
1411  * @param zoom desired zoom
1412  *
1413  * @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
1414  *         otherwise (errors, pre-render feature not supported, etc)
1415  *
1416  * @see ewk_view_pre_render_cancel()
1417  */
1418 EAPI Eina_Bool    ewk_view_pre_render_region(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom);
1419
1420 /**
1421  * Asks engine to pre-render region, given @a n extra cols/rows.
1422  *
1423  * This is an alternative method to ewk_view_pre_render_region(). It does not
1424  * make sense in all engines and therefore it might not be implemented at all.
1425  *
1426  * It's only useful if engine divide the area being rendered in smaller tiles,
1427  * forming a grid. Then, browser could call this function to pre-render @a n
1428  * rows/cols involving the current viewport.
1429  *
1430  * @param o view to ask pre-render
1431  * @param n number of cols/rows that must be part of the region pre-rendered
1432  *
1433  * @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
1434  *         otherwise (errors, pre-render feature not supported, etc)
1435  *
1436  * @see ewk_view_pre_render_region()
1437  */
1438 EAPI Eina_Bool    ewk_view_pre_render_relative_radius(Evas_Object *o, unsigned int n);
1439
1440 /**
1441  * Asks engine to start pre-rendering.
1442  *
1443  * This is an alternative method to pre-render around the view area.
1444  * The first step is to find the center view area where to start pre-rendering.
1445  * And then from the center of the view area the backing store append the render request
1446  * outward in spiral order. So that the tiles which are close to view area are displayed
1447  * sooner than outside.
1448  *
1449  * @param o view to ask pre-render
1450  *
1451  * @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
1452  *         otherwise (errors, pre-render feature not supported, etc)
1453  *
1454  */
1455 EAPI Eina_Bool    ewk_view_pre_render_start(Evas_Object *o);
1456
1457 /**
1458  * Cancels and clears previous the pre-render requests.
1459  *
1460  * @param o view to clear pre-render requests
1461  */
1462 EAPI void         ewk_view_pre_render_cancel(Evas_Object *o);
1463
1464 /**
1465  * Enables (resumes) rendering.
1466  *
1467  * @param o view object to enable rendering
1468  *
1469  * @return @c EINA_TRUE if rendering was enabled, @c EINA_FALSE
1470  *         otherwise (errors, rendering suspension feature not supported)
1471  *
1472  * @see ewk_view_disable_render()
1473  */
1474 EAPI Eina_Bool    ewk_view_enable_render(const Evas_Object *o);
1475
1476 /**
1477   * Disables (suspends) rendering.
1478   *
1479   * @param o view object to disable rendering
1480   *
1481   * @return @c EINA_TRUE if rendering was disabled, @c EINA_FALSE
1482   *         otherwise (errors, rendering suspension not supported)
1483   */
1484 EAPI Eina_Bool    ewk_view_disable_render(const Evas_Object *o);
1485
1486 /**
1487  * Gets the input method hints.
1488  *
1489  * @param o view object to get the input method hints
1490  *
1491  * @see Ewk_Imh
1492  *
1493  * @return the input method hints as @a Ewk_Imh bits-field
1494  */
1495 EAPI unsigned int ewk_view_imh_get(const Evas_Object *o);
1496
1497 /**
1498  * Gets the user agent string.
1499  *
1500  * @param o view object to get the user agent string
1501  *
1502  * @return the user agent string
1503  */
1504 EAPI const char  *ewk_view_setting_user_agent_get(const Evas_Object *o);
1505
1506 /**
1507  * Sets the user agent string.
1508  *
1509  * @param o view object to set the user agent string
1510  *
1511  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1512  */
1513 EAPI Eina_Bool    ewk_view_setting_user_agent_set(Evas_Object *o, const char *user_agent);
1514
1515 /**
1516  * Queries if the images are loaded automatically.
1517  *
1518  * @param o view object to query if the images are loaded automatically
1519  *
1520  * @return @c EINA_TRUE if the images are loaded automatically,
1521  *         @c EINA_FALSE if not or on failure
1522  */
1523 EAPI Eina_Bool    ewk_view_setting_auto_load_images_get(const Evas_Object *o);
1524
1525 /**
1526  * Enables/disables auto loading of the images.
1527  *
1528  * @param o view object to set auto loading of the images
1529  * @param automatic @c EINA_TRUE to enable auto loading of the images,
1530  *        @c EINA_FALSE to disable
1531  *
1532  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1533  */
1534 EAPI Eina_Bool    ewk_view_setting_auto_load_images_set(Evas_Object *o, Eina_Bool automatic);
1535
1536 /**
1537  * Queries if the images are shrinked automatically
1538  *
1539  * @param o view object to query if the images are shrinked automatically
1540  *
1541  * @return @c EINA_TRUE if the images are shrinked automatically,
1542  *         @c EINA_FALSE if not or on failure
1543  */
1544 EAPI Eina_Bool    ewk_view_setting_auto_shrink_images_get(const Evas_Object *o);
1545
1546 /**
1547  * Enables/disables auto shrinking of the images.
1548  *
1549  * @param o view object to set auto shrinking of the images
1550  * @param automatic @c EINA_TRUE to enable auto shrinking of the images,
1551  *        @c EINA_FALSE to disable
1552  *
1553  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1554  */
1555 EAPI Eina_Bool    ewk_view_setting_auto_shrink_images_set(Evas_Object *o, Eina_Bool automatic);
1556
1557 /**
1558  * Queries if the view can be resized automatically.
1559  *
1560  * @param o view object to query if the view can be resized automatically
1561  *
1562  * @return @c EINA_TRUE if view can be resized automatically,
1563  *         @c EINA_FALSE if not or on failure
1564  */
1565 EAPI Eina_Bool    ewk_view_setting_enable_auto_resize_window_get(const Evas_Object *o);
1566
1567 /**
1568  * Enables/disables if the view can be resized automatically.
1569  *
1570  * @param o view object to set if the view can be resized automatically
1571  * @param resizable @c EINA_TRUE if view can be resizable automatically,
1572  *        @c EINA_TRUE if not
1573  *
1574  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1575  */
1576 EAPI Eina_Bool    ewk_view_setting_enable_auto_resize_window_set(Evas_Object *o, Eina_Bool resizable);
1577
1578 /**
1579  * Queries if the scripts can be executed.
1580  *
1581  * @param o view object to query if the scripts can be executed
1582  *
1583  * @return @c EINA_TRUE if the scripts can be executed
1584  *         @c EINA_FALSE if not or on failure
1585  */
1586 EAPI Eina_Bool    ewk_view_setting_enable_scripts_get(const Evas_Object *o);
1587
1588 /**
1589  * Enables/disables scripts executing.
1590  *
1591  * @param o view object to set script executing
1592  * @param enable @c EINA_TRUE to enable scripts executing
1593  *        @c EINA_FALSE to disable
1594  *
1595  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1596  */
1597 EAPI Eina_Bool    ewk_view_setting_enable_scripts_set(Evas_Object *o, Eina_Bool enable);
1598
1599 /**
1600  * Queries if the plug-ins are enabled.
1601  *
1602  * @param o view object to query if the plug-ins are enabled
1603  *
1604  * @return @c EINA_TRUE if the plugins are enabled
1605  *         @c EINA_FALSE if not or on failure
1606  */
1607 EAPI Eina_Bool    ewk_view_setting_enable_plugins_get(const Evas_Object *o);
1608
1609 /**
1610  * Enables/disables the plug-ins.
1611  *
1612  * @param o view object to set the plug-ins
1613  * @param enable @c EINA_TRUE to enable the plug-ins
1614  *        @c EINA_FALSE to disable
1615  *
1616  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1617  */
1618 EAPI Eina_Bool    ewk_view_setting_enable_plugins_set(Evas_Object *o, Eina_Bool enable);
1619
1620 /**
1621  * Queries if the frame flattening feature is enabled.
1622  *
1623  * @param o view object to query if the frame flattening feature is enabled
1624  *
1625  * @return @c EINA_TRUE if the frame flattening feature is enabled,
1626  *         @c EINA_FALSE if not or on failure
1627  */
1628 EAPI Eina_Bool    ewk_view_setting_enable_frame_flattening_get(const Evas_Object *o);
1629
1630 /**
1631  * Enables/disables the frame flattening feature.
1632  *
1633  * @param o view object to set the frame flattening feature
1634  * @param enable @c EINA_TRUE to enable the frame flattening feature
1635  *        @c EINA_FALSE to disable
1636  *
1637  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1638  */
1639 EAPI Eina_Bool    ewk_view_setting_enable_frame_flattening_set(Evas_Object *o, Eina_Bool enable);
1640
1641 /**
1642  * Queries if the scripts can open the new windows.
1643  *
1644  * @param o view object to query if the scripts can open the new windows
1645  *
1646  * @return @c EINA_TRUE if the scripts can open the new windows
1647  *         @c EINA_FALSE if not or on failure
1648  */
1649 EAPI Eina_Bool    ewk_view_setting_scripts_can_open_windows_get(const Evas_Object *o);
1650
1651 /**
1652  * Enables/disables if the scripts can open the new windows.
1653  *
1654  * @param o view object to set if the scripts can open the new windows
1655  * @param allow @c EINA_TRUE if the scripts can open the new windows
1656  *        @c EINA_FALSE if not
1657  *
1658  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (scripts are disabled)
1659  *
1660  * @see ewk_view_setting_enable_scripts_set
1661  */
1662 EAPI Eina_Bool    ewk_view_setting_scripts_can_open_windows_set(Evas_Object *o, Eina_Bool allow);
1663
1664 /**
1665  * Returns whether scripts can close windows automatically.
1666  *
1667  * @param o View whose settings to check.
1668  *
1669  * @return @c EINA_TRUE if scripts can close windows, @c EINA_FALSE otherwise.
1670  */
1671 EAPI Eina_Bool    ewk_view_setting_scripts_can_close_windows_get(const Evas_Object *o);
1672
1673 /**
1674  * Sets whether scripts are allowed to close windows automatically.
1675  *
1676  * @param o View whose settings to change.
1677  * @param allow @c EINA_TRUE to allow scripts to close windows,
1678  *              @c EINA_FALSE otherwise.
1679  *
1680  * @return @c EINA_TRUE if the setting could be changed successfully,
1681  *         @c EINA_FALSE in case an error occurred.
1682  */
1683 EAPI Eina_Bool    ewk_view_setting_scripts_can_close_windows_set(Evas_Object *o, Eina_Bool allow);
1684
1685 /**
1686  * Returns whether scripts can access clipboard.
1687  *
1688  * @param o View whose settings to check.
1689  *
1690  * @return @c EINA_TRUE if scripts can access clipboard, @c EINA_FALSE otherwise.
1691  */
1692 EAPI Eina_Bool    ewk_view_setting_scripts_can_access_clipboard_get(const Evas_Object *o);
1693
1694 /**
1695  * Sets whether scripts are allowed to access clipboard.
1696  *
1697  * The default value is @c EINA_FALSE. If set to @c EINA_TRUE, document.execCommand()
1698  * allows cut, copy and paste commands. 
1699  *
1700  * @param o View whose settings to change.
1701  * @param allow @c EINA_TRUE to allow scripts access clipboard,
1702  *              @c EINA_FALSE otherwise.
1703  *
1704  * @return @c EINA_TRUE if the setting could be changed successfully,
1705  *         @c EINA_FALSE in case an error occurred.
1706  */
1707 EAPI Eina_Bool    ewk_view_setting_scripts_can_access_clipboard_set(Evas_Object *o, Eina_Bool allow);
1708
1709 /**
1710  * Queries if HTML elements @c textarea can be resizable.
1711  *
1712  * @param o view object to query if the textarea elements can be resizable
1713  *
1714  * @return @c EINA_TRUE if the textarea elements can be resizable
1715  *         @c EINA_FALSE if not or on failure
1716  */
1717 EAPI Eina_Bool    ewk_view_setting_resizable_textareas_get(const Evas_Object *o);
1718
1719 /**
1720  * Enables/disables if HTML elements @c textarea can be resizable.
1721  *
1722  * @param o view object to set if the textarea elements can be resizable
1723  * @param enable @c EINA_TRUE if the textarea elements can be resizable
1724  *        @c EINA_FALSE if not
1725  *
1726  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1727  */
1728 EAPI Eina_Bool    ewk_view_setting_resizable_textareas_set(Evas_Object *o, Eina_Bool enable);
1729
1730 /**
1731  * Gets the user style sheet.
1732  *
1733  * @param o view object to get the user style sheet
1734  *
1735  * @return the user style sheet
1736  */
1737 EAPI const char  *ewk_view_setting_user_stylesheet_get(const Evas_Object *o);
1738
1739 /**
1740  * Sets the user style sheet.
1741  *
1742  * @param o view object to set the user style sheet
1743  * @param uri uniform resource identifier to user style sheet
1744  *
1745  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1746  */
1747 EAPI Eina_Bool    ewk_view_setting_user_stylesheet_set(Evas_Object *o, const char *uri);
1748
1749 /**
1750  * Queries if the private browsing feature is enabled.
1751  *
1752  * @param o view object to query if the private browsing feature is enabled
1753  *
1754  * @return @c EINA_TRUE if the private browsing feature is enabled, or
1755  *         @c EINA_FALSE if not or on failure
1756  *
1757  * @see ewk_view_setting_private_browsing_set
1758  */
1759 EAPI Eina_Bool    ewk_view_setting_private_browsing_get(const Evas_Object *o);
1760
1761 /**
1762  * Enables/disables the private browsing feature.
1763  *
1764  * When this option is set, WebCore will avoid storing any record of browsing
1765  * activity  that may persist on disk or remain displayed when the
1766  * option is reset.
1767  *
1768  * This option does not affect the storage of such information in RAM.
1769  *
1770  * The following functions respect this setting:
1771  *  - HTML5/DOM Storage
1772  *  - Icon Database
1773  *  - Console Messages
1774  *  - MemoryCache
1775  *  - Application Cache
1776  *  - Back/Forward Page History
1777  *  - Page Search Results
1778  *  - HTTP Cookies
1779  *  - Plug-ins (that support NPNVprivateModeBool)
1780  *
1781  * @param o view object to set the private browsing feature
1782  * @param enable @c EINA_TRUE to enable the private browsing feature
1783  *        @c EINA_FALSE to disable
1784  *
1785  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1786  */
1787 EAPI Eina_Bool    ewk_view_setting_private_browsing_set(Evas_Object *o, Eina_Bool enable);
1788
1789 /**
1790  * Returns whether HTML5 application cache support is enabled for this view.
1791  *
1792  * The Offline Application Caching APIs are part of HTML5 and allow applications to store data locally that is accessed
1793  * when the network cannot be reached.
1794  *
1795  * Application cache support is enabled by default.
1796  *
1797  * @param o view object whose settings to query
1798  *
1799  * @return @c EINA_TRUE if the application cache is enabled,
1800  *         @c EINA_FALSE if not or on failure
1801  *
1802  * @sa ewk_settings_application_cache_path_set
1803  */
1804 EAPI Eina_Bool    ewk_view_setting_application_cache_get(const Evas_Object *o);
1805
1806 /**
1807  * Enables/disables the HTML5 application cache for this view.
1808  *
1809  * The Offline Application Caching APIs are part of HTML5 and allow applications to store data locally that is accessed
1810  * when the network cannot be reached.
1811  *
1812  * Application cache support is enabled by default.
1813  *
1814  * @param o view object whose settings to change
1815  * @param enable @c EINA_TRUE to enable the application cache,
1816  *        @c EINA_FALSE to disable
1817  *
1818  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1819  *
1820  * @sa ewk_settings_application_cache_path_set
1821  */
1822 EAPI Eina_Bool    ewk_view_setting_application_cache_set(Evas_Object *o, Eina_Bool enable);
1823
1824 /**
1825  * Queries if the caret browsing feature is enabled.
1826  *
1827  * @param o view object to query if the caret browsing feature is enabled
1828  *
1829  * @return @c EINA_TRUE if the caret browsing feature is enabled,
1830  *         @c EINA_FALSE if not or on failure
1831  */
1832 EAPI Eina_Bool    ewk_view_setting_caret_browsing_get(const Evas_Object *o);
1833
1834 /**
1835  * Enables/disables the caret browsing feature.
1836  *
1837  * @param o view object to set caret browsing feature
1838  * @param enable @c EINA_TRUE to enable the caret browsing feature
1839  *        @c EINA_FALSE to disable
1840  *
1841  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1842  */
1843 EAPI Eina_Bool    ewk_view_setting_caret_browsing_set(Evas_Object *o, Eina_Bool enable);
1844
1845 /**
1846  * Gets the current encoding.
1847  *
1848  * @param o view object to get the current encoding
1849  *
1850  * @return @c eina_strinshare containing the current encoding, or
1851  *         @c NULL if it's not set
1852  */
1853 EAPI const char  *ewk_view_setting_encoding_custom_get(const Evas_Object *o);
1854
1855 /**
1856  * Sets the encoding and reloads the page.
1857  *
1858  * @param o view to set the encoding
1859  * @param encoding the new encoding to set or @c NULL to restore the default one
1860  *
1861  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1862  */
1863 EAPI Eina_Bool    ewk_view_setting_encoding_custom_set(Evas_Object *o, const char *encoding);
1864
1865 /**
1866  * Gets the default encoding.
1867  *
1868  * @param o view object to get the default encoding
1869  *
1870  * @return @c eina_strinshare containing the default encoding, or
1871  *         @c NULL if it's not set
1872  */
1873 EAPI const char  *ewk_view_setting_encoding_default_get(const Evas_Object *o);
1874
1875 /**
1876  * Sets the default encoding.
1877  *
1878  * @param o view to set the default encoding
1879  * @param encoding the new encoding to set
1880  *
1881  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1882  */
1883 EAPI Eina_Bool    ewk_view_setting_encoding_default_set(Evas_Object *o, const char *encoding);
1884
1885 /**
1886  * Gets the minimum font size.
1887  *
1888  * @param o view object to get the minimum font size
1889  *
1890  * @return the minimum font size, or @c 0 on failure
1891  */
1892 EAPI int          ewk_view_setting_font_minimum_size_get(const Evas_Object *o);
1893
1894 /**
1895  * Sets the minimum font size.
1896  *
1897  * @param o view object to set the minimum font size
1898  * @param size a new minimum font size to set
1899  *
1900  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1901  */
1902 EAPI Eina_Bool    ewk_view_setting_font_minimum_size_set(Evas_Object *o, int size);
1903
1904 /**
1905  * Gets the minimum logical font size.
1906  *
1907  * @param o view object to get the minimum logical font size
1908  *
1909  * @return the minimum logical font size, or @c 0 on failure
1910  */
1911 EAPI int          ewk_view_setting_font_minimum_logical_size_get(const Evas_Object *o);
1912
1913 /**
1914  * Sets the minimum logical font size.
1915  *
1916  * @param o view object to set the minimum font size
1917  * @param size a new minimum logical font size to set
1918  *
1919  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1920  */
1921 EAPI Eina_Bool    ewk_view_setting_font_minimum_logical_size_set(Evas_Object *o, int size);
1922
1923 /**
1924  * Gets the default font size.
1925  *
1926  * @param o view object to get the default font size
1927  *
1928  * @return the default font size, or @c 0 on failure
1929  */
1930 EAPI int          ewk_view_setting_font_default_size_get(const Evas_Object *o);
1931
1932 /**
1933  * Sets the default font size.
1934  *
1935  * @param o view object to set the default font size
1936  * @param size a new default font size to set
1937  *
1938  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1939  */
1940 EAPI Eina_Bool    ewk_view_setting_font_default_size_set(Evas_Object *o, int size);
1941
1942 /**
1943  * Gets the Monospace font size.
1944  *
1945  * @param o view object to get the Monospace font size
1946  *
1947  * @return the Monospace font size, or @c 0 on failure
1948  */
1949 EAPI int          ewk_view_setting_font_monospace_size_get(const Evas_Object *o);
1950
1951 /**
1952  * Sets the Monospace font size.
1953  *
1954  * @param o view object to set the Monospace font size
1955  * @param size a new Monospace font size to set
1956  *
1957  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
1958  */
1959 EAPI Eina_Bool    ewk_view_setting_font_monospace_size_set(Evas_Object *o, int size);
1960
1961 /**
1962  * Gets the name of font for the given font family.
1963  *
1964  * @param o view object to get name of font the for font family
1965  * @param font_family the font family as @a Ewk_Font_Family enum to get font name
1966  *
1967  * @return the name of font family
1968  */
1969 EAPI const char *ewk_view_font_family_name_get(const Evas_Object *o, Ewk_Font_Family font_family);
1970
1971 /**
1972  * Sets the font for the given family.
1973  *
1974  * @param o view object to set font for the given family
1975  * @param font_family the font family as @a Ewk_Font_Family enum
1976  * @param name the font name to set
1977  *
1978  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
1979  */
1980 EAPI Eina_Bool ewk_view_font_family_name_set(Evas_Object *o, Ewk_Font_Family font_family, const char *name);
1981
1982 /**
1983  * Queries if the spatial naviagtion feature is enabled.
1984  *
1985  * @param o view object to query if spatial navigation feature is enabled
1986  *
1987  * @return @c EINA_TRUE if spatial navigation is enabled,
1988  *         @c EINA_FALSE if not or on failure
1989  */
1990 EAPI Eina_Bool    ewk_view_setting_spatial_navigation_get(const Evas_Object *o);
1991
1992 /**
1993  * Enables/disables the spatial navigation feature.
1994  *
1995  * @param o view object to set spatial navigation feature
1996  * @param enable @c EINA_TRUE to enable the spatial navigation feature,
1997  *        @c EINA_FALSE to disable
1998  *
1999  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
2000  */
2001 EAPI Eina_Bool    ewk_view_setting_spatial_navigation_set(Evas_Object *o, Eina_Bool enable);
2002
2003 /**
2004  * Queries if the local storage feature of HTML5 is enabled.
2005  *
2006  * @param o view object to query if the local storage feature is enabled
2007  *
2008  * @return @c EINA_TRUE if local storage is enabled,
2009  *         @c EINA_FALSE if not or on failure
2010  */
2011 EAPI Eina_Bool    ewk_view_setting_local_storage_get(const Evas_Object *o);
2012
2013 /**
2014  * Enables/disables the local storage feature of HTML5.
2015  *
2016  * Please notice that by default there is no storage path specified for the database.
2017  * This means that the contents of @c window.localStorage will not be saved to disk and
2018  * will be lost when the view is removed.
2019  * To set the path where the storage database will be stored, use
2020  * ewk_view_setting_local_storage_database_path_set.
2021  *
2022  * @param o view object to set if local storage is enabled
2023  * @param enable @c EINA_TRUE to enable the local storage feature,
2024  *        @c EINA_FALSE to disable
2025  *
2026  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
2027  *
2028  * @sa ewk_view_setting_local_storage_database_path_set
2029  */
2030 EAPI Eina_Bool    ewk_view_setting_local_storage_set(Evas_Object *o, Eina_Bool enable);
2031
2032 /**
2033  * Returns the path where the HTML5 local storage database is stored on disk.
2034  *
2035  * By default, there is no path set, which means changes to @c window.localStorage will not
2036  * be saved to disk whatsoever.
2037  *
2038  * @param o view object to get the database path to the local storage feature
2039  *
2040  * @return @c eina_stringshare containing the database path to the local storage feature, or
2041  *         @c NULL if it's not set
2042  *
2043  * @sa ewk_view_setting_local_storage_database_path_set
2044  */
2045 EAPI const char  *ewk_view_setting_local_storage_database_path_get(const Evas_Object *o);
2046
2047 /**
2048  * Sets the path where the HTML5 local storage database is stored on disk.
2049  *
2050  * By default, there is no path set, which means changes to @c window.localStorage will not
2051  * be saved to disk whatsoever.
2052  *
2053  * @param o view object to set the database path to the local storage feature
2054  * @param path a new database path to the local storage feature
2055  *
2056  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
2057  *
2058  * @sa ewk_view_setting_local_storage_set
2059  */
2060 EAPI Eina_Bool    ewk_view_setting_local_storage_database_path_set(Evas_Object *o, const char *path);
2061
2062 /**
2063  * Queries if the page cache feature is enabled.
2064  *
2065  * @param o view object to query if page cache feature is enabled
2066  *
2067  * @return @c EINA_TRUE if page cache is enabled,
2068  *         @c EINA_FALSE if not or on failure
2069  */
2070 EAPI Eina_Bool    ewk_view_setting_page_cache_get(const Evas_Object *o);
2071
2072 /**
2073  * Enables/disables the page cache feature.
2074  *
2075  * @param o view object to set page cache feature
2076  * @param enable @c EINA_TRUE to enable the page cache feature,
2077  *        @c EINA_FALSE to disable
2078  *
2079  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
2080  */
2081 EAPI Eina_Bool    ewk_view_setting_page_cache_set(Evas_Object *o, Eina_Bool enable);
2082
2083 /**
2084  * Queries if the encoding detector is enabled.
2085  *
2086  * @param o view object to query if the encoding detector is enabled
2087  *
2088  * @return @c EINA_TRUE if the encoding feature is enabled,
2089  *         @c EINA_FALSE if not or on failure
2090  */
2091 EAPI Eina_Bool    ewk_view_setting_encoding_detector_get(const Evas_Object *o);
2092
2093 /**
2094  * Enables/disables the encoding detector.
2095  *
2096  * @param o view object to set the encoding detector
2097  * @param enable @c EINA_TRUE to enable the encoding detector,
2098  *        @c EINA_FALSE to disable
2099  *
2100  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
2101  */
2102 EAPI Eina_Bool    ewk_view_setting_encoding_detector_set(Evas_Object *o, Eina_Bool enable);
2103
2104 /**
2105  * Queries if developer extensions are enabled.
2106  *
2107  * Currently, this is used to know whether the Web Inspector is enabled for a
2108  * given view.
2109  *
2110  * @param o view object to query if developer extensions are enabled
2111  *
2112  * @return @c EINA_TRUE if developer extensions are enabled, @c EINA_FALSE
2113  *         otherwise
2114  */
2115 EAPI Eina_Bool    ewk_view_setting_enable_developer_extras_get(const Evas_Object *o);
2116
2117 /**
2118  * Enables/disables developer extensions.
2119  *
2120  * This currently controls whether the Web Inspector should be enabled.
2121  *
2122  * @param o view object to set developer extensions
2123  * @param enable @c EINA_TRUE to enable developer extras, @c EINA_FALSE to
2124  *               disable
2125  *
2126  * @return @c EINA_TRUE on success or @EINA_FALSE on failure
2127  */
2128 EAPI Eina_Bool    ewk_view_setting_enable_developer_extras_set(Evas_Object *o, Eina_Bool enable);
2129
2130 /**
2131  * Sets the minimum interval for DOMTimers on current page.
2132  *
2133  * @param o view object to set the minimum interval
2134  *
2135  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
2136  */
2137 EAPI Eina_Bool    ewk_view_setting_minimum_timer_interval_set(Evas_Object *o, double interval);
2138
2139 /**
2140  * Gets the minimum interval for DOMTimers on current page.
2141  *
2142  * @param o view object to get the minimum interval
2143  *
2144  * @return the minimum interval on success or @c -1.0 on failure
2145  */
2146 EAPI double       ewk_view_setting_minimum_timer_interval_get(const Evas_Object *o);
2147
2148 /**
2149  * Queries whether WebGL support is enabled.
2150  *
2151  * WebGL support is enabled by default.
2152  *
2153  * @param o view object to query whether WebGL support is enabled
2154  *
2155  * @return @c EINA_TRUE if WebGL support enabled,
2156  *         @c EINA_FALSE if not or on failure
2157  */
2158 EAPI Eina_Bool ewk_view_setting_enable_webgl_get(const Evas_Object *o);
2159
2160 /**
2161  * Enables/disables WebGL support.
2162  *
2163  * WebGL support is enabled by default.
2164  *
2165  * @param o view object to set WebGL
2166  * @param enable @c EINA_TRUE to enable WebGL support,
2167  *        @c EINA_FALSE to disable
2168  *
2169  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
2170  */
2171 EAPI Eina_Bool ewk_view_setting_enable_webgl_set(Evas_Object *o, Eina_Bool enable);
2172
2173 /**
2174  * Queries if tab key focusing of page elements is enabled.
2175  *
2176  * When this setting is enabled, the elements in the page (links and form controls) will be cycled through by pressing the tab key.
2177  * Tab key focusing of page elements is enabled by default.
2178  *
2179  * @param o view object to query if tab key focusing of page elements is enabled
2180  *
2181  * @return @c EINA_TRUE if tab key focusing of page elements is enabled, @c EINA_FALSE
2182  *         otherwise
2183  */
2184 EAPI Eina_Bool ewk_view_setting_include_links_in_focus_chain_get(const Evas_Object *o);
2185
2186 /**
2187  * Enables/disables tab key focusing of page elements.
2188  *
2189  * When this setting is enabled, the elements in the page (links and form controls) will be cycled through by pressing the tab key.
2190  * Tab key focusing of page elements is enabled by default.
2191  *
2192  * @param o view object to set tab key focusing of page elements
2193  * @param enable @c EINA_TRUE to enable tab key focusing of page elements, @c EINA_FALSE to
2194  *               disable
2195  *
2196  * @return @c EINA_TRUE on success or @EINA_FALSE on failure
2197  */
2198 EAPI Eina_Bool ewk_view_setting_include_links_in_focus_chain_set(Evas_Object *o, Eina_Bool enable);
2199
2200 /**
2201  * Queries if hyperlink auditing is enabled.
2202  *
2203  * Hyperlink auditing is used if a hyperlink created by an @c a or @c area element has a @c ping attribute.
2204  * Please refer to the hyperlink auditing specification at http://www.whatwg.org/specs/web-apps/current-work/#hyperlink-auditing.
2205  * Hyperlink auditing is disabled by default.
2206  *
2207  * @param o view object to query if  hyperlink auditing is enabled
2208  *
2209  * @return @c EINA_TRUE if hyperlink auditing is enabled, @c EINA_FALSE
2210  *         otherwise
2211  */
2212 EAPI Eina_Bool ewk_view_setting_enable_hyperlink_auditing_get(const Evas_Object *o);
2213
2214 /**
2215  * Enables/disables hyperlink auditing.
2216  *
2217  * Hyperlink auditing is used if a hyperlink created by an @c a or @c area element has a @c ping attribute.
2218  * Please refer to the hyperlink auditing specification at http://www.whatwg.org/specs/web-apps/current-work/#hyperlink-auditing.
2219  * Hyperlink auditing is disabled by default.
2220  *
2221  * @param o view object to set hyperlink auditing
2222  * @param enable @c EINA_TRUE to enable hyperlink auditing, @c EINA_FALSE to
2223  *               disable
2224  *
2225  * @return @c EINA_TRUE on success or @EINA_FALSE on failure
2226  */
2227 EAPI Eina_Bool ewk_view_setting_enable_hyperlink_auditing_set(Evas_Object *o, Eina_Bool enable);
2228
2229 /**
2230  * Gets the internal data of @a o.
2231  *
2232  * This is similar to evas_object_smart_data_get(), but additionally does type checking.
2233  *
2234  * @param o view object to get the internal data
2235  *
2236  * @return the internal data of @a o, or @c NULL on failure
2237  */
2238 EAPI Ewk_View_Smart_Data *ewk_view_smart_data_get(const Evas_Object *o);
2239
2240 /**
2241  * Process scrolls.
2242  *
2243  * @param priv the pointer to the private data of the view to process scrolls
2244  *
2245  * @note This is not for general use but just for subclasses that want
2246  *       to define their own backing store.
2247  */
2248 EAPI void ewk_view_scrolls_process(Ewk_View_Smart_Data *sd);
2249
2250 /**
2251  * Paints using given graphics context the given area.
2252  *
2253  * This uses viewport relative area and will also handle scrollbars
2254  * and other extra elements. See ewk_view_paint_contents() for the
2255  * alternative function.
2256  *
2257  * @param priv the pointer to the private data of the view to use as paint source
2258  * @param cr the cairo context to use as paint destination, its state will
2259  *        be saved before operation and restored afterwards
2260  * @param area viewport relative geometry to paint
2261  *
2262  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
2263  *
2264  * @note This is an easy to use version, but internal structures are
2265  *       always created, then graphics context is clipped, then
2266  *       painted, restored and destroyed. This might not be optimum,
2267  *       so using @a Ewk_View_Paint_Context may be a better solutions
2268  *       for large number of operations.
2269  *
2270  * @see ewk_view_paint_contents()
2271  * @see ewk_view_paint_context_paint()
2272  *
2273  * @note This is not for general use but just for subclasses that want
2274  *       to define their own backing store.
2275  */
2276 EAPI Eina_Bool ewk_view_paint(Ewk_View_Private_Data *priv, cairo_t *cr, const Eina_Rectangle *area);
2277
2278 /**
2279  * Paints just contents using given graphics context the given area.
2280  *
2281  * This uses absolute coordinates for area and will just handle
2282  * contents, no scrollbars or extras. See ewk_view_paint() for the
2283  * alternative solution.
2284  *
2285  * @param priv the pointer to the private data of the view to use as paint source
2286  * @param cr the cairo context to use as paint destination, its state will
2287  *        be saved before operation and restored afterwards
2288  * @param area absolute geometry to paint
2289  *
2290  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
2291  *
2292  * @note This is an easy to use version, but internal structures are
2293  *       always created, then graphics context is clipped, then
2294  *       painted, restored and destroyed. This might not be optimum,
2295  *       so using @a Ewk_View_Paint_Context may be a better solutions
2296  *       for large number of operations.
2297  *
2298  * @see ewk_view_paint()
2299  * @see ewk_view_paint_context_paint_contents()
2300  *
2301  * @note This is not for general use but just for subclasses that want
2302  *       to define their own backing store.
2303  */
2304 EAPI Eina_Bool ewk_view_paint_contents(Ewk_View_Private_Data *priv, cairo_t *cr, const Eina_Rectangle *area);
2305
2306 /**
2307  * Gets the attributes of the viewport meta tag.
2308  *
2309  * Properties are returned in the respective pointers. Passing @c NULL to any of
2310  * these pointers will make that property to not be returned.
2311  *
2312  * @param o view object to get the viewport attributes
2313  * @param w the pointer to store the width of the viewport
2314  * @param h the pointer to store the height of the viewport
2315  * @param init_scale the pointer to store the initial scale value
2316  * @param max_scale the pointer to store the maximum scale value
2317  * @param min_scale the pointer to store the minimum scale value
2318  * @param device_pixel_ratio the pointer to store the device pixel ratio value
2319  * @param user_scalable the pointer to store if user can scale viewport
2320  */
2321 EAPI void ewk_view_viewport_attributes_get(const Evas_Object *o, int *w, int *h, float *init_scale, float *max_scale, float *min_scale, float *device_pixel_ratio , Eina_Bool *user_scalable);
2322
2323 /**
2324  * Sets the zoom range.
2325  *
2326  * @param o view object to set the zoom range
2327  * @param min_scale the minimum value of the zoom range
2328  * @param max_scale the maximum value of the zoom range
2329  *
2330  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
2331  */
2332 EAPI Eina_Bool ewk_view_zoom_range_set(Evas_Object *o, float min_scale, float max_scale);
2333
2334 /**
2335  * Gets the minimum value of the zoom range.
2336  *
2337  * @param o view object to get the minimum value of the zoom range
2338  *
2339  * @return the minimum value of the zoom range on success, or
2340  *         @c -1 on failure
2341  */
2342 EAPI float ewk_view_zoom_range_min_get(const Evas_Object *o);
2343
2344 /**
2345  * Gets the maximum value of the zoom range.
2346  *
2347  * @param o view object to get the maximum value of the zoom range
2348  *
2349  * @return the maximum value of the zoom range on success, or
2350  *         @c -1.0 on failure
2351  */
2352 EAPI float ewk_view_zoom_range_max_get(const Evas_Object *o);
2353
2354 /**
2355  * Enables/disables the zoom.
2356  *
2357  * @param o view to set zoom
2358  * @param user_scalable @c EINA_TRUE to enable zoom, @c EINA_FALSE to disable
2359  *
2360  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
2361  */
2362 EAPI Eina_Bool ewk_view_user_scalable_set(Evas_Object *o, Eina_Bool user_scalable);
2363
2364 /**
2365  * Queries if the zoom is enabled.
2366  *
2367  * @param o view to query if zoom is enabled
2368  *
2369  * @return @c EINA_TRUE if the zoom is enabled, @c EINA_FALSE if not or on failure
2370  */
2371 EAPI Eina_Bool ewk_view_user_scalable_get(const Evas_Object *o);
2372
2373 /**
2374  * Gets the device pixel ratio value.
2375  *
2376  * @param o view to get the device pixel ratio value
2377  *
2378  * @return the device pixel ratio value on success or @c -1.0 on failure
2379  */
2380 EAPI float ewk_view_device_pixel_ratio_get(const Evas_Object *o);
2381
2382 /**
2383  * Changes the text direction of the selected input node.
2384  *
2385  * @param o view object to set text direction.
2386  * @param direction text direction.
2387  */
2388 EAPI void ewk_view_text_direction_set(Evas_Object *o, Ewk_Text_Direction direction);
2389
2390 /**
2391  * Sets the view mode.
2392  *
2393  * The view-mode media feature describes the mode in which the
2394  * Web application is being shown as a running application.
2395  *
2396  * @param o view object to change the view mode
2397  * @param view_mode page view mode to set
2398  *
2399  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
2400  */
2401 EAPI Eina_Bool ewk_view_mode_set(Evas_Object *o, Ewk_View_Mode view_mode);
2402
2403 /**
2404  * Gets the view mode.
2405  *
2406  * @param o view object to get the view mode
2407  *
2408  * @return enum value of @a Ewk_View_Mode that indicates current view mode on success or
2409  *         EWK_VIEW_MODE_INVALID otherwise
2410  *
2411  * @see ewk_view_mode_set()
2412  */
2413 EAPI Ewk_View_Mode ewk_view_mode_get(const Evas_Object *o);
2414
2415 /**
2416  * Creates a JS object named @a obj_name as property of the window object. This should be called on a callback connectedto the
2417  * js,windowobject,clear signal.
2418  *
2419  * @param o view.
2420  * @param obj object that will be added(see: @a ewk_js_object_new).
2421  * @param obj_name name of the object.
2422  *
2423  * @return @c EINA_TRUE if object was added, @c EINA_FALSE if not.
2424  */
2425 EAPI Eina_Bool ewk_view_js_object_add(Evas_Object *o, Ewk_JS_Object *obj, const char *obj_name);
2426
2427 /// Defines the page visibility status.
2428 enum _Ewk_Page_Visibility_State {
2429     EWK_PAGE_VISIBILITY_STATE_VISIBLE,
2430     EWK_PAGE_VISIBILITY_STATE_HIDDEN,
2431     EWK_PAGE_VISIBILITY_STATE_PRERENDER,
2432     EWK_PAGE_VISIBILITY_STATE_PREVIEW
2433 };
2434 /// Creates a type name for @a _Ewk_Page_Visibility_State.
2435 typedef enum _Ewk_Page_Visibility_State Ewk_Page_Visibility_State;
2436
2437 /**
2438  * Sets the visibility state of the page.
2439  *
2440  * This function let WebKit knows the visibility status of the page.
2441  * WebKit will save the current status, and fire a "visibilitychange"
2442  * event which web application can listen. Web application could slow
2443  * down or stop itself when it gets a "visibilitychange" event and its
2444  * visibility state is hidden. If its visibility state is visible, then
2445  * the web application could use more resources.
2446  *
2447  * This feature makes that web application could use the resources efficiently,
2448  * such as power, CPU, and etc.
2449  *
2450  * If more detailed description is needed, please see the specification.
2451  * (http://www.w3.org/TR/page-visibility)
2452  *
2453  * @param o view object to set the visibility state.
2454  * @param page_visible_state the visible state of the page to set.
2455  * @param initial_state @c EINA_TRUE if this function is called at page initialization time,
2456  *                      @c EINA_FALSE otherwise.
2457  *
2458  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
2459  */
2460 EAPI Eina_Bool ewk_view_visibility_state_set(Evas_Object *o, Ewk_Page_Visibility_State page_visible_state, Eina_Bool initial_state);
2461
2462 /**
2463  * Gets the visibility state of the page.
2464  *
2465  * @param o view object
2466  *
2467  * @return enum value of @a Ewk_Page_Visibility_State that indicates current visibility status of the page.
2468  *
2469  * @see ewk_view_visibility_state_set()
2470  */
2471 EAPI Ewk_Page_Visibility_State ewk_view_visibility_state_get(const Evas_Object *o);
2472
2473 /**
2474  * Returns whether the view has displayed mixed content.
2475  *
2476  * When a view has displayed mixed content, any of its frames has loaded an HTTPS URI
2477  * which has itself loaded and displayed a resource (such as an image) from an insecure,
2478  * that is, non-HTTPS, URI.
2479  *
2480  * The status is reset only when a load event occurs (eg. the page is reloaded or a new page is loaded).
2481  *
2482  * When one of the containing frames displays mixed content, the view emits the "mixedcontent,displayed" signal.
2483  *
2484  * @param o The view to query.
2485  *
2486  * @sa ewk_frame_mixed_content_displayed_get
2487  */
2488 EAPI Eina_Bool ewk_view_mixed_content_displayed_get(const Evas_Object *o);
2489
2490 /**
2491  * Returns whether the view has run mixed content.
2492  *
2493  * When a view has run mixed content, any of its frames has loaded an HTTPS URI
2494  * which has itself loaded and run a resource (such as an image) from an insecure,
2495  * that is, non-HTTPS, URI.
2496  *
2497  * The status is reset only when a load event occurs (eg. the page is reloaded or a new page is loaded).
2498  *
2499  * When one of the containing frames runs mixed content, the view emits the "mixedcontent,run" signal.
2500  *
2501  * @param o The view to query.
2502  *
2503  * @sa ewk_frame_mixed_content_run_get
2504  */
2505 EAPI Eina_Bool ewk_view_mixed_content_run_get(const Evas_Object *o);
2506
2507 /**
2508  * Returns the SoupSession associated with this view.
2509  *
2510  * By default, all views share the same, default soup session also available
2511  * by calling ewk_network_default_soup_session_get.
2512  *
2513  * @param o The view to query.
2514  *
2515  * @sa ewk_view_soup_session_set, ewk_network_default_soup_session_get
2516  */
2517 EAPI SoupSession* ewk_view_soup_session_get(const Evas_Object *o);
2518
2519 /**
2520  * Associates a new SoupSession with this view.
2521  *
2522  * Only sessions of type SoupSessionAsync are supported.
2523  *
2524  * @note Changing the SoupSession should not be needed in most cases. If
2525  *       a different SoupSession is used, the cookie management and some
2526  *       network functions in ewk will not have any effect on it.
2527  *
2528  * @param o The view to change.
2529  * @param session The new SoupSession.
2530  *
2531  * @sa ewk_view_soup_session_get, ewk_network_default_soup_session_get
2532  */
2533 EAPI void ewk_view_soup_session_set(Evas_Object *o, SoupSession *session);
2534
2535 /**
2536  * Returns whether XSSAuditor feature is enabled.
2537  *
2538  * @param o view object to query whether XSSAuditor feature is enabled.
2539  *
2540  * @return @c EINA_TRUE if the XSSAuditor feature is enabled,
2541  *         @c EINA_FALSE if not or on failure.
2542  */
2543 EAPI Eina_Bool ewk_view_setting_enable_xss_auditor_get(const Evas_Object *o);
2544
2545 /**
2546  * Enables/disables the XSSAuditor feature.
2547  * 
2548  * The XSSAuditor (cross-site scripting protection) feature provides protection 
2549  * from reflected XSS attacks on vulnerable web sites. When XSS is encountered
2550  * in the page, frame sends a signal "xss,detected" with additional information 
2551  * on whether the entire page was blocked or only injected scripts were removed. 
2552  * This feature is enabled by default.
2553  *
2554  * @param o view object to set the XSSAuditor feature.
2555  * @param enable @c EINA_TRUE to enable the XSSAuditor feature,
2556  *        @c EINA_FALSE to disable.
2557  */
2558 EAPI void ewk_view_setting_enable_xss_auditor_set(Evas_Object *o, Eina_Bool enable);
2559
2560 /**
2561  * Returns whether video captions display feature is enabled.
2562  *
2563  * Video captions display is disabled by default.
2564  *
2565  * @param o view object to query whether video captions display feature is enabled.
2566  *
2567  * @return @c EINA_TRUE if the video captions display feature is enabled,
2568  *         @c EINA_FALSE if not or on failure.
2569  */
2570 EAPI Eina_Bool ewk_view_setting_should_display_captions_get(const Evas_Object *o);
2571
2572 /**
2573  * Enables/disables the video captions display feature.
2574  *
2575  * The video captions display feature is part of track support for HTML5 video.
2576  *
2577  * @param o view object to set the video captions display feature.
2578  * @param enable @c EINA_TRUE to enable the video captions display feature,
2579  * @c EINA_FALSE to disable.
2580  */
2581 EAPI void ewk_view_setting_should_display_captions_set(Evas_Object *o, Eina_Bool enable);
2582
2583 /**
2584  * Returns whether video subtitles display feature is enabled.
2585  *
2586  * Video subtitles display is disabled by default.
2587  *
2588  * @param o view object to query whether video subtitles display feature is enabled.
2589  *
2590  * @return @c EINA_TRUE if the video subtitles display feature is enabled,
2591  *         @c EINA_FALSE if not or on failure.
2592  */
2593 EAPI Eina_Bool ewk_view_setting_should_display_subtitles_get(const Evas_Object *o);
2594
2595 /**
2596  * Enables/disables the video subtitles display feature.
2597  *
2598  * The video subtitles display feature is part of track support for HTML5 video.
2599  *
2600  * @param o view object to set the video subtitles display feature.
2601  * @param enable @c EINA_TRUE to enable the video subtitles display feature,
2602  * @c EINA_FALSE to disable.
2603  */
2604 EAPI void ewk_view_setting_should_display_subtitles_set(Evas_Object *o, Eina_Bool enable);
2605
2606 /**
2607  * Returns whether video text descriptions display feature is enabled.
2608  *
2609  * Video text descriptions display is disabled by default.
2610  *
2611  * @param o view object to query whether video text descriptions display feature is enabled.
2612  *
2613  * @return @c EINA_TRUE if the video text descriptions display feature is enabled,
2614  *         @c EINA_FALSE if not or on failure.
2615  */
2616 EAPI Eina_Bool ewk_view_setting_should_display_text_descriptions_get(const Evas_Object *o);
2617
2618 /**
2619  * Enables/disables the video text descriptions display feature.
2620  *
2621  * The video text descriptions display feature is part of track support for HTML5 video.
2622  *
2623  * @param o view object to set the video text descriptions display feature.
2624  * @param enable @c EINA_TRUE to enable the video text descriptions display feature,
2625  * @c EINA_FALSE to disable.
2626  */
2627 EAPI void ewk_view_setting_should_display_text_descriptions_set(Evas_Object *o, Eina_Bool enable);
2628
2629 /**
2630  * Queries if the web audio feature of HTML5 is enabled.
2631  *
2632  * @param o view object to query if the web audio feature is enabled
2633  *
2634  * @return @c EINA_TRUE if web audio is enabled,
2635  *         @c EINA_FALSE if not or on failure
2636  */
2637 EAPI Eina_Bool    ewk_view_setting_web_audio_get(const Evas_Object *o);
2638
2639 /**
2640  * Enables/disables the web audio feature of HTML5.
2641  *
2642  * @param o view object to set the web audio
2643  * @param enable @c EINA_TRUE to enable the web audio feature,
2644  *        @c EINA_FALSE to disable
2645  *
2646  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
2647  */
2648 EAPI Eina_Bool    ewk_view_setting_web_audio_set(Evas_Object *o, Eina_Bool enable);
2649
2650 /**
2651  * Show the web inspector to debug a web page.
2652  *
2653  * The following signals are emiited.
2654  * "inspector,view,create" and "inspector,view,close"
2655  * The first one will be called to request the view for web inspector on view that will be inspected.
2656  * This callback should create the view for web inspector and set the view with ewk_view_web_inspector_view_set().
2657  * The second one will be called to close the view for web inspector on view having the web inspector after disconnecting frontend
2658  * This callback should remove the view for web inspector.
2659  *
2660  * When the view having the web inspector is removed,
2661  * please emit the "inspector,view,destroy" signal on view for web inspector.
2662  *
2663  * @param o The view to show the web inspector.
2664  *
2665  * @see ewk_view_web_inspector_close()
2666  * @see ewk_view_web_inspector_view_set()
2667  */
2668 EAPI void ewk_view_web_inspector_show(const Evas_Object *o);
2669
2670 /**
2671  * Close the web inspector view
2672  *
2673  * @param o The view to close the web inspector.
2674  *
2675  * @see ewk_view_web_inspector_show()
2676  * @see ewk_view_web_inspector_view_get()
2677  */
2678 EAPI void ewk_view_web_inspector_close(const Evas_Object *o);
2679
2680 /**
2681  * Get the view of web inspector.
2682  *
2683  * @param o The view that is inspected.
2684  *
2685  * @return view object on success or @c NULL on failure
2686  */
2687 EAPI Evas_Object* ewk_view_web_inspector_view_get(const Evas_Object *o);
2688
2689 /**
2690  * Set the view of web inspector.
2691  *
2692  * @param o The view that is inspected.
2693  * @param inspector_view The view of web inspector.
2694  */
2695 EAPI void ewk_view_web_inspector_view_set(Evas_Object *o, Evas_Object *inspector_view);
2696
2697 #ifdef __cplusplus
2698 }
2699 #endif
2700 #endif // ewk_view_h