Package org.gnome.webkit
Interface UserContentManager.ScriptMessageWithReplyReceivedCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
UserContentManager
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface UserContentManager.ScriptMessageWithReplyReceivedCallback
extends FunctionPointer
Functional interface declaration of the
ScriptMessageWithReplyReceivedCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
run
(Value value, ScriptMessageReply reply) This signal is emitted when JavaScript in a web view calls <code>window.webkit.messageHandlers.<name>.postMessage()</code>, after registering <code><name></code> using webkit_user_content_manager_register_script_message_handler_with_reply()default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default int
upcall
(MemorySegment sourceUserContentManager, MemorySegment value, MemorySegment reply) Theupcall
method is called from native code.
-
Method Details
-
run
This signal is emitted when JavaScript in a web view calls <code>window.webkit.messageHandlers.<name>.postMessage()</code>, after registering <code><name></code> using webkit_user_content_manager_register_script_message_handler_with_reply()The given
reply
can be used to send a return value with webkit_script_message_reply_return_value() or an error message with webkit_script_message_reply_return_error_message(). If none of them are called, an automatic reply with an undefined value will be sent.It is possible to handle the reply asynchronously, by simply calling g_object_ref() on the
reply
and returningtrue
. -
upcall
default int upcall(MemorySegment sourceUserContentManager, MemorySegment value, MemorySegment reply) Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.webkit.jsc.Value, org.gnome.webkit.ScriptMessageReply)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-