Class WebHitTestResult

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public final class WebHitTestResult extends GObject

Result of a Hit Test (Web Process Extensions).

WebKitWebHitTestResult extends WebKitHitTestResult to provide information about the WebKitDOMNode in the coordinates of the Hit Test.

Since:
2.8
  • Constructor Details

    • WebHitTestResult

      public WebHitTestResult(MemorySegment address)
      Create a WebHitTestResult instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • WebHitTestResult

      public WebHitTestResult()
      Create a new WebHitTestResult.
  • Method Details

    • getType

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

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

      protected WebHitTestResult 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
    • contextIsEditable

      public boolean contextIsEditable()

      Check whether there is an editable element at the hit test position.

      Checks whether HitTestResultContext.EDITABLE flag is present in the context flags.

      Returns:
      true if the hit test covers an editable element or false otherwise.
    • contextIsImage

      public boolean contextIsImage()

      Check whether there is an image element at the hit test position.

      Checks whether HitTestResultContext.IMAGE flag is present in the context flags.

      Returns:
      true if the hit test covers an image element or false otherwise.
    • contextIsLink

      public boolean contextIsLink()

      Check whether there is a link element at the hit test position.

      Checks whether HitTestResultContext.LINK flag is present in the context flags.

      Returns:
      true if the hit test covers a link element or false otherwise.
    • contextIsMedia

      public boolean contextIsMedia()

      Check whether there is a media element at the hit test position.

      Checks whether HitTestResultContext.MEDIA flag is present in the context flags.

      Returns:
      true if the hit test covers a media element or false otherwise.
    • contextIsScrollbar

      public boolean contextIsScrollbar()

      Check whether there is a scrollbar at the hit test position.

      Checks whether HitTestResultContext.SCROLLBAR flag is present in the context flags.

      Returns:
      true if the hit test covers a scrollbar or false otherwise.
    • contextIsSelection

      public boolean contextIsSelection()

      Check whether there is a selected element at the hit test position.

      Checks whether HitTestResultContext.SELECTION flag is present in the context flags.

      Returns:
      true if the hit test covers a selected element or false otherwise.
    • getContext

      public int getContext()
      Gets the the context flags for the hit test result.
      Returns:
      a bitmask of WebKitHitTestResultContext flags
    • getImageUri

      public String getImageUri()
      Obtains the URI associated with the image element at the hit test position.
      Returns:
      the URI of the image element, or null if the hit test does not cover an image element.
    • getJsNode

      public @Nullable Value getJsNode(@Nullable ScriptWorld world)
      Get the JSCValue for the DOM node in world at the coordinates of the Hit Test.
      Parameters:
      world - a WebKitScriptWorld, or null to use the default
      Returns:
      a JSCValue for the DOM node, or null
      Since:
      2.40
    • getLinkLabel

      public String getLinkLabel()
      Obtains the label associated with the link element at the hit test position.
      Returns:
      the label of the link element, or null if the hit test does not cover a link element or the link element does not have a label.
    • getLinkTitle

      public String getLinkTitle()
      Obtains the title associated with the link element at the hit test position.
      Returns:
      the title of the link element, or null if the hit test does not cover a link element or the link element does not have a title.
    • getLinkUri

      public String getLinkUri()
      Obtains the URI associated with the link element at the hit test position.
      Returns:
      the URI of the link element, or null if the hit test does not cover a link element.
    • getMediaUri

      public String getMediaUri()
      Obtains the URI associated with the media element at the hit test position.
      Returns:
      the URI of the media element, or null if the hit test does not cover a media element.
    • builder

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