ICoreWebView2DownloadOperation

Trait ICoreWebView2DownloadOperation 

Source
pub trait ICoreWebView2DownloadOperation: IUnknown {
Show 19 methods // Required 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§

Source

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

Source

unsafe fn remove_bytes_received_changed( &self, token: EventRegistrationToken, ) -> HRESULT

Remove an event handler previously added with add_BytesReceivedChanged.

Source

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.

Source

unsafe fn remove_estimated_end_time_changed( &self, token: EventRegistrationToken, ) -> HRESULT

Remove an event handler previously added with add_EstimatedEndTimeChanged.

Source

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

Source

unsafe fn remove_state_changed(&self, token: EventRegistrationToken) -> HRESULT

Remove an event handler previously added with add_StateChanged.

Source

unsafe fn get_uri(&self, uri: *mut LPWSTR) -> HRESULT

The URI of the download.

Source

unsafe fn get_content_disposition( &self, content_disposition: *mut LPWSTR, ) -> HRESULT

The Content-Disposition header value from the download’s HTTP response.

Source

unsafe fn get_mime_type(&self, mime_type: *mut LPWSTR) -> HRESULT

MIME type of the downloaded content.

Source

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.

Source

unsafe fn get_bytes_received(&self, bytes_received: *mut i64) -> HRESULT

The number of bytes that have been written to the download file.

Source

unsafe fn get_estimated_end_time( &self, estimated_end_time: *mut LPWSTR, ) -> HRESULT

The estimated end time in ISO 8601 Date and Time Format.

Source

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.

Source

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.

Source

unsafe fn get_interrupt_reason( &self, interrupt_reason: *mut DownloadInterruptReason, ) -> HRESULT

The reason why connection with file host was broken.

Source

unsafe fn cancel(&self) -> HRESULT

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.

Source

unsafe fn pause(&self) -> HRESULT

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.

Source

unsafe fn resume(&self) -> HRESULT

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.

Source

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§

Source§

impl ComInterface for dyn ICoreWebView2DownloadOperation

Source§

const IID: IID = IID_ICORE_WEB_VIEW2_DOWNLOAD_OPERATION

The associated id for this interface
Source§

type VTable = ICoreWebView2DownloadOperationVTable

A COM compatible V-Table
Source§

type Super = dyn IUnknown

The interface that this interface inherits from
Source§

fn is_iid_in_inheritance_chain(riid: &GUID) -> bool

Check whether a given IID is in the inheritance hierarchy of this interface
Source§

impl<C: ICoreWebView2DownloadOperation> ProductionComInterface<C> for dyn ICoreWebView2DownloadOperation

Source§

fn vtable<O: Offset>() -> Self::VTable

Get the vtable for a particular COM interface

Implementations on Foreign Types§

Source§

impl<T: ICoreWebView2DownloadOperation + ComInterface + ?Sized> ICoreWebView2DownloadOperation for ComPtr<T>

Source§

unsafe fn add_bytes_received_changed( &self, event_handler: *mut *mut ICoreWebView2BytesReceivedChangedEventHandlerVTable, token: *mut EventRegistrationToken, ) -> HRESULT

Source§

unsafe fn remove_bytes_received_changed( &self, token: EventRegistrationToken, ) -> HRESULT

Source§

unsafe fn add_estimated_end_time_changed( &self, event_handler: *mut *mut ICoreWebView2EstimatedEndTimeChangedEventHandlerVTable, token: *mut EventRegistrationToken, ) -> HRESULT

Source§

unsafe fn remove_estimated_end_time_changed( &self, token: EventRegistrationToken, ) -> HRESULT

Source§

unsafe fn add_state_changed( &self, event_handler: *mut *mut ICoreWebView2StateChangedEventHandlerVTable, token: *mut EventRegistrationToken, ) -> HRESULT

Source§

unsafe fn remove_state_changed(&self, token: EventRegistrationToken) -> HRESULT

Source§

unsafe fn get_uri(&self, uri: *mut LPWSTR) -> HRESULT

Source§

unsafe fn get_content_disposition( &self, content_disposition: *mut LPWSTR, ) -> HRESULT

Source§

unsafe fn get_mime_type(&self, mime_type: *mut LPWSTR) -> HRESULT

Source§

unsafe fn get_total_bytes_to_receive( &self, total_bytes_to_receive: *mut i64, ) -> HRESULT

Source§

unsafe fn get_bytes_received(&self, bytes_received: *mut i64) -> HRESULT

Source§

unsafe fn get_estimated_end_time( &self, estimated_end_time: *mut LPWSTR, ) -> HRESULT

Source§

unsafe fn get_result_file_path(&self, result_file_path: *mut LPWSTR) -> HRESULT

Source§

unsafe fn get_state(&self, download_state: *mut DownloadState) -> HRESULT

Source§

unsafe fn get_interrupt_reason( &self, interrupt_reason: *mut DownloadInterruptReason, ) -> HRESULT

Source§

unsafe fn cancel(&self) -> HRESULT

Source§

unsafe fn pause(&self) -> HRESULT

Source§

unsafe fn resume(&self) -> HRESULT

Source§

unsafe fn get_can_resume(&self, can_resume: *mut BOOL) -> HRESULT

Source§

impl<T: ICoreWebView2DownloadOperation + ComInterface + ?Sized> ICoreWebView2DownloadOperation for ComRc<T>

Source§

unsafe fn add_bytes_received_changed( &self, event_handler: *mut *mut ICoreWebView2BytesReceivedChangedEventHandlerVTable, token: *mut EventRegistrationToken, ) -> HRESULT

Source§

unsafe fn remove_bytes_received_changed( &self, token: EventRegistrationToken, ) -> HRESULT

Source§

unsafe fn add_estimated_end_time_changed( &self, event_handler: *mut *mut ICoreWebView2EstimatedEndTimeChangedEventHandlerVTable, token: *mut EventRegistrationToken, ) -> HRESULT

Source§

unsafe fn remove_estimated_end_time_changed( &self, token: EventRegistrationToken, ) -> HRESULT

Source§

unsafe fn add_state_changed( &self, event_handler: *mut *mut ICoreWebView2StateChangedEventHandlerVTable, token: *mut EventRegistrationToken, ) -> HRESULT

Source§

unsafe fn remove_state_changed(&self, token: EventRegistrationToken) -> HRESULT

Source§

unsafe fn get_uri(&self, uri: *mut LPWSTR) -> HRESULT

Source§

unsafe fn get_content_disposition( &self, content_disposition: *mut LPWSTR, ) -> HRESULT

Source§

unsafe fn get_mime_type(&self, mime_type: *mut LPWSTR) -> HRESULT

Source§

unsafe fn get_total_bytes_to_receive( &self, total_bytes_to_receive: *mut i64, ) -> HRESULT

Source§

unsafe fn get_bytes_received(&self, bytes_received: *mut i64) -> HRESULT

Source§

unsafe fn get_estimated_end_time( &self, estimated_end_time: *mut LPWSTR, ) -> HRESULT

Source§

unsafe fn get_result_file_path(&self, result_file_path: *mut LPWSTR) -> HRESULT

Source§

unsafe fn get_state(&self, download_state: *mut DownloadState) -> HRESULT

Source§

unsafe fn get_interrupt_reason( &self, interrupt_reason: *mut DownloadInterruptReason, ) -> HRESULT

Source§

unsafe fn cancel(&self) -> HRESULT

Source§

unsafe fn pause(&self) -> HRESULT

Source§

unsafe fn resume(&self) -> HRESULT

Source§

unsafe fn get_can_resume(&self, can_resume: *mut BOOL) -> HRESULT

Implementors§