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
Source§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§impl PartialOrd for ScriptDialog
impl PartialOrd for ScriptDialog
Source§impl StaticType for ScriptDialog
impl StaticType for ScriptDialog
Source§fn static_type() -> Type
fn static_type() -> Type
Self.