ewebkit2  1.11.0
Web engine based on WebKit2 for EFL
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Typedefs | Enumerations | Functions
ewk_view.h File Reference

WebKit main smart object. More...

#include "ewk_back_forward_list.h"
#include "ewk_color_picker.h"
#include "ewk_context.h"
#include "ewk_context_menu.h"
#include "ewk_download_job.h"
#include "ewk_error.h"
#include "ewk_page_group.h"
#include "ewk_popup_menu.h"
#include "ewk_security_origin.h"
#include "ewk_touch.h"
#include "ewk_url_request.h"
#include "ewk_url_response.h"
#include "ewk_window_features.h"
#include <Evas.h>

Go to the source code of this file.

Classes

struct  Ewk_View_Smart_Class
 Ewk view's class, to be overridden by sub-classes. More...
 
struct  Ewk_View_Smart_Data
 Contains an internal View data. More...
 
struct  Ewk_Download_Job_Error
 Structure containing details about a download failure. More...
 
struct  Ewk_CSS_Size
 Structure representing size. More...
 

Macros

#define EWK_VIEW_SMART_CLASS_VERSION   8UL
 
#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}
 
#define EWK_VIEW_SMART_CLASS_INIT_NULL   EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
 
#define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name)   EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
 

Typedefs

typedef struct Ewk_View_Smart_Data Ewk_View_Smart_Data
 
typedef struct Ewk_View_Smart_Class Ewk_View_Smart_Class
 
typedef struct EwkView EwkView
 
typedef struct
Ewk_Download_Job_Error 
Ewk_Download_Job_Error
 Creates a type name for Ewk_Download_Job_Error.
 
typedef struct Ewk_CSS_Size Ewk_CSS_Size
 Creates a type name for Ewk_CSS_Size.
 
typedef enum Ewk_Find_Options Ewk_Find_Options
 
typedef enum Ewk_Focus_Direction Ewk_Focus_Direction
 
typedef void(* Ewk_View_Script_Execute_Cb )(Evas_Object *o, const char *return_value, void *user_data)
 Callback type for use with ewk_view_script_execute()
 
typedef void(* Ewk_Page_Contents_Cb )(Ewk_Page_Contents_Type type, const char *data, void *user_data)
 

Enumerations

enum  Ewk_Text_Direction { EWK_TEXT_DIRECTION_RIGHT_TO_LEFT, EWK_TEXT_DIRECTION_LEFT_TO_RIGHT }
 Enum values containing text directionality values.
 
enum  Ewk_Page_Contents_Type { EWK_PAGE_CONTENTS_TYPE_MHTML, EWK_PAGE_CONTENTS_TYPE_STRING }
 Enum values containing page contents type values.
 
enum  Ewk_Find_Options {
  EWK_FIND_OPTIONS_NONE, EWK_FIND_OPTIONS_CASE_INSENSITIVE = 1 << 0, EWK_FIND_OPTIONS_AT_WORD_STARTS = 1 << 1, EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START = 1 << 2,
  EWK_FIND_OPTIONS_BACKWARDS = 1 << 3, EWK_FIND_OPTIONS_WRAP_AROUND = 1 << 4, EWK_FIND_OPTIONS_SHOW_OVERLAY = 1 << 5, EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR = 1 << 6,
  EWK_FIND_OPTIONS_SHOW_HIGHLIGHT = 1 << 7
}
 Provides option to find text. More...
 
enum  Ewk_Pagination_Mode {
  EWK_PAGINATION_MODE_INVALID = -1, EWK_PAGINATION_MODE_UNPAGINATED, EWK_PAGINATION_MODE_LEFT_TO_RIGHT, EWK_PAGINATION_MODE_RIGHT_TO_LEFT,
  EWK_PAGINATION_MODE_TOP_TO_BOTTOM, EWK_PAGINATION_MODE_BOTTOM_TO_TOP
}
 
enum  Ewk_Focus_Direction { EWK_FOCUS_DIRECTION_FORWARD = 0, EWK_FOCUS_DIRECTION_BACKWARD }
 

Functions

