objc2_preference_panes/generated/
NSPreferencePane.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7use objc2_app_kit::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSPreferencePaneUnselectReply(pub NSUInteger);
17impl NSPreferencePaneUnselectReply {
18 #[doc(alias = "NSUnselectCancel")]
19 pub const UnselectCancel: Self = Self(0);
20 #[doc(alias = "NSUnselectNow")]
21 pub const UnselectNow: Self = Self(1);
22 #[doc(alias = "NSUnselectLater")]
23 pub const UnselectLater: Self = Self(2);
24}
25
26unsafe impl Encode for NSPreferencePaneUnselectReply {
27 const ENCODING: Encoding = NSUInteger::ENCODING;
28}
29
30unsafe impl RefEncode for NSPreferencePaneUnselectReply {
31 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern "C" {
35 pub static NSPreferencePaneDoUnselectNotification: &'static NSString;
37}
38
39extern "C" {
40 pub static NSPreferencePaneCancelUnselectNotification: &'static NSString;
42}
43
44extern "C" {
45 pub static NSPreferencePaneSwitchToPaneNotification: &'static NSString;
47}
48
49extern "C" {
50 pub static NSPreferencePrefPaneIsAvailableNotification: &'static NSString;
52}
53
54extern "C" {
55 pub static NSPreferencePaneUpdateHelpMenuNotification: &'static NSString;
57}
58
59extern "C" {
60 pub static NSPrefPaneHelpMenuInfoPListKey: &'static NSString;
62}
63
64extern "C" {
65 pub static NSPrefPaneHelpMenuTitleKey: &'static NSString;
67}
68
69extern "C" {
70 pub static NSPrefPaneHelpMenuAnchorKey: &'static NSString;
72}
73
74extern_class!(
75 #[unsafe(super(NSObject))]
77 #[derive(Debug, PartialEq, Eq, Hash)]
78 pub struct NSPreferencePane;
79);
80
81extern_conformance!(
82 unsafe impl NSObjectProtocol for NSPreferencePane {}
83);
84
85impl NSPreferencePane {
86 extern_methods!(
87 #[unsafe(method(initWithBundle:))]
88 #[unsafe(method_family = init)]
89 pub unsafe fn initWithBundle(this: Allocated<Self>, bundle: &NSBundle) -> Retained<Self>;
90
91 #[unsafe(method(bundle))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn bundle(&self) -> Retained<NSBundle>;
94
95 #[cfg(feature = "objc2-app-kit")]
96 #[unsafe(method(loadMainView))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn loadMainView(&self, mtm: MainThreadMarker) -> Retained<NSView>;
99
100 #[unsafe(method(mainViewDidLoad))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn mainViewDidLoad(&self);
103
104 #[unsafe(method(mainNibName))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn mainNibName(&self) -> Retained<NSString>;
107
108 #[unsafe(method(assignMainView))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn assignMainView(&self);
111
112 #[unsafe(method(willSelect))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn willSelect(&self);
115
116 #[unsafe(method(didSelect))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn didSelect(&self);
119
120 #[unsafe(method(shouldUnselect))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn shouldUnselect(&self) -> NSPreferencePaneUnselectReply;
123
124 #[unsafe(method(replyToShouldUnselect:))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn replyToShouldUnselect(&self, should_unselect: bool);
127
128 #[unsafe(method(willUnselect))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn willUnselect(&self);
131
132 #[unsafe(method(didUnselect))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn didUnselect(&self);
135
136 #[cfg(feature = "objc2-app-kit")]
137 #[unsafe(method(mainView))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn mainView(&self, mtm: MainThreadMarker) -> Retained<NSView>;
140
141 #[cfg(feature = "objc2-app-kit")]
142 #[unsafe(method(setMainView:))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn setMainView(&self, main_view: &NSView);
146
147 #[cfg(feature = "objc2-app-kit")]
148 #[unsafe(method(initialKeyView))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn initialKeyView(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
151
152 #[cfg(feature = "objc2-app-kit")]
153 #[unsafe(method(setInitialKeyView:))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn setInitialKeyView(&self, initial_key_view: Option<&NSView>);
157
158 #[cfg(feature = "objc2-app-kit")]
159 #[unsafe(method(firstKeyView))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn firstKeyView(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
162
163 #[cfg(feature = "objc2-app-kit")]
164 #[unsafe(method(setFirstKeyView:))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn setFirstKeyView(&self, first_key_view: Option<&NSView>);
168
169 #[cfg(feature = "objc2-app-kit")]
170 #[unsafe(method(lastKeyView))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn lastKeyView(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
173
174 #[cfg(feature = "objc2-app-kit")]
175 #[unsafe(method(setLastKeyView:))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn setLastKeyView(&self, last_key_view: Option<&NSView>);
179
180 #[unsafe(method(autoSaveTextFields))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn autoSaveTextFields(&self) -> bool;
183
184 #[unsafe(method(isSelected))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn isSelected(&self) -> bool;
187
188 #[unsafe(method(updateHelpMenuWithArray:))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn updateHelpMenuWithArray(
191 &self,
192 in_array_of_menu_items: Option<&NSArray<NSDictionary<NSString, NSString>>>,
193 );
194 );
195}
196
197impl NSPreferencePane {
199 extern_methods!(
200 #[unsafe(method(init))]
201 #[unsafe(method_family = init)]
202 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
203
204 #[unsafe(method(new))]
205 #[unsafe(method_family = new)]
206 pub unsafe fn new() -> Retained<Self>;
207 );
208}