WebKit.Download
Description: Reference for WebKit.Download

### Class

# WebKitDownload

unstable since: 6.0

#### Description [src]

    final class WebKit.Download : GObject.Object
    {
      /* No available fields */
    }

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.

Available since: 6.0

#### Ancestors

- GObject

#### Instance methods

###### webkit_download_cancel

Cancels the download.

unstable since: 6.0

###### webkit_download_get_allow_overwrite

Returns the current value of the `WebKitDownload:allow-overwrite` property.

since: 2.6

###### webkit_download_get_destination

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

unstable since: 6.0

###### webkit_download_get_elapsed_time

Gets the elapsed time in seconds, including any fractional part.

unstable since: 6.0

###### webkit_download_get_estimated_progress

Gets the value of the `WebKitDownload:estimated-progress` property. Gets the value of the `WebKitDownload:estimated-progress` property. You can monitor the estimated progress of the download operation by connecting to the notify::estimated-progress signal of `download`.

unstable since: 6.0

###### webkit_download_get_received_data_length

Gets the length of the data already downloaded for `download`.

unstable since: 6.0

###### webkit_download_get_request

Retrieves the `WebKitURIRequest` object that backs the download process.

unstable since: 6.0

###### webkit_download_get_response

Retrieves the `WebKitURIResponse` object that backs the download process.

unstable since: 6.0

###### webkit_download_get_web_view

Get the `WebKitWebView` that initiated the download.

unstable since: 6.0

###### webkit_download_set_allow_overwrite

Sets the `WebKitDownload:allow-overwrite` property.

since: 2.6

###### webkit_download_set_destination

Sets the destination to which the downloaded file will be written.

unstable since: 6.0

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### WebKit.Download:allow-overwrite

Whether or not the download is allowed to overwrite an existing file on disk. If this property is `FALSE` and the destination already exists, the download will fail.

since: 2.6

###### WebKit.Download:destination

The local path to where the download will be saved.

unstable since: 6.0

###### WebKit.Download:estimated-progress

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 `WebKitDownload::received-data` signal to track the progress.

unstable since: 6.0

###### WebKit.Download:response

The `WebKitURIResponse` associated with this download.

unstable since: 6.0

#### Signals

###### WebKit.Download::created-destination

This signal is emitted after `WebKitDownload::decide-destination` and before `WebKitDownload::received-data` to notify that destination file has been created successfully at `destination`.

unstable since: 6.0

###### WebKit.Download::decide-destination

This signal is emitted after response is received to decide a destination for the download using webkit_download_set_destination(). If this signal is not handled, the file will be downloaded to `G_USER_DIRECTORY_DOWNLOAD` directory using `suggested_filename`.

unstable since: 6.0

###### WebKit.Download::failed

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 webkit_download_cancel(), this signal is emitted with error `WEBKIT_DOWNLOAD_ERROR_CANCELLED_BY_USER`. The download operation finishes after an error and `WebKitDownload::finished` signal is emitted after this one.

unstable since: 6.0

###### WebKit.Download::finished

This signal is emitted when download finishes successfully or due to an error. In case of errors `WebKitDownload::failed` signal is emitted before this one.

unstable since: 6.0

###### WebKit.Download::received-data

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.

unstable since: 6.0

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0

#### Class structure

    struct WebKitDownloadClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`
  No description available.