EAPI Eina_Bool ewk_view_smart_class_set (Ewk_View_Smart_Class *api)
 
EAPI Evas_Object * ewk_view_smart_add (Evas *e, Evas_Smart *smart, Ewk_Context *context, Ewk_Page_Group *pageGroup)
 
EAPI Evas_Object * ewk_view_add (Evas *e)
 
EAPI Evas_Object * ewk_view_add_with_context (Evas *e, Ewk_Context *context)
 
EAPI Ewk_Contextewk_view_context_get (const Evas_Object *o)
 
EAPI Ewk_Page_Groupewk_view_page_group_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_url_set (Evas_Object *o, const char *url)
 
EAPI const char * ewk_view_url_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_reload (Evas_Object *o)
 
EAPI Eina_Bool ewk_view_reload_bypass_cache (Evas_Object *o)
 
EAPI Eina_Bool ewk_view_stop (Evas_Object *o)
 
EAPI Eina_Bool ewk_view_back (Evas_Object *o)
 
EAPI Eina_Bool ewk_view_forward (Evas_Object *o)
 
EAPI Eina_Bool ewk_view_back_possible (Evas_Object *o)
 
EAPI Eina_Bool ewk_view_forward_possible (Evas_Object *o)
 
EAPI Ewk_Back_Forward_Listewk_view_back_forward_list_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_navigate_to (Evas_Object *o, const Ewk_Back_Forward_List_Item *item)
 
EAPI const char * ewk_view_title_get (const Evas_Object *o)
 
EAPI double ewk_view_load_progress_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_html_string_load (Evas_Object *o, const char *html, const char *baseUrl, const char *unreachableUrl)
 
EAPI Eina_Bool ewk_view_scale_set (Evas_Object *o, double scale_factor, int cx, int cy)
 
EAPI double ewk_view_scale_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_page_zoom_set (Evas_Object *o, double zoom_factor)
 
EAPI double ewk_view_page_zoom_get (const Evas_Object *o)
 
EAPI float ewk_view_device_pixel_ratio_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_device_pixel_ratio_set (Evas_Object *o, float ratio)
 
EAPI void ewk_view_theme_set (Evas_Object *o, const char *path)
 
EAPI const char * ewk_view_theme_get (const Evas_Object *o)
 
EAPI const char * ewk_view_custom_encoding_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_custom_encoding_set (Evas_Object *o, const char *encoding)
 
EAPI const char * ewk_view_user_agent_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_user_agent_set (Evas_Object *o, const char *user_agent)
 
EAPI Eina_Bool ewk_view_text_find (Evas_Object *o, const char *text, Ewk_Find_Options options, unsigned max_match_count)
 
EAPI Eina_Bool ewk_view_text_find_highlight_clear (Evas_Object *o)
 
EAPI Eina_Bool ewk_view_text_matches_count (Evas_Object *o, const char *text, Ewk_Find_Options options, unsigned max_match_count)
 
EAPI Eina_Bool ewk_view_mouse_events_enabled_set (Evas_Object *o, Eina_Bool enabled)
 
EAPI Eina_Bool ewk_view_mouse_events_enabled_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_feed_touch_event (Evas_Object *o, Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers)
 
EAPI Eina_Bool ewk_view_touch_events_enabled_set (Evas_Object *o, Eina_Bool enabled)
 
EAPI Eina_Bool ewk_view_touch_events_enabled_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_inspector_show (Evas_Object *o)
 
EAPI Eina_Bool ewk_view_inspector_close (Evas_Object *o)
 
EAPI Eina_Bool ewk_view_pagination_mode_set (Evas_Object *o, Ewk_Pagination_Mode mode)
 
EAPI Ewk_Pagination_Mode ewk_view_pagination_mode_get (const Evas_Object *o)
 
EAPI Eina_Bool ewk_view_fullscreen_exit (Evas_Object *o)
 
EAPI Eina_Bool ewk_view_page_contents_get (const Evas_Object *o, Ewk_Page_Contents_Type type, Ewk_Page_Contents_Cb callback, void *user_data)
 
