icrate/generated/WebKit/
WKPreferences.rs1use crate::common::*;
4use crate::AppKit::*;
5use crate::Foundation::*;
6use crate::WebKit::*;
7
8ns_enum!(
9 #[underlying(NSInteger)]
10 pub enum WKInactiveSchedulingPolicy {
11 WKInactiveSchedulingPolicySuspend = 0,
12 WKInactiveSchedulingPolicyThrottle = 1,
13 WKInactiveSchedulingPolicyNone = 2,
14 }
15);
16
17extern_class!(
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "WebKit_WKPreferences")]
20 pub struct WKPreferences;
21
22 #[cfg(feature = "WebKit_WKPreferences")]
23 unsafe impl ClassType for WKPreferences {
24 type Super = NSObject;
25 type Mutability = InteriorMutable;
26 }
27);
28
29#[cfg(feature = "WebKit_WKPreferences")]
30unsafe impl NSCoding for WKPreferences {}
31
32#[cfg(feature = "WebKit_WKPreferences")]
33unsafe impl NSObjectProtocol for WKPreferences {}
34
35#[cfg(feature = "WebKit_WKPreferences")]
36unsafe impl NSSecureCoding for WKPreferences {}
37
38extern_methods!(
39 #[cfg(feature = "WebKit_WKPreferences")]
40 unsafe impl WKPreferences {
41 #[method(minimumFontSize)]
42 pub unsafe fn minimumFontSize(&self) -> CGFloat;
43
44 #[method(setMinimumFontSize:)]
45 pub unsafe fn setMinimumFontSize(&self, minimum_font_size: CGFloat);
46
47 #[method(javaScriptCanOpenWindowsAutomatically)]
48 pub unsafe fn javaScriptCanOpenWindowsAutomatically(&self) -> bool;
49
50 #[method(setJavaScriptCanOpenWindowsAutomatically:)]
51 pub unsafe fn setJavaScriptCanOpenWindowsAutomatically(
52 &self,
53 java_script_can_open_windows_automatically: bool,
54 );
55
56 #[method(isFraudulentWebsiteWarningEnabled)]
57 pub unsafe fn isFraudulentWebsiteWarningEnabled(&self) -> bool;
58
59 #[method(setFraudulentWebsiteWarningEnabled:)]
60 pub unsafe fn setFraudulentWebsiteWarningEnabled(
61 &self,
62 fraudulent_website_warning_enabled: bool,
63 );
64
65 #[method(shouldPrintBackgrounds)]
66 pub unsafe fn shouldPrintBackgrounds(&self) -> bool;
67
68 #[method(setShouldPrintBackgrounds:)]
69 pub unsafe fn setShouldPrintBackgrounds(&self, should_print_backgrounds: bool);
70
71 #[method(tabFocusesLinks)]
72 pub unsafe fn tabFocusesLinks(&self) -> bool;
73
74 #[method(setTabFocusesLinks:)]
75 pub unsafe fn setTabFocusesLinks(&self, tab_focuses_links: bool);
76
77 #[method(isTextInteractionEnabled)]
78 pub unsafe fn isTextInteractionEnabled(&self) -> bool;
79
80 #[method(setTextInteractionEnabled:)]
81 pub unsafe fn setTextInteractionEnabled(&self, text_interaction_enabled: bool);
82
83 #[method(isSiteSpecificQuirksModeEnabled)]
84 pub unsafe fn isSiteSpecificQuirksModeEnabled(&self) -> bool;
85
86 #[method(setSiteSpecificQuirksModeEnabled:)]
87 pub unsafe fn setSiteSpecificQuirksModeEnabled(
88 &self,
89 site_specific_quirks_mode_enabled: bool,
90 );
91
92 #[method(isElementFullscreenEnabled)]
93 pub unsafe fn isElementFullscreenEnabled(&self) -> bool;
94
95 #[method(setElementFullscreenEnabled:)]
96 pub unsafe fn setElementFullscreenEnabled(&self, element_fullscreen_enabled: bool);
97
98 #[method(inactiveSchedulingPolicy)]
99 pub unsafe fn inactiveSchedulingPolicy(&self) -> WKInactiveSchedulingPolicy;
100
101 #[method(setInactiveSchedulingPolicy:)]
102 pub unsafe fn setInactiveSchedulingPolicy(
103 &self,
104 inactive_scheduling_policy: WKInactiveSchedulingPolicy,
105 );
106 }
107);
108
109extern_methods!(
110 #[cfg(feature = "WebKit_WKPreferences")]
112 unsafe impl WKPreferences {
113 #[method_id(@__retain_semantics Init init)]
114 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
115
116 #[method_id(@__retain_semantics New new)]
117 pub unsafe fn new() -> Id<Self>;
118 }
119);
120
121extern_methods!(
122 #[cfg(feature = "WebKit_WKPreferences")]
124 unsafe impl WKPreferences {
125 #[deprecated = "Java is no longer supported"]
126 #[method(javaEnabled)]
127 pub unsafe fn javaEnabled(&self) -> bool;
128
129 #[deprecated = "Java is no longer supported"]
130 #[method(setJavaEnabled:)]
131 pub unsafe fn setJavaEnabled(&self, java_enabled: bool);
132
133 #[deprecated = "Plug-ins are no longer supported"]
134 #[method(plugInsEnabled)]
135 pub unsafe fn plugInsEnabled(&self) -> bool;
136
137 #[deprecated = "Plug-ins are no longer supported"]
138 #[method(setPlugInsEnabled:)]
139 pub unsafe fn setPlugInsEnabled(&self, plug_ins_enabled: bool);
140
141 #[deprecated = "Use WKWebpagePreferences.allowsContentJavaScript to disable content JavaScript on a per-navigation basis"]
142 #[method(javaScriptEnabled)]
143 pub unsafe fn javaScriptEnabled(&self) -> bool;
144
145 #[deprecated = "Use WKWebpagePreferences.allowsContentJavaScript to disable content JavaScript on a per-navigation basis"]
146 #[method(setJavaScriptEnabled:)]
147 pub unsafe fn setJavaScriptEnabled(&self, java_script_enabled: bool);
148 }
149);