pub struct WebViewBuilder { /* private fields */ }
Expand description

A builder-pattern type to construct WebView objects.

Implementations

Create a new WebViewBuilder.

Build the WebView.

Available on crate feature v2_28 only.

The AutomationBrowsingContextPresentation of WebView. This should only be used when creating a new WebView as a response to signal::AutomationSession::create-web-view signal request. If the new WebView was added to a new tab of current browsing context window AutomationBrowsingContextPresentation::Tab should be used.

Available on crate feature v2_34 only.

Capture state of the camera device. Whenever the user grants a media-request sent by the web page, requesting video capture capabilities (navigator.mediaDevices.getUserMedia({video: true})) this property will be set to MediaCaptureState::Active.

The application can monitor this property and provide a visual indicator allowing to optionally deactivate or mute the capture device by setting this property respectively to MediaCaptureState::None or MediaCaptureState::Muted.

If the capture state of the device is set to MediaCaptureState::None the web-page can still re-request the permission to the user. Permission desision caching is left to the application.

Available on crate feature v2_38 only.

The default Content-Security-Policy used by the webview as if it were set by an HTTP header.

This applies to all content loaded including through navigation or via the various webkit_web_view_load_* APIs. However do note that many WebKit APIs bypass Content-Security-Policy in general such as UserContentManager and WebViewExt::run_javascript().

Policies are additive so if a website sets its own policy it still applies on top of the policy set here.

Available on crate feature v2_34 only.

Capture state of the display device. Whenever the user grants a media-request sent by the web page, requesting screencasting capabilities (navigator.mediaDevices.getDisplayMedia() this property will be set to [MediaCaptureState::Active`]crate::MediaCaptureState::Active.

The application can monitor this property and provide a visual indicator allowing to optionally deactivate or mute the capture device by setting this property respectively to MediaCaptureState::None or MediaCaptureState::Muted.

If the capture state of the device is set to MediaCaptureState::None the web-page can still re-request the permission to the user. Permission desision caching is left to the application.

Available on crate feature v2_8 only.

Whether the pages loaded inside WebView are editable. For more information see WebViewExt::set_editable().

Available on crate feature v2_18 only.

Whether the WebView is controlled by automation. This should only be used when creating a new WebView as a response to signal::AutomationSession::create-web-view signal request.

Available on crate feature v2_16 only.

Whether the WebView is ephemeral. An ephemeral web view never writes website data to the client storage, no matter what WebsiteDataManager its context is using. This is normally used to implement private browsing mode. This is a G_PARAM_CONSTRUCT_ONLY property, so you have to create an ephemeral WebView and it can’t be changed. The ephemeral WebsiteDataManager created for the WebView will inherit the network settings from the WebContext’s WebsiteDataManager. To use different settings you can get the WebsiteDataManager with WebViewExt::website_data_manager() and set the new ones. Note that all WebViews created with an ephemeral WebContext will be ephemeral automatically. See also WebContext::new_ephemeral().

Available on crate feature v2_30 only.

Whether the WebView audio is muted. When true, audio is silenced. It may still be playing, i.e. property::WebView::is-playing-audio may be true.

Available on crate feature v2_34 only.

Capture state of the microphone device. Whenever the user grants a media-request sent by the web page, requesting audio capture capabilities (navigator.mediaDevices.getUserMedia({audio: true})) this property will be set to MediaCaptureState::Active.

The application can monitor this property and provide a visual indicator allowing to optionally deactivate or mute the capture device by setting this property respectively to MediaCaptureState::None or MediaCaptureState::Muted.

If the capture state of the device is set to MediaCaptureState::None the web-page can still re-request the permission to the user. Permission desision caching is left to the application.

Available on crate feature v2_4 only.

The related WebView used when creating the view to share the same web process. This property is not readable because the related web view is only valid during the object construction.

Available on crate feature v2_6 only.

The Settings of the view.

Available on crate feature v2_6 only.

The UserContentManager of the view.

The WebContext of the view.

Available on crate feature v2_30 only.

The WebsitePolicies for the view.

The zoom level of the WebView content. See WebViewExt::set_zoom_level() for more details.

Whether the widget or any of its descendents can accept the input focus.

This property is meant to be set by widget implementations, typically in their instance init function.

Whether the widget can receive pointer events.

A list of css classes applied to this widget.

The name of this widget in the CSS tree.

This property is meant to be set by widget implementations, typically in their instance init function.

Whether the widget should grab focus when it is clicked with the mouse.

This property is only relevant for widgets that can take focus.

Whether this widget itself will accept the input focus.

Enables or disables the emission of the ::query-tooltip signal on widget.

A value of true indicates that widget can have a tooltip, in this case the widget will be queried using [signalGtk::query-tooltip] to determine whether it will provide a tooltip or not.

Override for height request of the widget.

If this is -1, the natural request will be used.

Whether to expand horizontally.

Whether to use the hexpand property.

Margin on bottom side of widget.

This property adds margin outside of the widget’s normal size request, the margin will be added in addition to the size from [methodGtk.set_size_request] for example.

Margin on end of widget, horizontally.

This property supports left-to-right and right-to-left text directions.

This property adds margin outside of the widget’s normal size request, the margin will be added in addition to the size from [methodGtk.set_size_request] for example.

Margin on start of widget, horizontally.

This property supports left-to-right and right-to-left text directions.

This property adds margin outside of the widget’s normal size request, the margin will be added in addition to the size from [methodGtk.set_size_request] for example.

Margin on top side of widget.

This property adds margin outside of the widget’s normal size request, the margin will be added in addition to the size from [methodGtk.set_size_request] for example.

The name of the widget.

The requested opacity of the widget.

Whether the widget will receive the default action when it is focused.

Whether the widget responds to input.

Sets the text of tooltip to be the given string, which is marked up with Pango markup.

Also see [methodGtk.set_markup].

This is a convenience property which will take care of getting the tooltip shown if the given string is not None: [propertyGtk:has-tooltip] will automatically be set to true and there will be taken care of [signalGtk::query-tooltip] in the default signal handler.

Note that if both [propertyGtk:tooltip-text] and [propertyGtk:tooltip-markup] are set, the last one wins.

Sets the text of tooltip to be the given string.

Also see [methodGtk.set_text].

This is a convenience property which will take care of getting the tooltip shown if the given string is not None: [propertyGtk:has-tooltip] will automatically be set to true and there will be taken care of [signalGtk::query-tooltip] in the default signal handler.

Note that if both [propertyGtk:tooltip-text] and [propertyGtk:tooltip-markup] are set, the last one wins.

Whether to expand vertically.

Whether to use the vexpand property.

Whether the widget is visible.

Override for width request of the widget.

If this is -1, the natural request will be used.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.