1/* 2 * Copyright (C) 2012 Igalia S.L. 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public License 15 * along with this library; see the file COPYING.LIB. If not, write to 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) 21#error "Only <webkit2/webkit2.h> can be included directly." 22#endif 23 24#ifndef WebKitHitTestResult_h 25#define WebKitHitTestResult_h 26 27#include <glib-object.h> 28#include <webkit2/WebKitDefines.h> 29 30G_BEGIN_DECLS 31 32#define WEBKIT_TYPE_HIT_TEST_RESULT (webkit_hit_test_result_get_type()) 33#define WEBKIT_HIT_TEST_RESULT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_HIT_TEST_RESULT, WebKitHitTestResult)) 34#define WEBKIT_IS_HIT_TEST_RESULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_HIT_TEST_RESULT)) 35#define WEBKIT_HIT_TEST_RESULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_HIT_TEST_RESULT, WebKitHitTestResultClass)) 36#define WEBKIT_IS_HIT_TEST_RESULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_HIT_TEST_RESULT)) 37#define WEBKIT_HIT_TEST_RESULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_HIT_TEST_RESULT, WebKitHitTestResultClass)) 38 39typedef struct _WebKitHitTestResult WebKitHitTestResult; 40typedef struct _WebKitHitTestResultClass WebKitHitTestResultClass; 41typedef struct _WebKitHitTestResultPrivate WebKitHitTestResultPrivate; 42 43/** 44 * WebKitHitTestResultContext: 45 * @WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT: anywhere in the document. 46 * @WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK: a hyperlink element. 47 * @WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE: an image element. 48 * @WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA: a video or audio element. 49 * @WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE: an editable element 50 * @WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR: a scrollbar element. 51 * 52 * Enum values with flags representing the context of a #WebKitHitTestResult. 53 */ 54typedef enum 55{ 56 WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT = 1 << 1, 57 WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK = 1 << 2, 58 WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE = 1 << 3, 59 WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA = 1 << 4, 60 WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE = 1 << 5, 61 WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR = 1 << 6 62} WebKitHitTestResultContext; 63 64struct _WebKitHitTestResult { 65 GObject parent; 66 67 WebKitHitTestResultPrivate *priv; 68}; 69 70struct _WebKitHitTestResultClass { 71 GObjectClass parent_class; 72 73 void (*_webkit_reserved0) (void); 74 void (*_webkit_reserved1) (void); 75 void (*_webkit_reserved2) (void); 76 void (*_webkit_reserved3) (void); 77}; 78 79WEBKIT_API GType 80webkit_hit_test_result_get_type (void); 81 82WEBKIT_API guint 83webkit_hit_test_result_get_context (WebKitHitTestResult *hit_test_result); 84 85WEBKIT_API gboolean 86webkit_hit_test_result_context_is_link (WebKitHitTestResult *hit_test_result); 87 88WEBKIT_API gboolean 89webkit_hit_test_result_context_is_image (WebKitHitTestResult *hit_test_result); 90 91WEBKIT_API gboolean 92webkit_hit_test_result_context_is_media (WebKitHitTestResult *hit_test_result); 93 94WEBKIT_API gboolean 95webkit_hit_test_result_context_is_editable (WebKitHitTestResult *hit_test_result); 96 97WEBKIT_API const gchar * 98webkit_hit_test_result_get_link_uri (WebKitHitTestResult *hit_test_result); 99 100WEBKIT_API const gchar * 101webkit_hit_test_result_get_link_title (WebKitHitTestResult *hit_test_result); 102 103WEBKIT_API const gchar * 104webkit_hit_test_result_get_link_label (WebKitHitTestResult *hit_test_result); 105 106WEBKIT_API const gchar * 107webkit_hit_test_result_get_image_uri (WebKitHitTestResult *hit_test_result); 108 109WEBKIT_API const gchar * 110webkit_hit_test_result_get_media_uri (WebKitHitTestResult *hit_test_result); 111 112WEBKIT_API gboolean 113webkit_hit_test_result_context_is_scrollbar (WebKitHitTestResult *hit_test_result); 114 115G_END_DECLS 116 117#endif 118