EAPI Eina_Bool ewk_view_script_execute (Evas_Object *o, const char *script, Ewk_View_Script_Execute_Cb callback, void *user_data)
 
EAPI Eina_Bool ewk_view_layout_fixed_set (Evas_Object *o, Eina_Bool enabled)
 
EAPI Eina_Bool ewk_view_layout_fixed_get (const Evas_Object *o)
 
EAPI void ewk_view_layout_fixed_size_set (const Evas_Object *o, Evas_Coord width, Evas_Coord height)
 
EAPI void ewk_view_layout_fixed_size_get (const Evas_Object *o, Evas_Coord *width, Evas_Coord *height)
 
EAPI void ewk_view_bg_color_set (Evas_Object *o, int r, int g, int b, int a)
 
EAPI void ewk_view_bg_color_get (const Evas_Object *o, int *r, int *g, int *b, int *a)
 
EAPI Eina_Bool ewk_view_contents_size_get (const Evas_Object *o, Evas_Coord *width, Evas_Coord *height)
 

Detailed Description

WebKit main smart object.

This object provides view related APIs of WebKit2 to EFL object.

The following signals (see evas_object_smart_callback_add()) are emitted:

Macro Definition Documentation

#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}

Initializer for whole Ewk_View_Smart_Class structure.

Parameters
smart_class_initinitializer to use for the "base" field (Evas_Smart_Class).
See Also
EWK_VIEW_SMART_CLASS_INIT_NULL
EWK_VIEW_SMART_CLASS_INIT_VERSION
EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
#define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION (   name)    EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))

Initializer to zero a whole Ewk_View_Smart_Class structure and set name and version.

Similar to EWK_VIEW_SMART_CLASS_INIT_NULL, but will set version field of Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION and name to the specific value.

It will keep a reference to name field as a "const char *", that is, name must be available while the structure is used (hint: static or global!) and will not be modified.

See Also
EWK_VIEW_SMART_CLASS_INIT_NULL
EWK_VIEW_SMART_CLASS_INIT_VERSION
EWK_VIEW_SMART_CLASS_INIT
#define EWK_VIEW_SMART_CLASS_INIT_NULL   EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)

Initializer to zero a whole Ewk_View_Smart_Class structure.

See Also
EWK_VIEW_SMART_CLASS_INIT_VERSION
EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
EWK_VIEW_SMART_CLASS_INIT
#define EWK_VIEW_SMART_CLASS_VERSION   8UL

The version you have to put into the version field in the Ewk_View_Smart_Class structure.

Typedef Documentation

Enum values used to set focus direction.

typedef void(* Ewk_Page_Contents_Cb)(Ewk_Page_Contents_Type type, const char *data, void *user_data)

Creates a type name for the callback function used to get the page contents.

Parameters
typetype of the contents
datastring buffer of the contents
user_datauser data will be passed when ewk_view_page_contents_get is called

Enumeration Type Documentation

Provides option to find text.

Enum values used to specify search options.

Enumerator
EWK_FIND_OPTIONS_NONE 

no search flags, this means a case sensitive, no wrap, forward only search.

EWK_FIND_OPTIONS_CASE_INSENSITIVE 

case insensitive search.

EWK_FIND_OPTIONS_AT_WORD_STARTS 

search text only at the beginning of the words.

EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START 

treat capital letters in the middle of words as word start.

EWK_FIND_OPTIONS_BACKWARDS 

search backwards.

EWK_FIND_OPTIONS_WRAP_AROUND 

if not present search will stop at the end of the document.

EWK_FIND_OPTIONS_SHOW_OVERLAY 

show overlay

EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR 

show indicator

EWK_FIND_OPTIONS_SHOW_HIGHLIGHT 

show highlight

Enum values used to set focus direction.

Enum values used to set pagination mode.

Enumerator
EWK_PAGINATION_MODE_INVALID 

invalid pagination mode that will be returned when error occured.

EWK_PAGINATION_MODE_UNPAGINATED 

default mode for pagination. not paginated

EWK_PAGINATION_MODE_LEFT_TO_RIGHT 

