Class AutomationSession
- All Implemented Interfaces:
Proxy
WebKitAutomationSession represents an automation session of a WebKitWebContext.
When a new session is requested, a WebKitAutomationSession is created and the signal
WebKitWebContext::automation-started is emitted with the WebKitAutomationSession as
argument. Then, the automation client can request the session to create a new
WebKitWebView
to interact with it. When this happens the signal WebKitAutomationSession
::create-web-view
is emitted.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
AutomationSession.Builder<B extends AutomationSession.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static interface
Functional interface declaration of theCreateWebViewCallback
callback.static interface
Functional interface declaration of theWillCloseCallback
callback.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionAutomationSession
(MemorySegment address) Create a AutomationSession proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected AutomationSession
asParent()
Returns this instance as if it were its parent type.static AutomationSession.Builder
<? extends AutomationSession.Builder> builder()
AAutomationSession.Builder
object constructs aAutomationSession
with the specified properties.emitCreateWebView
(@Nullable String detail) Emits the "create-web-view" signal.void
Emits the "will-close" signal.Get the the previously setWebKitAutomationSession
.getId()
Get the unique identifier of aWebKitAutomationSession
static Type
getType()
Get the GType of the AutomationSession classonCreateWebView
(@Nullable String detail, AutomationSession.CreateWebViewCallback handler) This signal is emitted when the automation client requests a new browsing context to interact with it.This signal is emitted when the given automation session is about to finish.void
Set the application information to this AutomationSession.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
AutomationSession
Create a AutomationSession proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getApplicationInfo
Get the the previously setWebKitAutomationSession
.Get the
WebKitAutomationSession
previously set with webkit_automation_session_set_application_info().- Returns:
- the
WebKitAutomationSession
of this AutomationSession, ornull
if no one has been set.
-
getId
Get the unique identifier of aWebKitAutomationSession
- Returns:
- the unique identifier of this AutomationSession
-
setApplicationInfo
Set the application information to this AutomationSession.This information will be used by the driver service to match the requested capabilities with the actual application information. If this information is not provided to the session when a new automation session is requested, the creation might fail if the client requested a specific browser name or version. This will not have any effect when called after the automation session has been fully created, so this must be called in the callback of
WebKitWebContext
::automation-started signal.- Parameters:
info
- aWebKitApplicationInfo
-
onCreateWebView
public SignalConnection<AutomationSession.CreateWebViewCallback> onCreateWebView(@Nullable @Nullable String detail, AutomationSession.CreateWebViewCallback handler) This signal is emitted when the automation client requests a new browsing context to interact with it. The callback handler should return aWebKitWebView
created withWebKitWebView
:is-controlled-by-automation construct property enabled andWebKitWebView
:automation-presentation-type construct property set if needed.If the signal is emitted with "tab" detail, the returned
WebKitWebView
should be a new web view added to a new tab of the current browsing context window. If the signal is emitted with "window" detail, the returnedWebKitWebView
should be a new web view added to a new window. When creating a new web view and there's an active browsing context, the new window or tab shouldn't be focused.- Parameters:
detail
- the signal detailhandler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitCreateWebView
Emits the "create-web-view" signal. SeeonCreateWebView(java.lang.String, org.gnome.webkit.AutomationSession.CreateWebViewCallback)
. -
onWillClose
public SignalConnection<AutomationSession.WillCloseCallback> onWillClose(AutomationSession.WillCloseCallback handler) This signal is emitted when the given automation session is about to finish. It allows clients to perform any cleanup tasks before the session is destroyed.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitWillClose
public void emitWillClose()Emits the "will-close" signal. SeeonWillClose(org.gnome.webkit.AutomationSession.WillCloseCallback)
. -
builder
AAutomationSession.Builder
object constructs aAutomationSession
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withAutomationSession.Builder.build()
.
-