Struct webkit6::WebView

source ·
pub struct WebView { /* private fields */ }
Expand description

The central class of the WPE WebKit and WebKitGTK APIs.

#WebKitWebView is the central class of the WPE WebKit and WebKitGTK APIs. It is responsible for managing the drawing of the content and forwarding of events. You can load any URI into the #WebKitWebView or a data string. With #WebKitSettings you can control various aspects of the rendering and loading of the content.

Note that in WebKitGTK, #WebKitWebView is scrollable by itself, so you don’t need to embed it in a #GtkScrolledWindow.

§Properties

§automation-presentation-type

The #WebKitAutomationBrowsingContextPresentation of #WebKitWebView. This should only be used when creating a new #WebKitWebView as a response to #WebKitAutomationSession::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.

Readable | Writeable | Construct Only

§camera-capture-state

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.

Readable | Writeable

§default-content-security-policy

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 #WebKitUserContentManager and webkit_web_view_run_javascript().

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

Readable | Writeable | Construct Only

§display-capture-state

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.

Readable | Writeable

§editable

Whether the pages loaded inside #WebKitWebView are editable. For more information see webkit_web_view_set_editable().

Readable | Writeable

§estimated-load-progress

An estimate of the percent completion for the current loading operation. This value will range from 0.0 to 1.0 and, once a load completes, will remain at 1.0 until a new load starts, at which point it will be reset to 0.0. The value is an estimate based on the total number of bytes expected to be received for a document, including all its possible subresources and child documents.

Readable

§favicon

The favicon currently associated to the #WebKitWebView. See webkit_web_view_get_favicon() for more details.

Readable

§is-controlled-by-automation

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

Readable | Writeable | Construct Only

§is-loading

Whether the #WebKitWebView is currently loading a page. This property becomes true as soon as a new load operation is requested and before the #WebKitWebView::load-changed signal is emitted with LoadEvent::Started and at that point the active URI is the requested one. When the load operation finishes the property is set to false before #WebKitWebView::load-changed is emitted with LoadEvent::Finished.

Readable

§is-muted

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

Readable | Writeable

§is-playing-audio

Whether the #WebKitWebView is currently playing audio from a page. This property becomes true as soon as web content starts playing any kind of audio. When a page is no longer playing any kind of sound, the property is set back to false.

Readable

§is-web-process-responsive

Whether the web process currently associated to the #WebKitWebView is responsive.

Readable

§microphone-capture-state

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.

Readable | Writeable

§network-session

The #WebKitNetworkSession of the view

Readable | Writeable | Construct Only

§page-id

The identifier of the #WebKitWebPage corresponding to the #WebKitWebView.

Readable

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

Writeable | Construct Only

§settings

The #WebKitSettings of the view.

Writeable | Construct

§title

The main frame document title of this #WebKitWebView. If the title has not been received yet, it will be None.

Readable

§uri

The current active URI of the #WebKitWebView. See webkit_web_view_get_uri() for more details.

Readable

§user-content-manager

The #WebKitUserContentManager of the view.

Readable | Writeable | Construct Only

§web-context

The #WebKitWebContext of the view.

Readable | Writeable | Construct Only

§web-extension-mode

This configures @web_view to treat the content as a WebExtension.

Note that this refers to the web standard WebExtensions and not WebKitWebExtensions.

In practice this limits the Content-Security-Policies that are allowed to be set. Some details can be found in Chrome’s documentation.

Readable | Writeable | Construct Only

§website-policies

The #WebKitWebsitePolicies for the view.

Readable | Writeable | Construct Only

§zoom-level

The zoom level of the #WebKitWebView content. See webkit_web_view_set_zoom_level() for more details.

Readable | Writeable

Widget

§can-focus

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.

Readable | Writeable

§can-target

Whether the widget can receive pointer events.

Readable | Writeable

§css-classes

A list of css classes applied to this widget.

Readable | Writeable

§css-name

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.

Readable | Writeable | Construct Only

§cursor

The cursor used by @widget.

Readable | Writeable

§focus-on-click

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

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

Readable | Writeable

§focusable

Whether this widget itself will accept the input focus.

Readable | Writeable

§halign

How to distribute horizontal space if widget gets extra space.

Readable | Writeable

§has-default

Whether the widget is the default widget.

Readable

§has-focus

Whether the widget has the input focus.

Readable

§has-tooltip

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 query-tooltip to determine whether it will provide a tooltip or not.

Readable | Writeable

§height-request

Override for height request of the widget.

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

Readable | Writeable

§hexpand

Whether to expand horizontally.

Readable | Writeable

§hexpand-set

Whether to use the hexpand property.

Readable | Writeable

§layout-manager

The GtkLayoutManager instance to use to compute the preferred size of the widget, and allocate its children.

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

Readable | Writeable

