gi-webkit2-4.0.14: WebKit2 bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.WebKit2.Objects.Download

Contents

Description

 

Synopsis

Exported types

Methods

cancel

downloadCancel Source #

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

downloadGetAllowOverwrite Source #

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

downloadGetDestination Source #

Arguments

:: (HasCallStack, MonadIO m, IsDownload a) 
=> a

download: a Download

-> m 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

downloadGetElapsedTime Source #

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

downloadGetEstimatedProgress Source #

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.

getReceivedDataLength

downloadGetReceivedDataLength Source #

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

downloadGetRequest Source #

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

downloadGetResponse Source #

Arguments

:: (HasCallStack, MonadIO m, IsDownload a) 
=> a

download: a Download

-> m 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

downloadGetWebView Source #

Arguments

:: (HasCallStack, MonadIO m, IsDownload a) 
=> a

download: a Download

-> m 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

downloadSetAllowOverwrite Source #

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

downloadSetDestination Source #

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 tranfer starts, the file will be saved with the filename suggested by the server in UserDirectoryDirectoryDownload directory.

Properties

allowOverwrite

destination

estimatedProgress

response

Signals

createdDestination

decideDestination

failed

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

finished

receivedData