Data Structures | Typedefs | Enumerations | Functions
Web

Data Structures

struct  _Elm_Web_Frame_Load_Error
 Structure used to report load errors. More...
 
struct  _Elm_Web_Menu_Item
 Structure describing the items in a menu. More...
 
struct  _Elm_Web_Menu
 Structure describing the menu of a popup. More...
 

Typedefs

typedef struct _Elm_Web_Frame_Load_Error Elm_Web_Frame_Load_Error
 Structure used to report load errors. More...
 
typedef struct _Elm_Web_Menu_Item Elm_Web_Menu_Item
 Structure describing the items in a menu.
 
typedef struct _Elm_Web_Menu Elm_Web_Menu
 Structure describing the menu of a popup. More...
 
typedef struct _Elm_Web_Window_Features Elm_Web_Window_Features
 Opaque handler containing the features (such as statusbar, menubar, etc) that are to be set on a newly requested window.
 
typedef Evas_Object *(* Elm_Web_Window_Open) (void *data, Evas_Object *obj, Eina_Bool js, const Elm_Web_Window_Features *window_features)
 Callback type for the create_window hook. More...
 
typedef Evas_Object *(* Elm_Web_Dialog_Alert) (void *data, Evas_Object *obj, const char *message)
 Callback type for the JS alert hook. More...
 
typedef Evas_Object *(* Elm_Web_Dialog_Confirm) (void *data, Evas_Object *obj, const char *message, Eina_Bool *ret)
 Callback type for the JS confirm hook. More...
 
typedef Evas_Object *(* Elm_Web_Dialog_Prompt) (void *data, Evas_Object *obj, const char *message, const char *def_value, const char **value, Eina_Bool *ret)
 Callback type for the JS prompt hook. More...
 
typedef Evas_Object *(* Elm_Web_Dialog_File_Selector) (void *data, Evas_Object *obj, Eina_Bool allows_multiple, Eina_List *accept_types, Eina_List **selected, Eina_Bool *ret)
 Callback type for the JS file selector hook. More...
 
typedef void(* Elm_Web_Console_Message) (void *data, Evas_Object *obj, const char *message, unsigned int line_number, const char *source_id)
 Callback type for the JS console message hook. More...
 

Enumerations

Functions

Eina_Bool elm_need_web (void)
 Request that your elementary application needs web support. More...
 
Eina_Bool elm_web_window_features_property_get (const Elm_Web_Window_Features *wf, Elm_Web_Window_Feature_Flag flag)
 Get boolean properties from Elm_Web_Window_Features (such as statusbar, menubar, etc) that are on a window. More...
 