§margin-bottom

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 [WidgetExtManual::set_size_request()][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.

Readable | Writeable

§margin-end

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 [WidgetExtManual::set_size_request()][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.

Readable | Writeable

§margin-start

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 [WidgetExtManual::set_size_request()][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.

Readable | Writeable

§margin-top

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 [WidgetExtManual::set_size_request()][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.

Readable | Writeable

§name

The name of the widget.

Readable | Writeable

§opacity

The requested opacity of the widget.

Readable | Writeable

§overflow

How content outside the widget’s content area is treated.

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

Readable | Writeable

§parent

The parent widget of this widget.

Readable

§receives-default

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

Readable | Writeable

§root

The GtkRoot widget of the widget tree containing this widget.

This will be None if the widget is not contained in a root widget.

Readable

§scale-factor

The scale factor of the widget.

Readable

§sensitive

Whether the widget responds to input.

Readable | Writeable

§tooltip-markup

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

Also see Gtk::Tooltip::set_markup().

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

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

Readable | Writeable

§tooltip-text

Sets the text of tooltip to be the given string.

Also see Gtk::Tooltip::set_text().

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

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

Readable | Writeable

§valign

How to distribute vertical space if widget gets extra space.

Readable | Writeable

§vexpand

Whether to expand vertically.

Readable | Writeable

§vexpand-set

Whether to use the vexpand property.

Readable | Writeable

§visible

Whether the widget is visible.

Readable | Writeable

§width-request

Override for width request of the widget.

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

Readable | Writeable

Accessible

§accessible-role

The accessible role of the given gtk::Accessible implementation.

The accessible role cannot be changed once set.

Readable | Writeable

§Signals

§authenticate

This signal is emitted when the user is challenged with HTTP authentication. To let the application access or supply the credentials as well as to allow the client application to either cancel the request or perform the authentication, the signal will pass an instance of the #WebKitAuthenticationRequest in the @request argument. To handle this signal asynchronously you should keep a ref of the request and return true. To disable HTTP authentication entirely, connect to this signal and simply return true.

The default signal handler will run a default authentication dialog asynchronously for the user to interact with.

§close

Emitted when closing a #WebKitWebView is requested. This occurs when a call is made from JavaScript’s window.close function or after trying to close the @web_view with webkit_web_view_try_close(). It is the owner’s responsibility to handle this signal to hide or destroy the #WebKitWebView, if necessary.

§context-menu

Emitted when a context menu is about to be displayed to give the application a chance to customize the proposed menu, prevent the menu from being displayed, or build its own context menu. To customize the proposed menu you can use webkit_context_menu_prepend(), webkit_context_menu_append() or webkit_context_menu_insert() to add new #WebKitContextMenuItems to @context_menu, webkit_context_menu_move_item() to reorder existing items, or webkit_context_menu_remove() to remove an existing item. The signal handler should return false, and the menu represented by @context_menu will be shown. To prevent the menu from being displayed you can just connect to this signal and return true so that the proposed menu will not be shown. To build your own menu, you can remove all items from the proposed menu with webkit_context_menu_remove_all(), add your own items and return false so that the menu will be shown. You can also ignore the proposed #WebKitContextMenu, build your own #GtkMenu and return true to prevent the proposed menu from being shown. If you just want the default menu to be shown always, simply don’t connect to this signal because showing the proposed context menu is the default behaviour.

If the signal handler returns false the context menu represented by @context_menu will be shown, if it return true the context menu will not be shown.

The proposed #WebKitContextMenu passed in @context_menu argument is only valid during the signal emission.

§context-menu-dismissed

Emitted after #WebKitWebView::context-menu signal, if the context menu is shown, to notify that the context menu is dismissed.

§create

Emitted when the creation of a new #WebKitWebView is requested. If this signal is handled the signal handler should return the newly created #WebKitWebView.

The #WebKitNavigationAction parameter contains information about the navigation action that triggered this signal.

The new #WebKitWebView must be related to @web_view, see #WebKitWebView:related-view for more details.

The new #WebKitWebView should not be displayed to the user until the #WebKitWebView::ready-to-show signal is emitted.

§decide-policy

This signal is emitted when WebKit is requesting the client to decide a policy decision, such as whether to navigate to a page, open a new window or whether or not to download a resource. The #WebKitNavigationPolicyDecision passed in the @decision argument is a generic type, but should be casted to a more specific type when making the decision. For example:

⚠️ The following code is in c ⚠️

static gboolean
decide_policy_cb (WebKitWebView *web_view,
                  WebKitPolicyDecision *decision,
                  WebKitPolicyDecisionType type)
{
    switch (type) {
    case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: {
        WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
        // Make a policy decision here
        break;
    }
    case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: {
        WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
        // Make a policy decision here
        break;
    }
    case WEBKIT_POLICY_DECISION_TYPE_RESPONSE:
        WebKitResponsePolicyDecision *response = WEBKIT_RESPONSE_POLICY_DECISION (decision);
        // Make a policy decision here
        break;
    default:
        // Making no decision results in webkit_policy_decision_use()
        return FALSE;
    }
    return TRUE;
}

It is possible to make policy decision asynchronously, by simply calling g_object_ref() on the @decision argument and returning true to block the default signal handler. If the last reference is removed on a #WebKitPolicyDecision and no decision has been made explicitly, webkit_policy_decision_use() will be the default policy decision. The default signal handler will simply call webkit_policy_decision_use(). Only the first policy decision chosen for a given #WebKitPolicyDecision will have any affect.

§enter-fullscreen

Emitted when JavaScript code calls element.webkitRequestFullScreen. If the signal is not handled the #WebKitWebView will proceed to full screen its top level window. This signal can be used by client code to request permission to the user prior doing the full screen transition and eventually prepare the top-level window (e.g. hide some widgets that would otherwise be part of the full screen window).

§insecure-content-detected

Prior to 2.46, this signal was emitted when insecure content was loaded in a secure content. Since 2.46, this signal is generally no longer emitted.

§leave-fullscreen

Emitted when the #WebKitWebView is about to restore its top level window out of its full screen state. This signal can be used by client code to restore widgets hidden during the #WebKitWebView::enter-fullscreen stage for instance.

§load-changed

Emitted when a load operation in @web_view changes. The signal is always emitted with LoadEvent::Started when a new load request is made and LoadEvent::Finished when the load finishes successfully or due to an error. When the ongoing load operation fails #WebKitWebView::load-failed signal is emitted before #WebKitWebView::load-changed is emitted with LoadEvent::Finished. If a redirection is received from the server, this signal is emitted with LoadEvent::Redirected after the initial emission with LoadEvent::Started and before LoadEvent::Committed. When the page content starts arriving the signal is emitted with LoadEvent::Committed event.

You can handle this signal and use a switch to track any ongoing load operation.

⚠️ The following code is in c ⚠️

static void web_view_load_changed (WebKitWebView  *web_view,
                                   WebKitLoadEvent load_event,
                                   gpointer        user_data)
{
    switch (load_event) {
    case WEBKIT_LOAD_STARTED:
        // New load, we have now a provisional URI
        provisional_uri = webkit_web_view_get_uri (web_view);
        // Here we could start a spinner or update the
        // location bar with the provisional URI
        break;
    case WEBKIT_LOAD_REDIRECTED:
        redirected_uri = webkit_web_view_get_uri (web_view);
        break;
    case WEBKIT_LOAD_COMMITTED:
        // The load is being performed. Current URI is
        // the final one and it won't change unless a new
        // load is requested or a navigation within the
        // same page is performed
        uri = webkit_web_view_get_uri (web_view);
        break;
    case WEBKIT_LOAD_FINISHED:
        // Load finished, we can now stop the spinner
        break;
    }
}
§load-failed

Emitted when an error occurs during a load operation. If the error happened when starting to load data for a page @load_event will be LoadEvent::Started. If it happened while loading a committed data source @load_event will be LoadEvent::Committed. Since a load error causes the load operation to finish, the signal WebKitWebView::load-changed will always be emitted with LoadEvent::Finished event right after this one.

By default, if the signal is not handled, a stock error page will be displayed. You need to handle the signal if you want to provide your own error page.

§load-failed-with-tls-errors

Emitted when a TLS error occurs during a load operation. To allow an exception for this @certificate and the host of @failing_uri use webkit_web_context_allow_tls_certificate_for_host().

To handle this signal asynchronously you should call g_object_ref() on @certificate and return true.

If false is returned, #WebKitWebView::load-failed will be emitted. The load will finish regardless of the returned value.

§mouse-target-changed

This signal is emitted when the mouse cursor moves over an element such as a link, image or a media element. To determine what type of element the mouse cursor is over, a Hit Test is performed on the current mouse coordinates and the result is passed in the @hit_test_result argument. The @modifiers argument is a bitmask of #GdkModifierType flags indicating the state of modifier keys. The signal is emitted again when the mouse is moved out of the current element with a new @hit_test_result.

§permission-request

This signal is emitted when WebKit is requesting the client to decide about a permission request, such as allowing the browser to switch to fullscreen mode, sharing its location or similar operations.

A possible way to use this signal could be through a dialog allowing the user decide what to do with the request:

⚠️ The following code is in c ⚠️

static gboolean permission_request_cb (WebKitWebView *web_view,
                                       WebKitPermissionRequest *request,
                                       GtkWindow *parent_window)
{
    GtkWidget *dialog = gtk_message_dialog_new (parent_window,
                                                GTK_DIALOG_MODAL,
                                                GTK_MESSAGE_QUESTION,
                                                GTK_BUTTONS_YES_NO,
                                                "Allow Permission Request?");
    gtk_widget_show (dialog);
    gint result = gtk_dialog_run (GTK_DIALOG (dialog));

    switch (result) {
    case GTK_RESPONSE_YES:
        webkit_permission_request_allow (request);
        break;
    default:
        webkit_permission_request_deny (request);
        break;
    }
    gtk_widget_destroy (dialog);

    return TRUE;
}

It is possible to handle permission requests asynchronously, by simply calling g_object_ref() on the @request argument and returning true to block the default signal handler. If the last reference is removed on a #WebKitPermissionRequest and the request has not been handled, webkit_permission_request_deny() will be the default action.

If the signal is not handled, the @request will be completed automatically by the specific #WebKitPermissionRequest that could allow or deny it. Check the documentation of classes implementing #WebKitPermissionRequest interface to know their default action.

§print

Emitted when printing is requested on @web_view, usually by a JavaScript call, before the print dialog is shown. This signal can be used to set the initial print settings and page setup of @print_operation to be used as default values in the print dialog. You can call webkit_print_operation_set_print_settings() and webkit_print_operation_set_page_setup() and then return false to propagate the event so that the print dialog is shown.

You can connect to this signal and return true to cancel the print operation or implement your own print dialog.

§query-permission-state

This signal allows the User-Agent to respond to permission requests for powerful features, as specified by the Permissions W3C Specification. You can reply to the query using webkit_permission_state_query_finish().

You can handle the query asynchronously by calling webkit_permission_state_query_ref() on @query and returning true. If the last reference of @query is removed and the query has not been handled, the query result will be set to WEBKIT_QUERY_PERMISSION_PROMPT.

§ready-to-show

Emitted after #WebKitWebView::create on the newly created #WebKitWebView when it should be displayed to the user. When this signal is emitted all the information about how the window should look, including size, position, whether the location, status and scrollbars should be displayed, is already set on the #WebKitWindowProperties of @web_view. See also webkit_web_view_get_window_properties().

§resource-load-started

Emitted when a new resource is going to be loaded. The @request parameter contains the #WebKitURIRequest that will be sent to the server. You can monitor the load operation by connecting to the different signals of @resource.

§run-as-modal

Emitted after #WebKitWebView::ready-to-show on the newly created #WebKitWebView when JavaScript code calls window.showModalDialog. The purpose of this signal is to allow the client application to prepare the new view to behave as modal. Once the signal is emitted a new main loop will be run to block user interaction in the parent #WebKitWebView until the new dialog is closed.

§run-color-chooser

This signal is emitted when the user interacts with a HTML element, requesting from WebKit to show a dialog to select a color. To let the application know the details of the color chooser, as well as to allow the client application to either cancel the request or perform an actual color selection, the signal will pass an instance of the #WebKitColorChooserRequest in the @request argument.

It is possible to handle this request asynchronously by increasing the reference count of the request.

The default signal handler will asynchronously run a regular #GtkColorChooser for the user to interact with.

§run-file-chooser

This signal is emitted when the user interacts with a HTML element, requesting from WebKit to show a dialog to select one or more files to be uploaded. To let the application know the details of the file chooser, as well as to allow the client application to either cancel the request or perform an actual selection of files, the signal will pass an instance of the #WebKitFileChooserRequest in the @request argument.

The default signal handler will asynchronously run a regular #GtkFileChooserDialog for the user to interact with.

§script-dialog

Emitted when JavaScript code calls window.alert, window.confirm or window.prompt, or when onbeforeunload event is fired. The @dialog parameter should be used to build the dialog. If the signal is not handled a different dialog will be built and shown depending on the dialog type: ScriptDialogType::Alert: message dialog with a single Close button. ScriptDialogType::Confirm: message dialog with OK and Cancel buttons. ScriptDialogType::Prompt: message dialog with OK and Cancel buttons and a text entry with the default text. ScriptDialogType::BeforeUnloadConfirm: message dialog with Stay and Leave buttons.

It is possible to handle the script dialog request asynchronously, by simply caling webkit_script_dialog_ref() on the @dialog argument and calling webkit_script_dialog_close() when done. If the last reference is removed on a #WebKitScriptDialog and the dialog has not been closed, webkit_script_dialog_close() will be called.

§show-notification

This signal is emitted when a notification should be presented to the user. The @notification is kept alive until either: 1) the web page cancels it or 2) a navigation happens.

The default handler will emit a notification using libnotify, if built with support for it.

§show-option-menu

This signal is emitted when a select element in @web_view needs to display a dropdown menu. This signal can be used to show a custom menu, using @menu to get the details of all items that should be displayed. The area of the element in the #WebKitWebView is given as @rectangle parameter, it can be used to position the menu. To handle this signal asynchronously you should keep a ref of the @menu.

The default signal handler will pop up a #GtkMenu.

§submit-form

This signal is emitted when a form is about to be submitted. The @request argument passed contains information about the text fields of the form. This is typically used to store login information that can be used later to pre-fill the form. The form will not be submitted until webkit_form_submission_request_submit() is called.

It is possible to handle the form submission request asynchronously, by simply calling g_object_ref() on the @request argument and calling webkit_form_submission_request_submit() when done to continue with the form submission. If the last reference is removed on a #WebKitFormSubmissionRequest and the form has not been submitted, webkit_form_submission_request_submit() will be called.

§user-message-received

This signal is emitted when a #WebKitUserMessage is received from the #WebKitWebPage corresponding to @web_view. You can reply to the message using webkit_user_message_send_reply().

You can handle the user message asynchronously by calling g_object_ref() on @message and returning true. If the last reference of @message is removed and the message has not been replied to, the operation in the #WebKitWebPage will finish with error UserMessageError::Message.

§web-process-terminated

This signal is emitted when the web process terminates abnormally due to @reason.

Widget

§destroy

Signals that all holders of a reference to the widget should release the reference that they hold.

May result in finalization of the widget if all references are released.

This signal is not suitable for saving widget state.

§direction-changed

Emitted when the text direction of a widget changes.

§hide

Emitted when @widget is hidden.

§keynav-failed

Emitted if keyboard navigation fails.

See [WidgetExtManual::keynav_failed()][crate::gtk::prelude::WidgetExtManual::keynav_failed()] for details.

§map

Emitted when @widget is going to be mapped.

A widget is mapped when the widget is visible (which is controlled with visible) and all its parents up to the toplevel widget are also visible.

The ::map signal can be used to determine whether a widget will be drawn, for instance it can resume an animation that was stopped during the emission of unmap.

§mnemonic-activate

Emitted when a widget is activated via a mnemonic.

The default handler for this signal activates @widget if @group_cycling is false, or just makes @widget grab focus if @group_cycling is true.

§move-focus

Emitted when the focus is moved.

The ::move-focus signal is a keybinding signal.

The default bindings for this signal are Tab to move forward, and Shift+Tab to move backward.

Action

§query-tooltip

Emitted when the widget’s tooltip is about to be shown.

This happens when the has-tooltip property is true and the hover timeout has expired with the cursor hovering “above” @widget; or emitted when @widget got focus in keyboard mode.

Using the given coordinates, the signal handler should determine whether a tooltip should be shown for @widget. If this is the case true should be returned, false otherwise. Note that if @keyboard_mode is true, the values of @x and @y are undefined and should not be used.

The signal handler is free to manipulate @tooltip with the therefore destined function calls.

§realize

Emitted when @widget is associated with a GdkSurface.

This means that [WidgetExtManual::realize()][crate::gtk::prelude::WidgetExtManual::realize()] has been called or the widget has been mapped (that is, it is going to be drawn).

§show

Emitted when @widget is shown.

§state-flags-changed

Emitted when the widget state changes.

See [WidgetExtManual::state_flags()][crate::gtk::prelude::WidgetExtManual::state_flags()].

§unmap

Emitted when @widget is going to be unmapped.

A widget is unmapped when either it or any of its parents up to the toplevel widget have been set as hidden.

As ::unmap indicates that a widget will not be shown any longer, it can be used to, for example, stop an animation on the widget.

§unrealize

Emitted when the GdkSurface associated with @widget is destroyed.

This means that [WidgetExtManual::unrealize()][crate::gtk::prelude::WidgetExtManual::unrealize()] has been called or the widget has been unmapped (that is, it is going to be hidden).

§Implements

WebViewExt, [WebViewBaseExt][trait@crate::prelude::WebViewBaseExt], gtk::prelude::WidgetExt, gtk::prelude::AccessibleExt, gtk::prelude::BuildableExt, gtk::prelude::ConstraintTargetExt

GLib type: GObject with reference counted clone semantics.

Implementations§

source§

impl WebView

source

pub const NONE: Option<&'static WebView> = None

source

pub fn new() -> WebView

Creates a new #WebKitWebView with the default #WebKitWebContext.

Creates a new #WebKitWebView with the default #WebKitWebContext and no #WebKitUserContentManager associated with it. See also webkit_web_view_new_with_context(), webkit_web_view_new_with_user_content_manager(), and webkit_web_view_new_with_settings().

§Returns

The newly created #WebKitWebView widget

source

pub fn builder() -> WebViewBuilder

Creates a new builder-pattern struct instance to construct WebView objects.

This method returns an instance of WebViewBuilder which can be used to create WebView objects.

Trait Implementations§

source§

impl Clone for WebView

source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the object. Dropping the object will decrement it again.

1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WebView

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for WebView

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl HasParamSpec for WebView

§

type ParamSpec = ParamSpecObject

§

type SetValue = WebView

Preferred value to be used as setter for the associated ParamSpec.
§

type BuilderFn = fn(_: &str) -> ParamSpecObjectBuilder<'_, WebView>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl Hash for WebView

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Hashes the memory address of this object.

1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for WebView

source§

fn cmp(&self, other: &Self) -> Ordering

Comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl ParentClassIs for WebView

source§

impl<OT: ObjectType> PartialEq<OT> for WebView

source§

fn eq(&self, other: &OT) -> bool

Equality for two GObjects.

Two GObjects are equal if their memory addresses are equal.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<OT: ObjectType> PartialOrd<OT> for WebView

source§

fn partial_cmp(&self, other: &OT) -> Option<Ordering>

Partial comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StaticType for WebView

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Eq for WebView

source§

impl IsA<Accessible> for WebView

source§

impl IsA<Buildable> for WebView

source§

impl IsA<ConstraintTarget> for WebView

source§

impl IsA<WebViewBase> for WebView

source§

impl IsA<Widget> for WebView

Auto Trait Implementations§

Blanket Implementations§

source§

impl<O> AccessibleExt for O
where O: IsA<Accessible>,

source§

impl<O> AccessibleExtManual for O
where O: IsA<Accessible>,

source§

fn update_property(&self, properties: &[Property<'_>])

source§

fn update_relation(&self, relations: &[Relation<'_>])

source§

fn update_state(&self, states: &[State])

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<O> BuildableExt for O
where O: IsA<Buildable>,

source§

impl<T> Cast for T
where T: ObjectType,

source§

fn upcast<T>(self) -> T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a superclass or interface T. Read more
source§

fn upcast_ref<T>(&self) -> &T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a reference of its superclass or interface T. Read more
source§

fn downcast<T>(self) -> Result<T, Self>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a subclass or interface implementor T. Read more
source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a reference of its subclass or interface implementor T. Read more
source§

fn dynamic_cast<T>(self) -> Result<T, Self>
where T: ObjectType,

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while upcast will do many checks at compile-time already. downcast will perform the same checks at runtime as dynamic_cast, but will also ensure some amount of compile-time safety. Read more
source§

fn dynamic_cast_ref<T>(&self) -> Option<&T>
where T: ObjectType,

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more
source§

unsafe fn unsafe_cast<T>(self) -> T
where T: ObjectType,

Casts to T unconditionally. Read more
source§

unsafe fn unsafe_cast_ref<T>(&self) -> &T
where T: ObjectType,

Casts to &T unconditionally. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

source§

impl<O> GObjectPropertyExpressionExt for O
where O: IsA<Object>,

source§

fn property_expression(&self, property_name: &str) -> PropertyExpression

Create an expression looking up an object’s property.
source§

fn property_expression_weak(&self, property_name: &str) -> PropertyExpression

Create an expression looking up an object’s property with a weak reference.
source§

fn this_expression(property_name: &str) -> PropertyExpression

Create an expression looking up a property in the bound this object.
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<U> IsSubclassableExt for U

source§

impl<T> ObjectExt for T
where T: ObjectType,

source§

fn is<U>(&self) -> bool
where U: StaticType,

Returns true if the object is an instance of (can be cast to) T.
source§

fn type_(&self) -> Type

Returns the type of the object.
source§

fn object_class(&self) -> &Class<Object>

Returns the ObjectClass of the object. Read more
source§

fn class(&self) -> &Class<T>
where T: IsClass,

Returns the class of the object.
source§

fn class_of<U>(&self) -> Option<&Class<U>>
where U: IsClass,

Returns the class of the object in the given type T. Read more
source§

fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>
where U: IsInterface,

Returns the interface T of the object. Read more
source§

fn set_property(&self, property_name: &str, value: impl Into<Value>)

Sets the property property_name of the object to value value. Read more
source§

fn set_property_from_value(&self, property_name: &str, value: &Value)

Sets the property property_name of the object to value value. Read more
source§

fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])

Sets multiple properties of the object at once. Read more
source§

fn set_properties_from_value(&self, property_values: &[(&str, Value)])

Sets multiple properties of the object at once. Read more
source§

fn property<V>(&self, property_name: &str) -> V
where V: for<'b> FromValue<'b> + 'static,

Gets the property property_name of the object and cast it to the type V. Read more
source§

fn property_value(&self, property_name: &str) -> Value

Gets the property property_name of the object. Read more
source§

fn has_property(&self, property_name: &str, type_: Option<Type>) -> bool

Check if the object has a property property_name of the given type_. Read more
source§

fn property_type(&self, property_name: &str) -> Option<Type>

Get the type of the property property_name of this object. Read more
source§

fn find_property(&self, property_name: &str) -> Option<ParamSpec>

Get the ParamSpec of the property property_name of this object.
source§

fn list_properties(&self) -> PtrSlice<ParamSpec>

Return all ParamSpec of the properties of this object.
source§

fn freeze_notify(&self) -> PropertyNotificationFreezeGuard

Freeze all property notifications until the return guard object is dropped. Read more
source§

unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn set_data<QD>(&self, key: &str, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

fn block_signal(&self, handler_id: &SignalHandlerId)

Block a given signal handler. Read more
source§

fn unblock_signal(&self, handler_id: &SignalHandlerId)

Unblock a given signal handler.
source§

fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)

Stop emission of the currently emitted signal.
source§

fn stop_signal_emission_by_name(&self, signal_name: &str)

Stop emission of the currently emitted signal by the (possibly detailed) signal name.
source§

fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_id on this object. Read more
source§

fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_id on this object. Read more
source§

unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_name on this object. Read more
source§

unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_id on this object. Read more
source§

fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_name on this object. Read more
source§

fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_id on this object. Read more
source§

fn watch_closure(&self, closure: &impl AsRef<Closure>)

Limits the lifetime of closure to the lifetime of the object. When the object’s reference count drops to zero, the closure will be invalidated. An invalidated closure will ignore any calls to invoke_with_values, or invoke when using Rust closures.
source§

fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> R

Emit signal by signal id. Read more
source§

fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>

Same as Self::emit but takes Value for the arguments.
source§

fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> R

Emit signal by its name. Read more
source§

fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>

Emit signal by its name. Read more
source§

fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by its name with details. Read more
source§

fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by its name with details. Read more
source§

fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by signal id with details. Read more
source§

fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by signal id with details. Read more
source§

fn disconnect(&self, handler_id: SignalHandlerId)

Disconnect a previously connected signal handler.
source§

fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + Send + Sync + 'static,

Connect to the notify signal of the object. Read more
source§

fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + 'static,

Connect to the notify signal of the object. Read more
source§

unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
where F: Fn(&T, &ParamSpec),

Connect to the notify signal of the object. Read more
source§

fn notify(&self, property_name: &str)

Notify that the given property has changed its value. Read more
source§

fn notify_by_pspec(&self, pspec: &ParamSpec)

Notify that the given property has changed its value. Read more
source§

fn downgrade(&self) -> WeakRef<T>

Downgrade this object to a weak reference.
source§

fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + Send + 'static,

Add a callback to be notified when the Object is disposed.
source§

fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + 'static,

Add a callback to be notified when the Object is disposed. Read more
source§

fn bind_property<'a, 'f, 't, O>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str, ) -> BindingBuilder<'a, 'f, 't>
where O: ObjectType,

Bind property source_property on this object to the target_property on the target object. Read more
source§

fn ref_count(&self) -> u32

Returns the strong reference count of this object.
source§

unsafe fn run_dispose(&self)

Runs the dispose mechanism of the object. Read more
source§

impl<T> Property for T
where T: HasParamSpec,

§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> TransparentType for T

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<O> WebViewExt for O
where O: IsA<WebView>,

source§

fn call_async_javascript_function<P: FnOnce(Result<Value, Error>) + 'static>( &self, body: &str, arguments: Option<&Variant>, world_name: Option<&str>, source_uri: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Asynchronously call @body with @arguments in the script world with name @world_name of the main frame current context in @self. The @arguments values must be one of the following types, or contain only the following GVariant types: number, string and dictionary. The result of the operation can be a Promise that will be properly passed to the callback. If @world_name is None, the default world is used. Any value that is not None is a distin ct world. The @source_uri will be shown in exceptions and doesn’t affect the behavior of the script. When not provided, the document URL is used. Read more
source§

fn call_async_javascript_function_future( &self, body: &str, arguments: Option<&Variant>, world_name: Option<&str>, source_uri: Option<&str>, ) -> Pin<Box_<dyn Future<Output = Result<Value, Error>> + 'static>>

source§

fn can_execute_editing_command<P: FnOnce(Result<(), Error>) + 'static>( &self, command: &str, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Asynchronously check if it is possible to execute the given editing command. Read more
source§

fn can_execute_editing_command_future( &self, command: &str, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>

source§

fn can_go_back(&self) -> bool

Determines whether @self has a previous history item. Read more
source§

fn can_go_forward(&self) -> bool

Determines whether @self has a next history item. Read more
source§

fn can_show_mime_type(&self, mime_type: &str) -> bool

Whether or not a MIME type can be displayed in @self. Read more
source§

fn download_uri(&self, uri: &str) -> Option<Download>

Requests downloading of the specified URI string for @self. Read more
source§

fn evaluate_javascript<P: FnOnce(Result<Value, Error>) + 'static>( &self, script: &str, world_name: Option<&str>, source_uri: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Asynchronously evaluate @script in the script world with name @world_name of the main frame current context in @self. If @world_name is None, the default world is used. Any value that is not None is a distinct world. The @source_uri will be shown in exceptions and doesn’t affect the behavior of the script. When not provided, the document URL is used. Read more
source§

fn evaluate_javascript_future( &self, script: &str, world_name: Option<&str>, source_uri: Option<&str>, ) -> Pin<Box_<dyn Future<Output = Result<Value, Error>> + 'static>>

source§

fn execute_editing_command(&self, command: &str)

Request to execute the given @command for @self. Read more
source§

fn execute_editing_command_with_argument(&self, command: &str, argument: &str)

Request to execute the given @command with @argument for @self. Read more
source§

fn automation_presentation_type(&self) -> AutomationBrowsingContextPresentation

Get the presentation type of #WebKitWebView when created for automation. Read more
source§

fn back_forward_list(&self) -> Option<BackForwardList>

Obtains the #WebKitBackForwardList associated with the given #WebKitWebView. Read more
source§

fn background_color(&self) -> RGBA

Gets the color that is used to draw the @self background. Read more
source§

fn camera_capture_state(&self) -> MediaCaptureState

Get the camera capture state of a #WebKitWebView. Read more
source§

fn context(&self) -> Option<WebContext>

Gets the web context of @self. Read more
source§

fn custom_charset(&self) -> Option<GString>

Returns the current custom character encoding name of @self. Read more
source§

fn default_content_security_policy(&self) -> Option<GString>

Gets the configured default Content-Security-Policy. Read more
source§

fn display_capture_state(&self) -> MediaCaptureState

Get the display capture state of a #WebKitWebView. Read more
source§

fn editor_state(&self) -> Option<EditorState>

Gets the web editor state of @self. Read more
source§

fn estimated_load_progress(&self) -> f64

Gets the value of the #WebKitWebView:estimated-load-progress property. Read more
source§

fn favicon(&self) -> Option<Texture>

Returns favicon currently associated to @self. Read more
source§

fn find_controller(&self) -> Option<FindController>

Gets the #WebKitFindController. Read more
source§

fn input_method_context(&self) -> Option<InputMethodContext>

Get the #WebKitInputMethodContext currently in use by @self. Read more
source§

fn inspector(&self) -> Option<WebInspector>

Get the #WebKitWebInspector associated to @self Read more
source§

fn is_muted(&self) -> bool

Gets the mute state of @self. Read more
source§

fn is_web_process_responsive(&self) -> bool

Get whether the current web process of a #WebKitWebView is responsive. Read more
source§

fn main_resource(&self) -> Option<WebResource>

Return the main resource of @self. Read more
source§

fn microphone_capture_state(&self) -> MediaCaptureState

Get the microphone capture state of a #WebKitWebView. Read more
source§

fn network_session(&self) -> Option<NetworkSession>

Get the #WebKitNetworkSession associated to @self. Read more
source§

fn page_id(&self) -> u64

Get the identifier of the #WebKitWebPage corresponding to the #WebKitWebView Read more
source§

fn session_state(&self) -> Option<WebViewSessionState>

Gets the current session state of @self Read more
source§

fn settings(&self) -> Option<Settings>

Gets the #WebKitSettings currently applied to @self. Read more
source§

fn snapshot<P: FnOnce(Result<Texture, Error>) + 'static>( &self, region: SnapshotRegion, options: SnapshotOptions, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Asynchronously retrieves a snapshot of @self for @region. Read more
source§

fn snapshot_future( &self, region: SnapshotRegion, options: SnapshotOptions, ) -> Pin<Box_<dyn Future<Output = Result<Texture, Error>> + 'static>>

source§

fn title(&self) -> Option<GString>

Gets the value of the #WebKitWebView:title property. Read more
source§

fn tls_info(&self) -> Option<(TlsCertificate, TlsCertificateFlags)>

Retrieves the #GTlsCertificate associated with the main resource of @self. Read more
source§

fn uri(&self) -> Option<GString>

Returns the current active URI of @self. Read more
source§

fn user_content_manager(&self) -> Option<UserContentManager>

Gets the user content manager associated to @self. Read more
source§

fn web_extension_mode(&self) -> WebExtensionMode

Get the view’s #WebKitWebExtensionMode. Read more
source§

fn website_policies(&self) -> Option<WebsitePolicies>

Gets the default website policies. Read more
source§

fn window_properties(&self) -> Option<WindowProperties>

Get the #WebKitWindowProperties object. Read more
source§

fn zoom_level(&self) -> f64

Set the zoom level of @self. Read more
source§

fn go_back(&self)

Loads the previous history item. Read more
source§

fn go_forward(&self)

Loads the next history item. Read more
source§

fn go_to_back_forward_list_item(&self, list_item: &BackForwardListItem)

Loads the specific history item @list_item. Read more
source§

fn is_controlled_by_automation(&self) -> bool

Get whether a #WebKitWebView was created with #WebKitWebView:is-controlled-by-automation property enabled. Read more
source§

fn is_editable(&self) -> bool

Gets whether the user is allowed to edit the HTML document. Read more
source§

fn is_loading(&self) -> bool

Gets the value of the #WebKitWebView:is-loading property. Read more
source§

fn is_playing_audio(&self) -> bool

Gets the value of the #WebKitWebView:is-playing-audio property. Read more
source§

fn load_alternate_html( &self, content: &str, content_uri: &str, base_uri: Option<&str>, )

Load the given @content string for the URI @content_uri. Read more
source§

fn load_bytes( &self, bytes: &Bytes, mime_type: Option<&str>, encoding: Option<&str>, base_uri: Option<&str>, )

Load the specified @bytes into @self using the given @mime_type and @encoding. Read more
source§

fn load_html(&self, content: &str, base_uri: Option<&str>)

Load the given @content string with the specified @base_uri. Read more
source§

fn load_plain_text(&self, plain_text: &str)

Load the specified @plain_text string into @self. Read more
source§

fn load_request(&self, request: &URIRequest)

Requests loading of the specified #WebKitURIRequest. Read more
source§

fn load_uri(&self, uri: &str)

Requests loading of the specified URI string. Read more
source§

fn reload(&self)

Reloads the current contents of @self. Read more
source§

fn reload_bypass_cache(&self)

Reloads the current contents of @self without using any cached data.
source§

fn restore_session_state(&self, state: &WebViewSessionState)

Restore the @self session state from @state Read more
source§

fn save<P: FnOnce(Result<InputStream, Error>) + 'static>( &self, save_mode: SaveMode, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Asynchronously save the current web page. Read more
source§

fn save_future( &self, save_mode: SaveMode, ) -> Pin<Box_<dyn Future<Output = Result<InputStream, Error>> + 'static>>

source§

fn save_to_file<P: FnOnce(Result<(), Error>) + 'static>( &self, file: &impl IsA<File>, save_mode: SaveMode, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Asynchronously save the current web page. Read more
source§

fn save_to_file_future( &self, file: &(impl IsA<File> + Clone + 'static), save_mode: SaveMode, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>

source§

fn send_message_to_page<P: FnOnce(Result<UserMessage, Error>) + 'static>( &self, message: &UserMessage, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Send @message to the #WebKitWebPage corresponding to @self. Read more
source§

fn send_message_to_page_future( &self, message: &UserMessage, ) -> Pin<Box_<dyn Future<Output = Result<UserMessage, Error>> + 'static>>

source§

fn set_background_color(&self, rgba: &RGBA)

Sets the color that will be used to draw the @self background. Read more
source§

fn set_camera_capture_state(&self, state: MediaCaptureState)

Set the camera capture state of a #WebKitWebView. Read more
source§

fn set_cors_allowlist(&self, allowlist: &[&str])

Sets the @allowlist for CORS. Read more
source§

fn set_custom_charset(&self, charset: Option<&str>)

Sets the current custom character encoding override of @self. Read more
source§

fn set_display_capture_state(&self, state: MediaCaptureState)

Set the display capture state of a #WebKitWebView. Read more
source§

fn set_editable(&self, editable: bool)

Sets whether the user is allowed to edit the HTML document. Read more
source§

fn set_input_method_context( &self, context: Option<&impl IsA<InputMethodContext>>, )

Set the #WebKitInputMethodContext to be used by @self. Read more
source§

fn set_is_muted(&self, muted: bool)

Sets the mute state of @self. Read more
source§

fn set_microphone_capture_state(&self, state: MediaCaptureState)

Set the microphone capture state of a #WebKitWebView. Read more
source§

fn set_settings(&self, settings: &Settings)

Sets the #WebKitSettings to be applied to @self. Read more
source§

fn set_zoom_level(&self, zoom_level: f64)

Set the zoom level of @self. Read more
source§

fn stop_loading(&self)

Stops any ongoing loading operation in @self. Read more
source§

fn terminate_web_process(&self)

Terminates the web process associated to @self. Read more
source§

fn try_close(&self)

Tries to close the @self. Read more
source§

fn web_context(&self) -> Option<WebContext>

The #WebKitWebContext of the view.
source§

fn connect_authenticate<F: Fn(&Self, &AuthenticationRequest) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when the user is challenged with HTTP authentication. To let the application access or supply the credentials as well as to allow the client application to either cancel the request or perform the authentication, the signal will pass an instance of the #WebKitAuthenticationRequest in the @request argument. To handle this signal asynchronously you should keep a ref of the request and return true. To disable HTTP authentication entirely, connect to this signal and simply return true. Read more
source§

fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted when closing a #WebKitWebView is requested. This occurs when a call is made from JavaScript’s window.close function or after trying to close the @web_view with webkit_web_view_try_close(). It is the owner’s responsibility to handle this signal to hide or destroy the #WebKitWebView, if necessary.
source§

fn connect_context_menu<F: Fn(&Self, &ContextMenu, &HitTestResult) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when a context menu is about to be displayed to give the application a chance to customize the proposed menu, prevent the menu from being displayed, or build its own context menu. To customize the proposed menu you can use webkit_context_menu_prepend(), webkit_context_menu_append() or webkit_context_menu_insert() to add new #WebKitContextMenuItems to @context_menu, webkit_context_menu_move_item() to reorder existing items, or webkit_context_menu_remove() to remove an existing item. The signal handler should return false, and the menu represented by @context_menu will be shown. To prevent the menu from being displayed you can just connect to this signal and return true so that the proposed menu will not be shown. To build your own menu, you can remove all items from the proposed menu with webkit_context_menu_remove_all(), add your own items and return false so that the menu will be shown. You can also ignore the proposed #WebKitContextMenu, build your own #GtkMenu and return true to prevent the proposed menu from being shown. If you just want the default menu to be shown always, simply don’t connect to this signal because showing the proposed context menu is the default behaviour. Read more
source§

fn connect_context_menu_dismissed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted after #WebKitWebView::context-menu signal, if the context menu is shown, to notify that the context menu is dismissed.
source§

fn connect_create<F: Fn(&Self, &NavigationAction) -> Widget + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when the creation of a new #WebKitWebView is requested. If this signal is handled the signal handler should return the newly created #WebKitWebView. Read more
source§

fn connect_decide_policy<F: Fn(&Self, &PolicyDecision, PolicyDecisionType) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when WebKit is requesting the client to decide a policy decision, such as whether to navigate to a page, open a new window or whether or not to download a resource. The #WebKitNavigationPolicyDecision passed in the @decision argument is a generic type, but should be casted to a more specific type when making the decision. For example: Read more
source§

fn connect_enter_fullscreen<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when JavaScript code calls element.webkitRequestFullScreen. If the signal is not handled the #WebKitWebView will proceed to full screen its top level window. This signal can be used by client code to request permission to the user prior doing the full screen transition and eventually prepare the top-level window (e.g. hide some widgets that would otherwise be part of the full screen window). Read more
source§

fn connect_insecure_content_detected<F: Fn(&Self, InsecureContentEvent) + 'static>( &self, f: F, ) -> SignalHandlerId

👎Deprecated: Since 2.46
Prior to 2.46, this signal was emitted when insecure content was loaded in a secure content. Since 2.46, this signal is generally no longer emitted. Read more
source§

fn connect_leave_fullscreen<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when the #WebKitWebView is about to restore its top level window out of its full screen state. This signal can be used by client code to restore widgets hidden during the #WebKitWebView::enter-fullscreen stage for instance. Read more
source§

fn connect_load_changed<F: Fn(&Self, LoadEvent) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when a load operation in @web_view changes. The signal is always emitted with LoadEvent::Started when a new load request is made and LoadEvent::Finished when the load finishes successfully or due to an error. When the ongoing load operation fails #WebKitWebView::load-failed signal is emitted before #WebKitWebView::load-changed is emitted with LoadEvent::Finished. If a redirection is received from the server, this signal is emitted with LoadEvent::Redirected after the initial emission with LoadEvent::Started and before LoadEvent::Committed. When the page content starts arriving the signal is emitted with LoadEvent::Committed event. Read more
source§

fn connect_load_failed<F: Fn(&Self, LoadEvent, &str, &Error) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when an error occurs during a load operation. If the error happened when starting to load data for a page @load_event will be LoadEvent::Started. If it happened while loading a committed data source @load_event will be LoadEvent::Committed. Since a load error causes the load operation to finish, the signal WebKitWebView::load-changed will always be emitted with LoadEvent::Finished event right after this one. Read more
source§

fn connect_load_failed_with_tls_errors<F: Fn(&Self, &str, &TlsCertificate, TlsCertificateFlags) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when a TLS error occurs during a load operation. To allow an exception for this @certificate and the host of @failing_uri use webkit_web_context_allow_tls_certificate_for_host(). Read more
source§

fn connect_mouse_target_changed<F: Fn(&Self, &HitTestResult, u32) + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when the mouse cursor moves over an element such as a link, image or a media element. To determine what type of element the mouse cursor is over, a Hit Test is performed on the current mouse coordinates and the result is passed in the @hit_test_result argument. The @modifiers argument is a bitmask of #GdkModifierType flags indicating the state of modifier keys. The signal is emitted again when the mouse is moved out of the current element with a new @hit_test_result. Read more
source§

fn connect_permission_request<F: Fn(&Self, &PermissionRequest) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when WebKit is requesting the client to decide about a permission request, such as allowing the browser to switch to fullscreen mode, sharing its location or similar operations. Read more
source§

fn connect_print<F: Fn(&Self, &PrintOperation) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when printing is requested on @web_view, usually by a JavaScript call, before the print dialog is shown. This signal can be used to set the initial print settings and page setup of @print_operation to be used as default values in the print dialog. You can call webkit_print_operation_set_print_settings() and webkit_print_operation_set_page_setup() and then return false to propagate the event so that the print dialog is shown. Read more
source§

fn connect_query_permission_state<F: Fn(&Self, &PermissionStateQuery) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal allows the User-Agent to respond to permission requests for powerful features, as specified by the Permissions W3C Specification. You can reply to the query using webkit_permission_state_query_finish(). Read more
source§

fn connect_ready_to_show<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted after #WebKitWebView::create on the newly created #WebKitWebView when it should be displayed to the user. When this signal is emitted all the information about how the window should look, including size, position, whether the location, status and scrollbars should be displayed, is already set on the #WebKitWindowProperties of @web_view. See also webkit_web_view_get_window_properties().
source§

fn connect_resource_load_started<F: Fn(&Self, &WebResource, &URIRequest) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when a new resource is going to be loaded. The @request parameter contains the #WebKitURIRequest that will be sent to the server. You can monitor the load operation by connecting to the different signals of @resource. Read more
source§

fn connect_run_as_modal<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted after #WebKitWebView::ready-to-show on the newly created #WebKitWebView when JavaScript code calls window.showModalDialog. The purpose of this signal is to allow the client application to prepare the new view to behave as modal. Once the signal is emitted a new main loop will be run to block user interaction in the parent #WebKitWebView until the new dialog is closed.
source§

fn connect_run_color_chooser<F: Fn(&Self, &ColorChooserRequest) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when the user interacts with a HTML element, requesting from WebKit to show a dialog to select a color. To let the application know the details of the color chooser, as well as to allow the client application to either cancel the request or perform an actual color selection, the signal will pass an instance of the #WebKitColorChooserRequest in the @request argument. Read more
source§

fn connect_run_file_chooser<F: Fn(&Self, &FileChooserRequest) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when the user interacts with a HTML element, requesting from WebKit to show a dialog to select one or more files to be uploaded. To let the application know the details of the file chooser, as well as to allow the client application to either cancel the request or perform an actual selection of files, the signal will pass an instance of the #WebKitFileChooserRequest in the @request argument. Read more
source§

fn connect_script_dialog<F: Fn(&Self, &ScriptDialog) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when JavaScript code calls window.alert, window.confirm or window.prompt, or when onbeforeunload event is fired. The @dialog parameter should be used to build the dialog. If the signal is not handled a different dialog will be built and shown depending on the dialog type: ScriptDialogType::Alert: message dialog with a single Close button. ScriptDialogType::Confirm: message dialog with OK and Cancel buttons. ScriptDialogType::Prompt: message dialog with OK and Cancel buttons and a text entry with the default text. ScriptDialogType::BeforeUnloadConfirm: message dialog with Stay and Leave buttons. Read more
source§

fn connect_show_notification<F: Fn(&Self, &Notification) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when a notification should be presented to the user. The @notification is kept alive until either: 1) the web page cancels it or 2) a navigation happens. Read more
source§

fn connect_show_option_menu<F: Fn(&Self, &OptionMenu, &Rectangle) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when a select element in @web_view needs to display a dropdown menu. This signal can be used to show a custom menu, using @menu to get the details of all items that should be displayed. The area of the element in the #WebKitWebView is given as @rectangle parameter, it can be used to position the menu. To handle this signal asynchronously you should keep a ref of the @menu. Read more
source§

fn connect_submit_form<F: Fn(&Self, &FormSubmissionRequest) + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when a form is about to be submitted. The @request argument passed contains information about the text fields of the form. This is typically used to store login information that can be used later to pre-fill the form. The form will not be submitted until webkit_form_submission_request_submit() is called. Read more
source§

fn connect_user_message_received<F: Fn(&Self, &UserMessage) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when a #WebKitUserMessage is received from the #WebKitWebPage corresponding to @web_view. You can reply to the message using webkit_user_message_send_reply(). Read more
source§

fn connect_web_process_terminated<F: Fn(&Self, WebProcessTerminationReason) + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when the web process terminates abnormally due to @reason. Read more
source§

fn connect_camera_capture_state_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_display_capture_state_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_editable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_estimated_load_progress_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_favicon_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_is_loading_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_is_muted_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_is_playing_audio_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_is_web_process_responsive_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_microphone_capture_state_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_page_id_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_settings_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source§

fn connect_uri_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source§

fn connect_zoom_level_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

impl<O> WidgetExt for O
where O: IsA<Widget>,

source§

fn action_set_enabled(&self, action_name: &str, enabled: bool)

source§

fn activate(&self) -> bool

source§

fn activate_action( &self, name: &str, args: Option<&Variant>, ) -> Result<(), BoolError>

source§

fn activate_default(&self)

source§

fn add_controller(&self, controller: impl IsA<EventController>)

source§

fn add_css_class(&self, css_class: &str)

source§

fn add_mnemonic_label(&self, label: &impl IsA<Widget>)

source§

fn allocate( &self, width: i32, height: i32, baseline: i32, transform: Option<Transform>, )

source§

fn child_focus(&self, direction: DirectionType) -> bool

source§

fn compute_bounds(&self, target: &impl IsA<Widget>) -> Option<Rect>

source§

fn compute_expand(&self, orientation: Orientation) -> bool

source§

fn compute_point( &self, target: &impl IsA<Widget>, point: &Point, ) -> Option<Point>

source§

fn compute_transform(&self, target: &impl IsA<Widget>) -> Option<Matrix>

source§

fn contains(&self, x: f64, y: f64) -> bool

source§

fn create_pango_context(&self) -> Context

source§

fn create_pango_layout(&self, text: Option<&str>) -> Layout

source§

fn drag_check_threshold( &self, start_x: i32, start_y: i32, current_x: i32, current_y: i32, ) -> bool

source§

fn error_bell(&self)

source§

fn allocated_baseline(&self) -> i32

source§

fn allocated_height(&self) -> i32

source§

fn allocated_width(&self) -> i32

source§

fn allocation(&self) -> Rectangle

source§

fn ancestor(&self, widget_type: Type) -> Option<Widget>

source§

fn can_focus(&self) -> bool

source§

fn can_target(&self) -> bool

source§

fn is_child_visible(&self) -> bool

source§

fn clipboard(&self) -> Clipboard

source§

fn css_classes(&self) -> Vec<GString>

source§

fn css_name(&self) -> GString

source§

fn cursor(&self) -> Option<Cursor>

source§

fn direction(&self) -> TextDirection

source§

fn display(&self) -> Display

source§

fn first_child(&self) -> Option<Widget>

source§

fn focus_child(&self) -> Option<Widget>

source§

fn gets_focus_on_click(&self) -> bool

source§

fn is_focusable(&self) -> bool

source§

fn font_map(&self) -> Option<FontMap>

source§

fn font_options(&self) -> Option<FontOptions>

source§

fn frame_clock(&self) -> Option<FrameClock>

source§

fn halign(&self) -> Align

source§

fn has_tooltip(&self) -> bool

source§

fn height(&self) -> i32

source§

fn hexpands(&self) -> bool

source§

fn is_hexpand_set(&self) -> bool

source§

fn last_child(&self) -> Option<Widget>

source§

fn layout_manager(&self) -> Option<LayoutManager>

source§

fn is_mapped(&self) -> bool

source§

fn margin_bottom(&self) -> i32

source§

fn margin_end(&self) -> i32

source§

fn margin_start(&self) -> i32

source§

fn margin_top(&self) -> i32

source§

fn widget_name(&self) -> GString

source§

fn native(&self) -> Option<Native>

source§

fn next_sibling(&self) -> Option<Widget>

source§

fn opacity(&self) -> f64

source§

fn overflow(&self) -> Overflow

source§

fn pango_context(&self) -> Context

source§

fn parent(&self) -> Option<Widget>

source§

fn preferred_size(&self) -> (Requisition, Requisition)

source§

fn prev_sibling(&self) -> Option<Widget>

source§

fn primary_clipboard(&self) -> Clipboard

source§

fn is_realized(&self) -> bool

source§

fn receives_default(&self) -> bool

source§

fn request_mode(&self) -> SizeRequestMode

source§

fn root(&self) -> Option<Root>

source§

fn scale_factor(&self) -> i32

source§

fn get_sensitive(&self) -> bool

source§

fn settings(&self) -> Settings

source§

fn size(&self, orientation: Orientation) -> i32

source§

fn size_request(&self) -> (i32, i32)

source§

fn state_flags(&self) -> StateFlags

source§

fn style_context(&self) -> StyleContext

source§

fn tooltip_markup(&self) -> Option<GString>

source§

fn tooltip_text(&self) -> Option<GString>

source§

fn valign(&self) -> Align

source§

fn vexpands(&self) -> bool

source§

fn is_vexpand_set(&self) -> bool

source§

fn get_visible(&self) -> bool

source§

fn width(&self) -> i32

source§

fn grab_focus(&self) -> bool

source§

fn has_css_class(&self, css_class: &str) -> bool

source§

fn has_default(&self) -> bool

source§

fn has_focus(&self) -> bool

source§

fn has_visible_focus(&self) -> bool

source§

fn hide(&self)

source§

fn in_destruction(&self) -> bool

source§

fn insert_action_group(&self, name: &str, group: Option<&impl IsA<ActionGroup>>)

source§

fn insert_after( &self, parent: &impl IsA<Widget>, previous_sibling: Option<&impl IsA<Widget>>, )

source§

fn insert_before( &self, parent: &impl IsA<Widget>, next_sibling: Option<&impl IsA<Widget>>, )

source§

fn is_ancestor(&self, ancestor: &impl IsA<Widget>) -> bool

source§

fn is_drawable(&self) -> bool

source§

fn is_focus(&self) -> bool

source§

fn is_sensitive(&self) -> bool

source§

fn is_visible(&self) -> bool

source§

fn keynav_failed(&self, direction: DirectionType) -> bool

source§

fn list_mnemonic_labels(&self) -> Vec<Widget>

source§

fn map(&self)

source§

fn measure( &self, orientation: Orientation, for_size: i32, ) -> (i32, i32, i32, i32)

source§

fn mnemonic_activate(&self, group_cycling: bool) -> bool

source§

fn observe_children(&self) -> ListModel

source§

fn observe_controllers(&self) -> ListModel

source§

fn pick(&self, x: f64, y: f64, flags: PickFlags) -> Option<Widget>

source§

fn queue_allocate(&self)

source§

fn queue_draw(&self)

source§

fn queue_resize(&self)

source§

fn realize(&self)

source§

fn remove_controller(&self, controller: &impl IsA<EventController>)

source§

fn remove_css_class(&self, css_class: &str)

source§

fn remove_mnemonic_label(&self, label: &impl IsA<Widget>)

source§

fn set_can_focus(&self, can_focus: bool)

source§

fn set_can_target(&self, can_target: bool)

source§

fn set_child_visible(&self, child_visible: bool)

source§

fn set_css_classes(&self, classes: &[&str])

source§

fn set_cursor(&self, cursor: Option<&Cursor>)

source§

fn set_cursor_from_name(&self, name: Option<&str>)

source§

fn set_direction(&self, dir: TextDirection)

source§

fn set_focus_child(&self, child: Option<&impl IsA<Widget>>)

source§

fn set_focus_on_click(&self, focus_on_click: bool)

source§

fn set_focusable(&self, focusable: bool)

source§

fn set_font_map(&self, font_map: Option<&impl IsA<FontMap>>)

source§

fn set_font_options(&self, options: Option<&FontOptions>)

source§

fn set_halign(&self, align: Align)

source§

fn set_has_tooltip(&self, has_tooltip: bool)

source§

fn set_hexpand(&self, expand: bool)

source§

fn set_hexpand_set(&self, set: bool)

source§

fn set_layout_manager(&self, layout_manager: Option<impl IsA<LayoutManager>>)

source§

fn set_margin_bottom(&self, margin: i32)

source§

fn set_margin_end(&self, margin: i32)

source§

fn set_margin_start(&self, margin: i32)

source§

fn set_margin_top(&self, margin: i32)

source§

fn set_widget_name(&self, name: &str)

source§

fn set_opacity(&self, opacity: f64)

source§

fn set_overflow(&self, overflow: Overflow)

source§

fn set_parent(&self, parent: &impl IsA<Widget>)

source§

fn set_receives_default(&self, receives_default: bool)

source§

fn set_sensitive(&self, sensitive: bool)

source§

fn set_size_request(&self, width: i32, height: i32)

source§

fn set_state_flags(&self, flags: StateFlags, clear: bool)

source§

fn set_tooltip_markup(&self, markup: Option<&str>)

source§

fn set_tooltip_text(&self, text: Option<&str>)

source§

fn set_valign(&self, align: Align)

source§

fn set_vexpand(&self, expand: bool)

source§

fn set_vexpand_set(&self, set: bool)

source§

fn set_visible(&self, visible: bool)

source§

fn should_layout(&self) -> bool

source§

fn show(&self)

source§

fn size_allocate(&self, allocation: &Rectangle, baseline: i32)

source§

fn snapshot_child( &self, child: &impl IsA<Widget>, snapshot: &impl IsA<Snapshot>, )

source§

fn translate_coordinates( &self, dest_widget: &impl IsA<Widget>, src_x: f64, src_y: f64, ) -> Option<(f64, f64)>

source§

fn trigger_tooltip_query(&self)

source§

fn unmap(&self)

source§

fn unparent(&self)

source§

fn unrealize(&self)

source§

fn unset_state_flags(&self, flags: StateFlags)

source§

fn height_request(&self) -> i32

source§

fn set_height_request(&self, height_request: i32)

source§

fn width_request(&self) -> i32

source§

fn set_width_request(&self, width_request: i32)

source§

fn connect_destroy<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_direction_changed<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self, TextDirection) + 'static,

source§

fn connect_hide<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_keynav_failed<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self, DirectionType) -> Propagation + 'static,

source§

fn connect_map<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_mnemonic_activate<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self, bool) -> Propagation + 'static,

source§

fn connect_move_focus<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self, DirectionType) + 'static,

source§

fn emit_move_focus(&self, direction: DirectionType)

source§

fn connect_query_tooltip<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self, i32, i32, bool, &Tooltip) -> bool + 'static,

source§

fn connect_realize<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_show<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_state_flags_changed<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self, StateFlags) + 'static,

source§

fn connect_unmap<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_unrealize<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_can_focus_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_can_target_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_css_classes_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_cursor_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_focus_on_click_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_focusable_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_halign_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_has_default_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_has_focus_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_has_tooltip_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_height_request_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_hexpand_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_hexpand_set_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_layout_manager_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_margin_bottom_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_margin_end_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_margin_start_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_margin_top_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_name_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_opacity_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_overflow_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_parent_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_receives_default_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_root_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_scale_factor_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_sensitive_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_tooltip_markup_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_tooltip_text_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_valign_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_vexpand_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_vexpand_set_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_visible_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

fn connect_width_request_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

source§

impl<O> WidgetExtManual for O
where O: IsA<Widget>,

source§

fn add_tick_callback<P>(&self, callback: P) -> TickCallbackId
where P: Fn(&Self, &FrameClock) -> ControlFlow + 'static,

source§

impl<O> ConstraintTargetExt for O

source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,

source§

impl<Super, Sub> MayDowncastTo<Sub> for Super
where Super: IsA<Super>, Sub: IsA<Super>,