24b7c966e7ea1eb65579d1127f70cab47ba47de5
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_hit_test.h
1 // Copyright 2013 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ewk_hit_test_h
6 #define ewk_hit_test_h
7
8 #include <Eina.h>
9 #include <tizen.h>
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 /**
16  * Ewk_Hit_Test_Mode:
17  * @EWK_HIT_TEST_MODE_DEFAULT: link data.
18  * @EWK_HIT_TEST_MODE_NODE_DATA: extra node data(tag name, node value, attribute infomation, etc).
19  * @EWK_HIT_TEST_MODE_IMAGE_DATA: extra image data(image data, image data length, image file name exteionsion, etc).
20  * @EWK_HIT_TEST_MODE_ALL: all data.
21  *
22  * Enum values with flags representing the hit test mode.
23  */
24
25 typedef enum {
26     EWK_HIT_TEST_MODE_DEFAULT = 1 << 1,
27     EWK_HIT_TEST_MODE_NODE_DATA = 1 << 2,
28     EWK_HIT_TEST_MODE_IMAGE_DATA = 1 << 3,
29     EWK_HIT_TEST_MODE_ALL = EWK_HIT_TEST_MODE_DEFAULT | EWK_HIT_TEST_MODE_NODE_DATA | EWK_HIT_TEST_MODE_IMAGE_DATA
30 } Ewk_Hit_Test_Mode;
31
32 /**
33  * Ewk_Hit_Test_Result_Context:
34  * @EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT: anywhere in the document.
35  * @EWK_HIT_TEST_RESULT_CONTEXT_LINK: a hyperlink element.
36  * @EWK_HIT_TEST_RESULT_CONTEXT_IMAGE: an image element.
37  * @EWK_HIT_TEST_RESULT_CONTEXT_MEDIA: a video or audio element.
38  * @EWK_HIT_TEST_RESULT_CONTEXT_SELECTION: the area is selected by the user.
39  * @EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE: the area is editable by the user.
40  * @EWK_HIT_TEST_RESULT_CONTEXT_TEXT: the area is text.
41  *
42  * Enum values with flags representing the context of a #Ewk_Hit_Test.
43  */
44 typedef enum {
45     EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT = 1 << 1,
46     EWK_HIT_TEST_RESULT_CONTEXT_LINK = 1 << 2,
47     EWK_HIT_TEST_RESULT_CONTEXT_IMAGE = 1 << 3,
48     EWK_HIT_TEST_RESULT_CONTEXT_MEDIA = 1 << 4,
49     EWK_HIT_TEST_RESULT_CONTEXT_SELECTION = 1 << 5,
50     EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE = 1 << 6,
51     EWK_HIT_TEST_RESULT_CONTEXT_TEXT = 1 << 7
52 } Ewk_Hit_Test_Result_Context;
53
54 /** Creates a type name for _Ewk_Hit_Test */
55 typedef struct _Ewk_Hit_Test Ewk_Hit_Test;
56
57 /**
58  * Frees hit test instance created by ewk_view_hit_test_new().
59  *
60  * @param hit_test instance
61  */
62 EXPORT_API void ewk_hit_test_free(Ewk_Hit_Test* hit_test);
63
64 /**
65  * Gets the context of  the hit test
66  *
67  * @param hit_test instance
68  * @return a bitmask of the hit test context on success, @c EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT otherwise.
69  */
70 EXPORT_API Ewk_Hit_Test_Result_Context ewk_hit_test_result_context_get(Ewk_Hit_Test* hit_test);
71
72 /**
73  * Gets the link uri string of the hit test
74  *
75  * @param hit_test instance
76  * @return the URI of the link element in the coordinates of the hit test on success, @c 0 otherwise.
77  */
78 EXPORT_API const char* ewk_hit_test_link_uri_get(Ewk_Hit_Test* hit_test);
79
80 /**
81  * Gets the link title string of the hit test
82  *
83  * @param hit_test instance
84  * @return the title of the link element in the coordinates of the hit test on success, @c 0 otherwise.
85  */
86 EXPORT_API const char* ewk_hit_test_link_title_get(Ewk_Hit_Test* hit_test);
87
88 /**
89  * Gets the link label string of the hit test
90  *
91  * @param hit_test instance
92  * @return the label of the link element in the coordinates of the hit test on success, @c 0 otherwise.
93  */
94 EXPORT_API const char* ewk_hit_test_link_label_get(Ewk_Hit_Test* hit_test);
95
96 /**
97  * Gets the image uri string of the hit test
98  *
99  * @param hit_test instance
100  * @return the URI of the image element in the coordinates of the hit test on success, @c 0 otherwise.
101  */
102 EXPORT_API const char* ewk_hit_test_image_uri_get(Ewk_Hit_Test* hit_test);
103
104 /**
105  * Gets the media uri string of the hit test
106  *
107  * @param hit_test instance
108  * @return the URI of the media element in the coordinates of the hit test on success, @c 0 otherwise.
109  */
110 EXPORT_API const char* ewk_hit_test_media_uri_get(Ewk_Hit_Test* hit_test);
111
112 /**
113  * Gets the tag name string of hit element of the hit test
114  *
115  * @param hit_test instance
116  * @return the tag name of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
117  */
118 EXPORT_API const char* ewk_hit_test_tag_name_get(Ewk_Hit_Test* hit_test);
119
120 /**
121  * Gets the node value string of hit element of the hit test
122  *
123  * @param hit_test instance
124  * @return the node value of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
125  */
126 EXPORT_API const char* ewk_hit_test_node_value_get(Ewk_Hit_Test* hit_test);
127
128 /**
129  * Gets the attribute data of hit element of the hit test
130  *
131  * @param hit_test instance
132  * @return the attribute data of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
133  */
134 EXPORT_API Eina_Hash* ewk_hit_test_attribute_hash_get(Ewk_Hit_Test* hit_test);
135
136 /**
137  * Gets the image buffer of hit element of the hit test
138  *
139  * @param hit_test instance
140  * @return the image buffer of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
141  */
142 EXPORT_API void* ewk_hit_test_image_buffer_get(Ewk_Hit_Test* hit_test);
143
144 /**
145  * Gets the image buffer length of hit element of the hit test
146  *
147  * @param hit_test instance
148  * @return the image buffer length of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
149  * Buffer length is truncated to 32 bit.
150  */
151 EXPORT_API unsigned int ewk_hit_test_image_buffer_length_get(Ewk_Hit_Test* hit_test);
152
153 /**
154  * Gets the image fiile name extension string of hit element of the hit test
155  *
156  * @param hit_test instance
157  * @return the image fiile name extension of the hit element in the coordinates of the hit test on success, @c 0 otherwise.
158  */
159 EXPORT_API const char* ewk_hit_test_image_file_name_extension_get(Ewk_Hit_Test* hit_test);
160
161 #ifdef __cplusplus
162 }
163 #endif
164
165 #endif // ewk_hit_test_h