Struct webkit6::ScriptDialog
source · pub struct ScriptDialog { /* private fields */ }
Expand description
Carries details to be shown in user-facing dialogs.
GLib type: Shared boxed type with reference counted clone semantics.
Implementations§
source§impl ScriptDialog
impl ScriptDialog
sourcepub fn as_ptr(&self) -> *mut WebKitScriptDialog
pub fn as_ptr(&self) -> *mut WebKitScriptDialog
Return the inner pointer to the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow(ptr: &*mut WebKitScriptDialog) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut WebKitScriptDialog) -> &Self
Borrows the underlying C value.
source§impl ScriptDialog
impl ScriptDialog
sourcepub fn close(&self)
pub fn close(&self)
Close @self.
When handling a #WebKitScriptDialog asynchronously (webkit_script_dialog_ref() was called in #WebKitWebView::script-dialog callback), this function needs to be called to notify that we are done with the script dialog. The dialog will be closed on destruction if this function hasn’t been called before.
sourcepub fn confirm_set_confirmed(&self, confirmed: bool)
pub fn confirm_set_confirmed(&self, confirmed: bool)
Set whether the user confirmed the dialog.
This method is used for ScriptDialogType::Confirm
and ScriptDialogType::BeforeUnloadConfirm
dialogs when
#WebKitWebView::script-dialog signal is emitted to set whether the user
confirmed the dialog or not. The default implementation of #WebKitWebView::script-dialog
signal sets true
when the OK or Stay buttons are clicked and false
otherwise.
It’s an error to use this method with a #WebKitScriptDialog that is not of type
ScriptDialogType::Confirm
or ScriptDialogType::BeforeUnloadConfirm
§confirmed
whether user confirmed the dialog
sourcepub fn dialog_type(&self) -> ScriptDialogType
pub fn dialog_type(&self) -> ScriptDialogType
sourcepub fn prompt_get_default_text(&self) -> Option<GString>
pub fn prompt_get_default_text(&self) -> Option<GString>
Get the default text of a #WebKitScriptDialog of type ScriptDialogType::Prompt
.
It’s an error to use this method with a #WebKitScriptDialog that is not of type
ScriptDialogType::Prompt
.
§Returns
the default text of @self
sourcepub fn prompt_set_text(&self, text: &str)
pub fn prompt_set_text(&self, text: &str)
Set the text entered by the user in the dialog.
This method is used for ScriptDialogType::Prompt
dialogs when
#WebKitWebView::script-dialog signal is emitted to set the text
entered by the user. The default implementation of #WebKitWebView::script-dialog
signal sets the text of the entry form when OK button is clicked, otherwise None
is set.
It’s an error to use this method with a #WebKitScriptDialog that is not of type
ScriptDialogType::Prompt
.
§text
the text to set
Trait Implementations§
source§impl Clone for ScriptDialog
impl Clone for ScriptDialog
source§impl Debug for ScriptDialog
impl Debug for ScriptDialog
source§impl From<ScriptDialog> for Value
impl From<ScriptDialog> for Value
source§fn from(s: ScriptDialog) -> Self
fn from(s: ScriptDialog) -> Self
source§impl HasParamSpec for ScriptDialog
impl HasParamSpec for ScriptDialog
type ParamSpec = ParamSpecBoxed
§type SetValue = ScriptDialog
type SetValue = ScriptDialog
type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, ScriptDialog>
fn param_spec_builder() -> Self::BuilderFn
source§impl Hash for ScriptDialog
impl Hash for ScriptDialog
source§impl Ord for ScriptDialog
impl Ord for ScriptDialog
source§fn cmp(&self, other: &ScriptDialog) -> Ordering
fn cmp(&self, other: &ScriptDialog) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for ScriptDialog
impl PartialEq for ScriptDialog
source§fn eq(&self, other: &ScriptDialog) -> bool
fn eq(&self, other: &ScriptDialog) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ScriptDialog
impl PartialOrd for ScriptDialog
source§fn partial_cmp(&self, other: &ScriptDialog) -> Option<Ordering>
fn partial_cmp(&self, other: &ScriptDialog) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for ScriptDialog
impl StaticType for ScriptDialog
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for ScriptDialog
impl StructuralPartialEq for ScriptDialog
Auto Trait Implementations§
impl Freeze for ScriptDialog
impl RefUnwindSafe for ScriptDialog
impl !Send for ScriptDialog
impl !Sync for ScriptDialog
impl Unpin for ScriptDialog
impl UnwindSafe for ScriptDialog
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)