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 |
No description available in the introspection data.
- newtype WebResource = WebResource (ManagedPtr WebResource)
- class GObject o => IsWebResource o
- toWebResource :: (MonadIO m, IsWebResource o) => o -> m WebResource
- noWebResource :: Maybe WebResource
- webResourceGetData :: (HasCallStack, MonadIO m, IsWebResource a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- webResourceGetDataFinish :: (HasCallStack, MonadIO m, IsWebResource a, IsAsyncResult b) => a -> b -> m ByteString
- webResourceGetResponse :: (HasCallStack, MonadIO m, IsWebResource a) => a -> m URIResponse
- webResourceGetUri :: (HasCallStack, MonadIO m, IsWebResource a) => a -> m Text
- getWebResourceResponse :: (MonadIO m, IsWebResource o) => o -> m URIResponse
- getWebResourceUri :: (MonadIO m, IsWebResource o) => o -> m Text
- type C_WebResourceFailedCallback = Ptr () -> Ptr GError -> Ptr () -> IO ()
- type WebResourceFailedCallback = GError -> IO ()
- afterWebResourceFailed :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedCallback -> m SignalHandlerId
- genClosure_WebResourceFailed :: WebResourceFailedCallback -> IO Closure
- mk_WebResourceFailedCallback :: C_WebResourceFailedCallback -> IO (FunPtr C_WebResourceFailedCallback)
- noWebResourceFailedCallback :: Maybe WebResourceFailedCallback
- onWebResourceFailed :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedCallback -> m SignalHandlerId
- wrap_WebResourceFailedCallback :: WebResourceFailedCallback -> C_WebResourceFailedCallback
- type C_WebResourceFailedWithTlsErrorsCallback = Ptr () -> Ptr TlsCertificate -> CUInt -> Ptr () -> IO ()
- type WebResourceFailedWithTlsErrorsCallback = TlsCertificate -> [TlsCertificateFlags] -> IO ()
- afterWebResourceFailedWithTlsErrors :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedWithTlsErrorsCallback -> m SignalHandlerId
- genClosure_WebResourceFailedWithTlsErrors :: WebResourceFailedWithTlsErrorsCallback -> IO Closure
- mk_WebResourceFailedWithTlsErrorsCallback :: C_WebResourceFailedWithTlsErrorsCallback -> IO (FunPtr C_WebResourceFailedWithTlsErrorsCallback)
- noWebResourceFailedWithTlsErrorsCallback :: Maybe WebResourceFailedWithTlsErrorsCallback
- onWebResourceFailedWithTlsErrors :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedWithTlsErrorsCallback -> m SignalHandlerId
- wrap_WebResourceFailedWithTlsErrorsCallback :: WebResourceFailedWithTlsErrorsCallback -> C_WebResourceFailedWithTlsErrorsCallback
- type C_WebResourceFinishedCallback = Ptr () -> Ptr () -> IO ()
- type WebResourceFinishedCallback = IO ()
- afterWebResourceFinished :: (IsWebResource a, MonadIO m) => a -> WebResourceFinishedCallback -> m SignalHandlerId
- genClosure_WebResourceFinished :: WebResourceFinishedCallback -> IO Closure
- mk_WebResourceFinishedCallback :: C_WebResourceFinishedCallback -> IO (FunPtr C_WebResourceFinishedCallback)
- noWebResourceFinishedCallback :: Maybe WebResourceFinishedCallback
- onWebResourceFinished :: (IsWebResource a, MonadIO m) => a -> WebResourceFinishedCallback -> m SignalHandlerId
- wrap_WebResourceFinishedCallback :: WebResourceFinishedCallback -> C_WebResourceFinishedCallback
- type C_WebResourceReceivedDataCallback = Ptr () -> Word64 -> Ptr () -> IO ()
- type WebResourceReceivedDataCallback = Word64 -> IO ()
- afterWebResourceReceivedData :: (IsWebResource a, MonadIO m) => a -> WebResourceReceivedDataCallback -> m SignalHandlerId
- genClosure_WebResourceReceivedData :: WebResourceReceivedDataCallback -> IO Closure
- mk_WebResourceReceivedDataCallback :: C_WebResourceReceivedDataCallback -> IO (FunPtr C_WebResourceReceivedDataCallback)
- noWebResourceReceivedDataCallback :: Maybe WebResourceReceivedDataCallback
- onWebResourceReceivedData :: (IsWebResource a, MonadIO m) => a -> WebResourceReceivedDataCallback -> m SignalHandlerId
- wrap_WebResourceReceivedDataCallback :: WebResourceReceivedDataCallback -> C_WebResourceReceivedDataCallback
- type C_WebResourceSentRequestCallback = Ptr () -> Ptr URIRequest -> Ptr URIResponse -> Ptr () -> IO ()
- type WebResourceSentRequestCallback = URIRequest -> URIResponse -> IO ()
- afterWebResourceSentRequest :: (IsWebResource a, MonadIO m) => a -> WebResourceSentRequestCallback -> m SignalHandlerId
- genClosure_WebResourceSentRequest :: WebResourceSentRequestCallback -> IO Closure
- mk_WebResourceSentRequestCallback :: C_WebResourceSentRequestCallback -> IO (FunPtr C_WebResourceSentRequestCallback)
- noWebResourceSentRequestCallback :: Maybe WebResourceSentRequestCallback
- onWebResourceSentRequest :: (IsWebResource a, MonadIO m) => a -> WebResourceSentRequestCallback -> m SignalHandlerId
- wrap_WebResourceSentRequestCallback :: WebResourceSentRequestCallback -> C_WebResourceSentRequestCallback
Exported types
newtype WebResource Source #
Memory-managed wrapper type.
class GObject o => IsWebResource o Source #
Type class for types which can be safely cast to WebResource
, for instance with toWebResource
.
toWebResource :: (MonadIO m, IsWebResource o) => o -> m WebResource Source #
Cast to WebResource
, for types for which this is known to be safe. For general casts, use castTo
.
noWebResource :: Maybe WebResource Source #
A convenience alias for Nothing
:: Maybe
WebResource
.
Methods
getData
:: (HasCallStack, MonadIO m, IsWebResource a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously get the raw data for resource
.
When the operation is finished, callback
will be called. You can then call
webResourceGetDataFinish
to get the result of the operation.
getDataFinish
webResourceGetDataFinish Source #
:: (HasCallStack, MonadIO m, IsWebResource a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m ByteString | Returns: a
string with the data of |
Finish an asynchronous operation started with webResourceGetData
.
getResponse
webResourceGetResponse Source #
:: (HasCallStack, MonadIO m, IsWebResource a) | |
=> a |
|
-> m URIResponse | Returns: the |
Retrieves the URIResponse
of the resource load operation.
This method returns Nothing
if called before the response
is received from the server. You can connect to notify::response
signal to be notified when the response is received.
getUri
:: (HasCallStack, MonadIO m, IsWebResource a) | |
=> a |
|
-> m Text | Returns: the current active URI of |
Returns the current active URI of resource
. The active URI might change during
a load operation:
<orderedlist>
<listitem><para>
When the resource load starts, the active URI is the requested URI
</para></listitem>
<listitem><para>
When the initial request is sent to the server, WebResource
::sent-request
signal is emitted without a redirected response, the active URI is the URI of
the request sent to the server.
</para></listitem>
<listitem><para>
In case of a server redirection, WebResource
::sent-request
signal
is emitted again with a redirected response, the active URI is the URI the request
was redirected to.
</para></listitem>
<listitem><para>
When the response is received from the server, the active URI is the final
one and it will not change again.
</para></listitem>
</orderedlist>
You can monitor the active URI by connecting to the notify::uri
signal of resource
.
Properties
response
The URIResponse
associated with this resource.
getWebResourceResponse :: (MonadIO m, IsWebResource o) => o -> m URIResponse Source #
Get the value of the “response
” property.
When overloading is enabled, this is equivalent to
get
webResource #response
uri
The current active URI of the WebResource
.
See webResourceGetUri
for more details.
getWebResourceUri :: (MonadIO m, IsWebResource o) => o -> m Text Source #
Get the value of the “uri
” property.
When overloading is enabled, this is equivalent to
get
webResource #uri
Signals
failed
type C_WebResourceFailedCallback = Ptr () -> Ptr GError -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type WebResourceFailedCallback Source #
This signal is emitted when an error occurs during the resource load operation.
afterWebResourceFailed :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “failed
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
webResource #failed callback
genClosure_WebResourceFailed :: WebResourceFailedCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_WebResourceFailedCallback :: C_WebResourceFailedCallback -> IO (FunPtr C_WebResourceFailedCallback) Source #
Generate a function pointer callable from C code, from a C_WebResourceFailedCallback
.
noWebResourceFailedCallback :: Maybe WebResourceFailedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
WebResourceFailedCallback
onWebResourceFailed :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “failed
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
webResource #failed callback
wrap_WebResourceFailedCallback :: WebResourceFailedCallback -> C_WebResourceFailedCallback Source #
Wrap a WebResourceFailedCallback
into a C_WebResourceFailedCallback
.
failedWithTlsErrors
type C_WebResourceFailedWithTlsErrorsCallback = Ptr () -> Ptr TlsCertificate -> CUInt -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type WebResourceFailedWithTlsErrorsCallback Source #
= TlsCertificate |
|
-> [TlsCertificateFlags] |
|
-> IO () |
This signal is emitted when a TLS error occurs during the resource load operation.
Since: 2.8
afterWebResourceFailedWithTlsErrors :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedWithTlsErrorsCallback -> m SignalHandlerId Source #
Connect a signal handler for the “failed-with-tls-errors
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
webResource #failedWithTlsErrors callback
genClosure_WebResourceFailedWithTlsErrors :: WebResourceFailedWithTlsErrorsCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_WebResourceFailedWithTlsErrorsCallback :: C_WebResourceFailedWithTlsErrorsCallback -> IO (FunPtr C_WebResourceFailedWithTlsErrorsCallback) Source #
Generate a function pointer callable from C code, from a C_WebResourceFailedWithTlsErrorsCallback
.
noWebResourceFailedWithTlsErrorsCallback :: Maybe WebResourceFailedWithTlsErrorsCallback Source #
A convenience synonym for
.Nothing
:: Maybe
WebResourceFailedWithTlsErrorsCallback
onWebResourceFailedWithTlsErrors :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedWithTlsErrorsCallback -> m SignalHandlerId Source #
Connect a signal handler for the “failed-with-tls-errors
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
webResource #failedWithTlsErrors callback
wrap_WebResourceFailedWithTlsErrorsCallback :: WebResourceFailedWithTlsErrorsCallback -> C_WebResourceFailedWithTlsErrorsCallback Source #
finished
type C_WebResourceFinishedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type WebResourceFinishedCallback = IO () Source #
This signal is emitted when the resource load finishes successfully
or due to an error. In case of errors WebResource
::failed
signal
is emitted before this one.
afterWebResourceFinished :: (IsWebResource a, MonadIO m) => a -> WebResourceFinishedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “finished
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
webResource #finished callback
genClosure_WebResourceFinished :: WebResourceFinishedCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_WebResourceFinishedCallback :: C_WebResourceFinishedCallback -> IO (FunPtr C_WebResourceFinishedCallback) Source #
Generate a function pointer callable from C code, from a C_WebResourceFinishedCallback
.
noWebResourceFinishedCallback :: Maybe WebResourceFinishedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
WebResourceFinishedCallback
onWebResourceFinished :: (IsWebResource a, MonadIO m) => a -> WebResourceFinishedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “finished
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
webResource #finished callback
wrap_WebResourceFinishedCallback :: WebResourceFinishedCallback -> C_WebResourceFinishedCallback Source #
Wrap a WebResourceFinishedCallback
into a C_WebResourceFinishedCallback
.
receivedData
type C_WebResourceReceivedDataCallback = Ptr () -> Word64 -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type WebResourceReceivedDataCallback Source #
This signal is emitted after response is received, every time new data has been received. It's useful to know the progress of the resource load operation.
afterWebResourceReceivedData :: (IsWebResource a, MonadIO m) => a -> WebResourceReceivedDataCallback -> m SignalHandlerId Source #
Connect a signal handler for the “received-data
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
webResource #receivedData callback
genClosure_WebResourceReceivedData :: WebResourceReceivedDataCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_WebResourceReceivedDataCallback :: C_WebResourceReceivedDataCallback -> IO (FunPtr C_WebResourceReceivedDataCallback) Source #
Generate a function pointer callable from C code, from a C_WebResourceReceivedDataCallback
.
noWebResourceReceivedDataCallback :: Maybe WebResourceReceivedDataCallback Source #
A convenience synonym for
.Nothing
:: Maybe
WebResourceReceivedDataCallback
onWebResourceReceivedData :: (IsWebResource a, MonadIO m) => a -> WebResourceReceivedDataCallback -> m SignalHandlerId Source #
Connect a signal handler for the “received-data
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
webResource #receivedData callback
wrap_WebResourceReceivedDataCallback :: WebResourceReceivedDataCallback -> C_WebResourceReceivedDataCallback Source #
Wrap a WebResourceReceivedDataCallback
into a C_WebResourceReceivedDataCallback
.
sentRequest
type C_WebResourceSentRequestCallback = Ptr () -> Ptr URIRequest -> Ptr URIResponse -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type WebResourceSentRequestCallback Source #
= URIRequest |
|
-> URIResponse |
|
-> IO () |
This signal is emitted when request
has been sent to the
server. In case of a server redirection this signal is
emitted again with the request
argument containing the new
request sent to the server due to the redirection and the
redirectedResponse
parameter containing the response
received by the server for the initial request.
afterWebResourceSentRequest :: (IsWebResource a, MonadIO m) => a -> WebResourceSentRequestCallback -> m SignalHandlerId Source #
Connect a signal handler for the “sent-request
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
webResource #sentRequest callback
genClosure_WebResourceSentRequest :: WebResourceSentRequestCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_WebResourceSentRequestCallback :: C_WebResourceSentRequestCallback -> IO (FunPtr C_WebResourceSentRequestCallback) Source #
Generate a function pointer callable from C code, from a C_WebResourceSentRequestCallback
.
noWebResourceSentRequestCallback :: Maybe WebResourceSentRequestCallback Source #
A convenience synonym for
.Nothing
:: Maybe
WebResourceSentRequestCallback
onWebResourceSentRequest :: (IsWebResource a, MonadIO m) => a -> WebResourceSentRequestCallback -> m SignalHandlerId Source #
Connect a signal handler for the “sent-request
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
webResource #sentRequest callback