Class HitTestResult
- All Implemented Interfaces:
Proxy
A Hit Test is an operation to get context information about a given
point in a WebKitWebView
. WebKitHitTestResult
represents the
result of a Hit Test. It provides context information about what is
at the coordinates of the Hit Test, such as if there's a link,
an image or a media.
You can get the context of the HitTestResult with
webkit_hit_test_result_get_context() that returns a bitmask of
WebKitHitTestResultContext
flags. You can also use
webkit_hit_test_result_context_is_link(), webkit_hit_test_result_context_is_image() and
webkit_hit_test_result_context_is_media() to determine whether there's
a link, image or a media element at the coordinates of the Hit Test.
Note that it's possible that several WebKitHitTestResultContext
flags
are active at the same time, for example if there's a link containing an image.
When the mouse is moved over a WebKitWebView
a Hit Test is performed
for the mouse coordinates and WebKitWebView
::mouse-target-changed
signal is emitted with a WebKitHitTestResult
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
HitTestResult.Builder<B extends HitTestResult.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionHitTestResult
(MemorySegment address) Create a HitTestResult proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected HitTestResult
asParent()
Returns this instance as if it were its parent type.static HitTestResult.Builder
<? extends HitTestResult.Builder> builder()
AHitTestResult.Builder
object constructs aHitTestResult
with the specified properties.boolean
Gets whetherHitTestResultContext.EDITABLE
flag is present inWebKitHitTestResult
:context.boolean
Gets whetherHitTestResultContext.IMAGE
flag is present inWebKitHitTestResult
:context.boolean
Gets whetherHitTestResultContext.LINK
flag is present inWebKitHitTestResult
:context.boolean
Gets whetherHitTestResultContext.MEDIA
flag is present inWebKitHitTestResult
:context.boolean
Gets whetherHitTestResultContext.SCROLLBAR
flag is present inWebKitHitTestResult
:context.boolean
Gets whetherHitTestResultContext.SELECTION
flag is present inWebKitHitTestResult
:context.int
Gets the value of theWebKitHitTestResult
:context property.Gets the value of theWebKitHitTestResult
:image-uri property.Gets the value of theWebKitHitTestResult
:link-label property.Gets the value of theWebKitHitTestResult
:link-title property.Gets the value of theWebKitHitTestResult
:link-uri property.Gets the value of theWebKitHitTestResult
:media-uri property.static Type
getType()
Get the GType of the HitTestResult classMethods 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, 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, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
HitTestResult
Create a HitTestResult proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, 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. -
contextIsEditable
public boolean contextIsEditable()Gets whetherHitTestResultContext.EDITABLE
flag is present inWebKitHitTestResult
:context.- Returns:
true
if there's an editable element at the coordinates of the this HitTestResult, orfalse
otherwise
-
contextIsImage
public boolean contextIsImage()Gets whetherHitTestResultContext.IMAGE
flag is present inWebKitHitTestResult
:context.- Returns:
true
if there's an image element in the coordinates of the Hit Test, orfalse
otherwise
-
contextIsLink
public boolean contextIsLink()Gets whetherHitTestResultContext.LINK
flag is present inWebKitHitTestResult
:context.- Returns:
true
if there's a link element in the coordinates of the Hit Test, orfalse
otherwise
-
contextIsMedia
public boolean contextIsMedia()Gets whetherHitTestResultContext.MEDIA
flag is present inWebKitHitTestResult
:context.- Returns:
true
if there's a media element in the coordinates of the Hit Test, orfalse
otherwise
-
contextIsScrollbar
public boolean contextIsScrollbar()Gets whetherHitTestResultContext.SCROLLBAR
flag is present inWebKitHitTestResult
:context.- Returns:
true
if there's a scrollbar element at the coordinates of the this HitTestResult, orfalse
otherwise
-
contextIsSelection
public boolean contextIsSelection()Gets whetherHitTestResultContext.SELECTION
flag is present inWebKitHitTestResult
:context.- Returns:
true
if there's a selected element at the coordinates of the this HitTestResult, orfalse
otherwise
-
getContext
public int getContext()Gets the value of theWebKitHitTestResult
:context property.- Returns:
- a bitmask of
WebKitHitTestResultContext
flags
-
getImageUri
Gets the value of theWebKitHitTestResult
:image-uri property.- Returns:
- the URI of the image element in the coordinates of the Hit Test,
or
null
if there isn't an image element in this HitTestResult context
-
getLinkLabel
Gets the value of theWebKitHitTestResult
:link-label property.- Returns:
- the label of the link element in the coordinates of the Hit Test,
or
null
if there isn't a link element in this HitTestResult context or the link element doesn't have a label
-
getLinkTitle
Gets the value of theWebKitHitTestResult
:link-title property.- Returns:
- the title of the link element in the coordinates of the Hit Test,
or
null
if there isn't a link element in this HitTestResult context or the link element doesn't have a title
-
getLinkUri
Gets the value of theWebKitHitTestResult
:link-uri property.- Returns:
- the URI of the link element in the coordinates of the Hit Test,
or
null
if there isn't a link element in this HitTestResult context
-
getMediaUri
Gets the value of theWebKitHitTestResult
:media-uri property.- Returns:
- the URI of the media element in the coordinates of the Hit Test,
or
null
if there isn't a media element in this HitTestResult context
-
builder
AHitTestResult.Builder
object constructs aHitTestResult
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withHitTestResult.Builder.build()
.
-