Class AutomationSession
- All Implemented Interfaces:
Proxy
Automation Session.
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.
- Since:
- 2.18
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classAutomationSession.Builder<B extends AutomationSession.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static interfaceFunctional interface declaration of theCreateWebViewCallbackcallback.static interfaceFunctional interface declaration of theWillCloseCallbackcallback.Nested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new AutomationSession.AutomationSession(MemorySegment address) Create a AutomationSession instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected AutomationSessionasParent()Return this instance as if it were its parent type.static AutomationSession.Builder<? extends AutomationSession.Builder> builder()AAutomationSession.Builderobject constructs aAutomationSessionwith the specified properties.emitCreateWebView(@Nullable String detail) Emits the "create-web-view" signal.voidEmits the "will-close" signal.Get the the previously setWebKitAutomationSession.getId()Get the unique identifier of aWebKitAutomationSessionstatic MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the AutomationSession class.onCreateWebView(@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.voidSet the application information tosession.Methods inherited from class 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, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, 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, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
AutomationSession
Create a AutomationSession instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
AutomationSession
public AutomationSession()Create a new AutomationSession.
-
-
Method Details
-
getType
Get the GType of the AutomationSession class.- Returns:
- the GType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
getApplicationInfo
Get the the previously set
WebKitAutomationSession.Get the
WebKitAutomationSessionpreviously set with webkit_automation_session_set_application_info().- Returns:
- the
WebKitAutomationSessionofsession,ornullif no one has been set. - Since:
- 2.18
-
getId
Get the unique identifier of aWebKitAutomationSession- Returns:
- the unique identifier of this AutomationSession
- Since:
- 2.18
-
setApplicationInfo
Set the application information to
session.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- Since:
- 2.18
-
onCreateWebView
public SignalConnection<AutomationSession.CreateWebViewCallback> onCreateWebView(@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 a
WebKitWebViewcreated 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
WebKitWebViewshould 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 returnedWebKitWebViewshould 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
- Since:
- 2.18
- See Also:
-
emitCreateWebView
Emits the "create-web-view" signal. SeeonCreateWebView(String, 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
- Since:
- 2.46
- See Also:
-
emitWillClose
public void emitWillClose()Emits the "will-close" signal. SeeonWillClose(AutomationSession.WillCloseCallback). -
builder
AAutomationSession.Builderobject constructs aAutomationSessionwith the specified properties. Use the variousset...()methods to set properties, and finish construction withAutomationSession.Builder.build().- Returns:
- the builder object
-