| Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.WebKit2.Objects.Download
Description
- newtype Download = Download (ManagedPtr Download)
- class GObject o => IsDownload o
- toDownload :: IsDownload o => o -> IO Download
- noDownload :: Maybe Download
- data DownloadCancelMethodInfo
- downloadCancel :: (HasCallStack, MonadIO m, IsDownload a) => a -> m ()
- data DownloadGetAllowOverwriteMethodInfo
- downloadGetAllowOverwrite :: (HasCallStack, MonadIO m, IsDownload a) => a -> m Bool
- data DownloadGetDestinationMethodInfo
- downloadGetDestination :: (HasCallStack, MonadIO m, IsDownload a) => a -> m Text
- data DownloadGetElapsedTimeMethodInfo
- downloadGetElapsedTime :: (HasCallStack, MonadIO m, IsDownload a) => a -> m Double
- data DownloadGetEstimatedProgressMethodInfo
- downloadGetEstimatedProgress :: (HasCallStack, MonadIO m, IsDownload a) => a -> m Double
- data DownloadGetReceivedDataLengthMethodInfo
- downloadGetReceivedDataLength :: (HasCallStack, MonadIO m, IsDownload a) => a -> m Word64
- data DownloadGetRequestMethodInfo
- downloadGetRequest :: (HasCallStack, MonadIO m, IsDownload a) => a -> m URIRequest
- data DownloadGetResponseMethodInfo
- downloadGetResponse :: (HasCallStack, MonadIO m, IsDownload a) => a -> m URIResponse
- data DownloadGetWebViewMethodInfo
- downloadGetWebView :: (HasCallStack, MonadIO m, IsDownload a) => a -> m WebView
- data DownloadSetAllowOverwriteMethodInfo
- downloadSetAllowOverwrite :: (HasCallStack, MonadIO m, IsDownload a) => a -> Bool -> m ()
- data DownloadSetDestinationMethodInfo
- downloadSetDestination :: (HasCallStack, MonadIO m, IsDownload a) => a -> Text -> m ()
- data DownloadAllowOverwritePropertyInfo
- constructDownloadAllowOverwrite :: IsDownload o => Bool -> IO (GValueConstruct o)
- downloadAllowOverwrite :: AttrLabelProxy "allowOverwrite"
- getDownloadAllowOverwrite :: (MonadIO m, IsDownload o) => o -> m Bool
- setDownloadAllowOverwrite :: (MonadIO m, IsDownload o) => o -> Bool -> m ()
- data DownloadDestinationPropertyInfo
- downloadDestination :: AttrLabelProxy "destination"
- getDownloadDestination :: (MonadIO m, IsDownload o) => o -> m Text
- data DownloadEstimatedProgressPropertyInfo
- downloadEstimatedProgress :: AttrLabelProxy "estimatedProgress"
- getDownloadEstimatedProgress :: (MonadIO m, IsDownload o) => o -> m Double
- data DownloadResponsePropertyInfo
- downloadResponse :: AttrLabelProxy "response"
- getDownloadResponse :: (MonadIO m, IsDownload o) => o -> m URIResponse
- type C_DownloadCreatedDestinationCallback = Ptr () -> CString -> Ptr () -> IO ()
- type DownloadCreatedDestinationCallback = Text -> IO ()
- data DownloadCreatedDestinationSignalInfo
- afterDownloadCreatedDestination :: (IsDownload a, MonadIO m) => a -> DownloadCreatedDestinationCallback -> m SignalHandlerId
- genClosure_DownloadCreatedDestination :: DownloadCreatedDestinationCallback -> IO Closure
- mk_DownloadCreatedDestinationCallback :: C_DownloadCreatedDestinationCallback -> IO (FunPtr C_DownloadCreatedDestinationCallback)
- noDownloadCreatedDestinationCallback :: Maybe DownloadCreatedDestinationCallback
- onDownloadCreatedDestination :: (IsDownload a, MonadIO m) => a -> DownloadCreatedDestinationCallback -> m SignalHandlerId
- wrap_DownloadCreatedDestinationCallback :: DownloadCreatedDestinationCallback -> Ptr () -> CString -> Ptr () -> IO ()
- type C_DownloadDecideDestinationCallback = Ptr () -> CString -> Ptr () -> IO CInt
- type DownloadDecideDestinationCallback = Text -> IO Bool
- data DownloadDecideDestinationSignalInfo
- afterDownloadDecideDestination :: (IsDownload a, MonadIO m) => a -> DownloadDecideDestinationCallback -> m SignalHandlerId
- genClosure_DownloadDecideDestination :: DownloadDecideDestinationCallback -> IO Closure
- mk_DownloadDecideDestinationCallback :: C_DownloadDecideDestinationCallback -> IO (FunPtr C_DownloadDecideDestinationCallback)
- noDownloadDecideDestinationCallback :: Maybe DownloadDecideDestinationCallback
- onDownloadDecideDestination :: (IsDownload a, MonadIO m) => a -> DownloadDecideDestinationCallback -> m SignalHandlerId
- wrap_DownloadDecideDestinationCallback :: DownloadDecideDestinationCallback -> Ptr () -> CString -> Ptr () -> IO CInt
- type C_DownloadFailedCallback = Ptr () -> Ptr GError -> Ptr () -> IO ()
- type DownloadFailedCallback = GError -> IO ()
- data DownloadFailedSignalInfo
- afterDownloadFailed :: (IsDownload a, MonadIO m) => a -> DownloadFailedCallback -> m SignalHandlerId
- genClosure_DownloadFailed :: DownloadFailedCallback -> IO Closure
- mk_DownloadFailedCallback :: C_DownloadFailedCallback -> IO (FunPtr C_DownloadFailedCallback)
- noDownloadFailedCallback :: Maybe DownloadFailedCallback
- onDownloadFailed :: (IsDownload a, MonadIO m) => a -> DownloadFailedCallback -> m SignalHandlerId
- wrap_DownloadFailedCallback :: DownloadFailedCallback -> Ptr () -> Ptr GError -> Ptr () -> IO ()
- type C_DownloadFinishedCallback = Ptr () -> Ptr () -> IO ()
- type DownloadFinishedCallback = IO ()
- data DownloadFinishedSignalInfo
- afterDownloadFinished :: (IsDownload a, MonadIO m) => a -> DownloadFinishedCallback -> m SignalHandlerId
- genClosure_DownloadFinished :: DownloadFinishedCallback -> IO Closure
- mk_DownloadFinishedCallback :: C_DownloadFinishedCallback -> IO (FunPtr C_DownloadFinishedCallback)
- noDownloadFinishedCallback :: Maybe DownloadFinishedCallback
- onDownloadFinished :: (IsDownload a, MonadIO m) => a -> DownloadFinishedCallback -> m SignalHandlerId
- wrap_DownloadFinishedCallback :: DownloadFinishedCallback -> Ptr () -> Ptr () -> IO ()
- type C_DownloadReceivedDataCallback = Ptr () -> Word64 -> Ptr () -> IO ()
- type DownloadReceivedDataCallback = Word64 -> IO ()
- data DownloadReceivedDataSignalInfo
- afterDownloadReceivedData :: (IsDownload a, MonadIO m) => a -> DownloadReceivedDataCallback -> m SignalHandlerId
- genClosure_DownloadReceivedData :: DownloadReceivedDataCallback -> IO Closure
- mk_DownloadReceivedDataCallback :: C_DownloadReceivedDataCallback -> IO (FunPtr C_DownloadReceivedDataCallback)
- noDownloadReceivedDataCallback :: Maybe DownloadReceivedDataCallback
- onDownloadReceivedData :: (IsDownload a, MonadIO m) => a -> DownloadReceivedDataCallback -> m SignalHandlerId
- wrap_DownloadReceivedDataCallback :: DownloadReceivedDataCallback -> Ptr () -> Word64 -> Ptr () -> IO ()
Exported types
Constructors
| Download (ManagedPtr Download) |
Instances
| GObject Download Source # | |
| IsObject Download Source # | |
| IsDownload Download Source # | |
| ((~) * info (ResolveDownloadMethod t Download), MethodInfo * info Download p) => IsLabel t (Download -> p) Source # | |
| ((~) * info (ResolveDownloadMethod t Download), MethodInfo * info Download p) => IsLabelProxy t (Download -> p) Source # | |
| HasAttributeList * Download Source # | |
| type AttributeList Download Source # | |
| type SignalList Download Source # | |
class GObject o => IsDownload o Source #
Instances
| (GObject a, UnknownAncestorError Constraint Download a) => IsDownload a Source # | |
| IsDownload Download Source # | |
toDownload :: IsDownload o => o -> IO Download Source #
Methods
cancel
data DownloadCancelMethodInfo Source #
Instances
| ((~) * signature (m ()), MonadIO m, IsDownload a) => MethodInfo * DownloadCancelMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> m () |
Cancels the download. When the ongoing download
operation is effectively cancelled the signal
Download::failed is emitted with
DownloadErrorCancelledByUser error.
getAllowOverwrite
data DownloadGetAllowOverwriteMethodInfo Source #
Instances
| ((~) * signature (m Bool), MonadIO m, IsDownload a) => MethodInfo * DownloadGetAllowOverwriteMethodInfo a signature Source # | |
downloadGetAllowOverwrite Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> m Bool | Returns: the current value of the |
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
data DownloadGetDestinationMethodInfo Source #
Instances
| ((~) * signature (m Text), MonadIO m, IsDownload a) => MethodInfo * DownloadGetDestinationMethodInfo a signature Source # | |
downloadGetDestination Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> m Text | Returns: the destination URI or |
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
data DownloadGetElapsedTimeMethodInfo Source #
Instances
| ((~) * signature (m Double), MonadIO m, IsDownload a) => MethodInfo * DownloadGetElapsedTimeMethodInfo a signature Source # | |
downloadGetElapsedTime Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> 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
data DownloadGetEstimatedProgressMethodInfo Source #
Instances
| ((~) * signature (m Double), MonadIO m, IsDownload a) => MethodInfo * DownloadGetEstimatedProgressMethodInfo a signature Source # | |
downloadGetEstimatedProgress Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> 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
data DownloadGetReceivedDataLengthMethodInfo Source #
Instances
| ((~) * signature (m Word64), MonadIO m, IsDownload a) => MethodInfo * DownloadGetReceivedDataLengthMethodInfo a signature Source # | |
downloadGetReceivedDataLength Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> m Word64 | Returns: the amount of bytes already downloaded. |
Gets the length of the data already downloaded for download
in bytes.
getRequest
data DownloadGetRequestMethodInfo Source #
Instances
| ((~) * signature (m URIRequest), MonadIO m, IsDownload a) => MethodInfo * DownloadGetRequestMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> m URIRequest | Returns: the |
Retrieves the URIRequest object that backs the download
process.
getResponse
data DownloadGetResponseMethodInfo Source #
Instances
| ((~) * signature (m URIResponse), MonadIO m, IsDownload a) => MethodInfo * DownloadGetResponseMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> m URIResponse | Returns: the |
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
data DownloadGetWebViewMethodInfo Source #
Instances
| ((~) * signature (m WebView), MonadIO m, IsDownload a) => MethodInfo * DownloadGetWebViewMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> m WebView | Returns: the |
Get the WebView that initiated the download.
setAllowOverwrite
data DownloadSetAllowOverwriteMethodInfo Source #
Instances
| ((~) * signature (Bool -> m ()), MonadIO m, IsDownload a) => MethodInfo * DownloadSetAllowOverwriteMethodInfo a signature Source # | |
downloadSetAllowOverwrite Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> Bool |
|
| -> 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
data DownloadSetDestinationMethodInfo Source #
Instances
| ((~) * signature (Text -> m ()), MonadIO m, IsDownload a) => MethodInfo * DownloadSetDestinationMethodInfo a signature Source # | |
downloadSetDestination Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDownload a) | |
| => a |
|
| -> Text |
|
| -> 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
data DownloadAllowOverwritePropertyInfo Source #
Instances
constructDownloadAllowOverwrite :: IsDownload o => Bool -> IO (GValueConstruct o) Source #
downloadAllowOverwrite :: AttrLabelProxy "allowOverwrite" Source #
getDownloadAllowOverwrite :: (MonadIO m, IsDownload o) => o -> m Bool Source #
setDownloadAllowOverwrite :: (MonadIO m, IsDownload o) => o -> Bool -> m () Source #
destination
data DownloadDestinationPropertyInfo Source #
Instances
downloadDestination :: AttrLabelProxy "destination" Source #
getDownloadDestination :: (MonadIO m, IsDownload o) => o -> m Text Source #
estimatedProgress
data DownloadEstimatedProgressPropertyInfo Source #
Instances
downloadEstimatedProgress :: AttrLabelProxy "estimatedProgress" Source #
getDownloadEstimatedProgress :: (MonadIO m, IsDownload o) => o -> m Double Source #
response
data DownloadResponsePropertyInfo Source #
Instances
downloadResponse :: AttrLabelProxy "response" Source #
getDownloadResponse :: (MonadIO m, IsDownload o) => o -> m URIResponse Source #
Signals
createdDestination
type DownloadCreatedDestinationCallback = Text -> IO () Source #
afterDownloadCreatedDestination :: (IsDownload a, MonadIO m) => a -> DownloadCreatedDestinationCallback -> m SignalHandlerId Source #
mk_DownloadCreatedDestinationCallback :: C_DownloadCreatedDestinationCallback -> IO (FunPtr C_DownloadCreatedDestinationCallback) Source #
onDownloadCreatedDestination :: (IsDownload a, MonadIO m) => a -> DownloadCreatedDestinationCallback -> m SignalHandlerId Source #
wrap_DownloadCreatedDestinationCallback :: DownloadCreatedDestinationCallback -> Ptr () -> CString -> Ptr () -> IO () Source #
decideDestination
afterDownloadDecideDestination :: (IsDownload a, MonadIO m) => a -> DownloadDecideDestinationCallback -> m SignalHandlerId Source #
mk_DownloadDecideDestinationCallback :: C_DownloadDecideDestinationCallback -> IO (FunPtr C_DownloadDecideDestinationCallback) Source #
onDownloadDecideDestination :: (IsDownload a, MonadIO m) => a -> DownloadDecideDestinationCallback -> m SignalHandlerId Source #
wrap_DownloadDecideDestinationCallback :: DownloadDecideDestinationCallback -> Ptr () -> CString -> Ptr () -> IO CInt Source #
failed
type DownloadFailedCallback = GError -> IO () Source #
afterDownloadFailed :: (IsDownload a, MonadIO m) => a -> DownloadFailedCallback -> m SignalHandlerId Source #
mk_DownloadFailedCallback :: C_DownloadFailedCallback -> IO (FunPtr C_DownloadFailedCallback) Source #
onDownloadFailed :: (IsDownload a, MonadIO m) => a -> DownloadFailedCallback -> m SignalHandlerId Source #
wrap_DownloadFailedCallback :: DownloadFailedCallback -> Ptr () -> Ptr GError -> Ptr () -> IO () Source #
finished
type DownloadFinishedCallback = IO () Source #
afterDownloadFinished :: (IsDownload a, MonadIO m) => a -> DownloadFinishedCallback -> m SignalHandlerId Source #
mk_DownloadFinishedCallback :: C_DownloadFinishedCallback -> IO (FunPtr C_DownloadFinishedCallback) Source #
onDownloadFinished :: (IsDownload a, MonadIO m) => a -> DownloadFinishedCallback -> m SignalHandlerId Source #
wrap_DownloadFinishedCallback :: DownloadFinishedCallback -> Ptr () -> Ptr () -> IO () Source #
receivedData
type DownloadReceivedDataCallback = Word64 -> IO () Source #
afterDownloadReceivedData :: (IsDownload a, MonadIO m) => a -> DownloadReceivedDataCallback -> m SignalHandlerId Source #
mk_DownloadReceivedDataCallback :: C_DownloadReceivedDataCallback -> IO (FunPtr C_DownloadReceivedDataCallback) Source #
onDownloadReceivedData :: (IsDownload a, MonadIO m) => a -> DownloadReceivedDataCallback -> m SignalHandlerId Source #
wrap_DownloadReceivedDataCallback :: DownloadReceivedDataCallback -> Ptr () -> Word64 -> Ptr () -> IO () Source #