Trait webkit2gtk::prelude::WebInspectorExt
source · [−]pub trait WebInspectorExt: 'static {
Show 17 methods
fn attach(&self);
fn close(&self);
fn detach(&self);
fn attached_height(&self) -> u32;
fn can_attach(&self) -> bool;
fn inspected_uri(&self) -> Option<GString>;
fn web_view(&self) -> Option<WebViewBase>;
fn is_attached(&self) -> bool;
fn show(&self);
fn connect_attach<F: Fn(&Self) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_bring_to_front<F: Fn(&Self) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_closed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_detach<F: Fn(&Self) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_open_window<F: Fn(&Self) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_attached_height_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_can_attach_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_inspected_uri_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}
Expand description
Required Methods
sourcefn attach(&self)
fn attach(&self)
Request self
to be attached.
The signal signal::WebInspector::attach
will be emitted. If the inspector is already attached it does nothing.
sourcefn detach(&self)
fn detach(&self)
Request self
to be detached.
The signal signal::WebInspector::detach
will be emitted. If the inspector is already detached it does nothing.
sourcefn attached_height(&self) -> u32
fn attached_height(&self) -> u32
Get the height that the inspector view when attached.
Get the height that the inspector view should have when it’s attached. If the inspector view is not attached this returns 0.
Returns
the height of the inspector view when attached
sourcefn can_attach(&self) -> bool
fn can_attach(&self) -> bool
v2_8
only.sourcefn inspected_uri(&self) -> Option<GString>
fn inspected_uri(&self) -> Option<GString>
sourcefn web_view(&self) -> Option<WebViewBase>
fn web_view(&self) -> Option<WebViewBase>
Get the WebViewBase
used to display the inspector.
This might be None
if the inspector hasn’t been loaded yet,
or it has been closed.
Returns
the WebViewBase
used to display the inspector or None
sourcefn is_attached(&self) -> bool
fn is_attached(&self) -> bool
sourcefn connect_attach<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId
fn connect_attach<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId
Emitted when the inspector is requested to be attached to the window where the inspected web view is. If this signal is not handled the inspector view will be automatically attached to the inspected view, so you only need to handle this signal if you want to attach the inspector view yourself (for example, to add the inspector view to a browser tab).
To prevent the inspector view from being attached you can connect to this
signal and simply return true
.
Returns
true
to stop other handlers from being invoked for the event.
false
to propagate the event further.
sourcefn connect_bring_to_front<F: Fn(&Self) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_bring_to_front<F: Fn(&Self) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId
Emitted when the inspector should be shown.
If the inspector is not attached the inspector window should be shown
on top of any other windows.
If the inspector is attached the inspector view should be made visible.
For example, if the inspector view is attached using a tab in a browser
window, the browser window should be raised and the tab containing the
inspector view should be the active one.
In both cases, if this signal is not handled, the default implementation
calls [WindowExtManual::present()
][crate::gtk::prelude::WindowExtManual::present()] on the current toplevel gtk::Window
of the
inspector view.
Returns
true
to stop other handlers from being invoked for the event.
false
to propagate the event further.
sourcefn connect_closed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_closed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Emitted when the inspector page is closed. If you are using your own inspector window, you should connect to this signal and destroy your window.
sourcefn connect_detach<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId
fn connect_detach<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId
Emitted when the inspector is requested to be detached from the window
it is currently attached to. The inspector is detached when the inspector page
is about to be closed, and this signal is emitted right before
signal::WebInspector::closed
, or when the user clicks on the detach button
in the inspector view to show the inspector in a separate window. In this case
the signal signal::WebInspector::open-window
is emitted after this one.
To prevent the inspector view from being detached you can connect to this
signal and simply return true
.
Returns
true
to stop other handlers from being invoked for the event.
false
to propagate the event further.
sourcefn connect_open_window<F: Fn(&Self) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_open_window<F: Fn(&Self) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId
Emitted when the inspector is requested to open in a separate window.
If this signal is not handled, a gtk::Window
with the inspector will be
created and shown, so you only need to handle this signal if you want
to use your own window.
This signal is emitted after signal::WebInspector::detach
to show
the inspector in a separate window after being detached.
To prevent the inspector from being shown you can connect to this
signal and simply return true
Returns
true
to stop other handlers from being invoked for the event.
false
to propagate the event further.
fn connect_attached_height_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_can_attach_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_can_attach_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
v2_8
only.