go to the next page with scrolling left to right horizontally.

EWK_PAGINATION_MODE_RIGHT_TO_LEFT 

go to the next page with scrolling right to left horizontally.

EWK_PAGINATION_MODE_TOP_TO_BOTTOM 

go to the next page with scrolling top to bottom vertically.

EWK_PAGINATION_MODE_BOTTOM_TO_TOP 

go to the next page with scrolling bottom to top vertically.

Function Documentation

EAPI Evas_Object* ewk_view_add ( Evas *  e)

Creates a new EFL WebKit view object.

Parameters
ecanvas object where to create the view object
Returns
view object on success or NULL on failure
EAPI Evas_Object* ewk_view_add_with_context ( Evas *  e,
Ewk_Context context 
)

Creates a new EFL WebKit view object based on specific Ewk_Context.

Parameters
ecanvas object where to create the view object
contextEwk_Context object to declare process model
Returns
view object on success or NULL on failure
EAPI Eina_Bool ewk_view_back ( Evas_Object *  o)

Asks the main frame to navigate back in the history.

Parameters
oview object to navigate back
Returns
EINA_TRUE on success or EINA_FALSE otherwise
See Also
ewk_frame_back()
EAPI Ewk_Back_Forward_List* ewk_view_back_forward_list_get ( const Evas_Object *  o)

Gets the back-forward list associated with this view.

The returned instance is unique for this view and thus multiple calls to this function with the same view as parameter returns the same handle. This handle is alive while view is alive, thus one might want to listen for EVAS_CALLBACK_DEL on given view (o) to know when to stop using returned handle.

Parameters
oview object to get navigation back-forward list
Returns
the back-forward list instance handle associated with this view
EAPI Eina_Bool ewk_view_back_possible ( Evas_Object *  o)

Queries if it is possible to navigate backwards one item in the history.

Parameters
oview object to query if backward navigation is possible
Returns
EINA_TRUE if it is possible to navigate backwards in the history, EINA_FALSE otherwise
EAPI void ewk_view_bg_color_get ( const Evas_Object *  o,
int *  r,
int *  g,
int *  b,
int *  a 
)

Gets the background color of the view.

Parameters
oview object to get the background color
rthe pointer to store red color component
gthe pointer to store green color component
bthe pointer to store blue color component
athe pointer to store alpha value
EAPI void ewk_view_bg_color_set ( Evas_Object *  o,
int  r,
int  g,
int  b,
int  a 
)

Sets the background color and transparency of the view.

Parameters
oview object to change the background color
rred color component
ggreen color component
bblue color component
atransparency
EAPI Eina_Bool ewk_view_contents_size_get ( const Evas_Object *  o,
Evas_Coord *  width,
Evas_Coord *  height 
)

Get contents size of current web page.

If it fails to get the content size, the width and height will be set to 0.

Parameters
oview object to get contents size
widthpointer to an integer in which to store the width of contents.
heightpointer to an integer in which to store the height of contents.
Returns
EINA_TRUE on success or EINA_FALSE otherwise
EAPI Ewk_Context* ewk_view_context_get ( const Evas_Object *  o)

Gets the Ewk_Context of this view.

Parameters
othe view object to get the Ewk_Context
Returns
the Ewk_Context of this view or NULL on failure
EAPI const char* ewk_view_custom_encoding_get ( const Evas_Object *  o)

Gets the current custom character encoding name.

Parameters
oview object to get the current encoding
Returns
eina_stringshare containing the current encoding, or NULL if it's not set
EAPI Eina_Bool ewk_view_custom_encoding_set ( Evas_Object *  o,
const char *  encoding 
)

Sets the custom character encoding and reloads the page.

Parameters
oview to set the encoding
encodingthe new encoding to set or NULL to restore the default one
Returns
EINA_TRUE on success EINA_FALSE otherwise
EAPI float ewk_view_device_pixel_ratio_get ( const Evas_Object *  o)

Queries the ratio between the CSS units and device pixels when the content is unscaled.

When designing touch-friendly contents, knowing the approximated target size on a device is important for contents providers in order to get the intented layout and element sizes.