void elm_web_window_features_region_get (const Elm_Web_Window_Features *wf, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
 TODO : Add documentation. More...
 
Evas_Object * elm_web_add (Evas_Object *parent)
 Add a new web object to the parent. More...
 
EINA_DEPRECATED Eina_Bool elm_web_uri_set (Evas_Object *obj, const char *uri)
 Sets the URI for the web object. More...
 
EINA_DEPRECATED const char * elm_web_uri_get (const Evas_Object *obj)
 Get the current URI for the object. More...
 

Detailed Description

web_inheritance_tree.png
preview-00.png

A web widget is used for displaying web pages (HTML/CSS/JS) using WebKit-EFL. You must have compiled Elementary with ewebkit support.

Signals that you can add callbacks for are:

available styles:

An example of use of web:

Typedef Documentation

typedef void(* Elm_Web_Console_Message) (void *data, Evas_Object *obj, const char *message, unsigned int line_number, const char *source_id)

Callback type for the JS console message hook.

When a console message is added from JavaScript, any set function to the console message hook will be called for the user to handle. There is no default implementation of this hook.

Parameters
dataUser data pointer set when setting the hook function.
objThe elm_web object that originated the message.
messageThe message sent.
line_numberThe line number.
source_idSource id.
See also
elm_web_console_message_hook_set()
typedef Evas_Object*(* Elm_Web_Dialog_Alert) (void *data, Evas_Object *obj, const char *message)

Callback type for the JS alert hook.

Parameters
dataUser data pointer set when setting the hook function.
objThe elm_web object requesting the new window.
messageThe message to show in the alert dialog.
Returns
The object representing the alert dialog. Elm_Web will run a second main loop to handle the dialog and normal flow of the application will be restored when the object is deleted, so the user should handle the popup properly in order to delete the object when the action is finished. If the function returns NULL the popup will be ignored.
See also
elm_web_dialog_alert_hook_set()
typedef Evas_Object*(* Elm_Web_Dialog_Confirm) (void *data, Evas_Object *obj, const char *message, Eina_Bool *ret)

Callback type for the JS confirm hook.

Parameters
dataUser data pointer set when setting the hook function.
objThe elm_web object requesting the new window.
messageThe message to show in the confirm dialog.
retPointer to store the user selection. EINA_TRUE if the user selected Ok, EINA_FALSE otherwise.
Returns
The object representing the confirm dialog. Elm_Web will run a second main loop to handle the dialog and normal flow of the application will be restored when the object is deleted, so the user should handle the popup properly in order to delete the object when the action is finished. If the function returns NULL the popup will be ignored.
See also
elm_web_dialog_confirm_hook_set()
typedef Evas_Object*(* Elm_Web_Dialog_File_Selector) (void *data, Evas_Object *obj, Eina_Bool allows_multiple, Eina_List *accept_types, Eina_List **selected, Eina_Bool *ret)

Callback type for the JS file selector hook.

Parameters
dataUser data pointer set when setting the hook function.
objThe elm_web object requesting the new window.
allows_multipleEINA_TRUE if multiple files can be selected.
accept_typesMime types accepted.
selectedPointer to store the list of malloc'ed strings containing the path to each file selected. Must be NULL if the file dialog is canceled.
retPointer to store the user selection. EINA_TRUE if the user selected Ok, EINA_FALSE otherwise.
Returns
The object representing the file selector dialog. Elm_Web will run a second main loop to handle the dialog and normal flow of the application will be restored when the object is deleted, so the user should handle the popup properly in order to delete the object when the action is finished. If the function returns NULL the popup will be ignored.
See also
elm_web_dialog_file selector_hook_set()
typedef Evas_Object*(* Elm_Web_Dialog_Prompt) (void *data, Evas_Object *obj, const char *message, const char *def_value, const char **value, Eina_Bool *ret)

Callback type for the JS prompt hook.

Parameters
dataUser data pointer set when setting the hook function.
objThe elm_web object requesting the new window.
messageThe message to show in the prompt dialog.
def_valueThe default value to present the user in the entry
valuePointer to store the value given by the user. Must be a malloc'ed string or NULL if the user canceled the popup.
retPointer to store the user selection. EINA_TRUE if the user selected Ok, EINA_FALSE otherwise.
Returns
The object representing the prompt dialog. Elm_Web will run a second main loop to handle the dialog and normal flow of the application will be restored when the object is deleted, so the user should handle the popup properly in order to delete the object when the action is finished. If the function returns NULL the popup will be ignored.
See also
elm_web_dialog_prompt_hook_set()

Structure used to report load errors.

Load errors are reported as signal by elm_web. All the strings are temporary references and should not be used after the signal callback returns. If it's required, make copies with strdup() or eina_stringshare_add() (they are not even guaranteed to be stringshared, so must use eina_stringshare_add() and not eina_stringshare_ref()).

typedef struct _Elm_Web_Menu Elm_Web_Menu

Structure describing the menu of a popup.

This structure will be passed as the event_info for the "popup,create" signal, which is emitted when a dropdown menu is opened. Users wanting to handle these popups by themselves should listen to this signal and set the handled property of the struct to EINA_TRUE. Leaving this property as EINA_FALSE means that the user will not handle the popup and the default implementation will be used.

When the popup is ready to be dismissed, a "popup,willdelete" signal will be emitted to notify the user that it can destroy any objects and free all data related to it.

See also
elm_web_popup_selected_set()
elm_web_popup_destroy()
typedef Evas_Object*(* Elm_Web_Window_Open) (void *data, Evas_Object *obj, Eina_Bool js, const Elm_Web_Window_Features *window_features)

Callback type for the create_window hook.

Parameters
dataUser data pointer set when setting the hook function.
objThe elm_web object requesting the new window.
jsSet to EINA_TRUE if the request was originated from JavaScript. EINA_FALSE otherwise.
window_featuresA pointer of Elm_Web_Window_Features indicating the features requested for the new window.
Returns
The elm_web widget where the request will be loaded. That is, if a new window or tab is created, the elm_web widget in it should be returned, and NOT the window object. Returning NULL should cancel the request.
See also
elm_web_window_create_hook_set()

Enumeration Type Documentation

Types of zoom available.

Enumerator
ELM_WEB_ZOOM_MODE_MANUAL 

Zoom controlled normally by elm_web_zoom_set.

ELM_WEB_ZOOM_MODE_AUTO_FIT 

Zoom until content fits in web object.

ELM_WEB_ZOOM_MODE_AUTO_FILL 

Zoom until content fills web object.

ELM_WEB_ZOOM_MODE_LAST 

Sentinel value to indicate end.

Function Documentation

Eina_Bool elm_need_web ( void  )

Request that your elementary application needs web support.

This initializes the Ewebkit library when called and if support exists it returns EINA_TRUE, otherwise returns EINA_FALSE. This must be called before any other function that deals with elm_web objects or ewk_view instances.

Examples:
web_example_02.c.

References elm_label_add(), and elm_object_focus_get().

Evas_Object* elm_web_add ( Evas_Object *  parent)

Add a new web object to the parent.

Parameters
parentThe parent object.
Returns
The new object or NULL if it cannot be created.
See also
elm_web_url_set()
elm_web_webkit_view_get()
EINA_DEPRECATED const char* elm_web_uri_get ( const Evas_Object *  obj)

Get the current URI for the object.

The returned string must not be freed and is guaranteed to be stringshared.

Parameters
objThe web object
Returns
A stringshared internal string with the current URI, or NULL on failure
Deprecated:
Use elm_web_url_get() instead
See also
elm_web_url_get()

References ELM_WEB_ZOOM_MODE_LAST.

EINA_DEPRECATED Eina_Bool elm_web_uri_set ( Evas_Object *  obj,
const char *  uri 
)

Sets the URI for the web object.

It must be a full URI, with resource included, in the form http://www.enlightenment.org or file:///tmp/something.html

Parameters
objThe web object
uriThe URI to set
Returns
EINA_TRUE if the URI could be set, EINA_FALSE if an error occurred.
Deprecated:
Use elm_web_url_set() instead
See also
elm_web_url_set()
Eina_Bool elm_web_window_features_property_get ( const Elm_Web_Window_Features wf,
Elm_Web_Window_Feature_Flag  flag 
)

Get boolean properties from Elm_Web_Window_Features (such as statusbar, menubar, etc) that are on a window.

Parameters
wfThe web window features object
flagThe web window feature flag whose value is required.
Returns
EINA_TRUE if the flag is set, EINA_FALSE otherwise
void elm_web_window_features_region_get ( const Elm_Web_Window_Features wf,
Evas_Coord *  x,
Evas_Coord *  y,
Evas_Coord *  w,
Evas_Coord *  h 
)

TODO : Add documentation.

Parameters
wfThe web window features object
x,y,w,h- the co-ordinates of the web view window.