![]() |
![]() |
![]() |
WebKitGTK+ Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
WebKitWebFrameWebKitWebFrame — The content of a WebKitWebView |
enum WebKitLoadStatus; WebKitWebFrame; WebKitWebFrame * webkit_web_frame_find_frame (WebKitWebFrame *frame
,const gchar *name
); WebKitWebDataSource * webkit_web_frame_get_data_source (WebKitWebFrame *frame
); JSGlobalContextRef webkit_web_frame_get_global_context (WebKitWebFrame *frame
); GtkPolicyType webkit_web_frame_get_horizontal_scrollbar_policy (WebKitWebFrame *frame
); WebKitLoadStatus webkit_web_frame_get_load_status (WebKitWebFrame *frame
); const gchar * webkit_web_frame_get_name (WebKitWebFrame *frame
); WebKitNetworkResponse * webkit_web_frame_get_network_response (WebKitWebFrame *frame
); WebKitWebFrame * webkit_web_frame_get_parent (WebKitWebFrame *frame
); WebKitWebDataSource * webkit_web_frame_get_provisional_data_source (WebKitWebFrame *frame
); WebKitSecurityOrigin * webkit_web_frame_get_security_origin (WebKitWebFrame *frame
); const gchar * webkit_web_frame_get_title (WebKitWebFrame *frame
); const gchar * webkit_web_frame_get_uri (WebKitWebFrame *frame
); GtkPolicyType webkit_web_frame_get_vertical_scrollbar_policy (WebKitWebFrame *frame
); WebKitWebView * webkit_web_frame_get_web_view (WebKitWebFrame *frame
); 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_load_string (WebKitWebFrame *frame
,const gchar *content
,const gchar *mime_type
,const gchar *encoding
,const gchar *base_uri
); void webkit_web_frame_load_uri (WebKitWebFrame *frame
,const gchar *uri
); WebKitWebFrame * webkit_web_frame_new (WebKitWebView *web_view
); void webkit_web_frame_print (WebKitWebFrame *frame
); GtkPrintOperationResult webkit_web_frame_print_full (WebKitWebFrame *frame
,GtkPrintOperation *operation
,GtkPrintOperationAction action
,GError **error
); void webkit_web_frame_reload (WebKitWebFrame *frame
); void webkit_web_frame_stop_loading (WebKitWebFrame *frame
);
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. |
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
|
WebKitWebDataSource * webkit_web_frame_get_data_source (WebKitWebFrame *frame
);
Returns the committed data source.
|
a WebKitWebFrame |
Returns : |
the committed WebKitWebDataSource. |
Since 1.1.14
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 |
GtkPolicyType webkit_web_frame_get_horizontal_scrollbar_policy
(WebKitWebFrame *frame
);
|
|
Returns : |
WebKitLoadStatus webkit_web_frame_get_load_status (WebKitWebFrame *frame
);
Determines the current status of the load.
|
a WebKitWebView |
Returns : |
Since 1.1.7
const gchar * webkit_web_frame_get_name (WebKitWebFrame *frame
);
Returns the frame
's name
|
a WebKitWebFrame |
Returns : |
the name of frame
|
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 |
Since 1.1.18
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
|
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.
|
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
|
Since 1.1.14
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
|
GtkPolicyType webkit_web_frame_get_vertical_scrollbar_policy
(WebKitWebFrame *frame
);
|
|
Returns : |
WebKitWebView * webkit_web_frame_get_web_view (WebKitWebFrame *frame
);
Returns the WebKitWebView that manages this WebKitWebFrame.
The WebKitWebView returned manages the entire hierarchy of WebKitWebFrame
objects that contains frame
.
|
a WebKitWebFrame |
Returns : |
the WebKitWebView that manages frame
|
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_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_uri (WebKitWebFrame *frame
,const gchar *uri
);
Requests loading of the specified URI string.
|
a WebKitWebFrame |
|
an URI string |
Since 1.1.1
WebKitWebFrame * webkit_web_frame_new (WebKitWebView *web_view
);
webkit_web_frame_new
has been deprecated since version 1.0.2 and should not be used in newly-written code. WebKitWebFrame can only be used to inspect existing
frames.
Creates a new WebKitWebFrame initialized with a controlling WebKitWebView.
|
the controlling WebKitWebView |
Returns : |
a new WebKitWebFrame |
void webkit_web_frame_print (WebKitWebFrame *frame
);
Prints the given WebKitWebFrame, by presenting a print dialog to the
user. If you need more control over the printing process, see
webkit_web_frame_print_full()
.
|
a WebKitWebFrame |
Since 1.1.5
GtkPrintOperationResult webkit_web_frame_print_full (WebKitWebFrame *frame
,GtkPrintOperation *operation
,GtkPrintOperationAction action
,GError **error
);
Prints the given WebKitWebFrame, using the given GtkPrintOperation
and GtkPrintOperationAction. This function wraps a call to
gtk_print_operation_run()
for printing the contents of the
WebKitWebFrame.
|
a WebKitWebFrame to be printed |
|
the GtkPrintOperation to be carried |
|
the GtkPrintOperationAction to be performed |
|
GError for error return |
Returns : |
Since 1.1.5
void webkit_web_frame_reload (WebKitWebFrame *frame
);
Reloads the initial request.
|
a WebKitWebFrame |
void webkit_web_frame_stop_loading (WebKitWebFrame *frame
);
Stops any pending loads on frame
's data source, and those of its children.
|
a WebKitWebFrame |