Don't draw contents to evas image when being background.
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_hit_test.h
1 /*
2    Copyright (C) 2011 Samsung Electronics
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 #ifndef ewk_hit_test_h
21 #define ewk_hit_test_h
22
23 #include <Eina.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /**
30  * Ewk_Hit_Test_Mode:
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.
35  *
36  * Enum values with flags representing the hit test mode.
37  */
38
39 typedef enum {
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
44 } Ewk_Hit_Test_Mode;
45
46 /**
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.
55  *
56  * Enum values with flags representing the context of a #Ewk_Hit_Test.
57  */
58 typedef enum {
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;
67
68 /** Creates a type name for _Ewk_Hit_Test */
69 typedef struct _Ewk_Hit_Test Ewk_Hit_Test;
70
71 /**
72  * Frees hit test instance created by ewk_view_hit_test_new().
73  *
74  * @param hit_test instance
75  */
76 EAPI void ewk_hit_test_free(Ewk_Hit_Test* hit_test);
77
78 /**
79  * Gets the context of  the hit test
80  *
81  * @param hit_test instance
82  * @return a bitmask of the hit test context on success, @c EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT otherwise.
83  */
84 EAPI Ewk_Hit_Test_Result_Context ewk_hit_test_result_context_get(Ewk_Hit_Test* hit_test);
85
86 /**
87  * Gets the link uri string of the hit test
88  *
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.
91  */
92 EAPI const char* ewk_hit_test_link_uri_get(Ewk_Hit_Test* hit_test);
93
94 /**
95  * Gets the link title string of the hit test
96  *
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.
99  */
100 EAPI const char* ewk_hit_test_link_title_get(Ewk_Hit_Test* hit_test);
101
102 /**
103  * Gets the link label string of the hit test
104  *
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.
107  */
108 EAPI const char* ewk_hit_test_link_label_get(Ewk_Hit_Test* hit_test);
109
110 /**
111  * Gets the image uri string of the hit test
112  *
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.
115  */
116 EAPI const char* ewk_hit_test_image_uri_get(Ewk_Hit_Test* hit_test);
117
118 /**
119  * Gets the media uri string of the hit test
120  *
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.
123  */
124 EAPI const char* ewk_hit_test_media_uri_get(Ewk_Hit_Test* hit_test);
125
126 /**
127  * Gets the tag name string of hit element of the hit test
128  *
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.
131  */
132 EAPI const char* ewk_hit_test_tag_name_get(Ewk_Hit_Test* hit_test);
133
134 /**
135  * Gets the node value string of hit element of the hit test
136  *
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.
139  */
140 EAPI const char* ewk_hit_test_node_value_get(Ewk_Hit_Test* hit_test);
141
142 /**
143  * Gets the attribute data of hit element of the hit test
144  *
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.
147  */
148 EAPI Eina_Hash* ewk_hit_test_attribute_hash_get(Ewk_Hit_Test* hit_test);
149
150 /**
151  * Gets the image buffer of hit element of the hit test
152  *
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.
155  */
156 EAPI void* ewk_hit_test_image_buffer_get(Ewk_Hit_Test* hit_test);
157
158 /**
159  * Gets the image buffer length of hit element of the hit test
160  *
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.
163  */
164 EAPI unsigned int ewk_hit_test_image_buffer_length_get(Ewk_Hit_Test* hit_test);
165
166 /**
167  * Gets the image fiile name extension string of hit element of the hit test
168  *
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.
171  */
172 EAPI const char* ewk_hit_test_image_file_name_extension_get(Ewk_Hit_Test* hit_test);
173
174 #ifdef __cplusplus
175 }
176 #endif
177
178 #endif // ewk_hit_test_h