As most first generation touch devices had a PPI of approximately 160, this became a de-facto value, when used in conjunction with the viewport meta tag.

Devices with a higher PPI learning towards 240 or 320, applies a pre-scaling on all content, of either 1.5 or 2.0, not affecting the CSS scale or pinch zooming.

This value can be set using this property and it is exposed to CSS media queries using the -webkit-device-pixel-ratio query.

For instance, if you want to load an image without having it upscaled on a web view using a device pixel ratio of 2.0 it can be done by loading an image of say 100x100 pixels but showing it at half the size.

@media (-webkit-min-device-pixel-ratio: 1.5) {
.icon {
width: 50px;
height: 50px;
url: "/images/icon@2x.png"; // This is actually a 100x100 image
}
}

If the above is used on a device with device pixel ratio of 1.5, it will be scaled down but still provide a better looking image.

Parameters
oview object to get device pixel ratio
Returns
the ratio between the CSS units and device pixels, or -1.0 on failure
EAPI Eina_Bool ewk_view_device_pixel_ratio_set ( Evas_Object *  o,
float  ratio 
)

Sets the ratio between the CSS units and device pixels when the content is unscaled.

Parameters
oview object to set device pixel ratio
Returns
EINA_TRUE if the device pixel ratio was set, EINA_FALSE otherwise
See Also
ewk_view_device_pixel_ratio_get()
EAPI Eina_Bool ewk_view_feed_touch_event ( Evas_Object *  o,
Ewk_Touch_Event_Type  type,
const Eina_List *  points,
const Evas_Modifier *  modifiers 
)

Feeds the touch event to the view.

Parameters
oview object to feed touch event
typethe type of touch event
pointsa list of points (Ewk_Touch_Point) to process
modifiersan Evas_Modifier handle to the list of modifier keys registered in the Evas. Users can get the Evas_Modifier from the Evas using evas_key_modifier_get() and can set each modifier key using evas_key_modifier_on() and evas_key_modifier_off()
Returns
EINA_TRUE on success or EINA_FALSE on failure
EAPI Eina_Bool ewk_view_forward ( Evas_Object *  o)

Asks the main frame to navigate forward in the history.

Parameters
oview object to navigate forward
Returns
EINA_TRUE on success or EINA_FALSE otherwise
See Also
ewk_frame_forward()
EAPI Eina_Bool ewk_view_forward_possible ( Evas_Object *  o)

Queries if it is possible to navigate forwards one item in the history.

Parameters
oview object to query if forward navigation is possible
Returns
EINA_TRUE if it is possible to navigate forwards in the history, EINA_FALSE otherwise
EAPI Eina_Bool ewk_view_fullscreen_exit ( Evas_Object *  o)

Exit fullscreen mode.

Parameters
oview object where to exit fullscreen
Returns
EINA_TRUE if successful, EINA_FALSE otherwise
EAPI Eina_Bool ewk_view_html_string_load ( Evas_Object *  o,
const char *  html,
const char *  baseUrl,
const char *  unreachableUrl 
)

Loads the specified html string as the content of the view.

External objects such as stylesheets or images referenced in the HTML document are located relative to baseUrl.

If an unreachableUrl is passed it is used as the url for the loaded content. This is typically used to display error pages for a failed load.

Parameters
oview object to load the HTML into
htmlHTML data to load
baseUrlBase URL used for relative paths to external objects (optional)
unreachableUrlURL that could not be reached (optional)
Returns
EINA_TRUE if it the HTML was successfully loaded, EINA_FALSE otherwise
EAPI Eina_Bool ewk_view_inspector_close ( Evas_Object *  o)

Close the inspector

Parameters
oThe view to close the inspector.
Returns
EINA_TRUE on success or EINA_FALSE on failure
EAPI Eina_Bool ewk_view_inspector_show ( Evas_Object *  o)

Show the inspector to debug a web page.

Parameters
oThe view to show the inspector.
Returns
EINA_TRUE on success or EINA_FALSE on failure
See Also
ewk_settings_developer_extras_enabled_set()
EAPI Eina_Bool ewk_view_layout_fixed_get ( const Evas_Object *  o)

