gi-webkit-3.0.14: WebKit 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.WebKit.Objects.Download

Contents

Description

Download carries information about a download request, including a NetworkRequest object. The application may use this object to control the download process, or to simply figure out what is to be downloaded, and do it itself.

Synopsis

Exported types

Methods

cancel

downloadCancel Source #

Arguments

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

download: the Download

-> m () 

Cancels the download. Calling this will not free the Download object, so you still need to call objectUnref on it, if you are the owner of a reference. Notice that cancelling the download provokes the emission of the WebKitDownload::error signal, reporting that the download was cancelled.

Since: 1.1.2

getCurrentSize

downloadGetCurrentSize Source #

Arguments

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

download: the Download

-> m Word64

Returns: the already downloaded size

Current already downloaded size.

Since: 1.1.2

getDestinationUri

downloadGetDestinationUri Source #

Arguments

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

download: the Download

-> m Text

Returns: the destination URI or Nothing

Obtains the URI to which the downloaded file will be written. This must have been set by the application before calling downloadStart, and may be Nothing.

Since: 1.1.2

getElapsedTime

downloadGetElapsedTime Source #

Arguments

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

download: a Download

-> m Double

Returns: seconds since the download was started, as a gdouble

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

Since: 1.1.2

getNetworkRequest

downloadGetNetworkRequest Source #

Arguments

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

download: the Download

-> m NetworkRequest

Returns: the NetworkRequest instance

Retrieves the NetworkRequest object that backs the download process.

Since: 1.1.2

getNetworkResponse

downloadGetNetworkResponse Source #

Arguments

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

download: the Download

-> m NetworkResponse

Returns: the NetworkResponse instance

Retrieves the NetworkResponse object that backs the download process.

Since: 1.1.16

getProgress

downloadGetProgress Source #

Arguments

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

download: a Download

-> m Double

Returns: a gdouble ranging from 0.0 to 1.0.

Determines the current progress of the download.

Since: 1.1.2

getStatus

downloadGetStatus Source #

Arguments

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

download: the Download

-> m DownloadStatus

Returns: the current DownloadStatus

Obtains the current status of the download, as a DownloadStatus.

Since: 1.1.2

getSuggestedFilename

downloadGetSuggestedFilename Source #

Arguments

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

download: the Download

-> m Text

Returns: the suggested filename

Retrieves the filename that was suggested by the server, or the one derived by WebKit from the URI.

Since: 1.1.2

getTotalSize

downloadGetTotalSize Source #

Arguments

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

download: the Download

-> m Word64

Returns: the expected total size of the downloaded file

Returns the expected total size of the download. This is expected because the server may provide incorrect or missing Content-Length. Notice that this may grow over time, as it will be always the same as current_size in the cases where current size surpasses it.

Since: 1.1.2

getUri

downloadGetUri Source #

Arguments

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

download: the Download

-> m Text

Returns: the URI

Convenience method to retrieve the URI from the NetworkRequest which is being downloaded.

Since: 1.1.2

new

downloadNew Source #

Arguments

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

request: a NetworkRequest

-> m Download

Returns: the new Download

Creates a new Download object for the given NetworkRequest object.

Since: 1.1.2

setDestinationUri

downloadSetDestinationUri Source #

Arguments

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

download: the Download

-> Text

destinationUri: the destination URI

-> m () 

Defines the URI that should be used to save the downloaded file to.

Since: 1.1.2

start

downloadStart Source #

Arguments

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

download: the Download

-> m () 

Initiates the download. Notice that you must have set the destination-uri property before calling this method.

Since: 1.1.2

Properties

currentSize

destinationUri

networkRequest

networkResponse

progress

status

suggestedFilename

totalSize

Signals

error