It derives from <GObject>.
Object used to communicate with the application when downloading.
<WebKitDownload> carries information about a
download request and response, including a
<WebKitURIRequest> and a
<WebKitURIResponse> objects. The application
may use this object to control the download process, or to simply figure
out what is to be downloaded, and handle the download process itself.
Whether or not the download is allowed to overwrite an existing file on
disk. If this property is #f and the destination already exists,
the download will fail.
Its value is a boolean.
Set it with (set! (download:allow-overwrite self) value).
The local path to where the download will be saved.
Its value is a string, or #f.
It is read only.
An estimate of the percent completion for the download operation. This
value will range from 0.0 to 1.0. The value is an estimate based on the
total number of bytes expected to be received for a download. If you
need a more accurate progress information you can connect to
download:received-data
signal to track the progress.
Its value is a real number.
It is read only.
The <WebKitURIResponse> associated with this
download.
Its value is a <WebKitURIResponse>, or
#f.
It is read only.
Cancels the download.
When the ongoing download operation is effectively cancelled the signal
download:failed is emitted with
cancelled-by-user error.
Passed: a <WebKitDownload>.
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.
Passed: a <WebKitDownload>.
Returned: a boolean.
the current value of the download:allow-overwrite property
Obtains the destination to which the downloaded file will be written.
You can connect to download:created-destination to make sure this
method returns a valid destination.
Passed: a <WebKitDownload>.
Returned: a string, or #f.
the destination or #f
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.
Passed: a <WebKitDownload>.
Returned: a real number.
seconds since the download was started
Gets the value of the download:estimated-progress property. 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 self.
Passed: a <WebKitDownload>.
Returned: a real number.
an estimate of the of the percent complete for a download as a range from 0.0 to 1.0.
Gets the length of the data already downloaded for self.
Gets the length of the data already downloaded for self in bytes.
Passed: a <WebKitDownload>.
Returned: an unsigned 64-bit integer.
the amount of bytes already downloaded.
Retrieves the <WebKitURIRequest> object that
backs the download process.
Passed: a <WebKitDownload>.
Returned: a <WebKitURIRequest>.
the <WebKitURIRequest> of self
Retrieves the <WebKitURIResponse> object that
backs the download process.
Retrieves the <WebKitURIResponse> object that
backs the download process. This method returns #f 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.
Passed: a <WebKitDownload>.
Returned: a <WebKitURIResponse>.
the <WebKitURIResponse>, or #f if the
response hasn’t been received yet.
Get the <WebKitWebView> that initiated the
download.
Passed: a <WebKitDownload>.
Returned: a <WebKitWebView>.
the <WebKitWebView> that initiated self, or
#f if self was not initiated by a
<WebKitWebView>.
Sets the download:allow-overwrite property.
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.
Passed: a <WebKitDownload>.
Passed: a boolean.
the new value for the download:allow-overwrite property
Sets the destination 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
download:set-destination. If you
want to set a fixed destination that doesn’t depend on the suggested
filename you can connect to notify::response signal and call
download:set-destination.
If download:decide-destination signal is not handled
and destination is not set when the download transfer starts, the file
will be saved with the filename suggested by the server in
directory-download directory.
Passed: a <WebKitDownload>.
Passed: a string.
the destination
Connect a handler with (connect object
download:created-destination handler). It is called as (handler
self destination).
This signal is emitted after download:decide-destination and before
download:received-data to
notify that destination file has been created successfully at
destination.
Passed: a <WebKitDownload>.
Passed: a string.
the destination
Connect a handler with (connect object download:decide-destination
handler). It is called as (handler self suggested-filename) ⇒
%return.
This signal is emitted after response is received to decide a
destination for the download using download:set-destination. If this signal is not
handled, the file will be downloaded to
directory-download directory using
suggested-filename.
Since 2.40, you may handle this signal asynchronously by returning
#t without calling download:set-destination. This indicates intent to
eventually call download:set-destination. In this case, the download
will not proceed until the destination is set or cancelled with
download:cancel.
Passed: a <WebKitDownload>.
Passed: a string.
the filename suggested for the download
Returned: a boolean.
#t to stop other handlers from being invoked for the event, or
#f to propagate the event further.
Connect a handler with (connect object download:failed handler).
It is called as (handler self error).
This signal is emitted when an error occurs during the download
operation. The given error, of the domain
WEBKIT_DOWNLOAD_ERROR, contains further details of the failure.
If the download is cancelled with download:cancel, this signal is emitted with error
cancelled-by-user. The download operation
finishes after an error and download:finished signal is emitted after this one.
Passed: a <WebKitDownload>.
Passed: a <GError>.
the <GError> that was triggered
Connect a handler with (connect object download:finished
handler). It is called as (handler self).
This signal is emitted when download finishes successfully or due to an
error. In case of errors download:failed signal is emitted before this one.
Passed: a <WebKitDownload>.
Connect a handler with (connect object download:received-data
handler). It is called as (handler self data-length).
This signal is emitted after response is received, every time new data has been written to the destination. It’s useful to know the progress of the download operation.
Passed: a <WebKitDownload>.
Passed: an unsigned 64-bit integer.
the length of data received in bytes