Queries if the webview is using fixed layout.

Parameters
oview object to query the status
Returns
EINA_TRUE if the webview is using fixed layout, or EINA_FALSE otherwise
EAPI Eina_Bool ewk_view_layout_fixed_set ( Evas_Object *  o,
Eina_Bool  enabled 
)

Sets whether the ewk_view use fixed layout or not.

The webview will use fixed layout if EINA_TRUE or not use it otherwise. The default value is EINA_FALSE.

Parameters
oview object to set fixed layout
enableda state to set
Returns
EINA_TRUE on success, or EINA_FALSE on failure
EAPI void ewk_view_layout_fixed_size_get ( const Evas_Object *  o,
Evas_Coord *  width,
Evas_Coord *  height 
)

Gets the fixed layout size of current web page.

Parameters
oview object to query the size
widthpointer to an integer value in which to get the width of fixed layout
heightpointer to an integer value in which to get the height of fixed layout
EAPI void ewk_view_layout_fixed_size_set ( const Evas_Object *  o,
Evas_Coord  width,
Evas_Coord  height 
)

Sets size of fixed layout to web page.

The webview size will be set with given size.

Parameters
oview object to set fixed layout
widthan integer value in which to set width of fixed layout
heightan integer value in which to set height of fixed layout
EAPI double ewk_view_load_progress_get ( const Evas_Object *  o)

Gets the current load progress of page.

The progress estimation from 0.0 to 1.0.

Parameters
oview object to get the current progress
Returns
the load progress of page, value from 0.0 to 1.0, or -1.0 on failure
EAPI Eina_Bool ewk_view_mouse_events_enabled_get ( const Evas_Object *  o)

Queries if the ewk_view supports the mouse events.

Parameters
oview object to query if the mouse events are enabled
Returns
EINA_TRUE if the mouse events are enabled or EINA_FALSE otherwise
EAPI Eina_Bool ewk_view_mouse_events_enabled_set ( Evas_Object *  o,
Eina_Bool  enabled 
)

Sets whether the ewk_view supports the mouse events or not.

The ewk_view will support the mouse events if EINA_TRUE or not support the mouse events otherwise. The default value is EINA_TRUE.

Parameters
oview object to enable/disable the mouse events
enableda state to set
Returns
EINA_TRUE on success or EINA_FALSE on failure
EAPI Eina_Bool ewk_view_navigate_to ( Evas_Object *  o,
const Ewk_Back_Forward_List_Item item 
)

Navigates to specified back-forward list item.

Parameters
oview object to navigate in the history
itemthe back-forward list item
Returns
EINA_TRUE on success or EINA_FALSE otherwise
EAPI Eina_Bool ewk_view_page_contents_get ( const Evas_Object *  o,
Ewk_Page_Contents_Type  type,
Ewk_Page_Contents_Cb  callback,
void *  user_data 
)

Get contents of the current web page.

Parameters
oview object to get the page contents
typetype of the page contents
callbackcallback function to be called when the operation is finished
user_datauser data to be passed to the callback function
Returns
EINA_TRUE on success or EINA_FALSE otherwise
EAPI Ewk_Page_Group* ewk_view_page_group_get ( const Evas_Object *  o)

Gets the Ewk_Page_Group of this view.

Parameters
othe view object to get the Ewk_Page_Group
Returns
the Ewk_Page_Group of this view or NULL on failure
EAPI double ewk_view_page_zoom_get ( const Evas_Object *  o)

Queries the current zoom factor of the page.

It returns previous zoom factor after ewk_view_page_zoom_factor_set is called immediately until zoom factor of page is really changed.

Parameters
oview object to get the zoom factor
Returns
current zoom factor in use on success or -1.0 on failure
EAPI Eina_Bool ewk_view_page_zoom_set ( Evas_Object *  o,
double  zoom_factor 
)

Sets zoom of the current page.

