Trait webview2_sys::ICoreWebView2DownloadOperation [−][src]
pub trait ICoreWebView2DownloadOperation: IUnknown {
Show 19 methods
unsafe fn add_bytes_received_changed(
&self,
event_handler: *mut *mut ICoreWebView2BytesReceivedChangedEventHandlerVTable,
token: *mut EventRegistrationToken
) -> HRESULT;
unsafe fn remove_bytes_received_changed(
&self,
token: EventRegistrationToken
) -> HRESULT;
unsafe fn add_estimated_end_time_changed(
&self,
event_handler: *mut *mut ICoreWebView2EstimatedEndTimeChangedEventHandlerVTable,
token: *mut EventRegistrationToken
) -> HRESULT;
unsafe fn remove_estimated_end_time_changed(
&self,
token: EventRegistrationToken
) -> HRESULT;
unsafe fn add_state_changed(
&self,
event_handler: *mut *mut ICoreWebView2StateChangedEventHandlerVTable,
token: *mut EventRegistrationToken
) -> HRESULT;
unsafe fn remove_state_changed(
&self,
token: EventRegistrationToken
) -> HRESULT;
unsafe fn get_uri(&self, uri: *mut LPWSTR) -> HRESULT;
unsafe fn get_content_disposition(
&self,
content_disposition: *mut LPWSTR
) -> HRESULT;
unsafe fn get_mime_type(&self, mime_type: *mut LPWSTR) -> HRESULT;
unsafe fn get_total_bytes_to_receive(
&self,
total_bytes_to_receive: *mut i64
) -> HRESULT;
unsafe fn get_bytes_received(&self, bytes_received: *mut i64) -> HRESULT;
unsafe fn get_estimated_end_time(
&self,
estimated_end_time: *mut LPWSTR
) -> HRESULT;
unsafe fn get_result_file_path(
&self,
result_file_path: *mut LPWSTR
) -> HRESULT;
unsafe fn get_state(&self, download_state: *mut DownloadState) -> HRESULT;
unsafe fn get_interrupt_reason(
&self,
interrupt_reason: *mut DownloadInterruptReason
) -> HRESULT;
unsafe fn cancel(&self) -> HRESULT;
unsafe fn pause(&self) -> HRESULT;
unsafe fn resume(&self) -> HRESULT;
unsafe fn get_can_resume(&self, can_resume: *mut BOOL) -> HRESULT;
}
Expand description
Represents a download operation. Gives access to the download’s metadata and supports a user canceling, pausing, or resuming the download.
Required methods
unsafe fn add_bytes_received_changed(
&self,
event_handler: *mut *mut ICoreWebView2BytesReceivedChangedEventHandlerVTable,
token: *mut EventRegistrationToken
) -> HRESULT
unsafe fn add_bytes_received_changed(
&self,
event_handler: *mut *mut ICoreWebView2BytesReceivedChangedEventHandlerVTable,
token: *mut EventRegistrationToken
) -> HRESULT
Add an event handler for the BytesReceivedChanged
event.
\snippet ScenarioCustomDownloadExperience.cpp BytesReceivedChanged
unsafe fn remove_bytes_received_changed(
&self,
token: EventRegistrationToken
) -> HRESULT
unsafe fn remove_bytes_received_changed(
&self,
token: EventRegistrationToken
) -> HRESULT
Remove an event handler previously added with add_BytesReceivedChanged
.
unsafe fn add_estimated_end_time_changed(
&self,
event_handler: *mut *mut ICoreWebView2EstimatedEndTimeChangedEventHandlerVTable,
token: *mut EventRegistrationToken
) -> HRESULT
unsafe fn add_estimated_end_time_changed(
&self,
event_handler: *mut *mut ICoreWebView2EstimatedEndTimeChangedEventHandlerVTable,
token: *mut EventRegistrationToken
) -> HRESULT
Add an event handler for the EstimatedEndTimeChanged
event.
unsafe fn remove_estimated_end_time_changed(
&self,
token: EventRegistrationToken
) -> HRESULT
unsafe fn remove_estimated_end_time_changed(
&self,
token: EventRegistrationToken
) -> HRESULT
Remove an event handler previously added with add_EstimatedEndTimeChanged
.
unsafe fn add_state_changed(
&self,
event_handler: *mut *mut ICoreWebView2StateChangedEventHandlerVTable,
token: *mut EventRegistrationToken
) -> HRESULT
unsafe fn add_state_changed(
&self,
event_handler: *mut *mut ICoreWebView2StateChangedEventHandlerVTable,
token: *mut EventRegistrationToken
) -> HRESULT
Add an event handler for the StateChanged
event.
\snippet ScenarioCustomDownloadExperience.cpp StateChanged
unsafe fn remove_state_changed(&self, token: EventRegistrationToken) -> HRESULT
unsafe fn remove_state_changed(&self, token: EventRegistrationToken) -> HRESULT
Remove an event handler previously added with add_StateChanged
.
unsafe fn get_content_disposition(
&self,
content_disposition: *mut LPWSTR
) -> HRESULT
unsafe fn get_content_disposition(
&self,
content_disposition: *mut LPWSTR
) -> HRESULT
The Content-Disposition header value from the download’s HTTP response.
unsafe fn get_mime_type(&self, mime_type: *mut LPWSTR) -> HRESULT
unsafe fn get_mime_type(&self, mime_type: *mut LPWSTR) -> HRESULT
MIME type of the downloaded content.
unsafe fn get_total_bytes_to_receive(
&self,
total_bytes_to_receive: *mut i64
) -> HRESULT
unsafe fn get_total_bytes_to_receive(
&self,
total_bytes_to_receive: *mut i64
) -> HRESULT
The expected size of the download in total number of bytes based on the HTTP Content-Length header. Returns -1 if the size is unknown.
unsafe fn get_bytes_received(&self, bytes_received: *mut i64) -> HRESULT
unsafe fn get_bytes_received(&self, bytes_received: *mut i64) -> HRESULT
The number of bytes that have been written to the download file.
unsafe fn get_estimated_end_time(
&self,
estimated_end_time: *mut LPWSTR
) -> HRESULT
unsafe fn get_estimated_end_time(
&self,
estimated_end_time: *mut LPWSTR
) -> HRESULT
The estimated end time in ISO 8601 Date and Time Format.
unsafe fn get_result_file_path(&self, result_file_path: *mut LPWSTR) -> HRESULT
unsafe fn get_result_file_path(&self, result_file_path: *mut LPWSTR) -> HRESULT
The absolute path to the download file, including file name. Host can change
this from ICoreWebView2DownloadStartingEventArgs
.
unsafe fn get_state(&self, download_state: *mut DownloadState) -> HRESULT
unsafe fn get_state(&self, download_state: *mut DownloadState) -> HRESULT
The state of the download. A download can be in progress, interrupted, or
completed. See COREWEBVIEW2_DOWNLOAD_STATE
for descriptions of states.
unsafe fn get_interrupt_reason(
&self,
interrupt_reason: *mut DownloadInterruptReason
) -> HRESULT
unsafe fn get_interrupt_reason(
&self,
interrupt_reason: *mut DownloadInterruptReason
) -> HRESULT
The reason why connection with file host was broken.
Cancels the download. If canceled, the default download dialog shows
that the download was canceled. Host should set the Cancel
property from
ICoreWebView2SDownloadStartingEventArgs
if the download should be
canceled without displaying the default download dialog.
Pauses the download. If paused, the default download dialog shows that the
download is paused. No effect if download is already paused. Pausing a
download changes the state to COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED
with InterruptReason
set to COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_PAUSED
.
Resumes a paused download. May also resume a download that was interrupted
for another reason, if CanResume
returns true. Resuming a download changes
the state from COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED
to
COREWEBVIEW2_DOWNLOAD_STATE_IN_PROGRESS
.
unsafe fn get_can_resume(&self, can_resume: *mut BOOL) -> HRESULT
unsafe fn get_can_resume(&self, can_resume: *mut BOOL) -> HRESULT
Returns true if an interrupted download can be resumed. Downloads with
the following interrupt reasons may automatically resume without you
calling any methods:
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE
,
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH
,
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT
.
In these cases download progress may be restarted with BytesReceived
reset to 0.
Trait Implementations
A COM compatible V-Table
Check whether a given IID is in the inheritance hierarchy of this interface