ICoreWebView2Controller2

Trait ICoreWebView2Controller2 

Source
pub trait ICoreWebView2Controller2: ICoreWebView2Controller {
    // Required methods
    unsafe fn get_default_background_color(
        &self,
        background_color: *mut Color,
    ) -> HRESULT;
    unsafe fn put_default_background_color(
        &self,
        background_color: Color,
    ) -> HRESULT;
}
Expand description

A continuation of the ICoreWebView2Controller interface.

Required Methods§

Source

unsafe fn get_default_background_color( &self, background_color: *mut Color, ) -> HRESULT

The DefaultBackgroundColor property is the color WebView renders underneath all web content. This means WebView renders this color when there is no web content loaded such as before the initial navigation or between navigations. This also means web pages with undefined css background properties or background properties containing transparent pixels will render their contents over this color. Web pages with defined and opaque background properties that span the page will obscure the DefaultBackgroundColor and display normally. The default value for this property is white to resemble the native browser experience.

The Color is specified by the COREWEBVIEW2_COLOR that represents an RGBA value. The A represents an Alpha value, meaning DefaultBackgroundColor can be transparent. In the case of a transparent DefaultBackgroundColor WebView will render hosting app content as the background. This Alpha value is not supported on Windows 7. Any A value other than 255 will result in E_INVALIDARG on Windows 7. It is supported on all other WebView compatible platforms.

Semi-transparent colors are not currently supported by this API and setting DefaultBackgroundColor to a semi-transparent color will fail with E_INVALIDARG. The only supported alpha values are 0 and 255, all other values will result in E_INVALIDARG. DefaultBackgroundColor can only be an opaque color or transparent.

\snippet ViewComponent.cpp DefaultBackgroundColor

Source

unsafe fn put_default_background_color( &self, background_color: Color, ) -> HRESULT

Sets the DefaultBackgroundColor property.

Trait Implementations§

Source§

impl ComInterface for dyn ICoreWebView2Controller2

Source§

const IID: IID = IID_ICORE_WEB_VIEW2_CONTROLLER2

The associated id for this interface
Source§

type VTable = ICoreWebView2Controller2VTable

A COM compatible V-Table
Source§

type Super = dyn ICoreWebView2Controller

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: ICoreWebView2Controller2> ProductionComInterface<C> for dyn ICoreWebView2Controller2

Source§

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

Get the vtable for a particular COM interface

Implementations on Foreign Types§

Source§

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

Source§

unsafe fn get_default_background_color( &self, background_color: *mut Color, ) -> HRESULT

Source§

unsafe fn put_default_background_color( &self, background_color: Color, ) -> HRESULT

Source§

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

Source§

unsafe fn get_default_background_color( &self, background_color: *mut Color, ) -> HRESULT

Source§

unsafe fn put_default_background_color( &self, background_color: Color, ) -> HRESULT

Implementors§