Parameters
oview object to set the zoom level
zoom_factora new level to set
Returns
EINA_TRUE on success or EINA_FALSE otherwise
EAPI Ewk_Pagination_Mode ewk_view_pagination_mode_get ( const Evas_Object *  o)

Get pagination mode of the current web page.

The default value is EWK_PAGINATION_MODE_UNPAGINATED. When error occured, EWK_PAGINATION_MODE_INVALID is returned.

Parameters
oview object to get the pagination mode
Returns
The pagination mode of the current web page
EAPI Eina_Bool ewk_view_pagination_mode_set ( Evas_Object *  o,
Ewk_Pagination_Mode  mode 
)

Set pagination mode to the current web page.

Parameters
oview object to set the pagenation mode
modeThe Ewk_Pagination_Mode to set
Returns
EINA_TRUE on success or EINA_FALSE on failure
EAPI Eina_Bool ewk_view_reload ( Evas_Object *  o)

Asks the main frame to reload the current document.

Parameters
oview object to reload current document
Returns
EINA_TRUE on success or EINA_FALSE otherwise
See Also
ewk_view_reload_bypass_cache()
EAPI Eina_Bool ewk_view_reload_bypass_cache ( Evas_Object *  o)

Reloads the current page's document without cache.

Parameters
oview object to reload current document
Returns
EINA_TRUE on success or EINA_FALSE otherwise
EAPI double ewk_view_scale_get ( const Evas_Object *  o)

Queries the current scale factor of the page.

It returns previous scale factor after ewk_view_scale_set is called immediately until scale factor of page is really changed.

Parameters
oview object to get the scale factor
Returns
current scale factor in use on success or -1.0 on failure
EAPI Eina_Bool ewk_view_scale_set ( Evas_Object *  o,
double  scale_factor,
int  cx,
int  cy 
)

Scales the current page, centered at the given point.

Parameters
oview object to set the zoom level
scale_factora new level to set
cxx of center coordinate
cyy of center coordinate
Returns
EINA_TRUE on success or EINA_FALSE otherwise
EAPI Eina_Bool ewk_view_script_execute ( Evas_Object *  o,
const char *  script,
Ewk_View_Script_Execute_Cb  callback,
void *  user_data 
)

Requests execution of the given script.

The result value for the execution can be retrieved from the asynchronous callback.

Parameters
oThe view to execute script
scriptJavaScript to execute
callbackThe function to call when the execution is completed, may be NULL
user_dataUser data, may be NULL
Returns
EINA_TRUE on success or EINA_FALSE on failure
EAPI Evas_Object* ewk_view_smart_add ( Evas *  e,
Evas_Smart *  smart,
Ewk_Context context,
Ewk_Page_Group pageGroup 
)

Creates a new EFL WebKit view object with Evas_Smart and Ewk_Context.

Note
The Evas_Object which inherits the ewk_view should create its Evas_Object using this API instead of evas_object_smart_add() because the default initialization for ewk_view is done in this API.
Parameters
ecanvas object where to create the view object
smartEvas_Smart object. Its type should be EWK_VIEW_TYPE_STR
contextEwk_Context object which is used for initializing
pageGroupEwk_Page_Group object which is used for initializing
Returns
view object on success or NULL on failure
EAPI Eina_Bool ewk_view_smart_class_set ( Ewk_View_Smart_Class api)

Sets the smart class APIs, enabling view to be inherited.

Parameters
apiclass definition to set, all members with the exception of Evas_Smart_Class->data may be overridden, must not be NULL
Note
Evas_Smart_Class->data is used to implement type checking and is not supposed to be changed/overridden. If you need extra data for your smart class to work, just extend Ewk_View_Smart_Class instead. The Evas_Object which inherits the ewk_view should use ewk_view_smart_add() to create Evas_Object instead of evas_object_smart_add() because it performs additional initialization for the ewk_view.
Returns
EINA_TRUE on success or EINA_FALSE on failure (probably version mismatch)
See Also
ewk_view_smart_add()
EAPI Eina_Bool ewk_view_stop ( Evas_Object *  o)

Asks the main frame to stop loading.

