pub struct WebView { /* private fields */ }
Expand description
Wrapper for ICoreWebView2
.
Implementations§
Source§impl WebView
impl WebView
pub fn into_inner(self) -> ComRc<dyn ICoreWebView2>
pub fn as_inner(&self) -> &ComRc<dyn ICoreWebView2>
Source§impl WebView
impl WebView
pub fn get_settings(&self) -> Result<Settings>
pub fn get_source(&self) -> Result<String>
pub fn add_content_loading( &self, handler: impl Fn(WebView, ContentLoadingEventArgs) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_content_loading( &self, token: EventRegistrationToken, ) -> Result<()>
pub fn add_source_changed( &self, handler: impl Fn(WebView, SourceChangedEventArgs) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_source_changed(&self, token: EventRegistrationToken) -> Result<()>
pub fn add_history_changed( &self, event_handler: impl Fn(WebView) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_history_changed( &self, token: EventRegistrationToken, ) -> Result<()>
pub fn add_script_dialog_opening( &self, handler: impl Fn(WebView, ScriptDialogOpeningEventArgs) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_script_dialog_opening( &self, token: EventRegistrationToken, ) -> Result<()>
pub fn add_permission_requested( &self, handler: impl Fn(WebView, PermissionRequestedEventArgs) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_permission_requested( &self, token: EventRegistrationToken, ) -> Result<()>
pub fn add_process_failed( &self, handler: impl Fn(WebView, ProcessFailedEventArgs) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_process_failed(&self, token: EventRegistrationToken) -> Result<()>
pub fn add_script_to_execute_on_document_created( &self, script: &str, callback: impl FnOnce(String) -> Result<()> + 'static, ) -> Result<()>
pub fn remove_script_to_execute_on_document_created( &self, id: &str, ) -> Result<()>
pub fn execute_script( &self, script: &str, callback: impl FnOnce(String) -> Result<()> + 'static, ) -> Result<()>
pub fn add_document_title_changed( &self, event_handler: impl Fn(WebView) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_document_title_changed( &self, token: EventRegistrationToken, ) -> Result<()>
pub fn capture_preview( &self, image_format: CapturePreviewImageFormat, image_stream: Stream, handler: impl FnOnce(Result<()>) -> Result<()> + 'static, ) -> Result<()>
pub fn reload(&self) -> Result<()>
pub fn post_web_message_as_json(&self, message_string: &str) -> Result<()>
pub fn post_web_message_as_string(&self, message_string: &str) -> Result<()>
pub fn add_web_message_received( &self, handler: impl Fn(WebView, WebMessageReceivedEventArgs) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_web_message_received( &self, token: EventRegistrationToken, ) -> Result<()>
pub fn get_browser_process_id(&self) -> Result<u32>
pub fn get_can_go_back(&self) -> Result<bool>
pub fn get_can_go_forward(&self) -> Result<bool>
pub fn go_back(&self) -> Result<()>
pub fn go_forward(&self) -> Result<()>
pub fn stop(&self) -> Result<()>
pub fn add_new_window_requested( &self, handler: impl Fn(WebView, NewWindowRequestedEventArgs) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_new_window_requested( &self, token: EventRegistrationToken, ) -> Result<()>
pub fn get_document_title(&self) -> Result<String>
pub fn open_dev_tools_window(&self) -> Result<()>
pub fn add_contains_full_screen_element_changed( &self, event_handler: impl Fn(WebView) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_contains_full_screen_element_changed( &self, token: EventRegistrationToken, ) -> Result<()>
pub fn get_contains_full_screen_element(&self) -> Result<bool>
pub fn add_web_resource_requested( &self, handler: impl Fn(WebView, WebResourceRequestedEventArgs) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_web_resource_requested( &self, token: EventRegistrationToken, ) -> Result<()>
pub fn add_web_resource_requested_filter( &self, uri: &str, resource_context: WebResourceContext, ) -> Result<()>
pub fn remove_web_resource_requested_filter( &self, uri: &str, resource_context: WebResourceContext, ) -> Result<()>
pub fn add_window_close_requested( &self, event_handler: impl Fn(WebView) -> Result<()> + 'static, ) -> Result<EventRegistrationToken>
pub fn remove_window_close_requested( &self, token: EventRegistrationToken, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebView
impl !RefUnwindSafe for WebView
impl !Send for WebView
impl !Sync for WebView
impl !Unpin for WebView
impl !UnwindSafe for WebView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more