Class ScriptDialog
-
Constructor Summary
ConstructorDescriptionScriptDialog
(MemorySegment address) Create a ScriptDialog proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this ScriptDialog.void
confirmSetConfirmed
(boolean confirmed) Set whether the user confirmed the dialog.Get the dialog type of aWebKitScriptDialog
.Get the message of aWebKitScriptDialog
.static Type
getType()
Get the GType of the ScriptDialog classGet the default text of aWebKitScriptDialog
of typeScriptDialogType.PROMPT
.void
promptSetText
(String text) Set the text entered by the user in the dialog.ref()
Atomically increments the reference count of this ScriptDialog by one.void
unref()
Atomically decrements the reference count of this ScriptDialog by one.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ScriptDialog
Create a ScriptDialog proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
close
public void close()Close this ScriptDialog.When handling a
WebKitScriptDialog
asynchronously (webkit_script_dialog_ref() was called inWebKitWebView
::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. -
confirmSetConfirmed
public void confirmSetConfirmed(boolean confirmed) Set whether the user confirmed the dialog.This method is used for
ScriptDialogType.CONFIRM
andScriptDialogType.BEFORE_UNLOAD_CONFIRM
dialogs whenWebKitWebView
::script-dialog signal is emitted to set whether the user confirmed the dialog or not. The default implementation ofWebKitWebView
::script-dialog signal setstrue
when the OK or Stay buttons are clicked andfalse
otherwise. It's an error to use this method with aWebKitScriptDialog
that is not of typeScriptDialogType.CONFIRM
orScriptDialogType.BEFORE_UNLOAD_CONFIRM
- Parameters:
confirmed
- whether user confirmed the dialog
-
getDialogType
Get the dialog type of aWebKitScriptDialog
.- Returns:
- the
WebKitScriptDialogType
of this ScriptDialog
-
getMessage
Get the message of aWebKitScriptDialog
.- Returns:
- the message of this ScriptDialog.
-
promptGetDefaultText
Get the default text of aWebKitScriptDialog
of typeScriptDialogType.PROMPT
.It's an error to use this method with a
WebKitScriptDialog
that is not of typeScriptDialogType.PROMPT
.- Returns:
- the default text of this ScriptDialog
-
promptSetText
Set the text entered by the user in the dialog.This method is used for
ScriptDialogType.PROMPT
dialogs whenWebKitWebView
::script-dialog signal is emitted to set the text entered by the user. The default implementation ofWebKitWebView
::script-dialog signal sets the text of the entry form when OK button is clicked, otherwisenull
is set. It's an error to use this method with aWebKitScriptDialog
that is not of typeScriptDialogType.PROMPT
.- Parameters:
text
- the text to set
-
ref
Atomically increments the reference count of this ScriptDialog by one.This function is MT-safe and may be called from any thread.
- Returns:
- The passed in
WebKitScriptDialog
-
unref
public void unref()Atomically decrements the reference count of this ScriptDialog by one.If the reference count drops to 0, all memory allocated by the
WebKitScriptdialog
is released. This function is MT-safe and may be called from any thread.
-