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.
- 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 org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new AutomationSession.AutomationSession(MemorySegment address) Create a AutomationSession proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected AutomationSessionasParent()Returns 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 @Nullable TypegetType()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.voidSet the application information tosession.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, 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 org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.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
-
AutomationSession
public AutomationSession()Creates a new AutomationSession.
-
-
Method Details
-
getType
Get the GType of the AutomationSession class- Returns:
- the GType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, 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
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 tosession.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 aWebKitWebViewcreated 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(java.lang.String, org.webkitgtk.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(org.webkitgtk.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
-