Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Data source encapsulates the content of a WebFrame
. A
WebFrame
has a main resource and subresources and the data source
provides access to these resources. When a request gets loaded initially,
it is set to a provisional state. The application can request for the
request that initiated the load by asking for the provisional data source
and invoking the webkit_web_data_source_get_initial_request method of
WebDataSource
. This data source may not have enough data and some
methods may return empty values. To get a "full" data source with the data
and resources loaded, you need to get the non-provisional data source
through 'GI.WebKit.Objects.WebFrame.WebFrame'\'s webkit_web_frame_get_data_source method. This
data source will have the data after everything was loaded. Make sure that
the data source was finished loading before using any of its methods. You
can do this via webkit_web_data_source_is_loading.
- newtype WebDataSource = WebDataSource (ManagedPtr WebDataSource)
- class GObject o => IsWebDataSource o
- toWebDataSource :: (MonadIO m, IsWebDataSource o) => o -> m WebDataSource
- noWebDataSource :: Maybe WebDataSource
- webDataSourceGetData :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m String
- webDataSourceGetEncoding :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m Text
- webDataSourceGetInitialRequest :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m NetworkRequest
- webDataSourceGetMainResource :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m WebResource
- webDataSourceGetRequest :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m NetworkRequest
- webDataSourceGetSubresources :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m [WebResource]
- webDataSourceGetUnreachableUri :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m Text
- webDataSourceGetWebFrame :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m WebFrame
- webDataSourceIsLoading :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m Bool
- webDataSourceNew :: (HasCallStack, MonadIO m) => m WebDataSource
- webDataSourceNewWithRequest :: (HasCallStack, MonadIO m, IsNetworkRequest a) => a -> m WebDataSource
Exported types
newtype WebDataSource Source #
class GObject o => IsWebDataSource o Source #
toWebDataSource :: (MonadIO m, IsWebDataSource o) => o -> m WebDataSource Source #
Methods
getData
:: (HasCallStack, MonadIO m, IsWebDataSource a) | |
=> a |
|
-> m String | Returns: a |
Returns the raw data that represents the the frame's content.The data will
be incomplete until the data has finished loading. Returns Nothing
if the web
frame hasn't loaded any data. Use webkit_web_data_source_is_loading to test
if data source is in the process of loading.
Since: 1.1.14
getEncoding
webDataSourceGetEncoding Source #
:: (HasCallStack, MonadIO m, IsWebDataSource a) | |
=> a |
|
-> m Text | Returns: the encoding name of the |
Returns the text encoding name as set in the WebView
, or if not, the
text encoding of the response.
Since: 1.1.14
getInitialRequest
webDataSourceGetInitialRequest Source #
:: (HasCallStack, MonadIO m, IsWebDataSource a) | |
=> a |
|
-> m NetworkRequest | Returns: the original |
Returns a reference to the original request that was used to load the web
content. The NetworkRequest
returned by this method is the request
prior to the "committed" load state. See webkit_web_data_source_get_request
for getting the "committed" request.
Since: 1.1.14
getMainResource
webDataSourceGetMainResource Source #
:: (HasCallStack, MonadIO m, IsWebDataSource a) | |
=> a |
|
-> m WebResource | Returns: a new |
Returns the main resource of the dataSource
Since: 1.1.14
getRequest
webDataSourceGetRequest Source #
:: (HasCallStack, MonadIO m, IsWebDataSource a) | |
=> a |
|
-> m NetworkRequest | Returns: the |
Returns a NetworkRequest
that was used to create this
WebDataSource
. The NetworkRequest
returned by this method is
the request that was "committed", and hence, different from the request you
get from the webkit_web_data_source_get_initial_request method.
Since: 1.1.14
getSubresources
webDataSourceGetSubresources Source #
:: (HasCallStack, MonadIO m, IsWebDataSource a) | |
=> a |
|
-> m [WebResource] | Returns:
a |
Gives you a List
of WebResource
objects that compose the
WebView
to which this WebDataSource
is attached.
Since: 1.1.15
getUnreachableUri
webDataSourceGetUnreachableUri Source #
:: (HasCallStack, MonadIO m, IsWebDataSource a) | |
=> a |
|
-> m Text | Returns: the unreachable URL of |
Return the unreachable URI of dataSource
. The dataSource
will have an
unreachable URL if it was created using 'GI.WebKit.Objects.WebFrame.WebFrame'\'s
webkit_web_frame_load_alternate_html_string method.
Since: 1.1.14
getWebFrame
webDataSourceGetWebFrame Source #
:: (HasCallStack, MonadIO m, IsWebDataSource a) | |
=> a |
|
-> m WebFrame | Returns: the |
Returns the WebFrame
that represents this data source
Since: 1.1.14
isLoading
webDataSourceIsLoading Source #
:: (HasCallStack, MonadIO m, IsWebDataSource a) | |
=> a |
|
-> m Bool | Returns: |
Determines whether the data source is in the process of loading its content.
Since: 1.1.14
new
:: (HasCallStack, MonadIO m) | |
=> m WebDataSource | Returns: a new |
Creates a new WebDataSource
instance. The URL of the
WebDataSource
will be set to "about:blank".
Since: 1.1.14
newWithRequest
webDataSourceNewWithRequest Source #
:: (HasCallStack, MonadIO m, IsNetworkRequest a) | |
=> a |
|
-> m WebDataSource | Returns: a new |
Creates a new WebDataSource
from a NetworkRequest
. Normally,
WebFrame
objects create their data sources so you will almost never
want to invoke this method directly.
Since: 1.1.14