ewebkit2
1.11.0
Web engine based on WebKit2 for EFL
|
Describes the Download Job API. More...
Go to the source code of this file.
Typedefs | |
typedef struct EwkObject | Ewk_Download_Job |
typedef enum Ewk_Download_Job_State | Ewk_Download_Job_State |
Creates a type name for Ewk_Download_Job_State. | |
Enumerations | |
enum | Ewk_Download_Job_State { EWK_DOWNLOAD_JOB_STATE_UNKNOWN = -1, EWK_DOWNLOAD_JOB_STATE_NOT_STARTED, EWK_DOWNLOAD_JOB_STATE_DOWNLOADING, EWK_DOWNLOAD_JOB_STATE_FAILED, EWK_DOWNLOAD_JOB_STATE_CANCELLING, EWK_DOWNLOAD_JOB_STATE_CANCELLED, EWK_DOWNLOAD_JOB_STATE_FINISHED } |
Defines the possible states of a download. More... | |
Functions | |
EAPI Ewk_Download_Job_State | ewk_download_job_state_get (const Ewk_Download_Job *download) |
EAPI Ewk_Url_Request * | ewk_download_job_request_get (const Ewk_Download_Job *download) |
EAPI Ewk_Url_Response * | ewk_download_job_response_get (const Ewk_Download_Job *download) |
EAPI const char * | ewk_download_job_destination_get (const Ewk_Download_Job *download) |
EAPI Eina_Bool | ewk_download_job_destination_set (Ewk_Download_Job *download, const char *destination) |
EAPI const char * | ewk_download_job_suggested_filename_get (const Ewk_Download_Job *download) |
EAPI Eina_Bool | ewk_download_job_cancel (Ewk_Download_Job *download) |
EAPI double | ewk_download_job_estimated_progress_get (const Ewk_Download_Job *download) |
EAPI double | ewk_download_job_elapsed_time_get (const Ewk_Download_Job *download) |
EAPI uint64_t | ewk_download_job_received_data_size_get (const Ewk_Download_Job *download) |
Describes the Download Job API.
typedef struct EwkObject Ewk_Download_Job |
Declare Ewk_Download_Job as Ewk_Object.
Defines the possible states of a download.
EAPI Eina_Bool ewk_download_job_cancel | ( | Ewk_Download_Job * | download) |
Cancels the download asynchronously.
When the ongoing download operation is effectively cancelled a "download,cancelled" signal will be emitted on the view.
download | a Ewk_Download_Job to cancel. |
EINA_TRUE
if the cancellation request was taken into account, or EINA_FALSE
otherwise. EAPI const char* ewk_download_job_destination_get | ( | const Ewk_Download_Job * | download) |
Query the URL to which the downloaded file will be written.
download | a Ewk_Download_Job to query. |
NULL
. This pointer is guaranteed to be eina_stringshare, so whenever possible save yourself some cpu cycles and use eina_stringshare_ref() instead of eina_stringshare_add() or strdup(). EAPI Eina_Bool ewk_download_job_destination_set | ( | Ewk_Download_Job * | download, |
const char * | destination | ||
) |
Sets the destination path for this download.
Sets the path to which the downloaded file will be written.
This method needs to be called before the download transfer starts, by connecting to the "download,new" signal on the Ewk_View and setting the destination in the callback. To set the destination using the filename suggested by the server use ewk_download_job_suggested_filename_get().
download | Ewk_Download_Job to update. |
destination | the destination path. |
EINA_TRUE
if successful, EINA_FALSE
otherwise.EAPI double ewk_download_job_elapsed_time_get | ( | const Ewk_Download_Job * | download) |
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.
download | a Ewk_Download_Job |
EAPI double ewk_download_job_estimated_progress_get | ( | const Ewk_Download_Job * | download) |
Query the estimated progress for this download.
download | a Ewk_Download_Job to query. |
EAPI uint64_t ewk_download_job_received_data_size_get | ( | const Ewk_Download_Job * | download) |
Gets the data size, already downloaded.
If the download finished, had an error or was cancelled this is the data size between its start and the end.
download | a Ewk_Download_Job to query. |
EAPI Ewk_Url_Request* ewk_download_job_request_get | ( | const Ewk_Download_Job * | download) |
Query the URL request for this download.
download | a Ewk_Download_Job to query. |
EAPI Ewk_Url_Response* ewk_download_job_response_get | ( | const Ewk_Download_Job * | download) |
Query the URL response for this download.
download | a Ewk_Download_Job to query. |
NULL
if it was not received yet. EAPI Ewk_Download_Job_State ewk_download_job_state_get | ( | const Ewk_Download_Job * | download) |
Query the state for this download.
download | a Ewk_Download_Job to query. |
EAPI const char* ewk_download_job_suggested_filename_get | ( | const Ewk_Download_Job * | download) |
Queries the suggested file name for this download.
It can be useful to use the value returned by this function to construct the destination path to pass to ewk_download_job_destination_set().
download | Ewk_Download_Job to query. |