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 :: IsWebDataSource o => o -> IO WebDataSource
- noWebDataSource :: Maybe WebDataSource
- data WebDataSourceGetDataMethodInfo
- webDataSourceGetData :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m String
- data WebDataSourceGetEncodingMethodInfo
- webDataSourceGetEncoding :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m Text
- data WebDataSourceGetInitialRequestMethodInfo
- webDataSourceGetInitialRequest :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m NetworkRequest
- data WebDataSourceGetMainResourceMethodInfo
- webDataSourceGetMainResource :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m WebResource
- data WebDataSourceGetRequestMethodInfo
- webDataSourceGetRequest :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m NetworkRequest
- data WebDataSourceGetSubresourcesMethodInfo
- webDataSourceGetSubresources :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m [WebResource]
- data WebDataSourceGetUnreachableUriMethodInfo
- webDataSourceGetUnreachableUri :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m Text
- data WebDataSourceGetWebFrameMethodInfo
- webDataSourceGetWebFrame :: (HasCallStack, MonadIO m, IsWebDataSource a) => a -> m WebFrame
- data WebDataSourceIsLoadingMethodInfo
- 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 #
GObject WebDataSource Source # | |
IsObject WebDataSource Source # | |
IsWebDataSource WebDataSource Source # | |
((~) * info (ResolveWebDataSourceMethod t WebDataSource), MethodInfo * info WebDataSource p) => IsLabel t (WebDataSource -> p) Source # | |
((~) * info (ResolveWebDataSourceMethod t WebDataSource), MethodInfo * info WebDataSource p) => IsLabelProxy t (WebDataSource -> p) Source # | |
HasAttributeList * WebDataSource Source # | |
type AttributeList WebDataSource Source # | |
type SignalList WebDataSource Source # | |
class GObject o => IsWebDataSource o Source #
toWebDataSource :: IsWebDataSource o => o -> IO WebDataSource Source #
Methods
getData
data WebDataSourceGetDataMethodInfo Source #
((~) * signature (m String), MonadIO m, IsWebDataSource a) => MethodInfo * WebDataSourceGetDataMethodInfo a signature Source # | |
:: (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
data WebDataSourceGetEncodingMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsWebDataSource a) => MethodInfo * WebDataSourceGetEncodingMethodInfo a signature Source # | |
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
data WebDataSourceGetInitialRequestMethodInfo Source #
((~) * signature (m NetworkRequest), MonadIO m, IsWebDataSource a) => MethodInfo * WebDataSourceGetInitialRequestMethodInfo a signature Source # | |
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
data WebDataSourceGetMainResourceMethodInfo Source #
((~) * signature (m WebResource), MonadIO m, IsWebDataSource a) => MethodInfo * WebDataSourceGetMainResourceMethodInfo a signature Source # | |
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
data WebDataSourceGetRequestMethodInfo Source #
((~) * signature (m NetworkRequest), MonadIO m, IsWebDataSource a) => MethodInfo * WebDataSourceGetRequestMethodInfo a signature Source # | |
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
data WebDataSourceGetSubresourcesMethodInfo Source #
((~) * signature (m [WebResource]), MonadIO m, IsWebDataSource a) => MethodInfo * WebDataSourceGetSubresourcesMethodInfo a signature Source # | |
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
data WebDataSourceGetUnreachableUriMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsWebDataSource a) => MethodInfo * WebDataSourceGetUnreachableUriMethodInfo a signature Source # | |
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
data WebDataSourceGetWebFrameMethodInfo Source #
((~) * signature (m WebFrame), MonadIO m, IsWebDataSource a) => MethodInfo * WebDataSourceGetWebFrameMethodInfo a signature Source # | |
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
data WebDataSourceIsLoadingMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsWebDataSource a) => MethodInfo * WebDataSourceIsLoadingMethodInfo a signature Source # | |
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