Maintainer | gtk2hs-users@lists.sourceforge.net |
---|---|
Stability | provisional |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
Object used to communicate with the application when downloading
- data Download
- class GObjectClass o => DownloadClass o
- data DownloadError
- data DownloadStatus
- downloadNew :: NetworkRequestClass request => request -> IO Download
- downloadStart :: DownloadClass self => self -> IO ()
- downloadCancel :: DownloadClass self => self -> IO ()
- downloadGetUri :: (DownloadClass self, GlibString string) => self -> IO (Maybe string)
- downloadGetNetworkRequest :: DownloadClass self => self -> IO NetworkRequest
- downloadGetNetworkResponse :: DownloadClass self => self -> IO NetworkResponse
- downloadGetSuggestedFilename :: (DownloadClass self, GlibString string) => self -> IO (Maybe string)
- downloadGetDestinationUri :: (DownloadClass self, GlibString string) => 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, GlibString string) => self -> string -> IO ()
- currentSize :: DownloadClass self => ReadAttr self Int
- destinationUri :: (DownloadClass self, GlibString string) => 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, GlibString string) => ReadAttr self (Maybe string)
- totalSize :: DownloadClass self => ReadAttr self Int
- downloadError :: (DownloadClass self, GlibString string) => Signal self (Int -> Int -> string -> IO Bool)
Description
WebKitDownload carries information about a download request, including a WebKitNetworkRequest 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.
Types
class GObjectClass o => DownloadClass o Source
Enums
data DownloadError Source
data DownloadStatus Source
Constructors
downloadNew :: NetworkRequestClass request => request -> IO Download Source
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
.
:: (DownloadClass self, GlibString string) | |
=> self | |
-> IO (Maybe string) | the uri or |
Retrieves the URI from Download
which is being downloaded.
downloadGetNetworkRequest :: DownloadClass self => self -> IO NetworkRequest Source
Retrieves the NetworkRequest
that backs the download process.
downloadGetNetworkResponse :: DownloadClass self => self -> IO NetworkResponse Source
Retrieves the NetworkResponse
object that backs the download process.
- Since 1.1.16
downloadGetSuggestedFilename Source
:: (DownloadClass self, GlibString string) | |
=> self | |
-> IO (Maybe string) | the suggested filename or |
Retrieves the filename that was suggested by the server, or the one derived from the URI.
downloadGetDestinationUri :: (DownloadClass self, GlibString string) => self -> IO (Maybe string) Source
Obtains the URI to which the downloaded file will be written.
It is set by Application before call downloadStart
:: DownloadClass self | |
=> self | |
-> IO Double | a |
Determines the current progress of the Download
:: DownloadClass self | |
=> self | |
-> IO Double | seconds since the |
:: DownloadClass self | |
=> self | |
-> IO Int | the expected total size of the downloaded file. |
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.
:: DownloadClass self | |
=> self | |
-> IO Int | the already downloaded size. |
Returns the current already downleaded size
:: DownloadClass self | |
=> self | |
-> IO DownloadStatus | the current |
Obtains the current status of the Download
as DownloadStatus
downloadSetDestinationUri Source
:: (DownloadClass self, GlibString string) | |
=> self | |
-> string |
|
-> IO () |
Defines the URI that should be used to save the downloaded file to.
Attributes
currentSize :: DownloadClass self => ReadAttr self Int Source
The length of the data already downloaded
Default value: 0
- Since 1.1.2
destinationUri :: (DownloadClass self, GlibString string) => 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 NetworkRequest Source
The NetworkRequest instance associated with the download.
- Since 1.1.2
networkResponse :: DownloadClass self => Attr self NetworkResponse Source
The NetworkResponse instance associated with the download.
- Since 1.1.16
progress :: DownloadClass self => ReadAttr self Double Source
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 DownloadStatus Source
suggestedFilename :: (DownloadClass self, GlibString string) => ReadAttr self (Maybe string) Source
The file name suggested as default when saving
Default value: ""
- Since 1.1.2
totalSize :: DownloadClass self => ReadAttr self Int Source
The total size of the file
Default value: 0
- Since 1.1.2
Signals
downloadError :: (DownloadClass self, GlibString string) => 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