1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use webkit2_sys;
glib_wrapper! {
pub struct PolicyDecision(Object<webkit2_sys::WebKitPolicyDecision, webkit2_sys::WebKitPolicyDecisionClass, PolicyDecisionClass>);
match fn {
get_type => || webkit2_sys::webkit_policy_decision_get_type(),
}
}
pub const NONE_POLICY_DECISION: Option<&PolicyDecision> = None;
pub trait PolicyDecisionExt: 'static {
fn download(&self);
fn ignore(&self);
fn use_(&self);
}
impl<O: IsA<PolicyDecision>> PolicyDecisionExt for O {
fn download(&self) {
unsafe {
webkit2_sys::webkit_policy_decision_download(self.as_ref().to_glib_none().0);
}
}
fn ignore(&self) {
unsafe {
webkit2_sys::webkit_policy_decision_ignore(self.as_ref().to_glib_none().0);
}
}
fn use_(&self) {
unsafe {
webkit2_sys::webkit_policy_decision_use(self.as_ref().to_glib_none().0);
}
}
}
impl fmt::Display for PolicyDecision {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "PolicyDecision")
}
}