gi-webkit2-4.0.21: WebKit2 bindings

Copyright Will Thompson Iñaki García Etxebarria and Jonas Platte LGPL-2.1 Iñaki García Etxebarria (inaki@blueleaf.cc) None Haskell2010

Description

No description available in the introspection data.

Synopsis

Exported types

Memory-managed wrapper type.

Constructors

Instances

Type class for types which can be safely cast to Download, for instance with toDownload.

Instances

Cast to Download, for types for which this is known to be safe. For general casts, use castTo.

A convenience alias for Nothing :: Maybe Download.

Methods

cancel

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> m ()

Cancels the download. When the ongoing download operation is effectively cancelled the signal Download::failed is emitted with DownloadErrorCancelledByUser error.

getAllowOverwrite

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> m Bool Returns: the current value of the Download:allow-overwrite property

Returns the current value of the Download:allow-overwrite property, which determines whether the download will overwrite an existing file on disk, or if it will fail if the destination already exists.

Since: 2.6

getDestination

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> m (Maybe Text) Returns: the destination URI or Nothing

Obtains the URI to which the downloaded file will be written. You can connect to Download::created-destination to make sure this method returns a valid destination.

getElapsedTime

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> m Double Returns: seconds since the download was started

Gets the elapsed time in seconds, including any fractional part. If the download finished, had an error or was cancelled this is the time between its start and the event.

getEstimatedProgress

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> m Double Returns: an estimate of the of the percent complete for a download as a range from 0.0 to 1.0.

Gets the value of the Download:estimated-progress property. You can monitor the estimated progress of the download operation by connecting to the notify::estimated-progress signal of download.

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> m Word64 Returns: the amount of bytes already downloaded.

Gets the length of the data already downloaded for download in bytes.

getRequest

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> m URIRequest Returns: the URIRequest of download

Retrieves the URIRequest object that backs the download process.

getResponse

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> m (Maybe URIResponse) Returns: the URIResponse, or Nothing if the response hasn't been received yet.

Retrieves the URIResponse object that backs the download process. 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.

getWebView

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> m (Maybe WebView) Returns: the WebView that initiated download, or Nothing if download was not initiated by a WebView.

Get the WebView that initiated the download.

setAllowOverwrite

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> Bool allowed: the new value for the Download:allow-overwrite property -> m ()

Sets the Download:allow-overwrite property, which determines whether the download may overwrite an existing file on disk, or if it will fail if the destination already exists.

Since: 2.6

setDestination

Arguments

 :: (HasCallStack, MonadIO m, IsDownload a) => a download: a Download -> Text uri: the destination URI -> m ()

Sets the URI to which the downloaded file will be written. This method should be called before the download transfer starts or it will not have any effect on the ongoing download operation. To set the destination using the filename suggested by the server connect to Download::decide-destination signal and call downloadSetDestination. If you want to set a fixed destination URI that doesn't depend on the suggested filename you can connect to notify::response signal and call downloadSetDestination. If Download::decide-destination signal is not handled and destination URI is not set when the download transfer starts, the file will be saved with the filename suggested by the server in UserDirectoryDirectoryDownload directory.

Properties

allowOverwrite

Whether or not the download is allowed to overwrite an existing file on disk. If this property is False and the destination already exists, the download will fail.

Since: 2.6

Construct a GValueConstruct with valid value for the “allow-overwrite” property. This is rarely needed directly, but it is used by new.

Get the value of the “allow-overwrite” property. When overloading is enabled, this is equivalent to

get download #allowOverwrite


Set the value of the “allow-overwrite” property. When overloading is enabled, this is equivalent to

set download [ #allowOverwrite := value ]


destination

Get the value of the “destination” property. When overloading is enabled, this is equivalent to

get download #destination


estimatedProgress

An estimate of the percent completion for the download operation. This value will range from 0.0 to 1.0. The value is an estimate based on the total number of bytes expected to be received for a download. If you need a more accurate progress information you can connect to Download::received-data signal to track the progress.

Get the value of the “estimated-progress” property. When overloading is enabled, this is equivalent to

get download #estimatedProgress


response

The URIResponse associated with this download.

Get the value of the “response” property. When overloading is enabled, this is equivalent to

get download #response


Signals

createdDestination

type C_DownloadCreatedDestinationCallback = Ptr () -> CString -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

Arguments

 = Text destination: the destination URI -> IO ()

This signal is emitted after Download::decide-destination and before Download::received-data to notify that destination file has been created successfully at destination.

Connect a signal handler for the “created-destination” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after download #createdDestination callback


Wrap the callback into a GClosure.

Generate a function pointer callable from C code, from a C_DownloadCreatedDestinationCallback.

A convenience synonym for Nothing :: Maybe DownloadCreatedDestinationCallback.

Connect a signal handler for the “created-destination” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on download #createdDestination callback


Wrap a DownloadCreatedDestinationCallback into a C_DownloadCreatedDestinationCallback.

decideDestination

type C_DownloadDecideDestinationCallback = Ptr () -> CString -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

Arguments

 = Text suggestedFilename: the filename suggested for the download -> IO Bool Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

This signal is emitted after response is received to decide a destination URI for the download. If this signal is not handled the file will be downloaded to UserDirectoryDirectoryDownload directory using suggestedFilename.

Connect a signal handler for the “decide-destination” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after download #decideDestination callback


Wrap the callback into a GClosure.

Generate a function pointer callable from C code, from a C_DownloadDecideDestinationCallback.

A convenience synonym for Nothing :: Maybe DownloadDecideDestinationCallback.

Connect a signal handler for the “decide-destination” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on download #decideDestination callback


Wrap a DownloadDecideDestinationCallback into a C_DownloadDecideDestinationCallback.

failed

type C_DownloadFailedCallback = Ptr () -> Ptr GError -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

Arguments

 = GError error: the GError that was triggered -> IO ()

This signal is emitted when an error occurs during the download operation. The given error, of the domain WEBKIT_DOWNLOAD_ERROR, contains further details of the failure. If the download is cancelled with downloadCancel, this signal is emitted with error DownloadErrorCancelledByUser. The download operation finishes after an error and Download::finished signal is emitted after this one.

Connect a signal handler for the “failed” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after download #failed callback


Wrap the callback into a GClosure.

Generate a function pointer callable from C code, from a C_DownloadFailedCallback.

A convenience synonym for Nothing :: Maybe DownloadFailedCallback.

Connect a signal handler for the “failed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on download #failed callback


Wrap a DownloadFailedCallback into a C_DownloadFailedCallback.

finished

type C_DownloadFinishedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

This signal is emitted when download finishes successfully or due to an error. In case of errors Download::failed signal is emitted before this one.

Connect a signal handler for the “finished” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after download #finished callback


Wrap the callback into a GClosure.

Generate a function pointer callable from C code, from a C_DownloadFinishedCallback.

A convenience synonym for Nothing :: Maybe DownloadFinishedCallback.

Connect a signal handler for the “finished” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on download #finished callback


Wrap a DownloadFinishedCallback into a C_DownloadFinishedCallback.

Type for the callback on the (unwrapped) C side.

Arguments

 = Word64 dataLength: the length of data received in bytes -> IO ()

This signal is emitted after response is received, every time new data has been written to the destination. It's useful to know the progress of the download operation.

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 download #receivedData callback


Wrap the callback into a GClosure.

Generate a function pointer callable from C code, from a C_DownloadReceivedDataCallback.

A convenience synonym for Nothing :: Maybe DownloadReceivedDataCallback.

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 download #receivedData callback


Wrap a DownloadReceivedDataCallback into a C_DownloadReceivedDataCallback.