Class WebFormManager
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gobject.GObject
org.webkitgtk.webprocessextension.WebFormManager
- All Implemented Interfaces:
Proxy
Form manager of a
WebKitWebPage in a WebKitScriptWorld- Since:
- 2.40
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWebFormManager.Builder<B extends WebFormManager.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static interfaceFunctional interface declaration of theFormControlsAssociatedCallbackcallback.static classstatic interfaceFunctional interface declaration of theWillSendSubmitEventCallbackcallback.static interfaceFunctional interface declaration of theWillSubmitFormCallbackcallback.Nested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new WebFormManager.WebFormManager(MemorySegment address) Create a WebFormManager instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected WebFormManagerasParent()Return this instance as if it were its parent type.static WebFormManager.Builder<? extends WebFormManager.Builder> builder()AWebFormManager.Builderobject constructs aWebFormManagerwith the specified properties.voidemitFormControlsAssociated(@Nullable Frame frame, @Nullable Value @Nullable [] elements) Emits the "form-controls-associated" signal.voidemitWillSendSubmitEvent(@Nullable Value form, @Nullable Frame sourceFrame, @Nullable Frame targetFrame) Emits the "will-send-submit-event" signal.voidemitWillSubmitForm(@Nullable Value form, @Nullable Frame sourceFrame, @Nullable Frame targetFrame) Emits the "will-submit-form" signal.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the WebFormManager class.static voidinputElementAutoFill(Value element, String value) Set the value of an HTML input element as if it had been edited by the user, triggering a change event, and set it as filled automatically.static booleaninputElementIsAutoFilled(Value element) Get whetherelementis an HTML input element that has been filled automatically.static booleaninputElementIsUserEdited(Value element) Get whetherelementis an HTML text input element that has been edited by a user action.Emitted after form elements (or form associated elements) are associated toframe.This is useful to implement form auto filling for web pages where form fields are added dynamically.This signal is emitted when the DOM submit event is about to be fired forform.JavaScript code may rely on the submit event to detect that the user has clicked on a submit button, and to possibly cancel the form submission beforeWebKitWebFormManager::will-submit-form signal is emitted.This signal is emitted whenformwill imminently be submitted.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
-
WebFormManager
Create a WebFormManager instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
WebFormManager
public WebFormManager()Create a new WebFormManager.
-
-
Method Details
-
getType
Get the GType of the WebFormManager 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. -
inputElementAutoFill
Set the value of an HTML input element as if it had been edited by the user, triggering a change event, and set it as filled automatically. Ifelementis not an HTML input element this function does nothing.- Parameters:
element- aJSCValuevalue- the text to set- Since:
- 2.40
-
inputElementIsAutoFilled
Get whetherelementis an HTML input element that has been filled automatically.- Parameters:
element- aJSCValue- Returns:
trueifelementis an HTML input element that has been filled automatically, orfalseotherwise- Since:
- 2.40
-
inputElementIsUserEdited
Get whetherelementis an HTML text input element that has been edited by a user action.- Parameters:
element- aJSCValue- Returns:
trueifelementis an HTML text input element that has been edited by a user action, orfalseotherwise- Since:
- 2.40
-
onFormControlsAssociated
public SignalConnection<WebFormManager.FormControlsAssociatedCallback> onFormControlsAssociated(WebFormManager.FormControlsAssociatedCallback handler) Emitted after form elements (or form associated elements) are associated to
frame.This is useful to implement form auto filling for web pages where form fields are added dynamically. This signal might be emitted multiple times for the same frame.Note that this signal could be also emitted when form controls are moved between forms. In that case, the
elementsarray carries the list of those elements which have moved.Clients should take a reference to the members of the
elementsarray if it is desired to keep them alive after the signal handler returns.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- Since:
- 2.40
- See Also:
-
emitFormControlsAssociated
public void emitFormControlsAssociated(@Nullable Frame frame, @Nullable Value @Nullable [] elements) Emits the "form-controls-associated" signal. SeeonFormControlsAssociated(WebFormManager.FormControlsAssociatedCallback). -
onWillSendSubmitEvent
public SignalConnection<WebFormManager.WillSendSubmitEventCallback> onWillSendSubmitEvent(WebFormManager.WillSendSubmitEventCallback handler) This signal is emitted when the DOM submit event is about to be fired forform.JavaScript code may rely on the submit event to detect that the user has clicked on a submit button, and to possibly cancel the form submission beforeWebKitWebFormManager::will-submit-form signal is emitted. However, beware that, for historical reasons, the submit event is not emitted at all if the form submission is triggered by JavaScript. For these reasons, this signal may not be used to reliably detect whether a form will be submitted. Instead, use it to detect if a user has clicked on a form's submit button even if JavaScript later cancels the form submission, or to read the values of the form's fields even if JavaScript later clears certain fields before submitting. This may be needed, for example, to implement a robust browser password manager, as some misguided websites may use such techniques to attempt to thwart password managers.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- Since:
- 2.40
- See Also:
-
emitWillSendSubmitEvent
public void emitWillSendSubmitEvent(@Nullable Value form, @Nullable Frame sourceFrame, @Nullable Frame targetFrame) Emits the "will-send-submit-event" signal. SeeonWillSendSubmitEvent(WebFormManager.WillSendSubmitEventCallback). -
onWillSubmitForm
public SignalConnection<WebFormManager.WillSubmitFormCallback> onWillSubmitForm(WebFormManager.WillSubmitFormCallback handler) This signal is emitted whenformwill imminently be submitted. It can no longer be cancelled. This event always occurs immediately before a form is submitted to its target, so use this event to reliably detect when a form is submitted. This signal is emitted afterWebKitWebFormManager::will-send-submit-event if that signal is emitted.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- Since:
- 2.40
- See Also:
-
emitWillSubmitForm
public void emitWillSubmitForm(@Nullable Value form, @Nullable Frame sourceFrame, @Nullable Frame targetFrame) Emits the "will-submit-form" signal. SeeonWillSubmitForm(WebFormManager.WillSubmitFormCallback). -
builder
AWebFormManager.Builderobject constructs aWebFormManagerwith the specified properties. Use the variousset...()methods to set properties, and finish construction withWebFormManager.Builder.build().- Returns:
- the builder object
-