Class WebFormManager

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class WebFormManager extends GObject
Form manager of a WebKitWebPage in a WebKitScriptWorld
Since:
2.40
  • Constructor Details

    • WebFormManager

      public WebFormManager(MemorySegment address)
      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

      public static @Nullable Type getType()
      Get the GType of the WebFormManager class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected WebFormManager asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • inputElementAutoFill

      public static void inputElementAutoFill(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. If element is not an HTML input element this function does nothing.
      Parameters:
      element - a JSCValue
      value - the text to set
      Since:
      2.40
    • inputElementIsAutoFilled

      public static boolean inputElementIsAutoFilled(Value element)
      Get whether element is an HTML input element that has been filled automatically.
      Parameters:
      element - a JSCValue
      Returns:
      true if element is an HTML input element that has been filled automatically, or false otherwise
      Since:
      2.40
    • inputElementIsUserEdited

      public static boolean inputElementIsUserEdited(Value element)
      Get whether element is an HTML text input element that has been edited by a user action.
      Parameters:
      element - a JSCValue
      Returns:
      true if element is an HTML text input element that has been edited by a user action, or false otherwise
      Since:
      2.40
    • onFormControlsAssociated

      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 elements array carries the list of those elements which have moved.

      Clients should take a reference to the members of the elements array 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. See onFormControlsAssociated(WebFormManager.FormControlsAssociatedCallback).
    • onWillSendSubmitEvent

      This signal is emitted when the DOM submit event is about to be fired for form. 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 before WebKitWebFormManager::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. See onWillSendSubmitEvent(WebFormManager.WillSendSubmitEventCallback).
    • onWillSubmitForm

      This signal is emitted when form will 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 after WebKitWebFormManager::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. See onWillSubmitForm(WebFormManager.WillSubmitFormCallback).
    • builder

      public static WebFormManager.Builder<? extends WebFormManager.Builder> builder()
      A WebFormManager.Builder object constructs a WebFormManager with the specified properties. Use the various set...() methods to set properties, and finish construction with WebFormManager.Builder.build().
      Returns:
      the builder object