Top |
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 “mouse-target-changed” signal is emitted with a WebKitHitTestResult.
guint
webkit_hit_test_result_get_context (WebKitHitTestResult *hit_test_result
);
Gets the value of the “context” property.
gboolean
webkit_hit_test_result_context_is_link
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
flag is present in
“context”.
gboolean
webkit_hit_test_result_context_is_image
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE
flag is present in
“context”.
gboolean
webkit_hit_test_result_context_is_media
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA
flag is present in
“context”.
gboolean
webkit_hit_test_result_context_is_editable
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE
flag is present in
“context”.
gboolean
webkit_hit_test_result_context_is_selection
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION
flag is present in
“context”.
TRUE
if there's a selected element at the coordinates of the hit_test_result
,
or FALSE
otherwise
Since: 2.8
gboolean
webkit_hit_test_result_context_is_scrollbar
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR
flag is present in
“context”.
const gchar *
webkit_hit_test_result_get_link_uri (WebKitHitTestResult *hit_test_result
);
Gets the value of the “link-uri” property.
the URI of the link element in the coordinates of the Hit Test,
or NULL
if there isn't a link element in hit_test_result
context
const gchar *
webkit_hit_test_result_get_link_title (WebKitHitTestResult *hit_test_result
);
Gets the value of the “link-title” property.
the title of the link element in the coordinates of the Hit Test,
or NULL
if there isn't a link element in hit_test_result
context or the
link element doesn't have a title
const gchar *
webkit_hit_test_result_get_link_label (WebKitHitTestResult *hit_test_result
);
Gets the value of the “link-label” property.
the label of the link element in the coordinates of the Hit Test,
or NULL
if there isn't a link element in hit_test_result
context or the
link element doesn't have a label
const gchar *
webkit_hit_test_result_get_image_uri (WebKitHitTestResult *hit_test_result
);
Gets the value of the “image-uri” property.
the URI of the image element in the coordinates of the Hit Test,
or NULL
if there isn't an image element in hit_test_result
context
const gchar *
webkit_hit_test_result_get_media_uri (WebKitHitTestResult *hit_test_result
);
Gets the value of the “media-uri” property.
the URI of the media element in the coordinates of the Hit Test,
or NULL
if there isn't a media element in hit_test_result
context
Enum values with flags representing the context of a WebKitHitTestResult.
“context”
property“context” guint
Bitmask of WebKitHitTestResultContext flags representing the context of the WebKitHitTestResult.
Flags: Read / Write / Construct Only
Default value: 0
“image-uri”
property“image-uri” gchar *
The URI of the image if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE
is present in “context”
Flags: Read / Write / Construct Only
Default value: NULL
“link-label”
property“link-label” gchar *
The label of the link if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
is present in “context”
Flags: Read / Write / Construct Only
Default value: NULL
“link-title”
property“link-title” gchar *
The title of the link if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
is present in “context”
Flags: Read / Write / Construct Only
Default value: NULL
“link-uri”
property“link-uri” gchar *
The URI of the link if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
is present in “context”
Flags: Read / Write / Construct Only
Default value: NULL
“media-uri”
property“media-uri” gchar *
The URI of the media if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA
is present in “context”
Flags: Read / Write / Construct Only
Default value: NULL