2 Copyright (C) 2011 Samsung Electronics
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.
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.
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.
20 #ifndef ewk_hit_test_h
21 #define ewk_hit_test_h
31 * @EWK_HIT_TEST_MODE_DEFAULT: link data.
32 * @EWK_HIT_TEST_MODE_NODE_DATA: extra node data(tag name, node value, attribute infomation, etc).
33 * @EWK_HIT_TEST_MODE_IMAGE_DATA: extra image data(image data, image data length, image file name exteionsion, etc).
34 * @EWK_HIT_TEST_MODE_ALL: all data.
36 * Enum values with flags representing the hit test mode.
40 EWK_HIT_TEST_MODE_DEFAULT = 1 << 1,
41 EWK_HIT_TEST_MODE_NODE_DATA = 1 << 2,
42 EWK_HIT_TEST_MODE_IMAGE_DATA = 1 << 3,
43 EWK_HIT_TEST_MODE_ALL = EWK_HIT_TEST_MODE_DEFAULT | EWK_HIT_TEST_MODE_NODE_DATA | EWK_HIT_TEST_MODE_IMAGE_DATA
47 * Ewk_Hit_Test_Result_Context:
48 * @EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT: anywhere in the document.
49 * @EWK_HIT_TEST_RESULT_CONTEXT_LINK: a hyperlink element.
50 * @EWK_HIT_TEST_RESULT_CONTEXT_IMAGE: an image element.
51 * @EWK_HIT_TEST_RESULT_CONTEXT_MEDIA: a video or audio element.
52 * @EWK_HIT_TEST_RESULT_CONTEXT_SELECTION: the area is selected by the user.
53 * @EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE: the area is editable by the user.
54 * @EWK_HIT_TEST_RESULT_CONTEXT_TEXT: the area is text.
56 * Enum values with flags representing the context of a #Ewk_Hit_Test.
59 EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT = 1 << 1,
60 EWK_HIT_TEST_RESULT_CONTEXT_LINK = 1 << 2,
61 EWK_HIT_TEST_RESULT_CONTEXT_IMAGE = 1 << 3,
62 EWK_HIT_TEST_RESULT_CONTEXT_MEDIA = 1 << 4,
63 EWK_HIT_TEST_RESULT_CONTEXT_SELECTION = 1 << 5,
64 EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE = 1 << 6,
65 EWK_HIT_TEST_RESULT_CONTEXT_TEXT = 1 << 7
66 } Ewk_Hit_Test_Result_Context;
68 /** Creates a type name for _Ewk_Hit_Test */
69 typedef struct _Ewk_Hit_Test Ewk_Hit_Test;
72 * Frees hit test instance created by ewk_view_hit_test_new().
74 * @param hit_test instance
76 EAPI void ewk_hit_test_free(Ewk_Hit_Test* hit_test);
79 * Gets the context of the hit test
81 * @param hit_test instance
82 * @return a bitmask of the hit test context on success, @c EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT otherwise.
84 EAPI Ewk_Hit_Test_Result_Context ewk_hit_test_result_context_get(Ewk_Hit_Test* hit_test);
87 * Gets the link uri string of the hit test
89 * @param hit_test instance
90 * @return the URI of the link element in the coordinates of the hit test on success, @c 0 otherwise.
92 EAPI const char* ewk_hit_test_link_uri_get(Ewk_Hit_Test* hit_test);
95 * Gets the link title string of the hit test
97 * @param hit_test instance
98 * @return the title of the link element in the coordinates of the hit test on success, @c 0 otherwise.
100 EAPI const char* ewk_hit_test_link_title_get(Ewk_Hit_Test* hit_test);
103 * Gets the link label string of the hit test
105 * @param hit_test instance
106 * @return the label of the link element in the coordinates of the hit test on success, @c 0 otherwise.
108 EAPI const char* ewk_hit_test_link_label_get(Ewk_Hit_Test* hit_test);
111 * Gets the image uri string of the hit test
113 * @param hit_test instance
114 * @return the URI of the image element in the coordinates of the hit test on success, @c 0 otherwise.
116 EAPI const char* ewk_hit_test_image_uri_get(Ewk_Hit_Test* hit_test);
119 * Gets the media uri string of the hit test
121 * @param hit_test instance
122 * @return the URI of the media element in the coordinates of the hit test on success, @c 0 otherwise.
124 EAPI const char* ewk_hit_test_media_uri_get(Ewk_Hit_Test* hit_test);
127 * Gets the tag name string of hit element of the hit test
129 * @param hit_test instance
130 * @return the tag name of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
132 EAPI const char* ewk_hit_test_tag_name_get(Ewk_Hit_Test* hit_test);
135 * Gets the node value string of hit element of the hit test
137 * @param hit_test instance
138 * @return the node value of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
140 EAPI const char* ewk_hit_test_node_value_get(Ewk_Hit_Test* hit_test);
143 * Gets the attribute data of hit element of the hit test
145 * @param hit_test instance
146 * @return the attribute data of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
148 EAPI Eina_Hash* ewk_hit_test_attribute_hash_get(Ewk_Hit_Test* hit_test);
151 * Gets the image buffer of hit element of the hit test
153 * @param hit_test instance
154 * @return the image buffer of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
156 EAPI void* ewk_hit_test_image_buffer_get(Ewk_Hit_Test* hit_test);
159 * Gets the image buffer length of hit element of the hit test
161 * @param hit_test instance
162 * @return the image buffer length of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
164 EAPI unsigned int ewk_hit_test_image_buffer_length_get(Ewk_Hit_Test* hit_test);
167 * Gets the image fiile name extension string of hit element of the hit test
169 * @param hit_test instance
170 * @return the image fiile name extension of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
172 EAPI const char* ewk_hit_test_image_file_name_extension_get(Ewk_Hit_Test* hit_test);
178 #endif // ewk_hit_test_h