webkit_web_process_extension6/auto/
web_hit_test_result.rs1use crate::{ScriptWorld, ffi};
7use glib::translate::*;
8
9glib::wrapper! {
10 #[doc(alias = "WebKitWebHitTestResult")]
11 pub struct WebHitTestResult(Object<ffi::WebKitWebHitTestResult, ffi::WebKitWebHitTestResultClass>);
12
13 match fn {
14 type_ => || ffi::webkit_web_hit_test_result_get_type(),
15 }
16}
17
18impl WebHitTestResult {
19 #[doc(alias = "webkit_web_hit_test_result_context_is_editable")]
20 pub fn context_is_editable(&self) -> bool {
21 unsafe {
22 from_glib(ffi::webkit_web_hit_test_result_context_is_editable(
23 self.to_glib_none().0,
24 ))
25 }
26 }
27
28 #[doc(alias = "webkit_web_hit_test_result_context_is_image")]
29 pub fn context_is_image(&self) -> bool {
30 unsafe {
31 from_glib(ffi::webkit_web_hit_test_result_context_is_image(
32 self.to_glib_none().0,
33 ))
34 }
35 }
36
37 #[doc(alias = "webkit_web_hit_test_result_context_is_link")]
38 pub fn context_is_link(&self) -> bool {
39 unsafe {
40 from_glib(ffi::webkit_web_hit_test_result_context_is_link(
41 self.to_glib_none().0,
42 ))
43 }
44 }
45
46 #[doc(alias = "webkit_web_hit_test_result_context_is_media")]
47 pub fn context_is_media(&self) -> bool {
48 unsafe {
49 from_glib(ffi::webkit_web_hit_test_result_context_is_media(
50 self.to_glib_none().0,
51 ))
52 }
53 }
54
55 #[doc(alias = "webkit_web_hit_test_result_context_is_scrollbar")]
56 pub fn context_is_scrollbar(&self) -> bool {
57 unsafe {
58 from_glib(ffi::webkit_web_hit_test_result_context_is_scrollbar(
59 self.to_glib_none().0,
60 ))
61 }
62 }
63
64 #[doc(alias = "webkit_web_hit_test_result_context_is_selection")]
65 pub fn context_is_selection(&self) -> bool {
66 unsafe {
67 from_glib(ffi::webkit_web_hit_test_result_context_is_selection(
68 self.to_glib_none().0,
69 ))
70 }
71 }
72
73 #[doc(alias = "webkit_web_hit_test_result_get_context")]
74 #[doc(alias = "get_context")]
75 pub fn context(&self) -> u32 {
76 unsafe { ffi::webkit_web_hit_test_result_get_context(self.to_glib_none().0) }
77 }
78
79 #[doc(alias = "webkit_web_hit_test_result_get_image_uri")]
80 #[doc(alias = "get_image_uri")]
81 pub fn image_uri(&self) -> Option<glib::GString> {
82 unsafe {
83 from_glib_none(ffi::webkit_web_hit_test_result_get_image_uri(
84 self.to_glib_none().0,
85 ))
86 }
87 }
88
89 #[doc(alias = "webkit_web_hit_test_result_get_js_node")]
90 #[doc(alias = "get_js_node")]
91 pub fn js_node(&self, world: Option<&ScriptWorld>) -> Option<javascriptcore::Value> {
92 unsafe {
93 from_glib_full(ffi::webkit_web_hit_test_result_get_js_node(
94 self.to_glib_none().0,
95 world.to_glib_none().0,
96 ))
97 }
98 }
99
100 #[doc(alias = "webkit_web_hit_test_result_get_link_label")]
101 #[doc(alias = "get_link_label")]
102 pub fn link_label(&self) -> Option<glib::GString> {
103 unsafe {
104 from_glib_none(ffi::webkit_web_hit_test_result_get_link_label(
105 self.to_glib_none().0,
106 ))
107 }
108 }
109
110 #[doc(alias = "webkit_web_hit_test_result_get_link_title")]
111 #[doc(alias = "get_link_title")]
112 pub fn link_title(&self) -> Option<glib::GString> {
113 unsafe {
114 from_glib_none(ffi::webkit_web_hit_test_result_get_link_title(
115 self.to_glib_none().0,
116 ))
117 }
118 }
119
120 #[doc(alias = "webkit_web_hit_test_result_get_link_uri")]
121 #[doc(alias = "get_link_uri")]
122 pub fn link_uri(&self) -> Option<glib::GString> {
123 unsafe {
124 from_glib_none(ffi::webkit_web_hit_test_result_get_link_uri(
125 self.to_glib_none().0,
126 ))
127 }
128 }
129
130 #[doc(alias = "webkit_web_hit_test_result_get_media_uri")]
131 #[doc(alias = "get_media_uri")]
132 pub fn media_uri(&self) -> Option<glib::GString> {
133 unsafe {
134 from_glib_none(ffi::webkit_web_hit_test_result_get_media_uri(
135 self.to_glib_none().0,
136 ))
137 }
138 }
139}