| WebKit2GTK+ Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | ||||
struct WebKitHitTestResult; enum WebKitHitTestResultContext; guint webkit_hit_test_result_get_context (WebKitHitTestResult *hit_test_result); gboolean webkit_hit_test_result_context_is_link (WebKitHitTestResult *hit_test_result); gboolean webkit_hit_test_result_context_is_image (WebKitHitTestResult *hit_test_result); gboolean webkit_hit_test_result_context_is_media (WebKitHitTestResult *hit_test_result); gboolean webkit_hit_test_result_context_is_editable (WebKitHitTestResult *hit_test_result); const gchar * webkit_hit_test_result_get_link_uri (WebKitHitTestResult *hit_test_result); const gchar * webkit_hit_test_result_get_link_title (WebKitHitTestResult *hit_test_result); const gchar * webkit_hit_test_result_get_link_label (WebKitHitTestResult *hit_test_result); const gchar * webkit_hit_test_result_get_image_uri (WebKitHitTestResult *hit_test_result); const gchar * webkit_hit_test_result_get_media_uri (WebKitHitTestResult *hit_test_result); gboolean webkit_hit_test_result_context_is_scrollbar (WebKitHitTestResult *hit_test_result);
"context" guint : Read / Write / Construct Only "image-uri" gchar* : Read / Write / Construct Only "link-label" gchar* : Read / Write / Construct Only "link-title" gchar* : Read / Write / Construct Only "link-uri" gchar* : Read / Write / Construct Only "media-uri" gchar* : Read / Write / Construct Only
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.
typedef enum {
    WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT  = 1 << 1,
    WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK      = 1 << 2,
    WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE     = 1 << 3,
    WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA     = 1 << 4,
    WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE  = 1 << 5,
    WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR = 1 << 6
} WebKitHitTestResultContext;
Enum values with flags representing the context of a WebKitHitTestResult.
| anywhere in the document. | |
| a hyperlink element. | |
| an image element. | |
| a video or audio element. | |
| an editable element | |
| a scrollbar element. | 
guint               webkit_hit_test_result_get_context  (WebKitHitTestResult *hit_test_result);
Gets the value of the "context" property.
  | 
a WebKitHitTestResult | 
Returns :  | 
a bitmask of WebKitHitTestResultContext flags | 
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".
  | 
a WebKitHitTestResult | 
Returns :  | 
TRUE if there's a link element in the coordinates of the Hit Test,
or FALSE otherwise | 
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".
  | 
a WebKitHitTestResult | 
Returns :  | 
TRUE if there's an image element in the coordinates of the Hit Test,
or FALSE otherwise | 
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".
  | 
a WebKitHitTestResult | 
Returns :  | 
TRUE if there's a media element in the coordinates of the Hit Test,
or FALSE otherwise | 
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".
  | 
a WebKitHitTestResult | 
Returns :  | 
TRUE if there's an editable element at the coordinates of the hit_test_result,
or FALSE otherwise | 
const gchar *       webkit_hit_test_result_get_link_uri (WebKitHitTestResult *hit_test_result);
Gets the value of the "link-uri" property.
  | 
a WebKitHitTestResult | 
Returns :  | 
the URI of the link element in the coordinates of the Hit Test,
or NULL if there ins'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.
  | 
a WebKitHitTestResult | 
Returns :  | 
the title of the link element in the coordinates of the Hit Test,
or NULL if there ins'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.
  | 
a WebKitHitTestResult | 
Returns :  | 
the label of the link element in the coordinates of the Hit Test,
or NULL if there ins'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.
  | 
a WebKitHitTestResult | 
Returns :  | 
the URI of the image element in the coordinates of the Hit Test,
or NULL if there ins'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.
  | 
a WebKitHitTestResult | 
Returns :  | 
the URI of the media element in the coordinates of the Hit Test,
or NULL if there ins't a media element in hit_test_result context | 
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".
  | 
a WebKitHitTestResult | 
Returns :  | 
TRUE if there's a scrollbar element at the coordinates of the hit_test_result,
or FALSE otherwise | 
"context" property"context" guint : Read / Write / Construct Only
Bitmask of WebKitHitTestResultContext flags representing the context of the WebKitHitTestResult.
Default value: 0
"image-uri" property"image-uri" gchar* : Read / Write / Construct Only
The URI of the image if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE
is present in "context"
Default value: NULL
"link-label" property"link-label" gchar* : Read / Write / Construct Only
The label of the link if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
is present in "context"
Default value: NULL
"link-title" property"link-title" gchar* : Read / Write / Construct Only
The title of the link if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
is present in "context"
Default value: NULL
"link-uri" property"link-uri" gchar* : Read / Write / Construct Only
The URI of the link if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
is present in "context"
Default value: NULL
"media-uri" property"media-uri" gchar* : Read / Write / Construct Only
The URI of the media if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA
is present in "context"
Default value: NULL