![]() |
![]() |
![]() |
WebKitClutter Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
enum WebKitLoadStatus; WebKitWebFrame; GType webkit_web_frame_get_type (void
); const gchar * webkit_web_frame_get_name (WebKitWebFrame *frame
); const gchar * webkit_web_frame_get_title (WebKitWebFrame *frame
); const gchar * webkit_web_frame_get_uri (WebKitWebFrame *frame
); WebKitWebPage * webkit_web_frame_get_page (WebKitWebFrame *Param1
); WebKitWebFrame * webkit_web_frame_get_parent (WebKitWebFrame *frame
); void webkit_web_frame_load_uri (WebKitWebFrame *frame
,const gchar *uri
); void webkit_web_frame_load_string (WebKitWebFrame *frame
,const gchar *content
,const gchar *mime_type
,const gchar *encoding
,const gchar *base_uri
); void webkit_web_frame_load_alternate_string (WebKitWebFrame *frame
,const gchar *content
,const gchar *base_url
,const gchar *unreachable_url
); void webkit_web_frame_load_request (WebKitWebFrame *frame
,WebKitNetworkRequest *request
); void webkit_web_frame_stop_loading (WebKitWebFrame *frame
); void webkit_web_frame_reload (WebKitWebFrame *frame
); WebKitWebFrame * webkit_web_frame_find_frame (WebKitWebFrame *frame
,const gchar *name
); JSGlobalContextRef webkit_web_frame_get_global_context (WebKitWebFrame *frame
); void webkit_web_frame_print (WebKitWebFrame *frame
); WebKitLoadStatus webkit_web_frame_get_load_status (WebKitWebFrame *frame
); WebKitWebDataSource * webkit_web_frame_get_data_source (WebKitWebFrame *frame
); WebKitWebDataSource * webkit_web_frame_get_provisional_data_source (WebKitWebFrame *frame
); WebKitSecurityOrigin * webkit_web_frame_get_security_origin (WebKitWebFrame *frame
); WebKitNetworkResponse * webkit_web_frame_get_network_response (WebKitWebFrame *frame
); gboolean webkit_web_frame_get_contents_size (WebKitWebFrame *webFrame
,int *width
,int *height
); int webkit_web_frame_get_contents_width (WebKitWebFrame *webFrame
); int webkit_web_frame_get_contents_height (WebKitWebFrame *webFrame
); gboolean webkit_web_frame_get_scroll_offset (WebKitWebFrame *webFrame
,int *x
,int *y
); int webkit_web_frame_get_x_scroll_offset (WebKitWebFrame *webFrame
); int webkit_web_frame_get_y_scroll_offset (WebKitWebFrame *webFrame
); void webkit_web_frame_set_scroll_offset (WebKitWebFrame *webFrame
,int x
,int y
); void webkit_web_frame_set_x_scroll_offset (WebKitWebFrame *webFrame
,int offset
); void webkit_web_frame_set_y_scroll_offset (WebKitWebFrame *webFrame
,int offset
); void webkit_web_frame_scroll (WebKitWebFrame *webFrame
,int x
,int y
); void webkit_web_frame_render (WebKitWebFrame *webFrame
,cairo_t *cr
,gint x_offset
,gint y_offset
,gint width
,gint height
); gfloat webkit_web_frame_get_zoom_level (WebKitWebFrame *webFrame
); void webkit_web_frame_set_zoom_level (WebKitWebFrame *webFrame
,gfloat zoomLevel
); void webkit_web_frame_zoom_in (WebKitWebFrame *webFrame
); void webkit_web_frame_zoom_out (WebKitWebFrame *webFrame
); gfloat webkit_web_frame_get_text_zoom_level (WebKitWebFrame *webFrame
); void webkit_web_frame_set_text_zoom_level (WebKitWebFrame *webFrame
,gfloat zoomLevel
); void webkit_web_frame_save_as_pdf (WebKitWebFrame *frame
,const char *file_name
,gfloat width
,gfloat height
); gfloat webkit_web_frame_get_contents_scale (WebKitWebFrame *webFrame
); void webkit_web_frame_set_contents_frozen (WebKitWebFrame *webFrame
,gboolean freeze
); void webkit_web_frame_set_contents_scale (WebKitWebFrame *webFrame
,gfloat scale
);
"contents-height" gint : Read "contents-width" gint : Read "load-status" WebKitLoadStatus : Read "name" gchar* : Read "text-zoom-level" gfloat : Read / Write "title" gchar* : Read "uri" gchar* : Read "x-scroll-offset" gint : Read / Write "y-scroll-offset" gint : Read / Write "zoom-level" gfloat : Read / Write
"cleared" :Run Last
"contents-size-changed" :Run Last
"hovering-over-link" :Run Last
"load-committed" :Run Last
"load-done" :Run Last
"scroll-offset-changed" :Run Last
"title-changed" :Run Last
A WebKitWebView contains a main WebKitWebFrame. A WebKitWebFrame contains the content of one URI. The URI and name of the frame can be retrieved, the load status and progress can be observed using the signals and can be controlled using the methods of the WebKitWebFrame. A WebKitWebFrame can have any number of children and one child can be found by using webkit_web_frame_find_frame.
/* Get the frame from the WebKitWebView */ WebKitWebFrame *frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW(my_view)); g_print("The URI of this frame is '%s'", webkit_web_frame_get_uri (frame));
typedef enum { WEBKIT_LOAD_PROVISIONAL, WEBKIT_LOAD_COMMITTED, WEBKIT_LOAD_FINISHED, WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT, WEBKIT_LOAD_FAILED } WebKitLoadStatus;
No data has been received yet, empty structures have been allocated to perform the load; the load may still fail for transport issues such as not being able to resolve a name, or connect to a port. | |
The first data chunk has arrived, meaning that the necessary transport requirements are stabilished, and the load is being performed. | |
This state means that everything that was required to display the page has been loaded. | |
The first layout with actual visible content happened; one or more layouts may have happened before that caused nothing to be visible on the screen, because the data available at the time was not significant enough. | |
This state means that some error occurred during the page load that prevented it from being completed. You can connect to the "load-error" signal if you want to know precisely what kind of error occurred. |
const gchar * webkit_web_frame_get_name (WebKitWebFrame *frame
);
Returns the frame
's name
|
a WebKitWebFrame |
Returns : |
the name of frame
|
const gchar * webkit_web_frame_get_title (WebKitWebFrame *frame
);
Returns the frame
's document title
|
a WebKitWebFrame |
Returns : |
the title of frame
|
const gchar * webkit_web_frame_get_uri (WebKitWebFrame *frame
);
Returns the current URI of the contents displayed by the frame
|
a WebKitWebFrame |
Returns : |
the URI of frame
|
WebKitWebFrame * webkit_web_frame_get_parent (WebKitWebFrame *frame
);
Returns the frame
's parent frame, or NULL
if it has none.
|
a WebKitWebFrame |
Returns : |
the parent WebKitWebFrame or NULL in case there is none. [transfer none]
|
void webkit_web_frame_load_uri (WebKitWebFrame *frame
,const gchar *uri
);
Requests loading of the specified URI string.
|
a WebKitWebFrame |
|
an URI string |
Since 1.1.1
void webkit_web_frame_load_string (WebKitWebFrame *frame
,const gchar *content
,const gchar *mime_type
,const gchar *encoding
,const gchar *base_uri
);
Requests loading of the given content
with the specified mime_type
,
encoding
and base_uri
.
If mime_type
is NULL
, "text/html" is assumed.
If encoding
is NULL
, "UTF-8" is assumed.
|
a WebKitWebFrame |
|
an URI string |
|
the MIME type, or NULL
|
|
the encoding, or NULL
|
|
the base URI for relative locations |
Since 1.1.1
void webkit_web_frame_load_alternate_string (WebKitWebFrame *frame
,const gchar *content
,const gchar *base_url
,const gchar *unreachable_url
);
Request loading of an alternate content for a URL that is unreachable.
Using this method will preserve the back-forward list. The URI passed in
base_url
has to be an absolute URI.
|
a WebKitWebFrame |
|
the alternate content to display as the main page of the frame
|
|
the base URI for relative locations |
|
the URL for the alternate page content |
Since 1.1.6
void webkit_web_frame_load_request (WebKitWebFrame *frame
,WebKitNetworkRequest *request
);
Connects to a given URI by initiating an asynchronous client request.
Creates a provisional data source that will transition to a committed data
source once any data has been received. Use webkit_web_frame_stop_loading()
to
stop the load. This function is typically invoked on the main frame.
|
a WebKitWebFrame |
|
a WebKitNetworkRequest |
void webkit_web_frame_stop_loading (WebKitWebFrame *frame
);
Stops any pending loads on frame
's data source, and those of its children.
|
a WebKitWebFrame |
void webkit_web_frame_reload (WebKitWebFrame *frame
);
Reloads the initial request.
|
a WebKitWebFrame |
WebKitWebFrame * webkit_web_frame_find_frame (WebKitWebFrame *frame
,const gchar *name
);
For pre-defined names, returns frame
if name
is "_self" or "_current",
returns frame
's parent frame if name
is "_parent", and returns the main
frame if name
is "_top". Also returns frame
if it is the main frame and
name
is either "_parent" or "_top". For other names, this function returns
the first frame that matches name
. This function searches frame
and its
descendents first, then frame
's parent and its children moving up the
hierarchy until a match is found. If no match is found in frame
's
hierarchy, this function will search for a matching frame in other main
frame hierarchies. Returns NULL
if no match is found.
|
a WebKitWebFrame |
|
the name of the frame to be found |
Returns : |
the found WebKitWebFrame or NULL in case none is found. [transfer none]
|
JSGlobalContextRef webkit_web_frame_get_global_context (WebKitWebFrame *frame
);
Gets the global JavaScript execution context. Use this function to bridge between the WebKit and JavaScriptCore APIs.
|
a WebKitWebFrame |
Returns : |
the global JavaScript context. [transfer none] |
WebKitLoadStatus webkit_web_frame_get_load_status (WebKitWebFrame *frame
);
Determines the current status of the load.
|
a WebKitWebView |
Returns : |
a WebKitLoadStatus object |
Since 1.1.7
WebKitWebDataSource * webkit_web_frame_get_data_source (WebKitWebFrame *frame
);
Returns the committed data source.
|
a WebKitWebFrame |
Returns : |
the committed WebKitWebDataSource. [transfer none] |
Since 1.1.14
WebKitWebDataSource * webkit_web_frame_get_provisional_data_source
(WebKitWebFrame *frame
);
You use the webkit_web_frame_load_request method to initiate a request that creates a provisional data source. The provisional data source will transition to a committed data source once any data has been received. Use webkit_web_frame_get_data_source to get the committed data source.
|
a WebKitWebFrame |
Returns : |
the provisional WebKitWebDataSource or NULL if a load
request is not in progress. [transfer none]
|
Since 1.1.14
WebKitSecurityOrigin * webkit_web_frame_get_security_origin
(WebKitWebFrame *frame
);
Returns the frame
's security origin.
|
a WebKitWebFrame |
Returns : |
the security origin of frame . [transfer none]
|
Since 1.1.14
WebKitNetworkResponse * webkit_web_frame_get_network_response
(WebKitWebFrame *frame
);
Returns a WebKitNetworkResponse object representing the response that was given to the request for the given frame, or NULL if the frame was not created by a load. You must unref the object when you are done with it.
|
a WebKitWebFrame |
Returns : |
a WebKitNetworkResponse object. [transfer full] |
Since 1.1.18
gboolean webkit_web_frame_get_contents_size (WebKitWebFrame *webFrame
,int *width
,int *height
);
int webkit_web_frame_get_contents_width (WebKitWebFrame *webFrame
);
int webkit_web_frame_get_contents_height
(WebKitWebFrame *webFrame
);
gboolean webkit_web_frame_get_scroll_offset (WebKitWebFrame *webFrame
,int *x
,int *y
);
Obtains the current scroll offset the the given webFrame
.
|
a WebKitWebFrame instance |
|
the location where the value for the x position should be stored or NULL
|
|
the location where the value for the y position should be stored or NULL
|
Returns : |
TRUE if the position was correctly obtained, FALSE
if the frame does not have a view currently. |
int webkit_web_frame_get_x_scroll_offset
(WebKitWebFrame *webFrame
);
Obtains the current scroll offset of the x axis for the the given
webFrame
.
|
a WebKitWebFrame instance |
Returns : |
the x scroll offset or -1 if no view exists for the frame. |
int webkit_web_frame_get_y_scroll_offset
(WebKitWebFrame *webFrame
);
Obtains the current scroll offset of the y axis for the the given
webFrame
.
|
a WebKitWebFrame instance |
Returns : |
the y scroll offset or -1 if no view exists for the frame. |
void webkit_web_frame_set_scroll_offset (WebKitWebFrame *webFrame
,int x
,int y
);
Sets the scroll offset of the given frame.
|
a WebKitWebFrame instance |
|
the x position to where the view should be scrolled |
|
the y position to where the view should be scrolled |
void webkit_web_frame_set_x_scroll_offset (WebKitWebFrame *webFrame
,int offset
);
Sets the x scroll offset of the given frame.
|
a WebKitWebFrame instance |
|
the x position to where the view should be scrolled |
void webkit_web_frame_set_y_scroll_offset (WebKitWebFrame *webFrame
,int offset
);
Sets the y scroll offset of the given frame.
|
a WebKitWebFrame instance |
|
the y position to where the view should be scrolled |
void webkit_web_frame_scroll (WebKitWebFrame *webFrame
,int x
,int y
);
Shifts the visible area by scrolling the contents of the given frame by the provided amount.
|
a WebKitWebFrame instance |
|
how many pixels the view should be scrolled in the x axis |
|
how many pixels the view should be scrolled in the y axis |
void webkit_web_frame_render (WebKitWebFrame *webFrame
,cairo_t *cr
,gint x_offset
,gint y_offset
,gint width
,gint height
);
gfloat webkit_web_frame_get_zoom_level (WebKitWebFrame *webFrame
);
Returns the zoom level of webFrame
, i.e. the factor by which elements in
the frame are scaled with respect to their original size.
|
a WebKitWebFrame |
Returns : |
the zoom level of web_frame
|
void webkit_web_frame_set_zoom_level (WebKitWebFrame *webFrame
,gfloat zoomLevel
);
Sets the zoom level of webFrame
, i.e. the factor by which elements in
the frame are scaled with respect to their original size.
|
a WebKitWebFrame |
|
the new zoom level |
void webkit_web_frame_zoom_in (WebKitWebFrame *webFrame
);
Increases the zoom level of webFrame
. The current zoom
level is incremented by the value of the "zoom-step"
property of the WebKitWebSettings associated with web_frame
.
|
a WebKitWebFrame |
void webkit_web_frame_zoom_out (WebKitWebFrame *webFrame
);
Decreases the zoom level of webFrame
. The current zoom
level is decremented by the value of the "zoom-step"
property of the WebKitWebSettings associated with web_frame
.
|
a WebKitWebFrame |
gfloat webkit_web_frame_get_text_zoom_level
(WebKitWebFrame *webFrame
);
Returns the text zoom level of webFrame
, i.e. the factor by which
text in the frame is scaled with respect to its original size.
|
a WebKitWebFrame |
Returns : |
the text zoom level of web_frame
|
void webkit_web_frame_set_text_zoom_level (WebKitWebFrame *webFrame
,gfloat zoomLevel
);
Sets the text zoom level of webFrame
, i.e. the factor by which
text in the frame is scaled with respect to its original size.
|
a WebKitWebFrame |
|
the new zoom level |
void webkit_web_frame_save_as_pdf (WebKitWebFrame *frame
,const char *file_name
,gfloat width
,gfloat height
);
Prints the given WebKitWebFrame to a pdf
|
a WebKitWebFrame |
|
a path to which the file will be written |
|
width of the page |
|
height of the page |
gfloat webkit_web_frame_get_contents_scale (WebKitWebFrame *webFrame
);
Gets the scale factor applied to the frame contents.
|
a WebKitWebFrame |
Returns : |
the scale applied to the frame contents |
void webkit_web_frame_set_contents_frozen (WebKitWebFrame *webFrame
,gboolean freeze
);
Freeze frame contents preventing them from getting relayouted after size or scale changes.
|
a WebKitWebFrame |
|
whether to freeze frame contents |
void webkit_web_frame_set_contents_scale (WebKitWebFrame *webFrame
,gfloat scale
);
Sets the scale factor to be applied to the frame contents.
|
a WebKitWebFrame |
|
the scale for the frame contents |
"contents-height"
property "contents-height" gint : Read
The height of the frame's contents.
Default value: 0
"contents-width"
property "contents-width" gint : Read
The width of the frame's contents.
Default value: 0
"load-status"
property"load-status" WebKitLoadStatus : Read
Determines the current status of the load.
Default value: WEBKIT_LOAD_FINISHED
Since 1.1.7
"text-zoom-level"
property "text-zoom-level" gfloat : Read / Write
The level of zoom of the text.
Allowed values: >= G_MINFLOAT
Default value: 1
"uri"
property "uri" gchar* : Read
The current URI of the contents displayed by the frame.
Default value: NULL
"x-scroll-offset"
property "x-scroll-offset" gint : Read / Write
The scroll offset of the x axis.
Default value: 0
"y-scroll-offset"
property "y-scroll-offset" gint : Read / Write
The scroll offset of the y axis.
Default value: 0
"cleared"
signalvoid user_function (WebKitWebFrame *webkitwebframe,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"contents-size-changed"
signalvoid user_function (WebKitWebFrame *frame,
guint width,
guint height,
gpointer user_data) : Run Last
FIXME: Should we notify on the width and height propertied instead?
|
the object on which the signal is emitted |
|
The new width |
|
The new height |
|
user data set when the signal handler was connected. |
"hovering-over-link"
signalvoid user_function (WebKitWebFrame *webkitwebframe,
gchar *arg1,
gchar *arg2,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"load-committed"
signalvoid user_function (WebKitWebFrame *webkitwebframe,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"load-done"
signalvoid user_function (WebKitWebFrame *web_frame,
gboolean arg1,
gpointer user_data) : Run Last
WebKitWebFrame::load-done
is deprecated and should not be used in newly-written code. Use the "load-status" property instead, and/or
WebKitWebView::load-error to be notified of load errors
Emitted when frame loading is done.
|
the object on which the signal is emitted |
|
user data set when the signal handler was connected. |
"scroll-offset-changed"
signalvoid user_function (WebKitWebFrame *frame,
gpointer user_data) : Run Last
FIXME: This should be a notification on the two scroll properties, but rigth now the engine only signals changes without saying in which direction.
|
the object on which the signal is emitted |
|
user data set when the signal handler was connected. |
"title-changed"
signalvoid user_function (WebKitWebFrame *frame,
gchar *title,
gpointer user_data) : Run Last
WebKitWebFrame::title-changed
has been deprecated since version 1.1.18 and should not be used in newly-written code. Use "notify::title" instead.
When a WebKitWebFrame changes the document title this signal is emitted.
|
the object on which the signal is emitted |
|
the new title |
|
user data set when the signal handler was connected. |