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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKContentMode(pub NSInteger);
impl WKContentMode {
    #[doc(alias = "WKContentModeRecommended")]
    pub const Recommended: Self = Self(0);
    #[doc(alias = "WKContentModeMobile")]
    pub const Mobile: Self = Self(1);
    #[doc(alias = "WKContentModeDesktop")]
    pub const Desktop: Self = Self(2);
}

unsafe impl Encode for WKContentMode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for WKContentMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct WKWebpagePreferences;

    unsafe impl ClassType for WKWebpagePreferences {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for WKWebpagePreferences {}

extern_methods!(
    unsafe impl WKWebpagePreferences {
        #[method(preferredContentMode)]
        pub unsafe fn preferredContentMode(&self) -> WKContentMode;

        #[method(setPreferredContentMode:)]
        pub unsafe fn setPreferredContentMode(&self, preferred_content_mode: WKContentMode);

        #[method(allowsContentJavaScript)]
        pub unsafe fn allowsContentJavaScript(&self) -> bool;

        #[method(setAllowsContentJavaScript:)]
        pub unsafe fn setAllowsContentJavaScript(&self, allows_content_java_script: bool);

        #[method(isLockdownModeEnabled)]
        pub unsafe fn isLockdownModeEnabled(&self) -> bool;

        #[method(setLockdownModeEnabled:)]
        pub unsafe fn setLockdownModeEnabled(&self, lockdown_mode_enabled: bool);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl WKWebpagePreferences {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);