webkit-0.11.0: Binding to the Webkit library.Source codeContentsIndex
Graphics.UI.Gtk.WebKit.Download
Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
Contents
Types
Enums
Constructors
Methods
Attributes
Signals
Description
Object used to communicate with the application when downloading
Synopsis
data Download
data DownloadError
= DownloadErrorCancelledByUser
| DownloadErrorDestination
| DownloadErrorNetwork
data DownloadStatus
= DownloadStatusError
| DownloadStatusCreated
| DownloadStatusStarted
| DownloadStatusCancelled
| DownloadStatusFinished
downloadNew :: NetworkRequestClass request => request -> IO Download
downloadStart :: DownloadClass self => self -> IO ()
downloadCancel :: DownloadClass self => self -> IO ()
downloadGetUri :: DownloadClass self => self -> IO (Maybe String)
downloadGetNetworkRequest :: DownloadClass self => self -> IO NetworkRequest
downloadGetSuggestedFilename :: DownloadClass self => self -> IO (Maybe String)
downloadGetDestinationUri :: DownloadClass self => self -> IO (Maybe String)
downloadGetProgress :: DownloadClass self => self -> IO Double
downloadGetElapsedTime :: DownloadClass self => self -> IO Double
downloadGetTotalSize :: DownloadClass self => self -> IO Int
downloadGetCurrentSize :: DownloadClass self => self -> IO Int
downloadGetStatus :: DownloadClass self => self -> IO DownloadStatus
downloadSetDestinationUri :: DownloadClass self => self -> String -> IO ()
currentSize :: DownloadClass self => ReadAttr self Int
destinationUri :: DownloadClass self => Attr self (Maybe String)
networkRequest :: DownloadClass self => Attr self NetworkRequest
networkResponse :: DownloadClass self => Attr self NetworkResponse
progress :: DownloadClass self => ReadAttr self Double
status :: DownloadClass self => ReadAttr self DownloadStatus
suggestedFilename :: DownloadClass self => ReadAttr self (Maybe String)
totalSize :: DownloadClass self => ReadAttr self Int
downloadError :: DownloadClass self => Signal self (Int -> Int -> String -> IO Bool)
Types
data Download Source
Enums
data DownloadError Source
Constructors
DownloadErrorCancelledByUser
DownloadErrorDestination
DownloadErrorNetwork
data DownloadStatus Source
Constructors
DownloadStatusError
DownloadStatusCreated
DownloadStatusStarted
DownloadStatusCancelled
DownloadStatusFinished
Constructors
downloadNew :: NetworkRequestClass request => request -> IO DownloadSource

Create a new Download instance for the given NetworkRequest

Object used to communicate with the application when downloading.

Methods
downloadStart :: DownloadClass self => self -> IO ()Source

Initiates the Download.

Notice that you must have set the destination-uri property before calling this function.

downloadCancel :: DownloadClass self => self -> IO ()Source
Cancels the Download.
downloadGetUriSource
:: DownloadClass self
=> selfthe uri or Nothing in case of failed
-> IO (Maybe String)
Retrieves the URI from Download which is being downloaded.
downloadGetNetworkRequest :: DownloadClass self => self -> IO NetworkRequestSource
Retrieves the NetworkRequest that backs the download process.
downloadGetSuggestedFilenameSource
:: DownloadClass self
=> selfthe suggested filename or Nothing in case of failed
-> IO (Maybe String)
Retrieves the filename that was suggested by the server, or the one derived from the URI.
downloadGetDestinationUri :: DownloadClass self => self -> IO (Maybe String)Source

Obtains the URI to which the downloaded file will be written.

It is set by Application before call downloadStart

downloadGetProgressSource
:: DownloadClass self
=> selfa Double ranging from 0.0 to 1.0
-> IO Double
Determines the current progress of the Download
downloadGetElapsedTimeSource
:: DownloadClass self
=> selfseconds since the Download was started.
-> IO Double

Return elapsed time for the Download in seconds. includeing any fractional part.

If the Download is finished, had an error or was cancelled, this is the time between its start and the event.

downloadGetTotalSizeSource
:: DownloadClass self
=> selfthe expected total size of the downloaded file.
-> IO Int

Returns the excepted 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.

downloadGetCurrentSizeSource
:: DownloadClass self
=> selfthe already downloaded size.
-> IO Int
Returns the current already downleaded size
downloadGetStatusSource
:: DownloadClass self
=> selfthe current DownloadStatus
-> IO DownloadStatus
Obtains the current status of the Download as DownloadStatus
downloadSetDestinationUriSource
:: DownloadClass self
=> selfdestination_uri - the destination URI
-> String
-> IO ()
Defines the URI that should be used to save the downloaded file to.
Attributes
currentSize :: DownloadClass self => ReadAttr self IntSource

The length of the data already downloaded

Default value: 0

  • Since 1.1.2
destinationUri :: DownloadClass self => Attr self (Maybe String)Source

The URI of the save location for this download.

Default value: ""

  • Since 1.1.2
networkRequest :: DownloadClass self => Attr self NetworkRequestSource

The NetworkRequest instance associated with the download.

  • Since 1.1.2
networkResponse :: DownloadClass self => Attr self NetworkResponseSource

The NetworkResponse instance associated with the download.

  • Since 1.1.16
progress :: DownloadClass self => ReadAttr self DoubleSource

Determines the current progress of the download. Notice that, although the progress changes are reported as soon as possible, the emission of the notify signal for this property is throttled, for the benefit of download managers. If you care about every update, use Download : currentSize.

Allowed values: [0,1]

Default value: 1

  • Since 1.1.2
status :: DownloadClass self => ReadAttr self DownloadStatusSource

Determines the current status of the download.

Default value: DownloadStatusCreated

  • Since 1.1.2
suggestedFilename :: DownloadClass self => ReadAttr self (Maybe String)Source

The file name suggested as default when saving

Default value: ""

  • Since 1.1.2
totalSize :: DownloadClass self => ReadAttr self IntSource

The total size of the file

Default value: 0

  • Since 1.1.2
Signals
downloadError :: DownloadClass self => Signal self (Int -> Int -> String -> IO Bool)Source

Emitted when download is interrupted either by user action or by network errors, errorDetail will take any value of DownloadError.

download: the object on which the signal is emitted errorCode: the corresponding error code errorDetail: detailed error code for the error, see DownloadError reason: a string describing the error

Since 1.1.2

Produced by Haddock version 2.6.0