Parameters
oview object to stop loading
Returns
EINA_TRUE on success or EINA_FALSE otherwise.
EAPI Eina_Bool ewk_view_text_find ( Evas_Object *  o,
const char *  text,
Ewk_Find_Options  options,
unsigned  max_match_count 
)

Searches and hightlights the given string in the document.

Parameters
oview object to find text
texttext to find
optionsoptions to find
max_match_countmaximum match count to find, unlimited if 0
Returns
EINA_TRUE on success, EINA_FALSE on errors
EAPI Eina_Bool ewk_view_text_find_highlight_clear ( Evas_Object *  o)

Clears the highlight of searched text.

Parameters
oview object to find text
Returns
EINA_TRUE on success, EINA_FALSE on errors
EAPI Eina_Bool ewk_view_text_matches_count ( Evas_Object *  o,
const char *  text,
Ewk_Find_Options  options,
unsigned  max_match_count 
)

Counts the given string in the document.

This does not highlight the matched string and just count the matched string.

As the search is carried out through the whole document, only the following EWK_FIND_OPTIONS are valid.

  • EWK_FIND_OPTIONS_NONE
  • EWK_FIND_OPTIONS_CASE_INSENSITIVE
  • EWK_FIND_OPTIONS_AT_WORD_START
  • EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START

The "text,found" callback will be called with the number of matched string.

Parameters
oview object to find text
texttext to find
optionsoptions to find
max_match_countmaximum match count to find, unlimited if 0
Returns
EINA_TRUE on success, EINA_FALSE on errors
EAPI const char* ewk_view_theme_get ( const Evas_Object *  o)

Gets the theme set on this view.

This returns the value set by ewk_view_theme_set().

Parameters
oview object to get theme path
Returns
the theme path, may be NULL if not set
EAPI void ewk_view_theme_set ( Evas_Object *  o,
const char *  path 
)

Sets the theme path that will be used by this view.

This also sets the theme on the main frame. As frames inherit theme from their parent, this will have all frames with unset theme to use this one.

Parameters
oview object to change theme
paththeme path
EAPI const char* ewk_view_title_get ( const Evas_Object *  o)

Gets the current title of the main frame.

It returns an internal string and should not be modified. The string is guaranteed to be stringshared.

Parameters
oview object to get current title
Returns
current title on success or NULL on failure
EAPI Eina_Bool ewk_view_touch_events_enabled_get ( const Evas_Object *  o)

Queries if the ewk_view supports the touch events.

Parameters
oview object to query if the touch events are enabled
Returns
EINA_TRUE if the touch events are enabled or EINA_FALSE otherwise
EAPI Eina_Bool ewk_view_touch_events_enabled_set ( Evas_Object *  o,
Eina_Bool  enabled 
)

Sets whether the ewk_view supports the touch events or not.

The ewk_view will support the touch events if EINA_TRUE or not support the touch events otherwise. The default value is EINA_FALSE.

Parameters
oview object to enable/disable the touch events
enableda state to set
Returns
EINA_TRUE on success or EINA_FALSE on failure
EAPI const char* ewk_view_url_get ( const Evas_Object *  o)

Returns the current URL string of view object.

It returns an internal string and should not be modified. The string is guaranteed to be stringshared.

Parameters
oview object to get current URL
Returns
current URL on success or NULL on failure
EAPI Eina_Bool ewk_view_url_set ( Evas_Object *  o,
const char *  url 
)

Asks the object to load the given URL.

Parameters
oview object to load URL
urluniform resource identifier to load
Returns
EINA_TRUE is returned if o is valid, irrespective of load, or EINA_FALSE on failure
EAPI const char* ewk_view_user_agent_get ( const Evas_Object *  o)

Gets the current user agent string.

Parameters
oview object to get the current user agent
Returns
eina_stringshare containing the current user agent, or default user agent if it's not set
EAPI Eina_Bool ewk_view_user_agent_set ( Evas_Object *  o,
const char *  user_agent 
)

Sets the user agent string.

Parameters
oview to set the user agent
user_agentthe user agent string to set or NULL to restore the default one
Returns
EINA_TRUE on success EINA_FALSE otherwise