1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSButton, NSControl, NSView, NSResponder, NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 #[cfg(all(
18 feature = "NSButton",
19 feature = "NSControl",
20 feature = "NSResponder",
21 feature = "NSView"
22 ))]
23 pub struct NSStatusBarButton;
24);
25
26#[cfg(all(
27 feature = "NSAccessibilityProtocols",
28 feature = "NSButton",
29 feature = "NSControl",
30 feature = "NSResponder",
31 feature = "NSView"
32))]
33extern_conformance!(
34 unsafe impl NSAccessibility for NSStatusBarButton {}
35);
36
37#[cfg(all(
38 feature = "NSAccessibilityProtocols",
39 feature = "NSButton",
40 feature = "NSControl",
41 feature = "NSResponder",
42 feature = "NSView"
43))]
44extern_conformance!(
45 unsafe impl NSAccessibilityButton for NSStatusBarButton {}
46);
47
48#[cfg(all(
49 feature = "NSAccessibilityProtocols",
50 feature = "NSButton",
51 feature = "NSControl",
52 feature = "NSResponder",
53 feature = "NSView"
54))]
55extern_conformance!(
56 unsafe impl NSAccessibilityElementProtocol for NSStatusBarButton {}
57);
58
59#[cfg(all(
60 feature = "NSAnimation",
61 feature = "NSButton",
62 feature = "NSControl",
63 feature = "NSResponder",
64 feature = "NSView"
65))]
66extern_conformance!(
67 unsafe impl NSAnimatablePropertyContainer for NSStatusBarButton {}
68);
69
70#[cfg(all(
71 feature = "NSAppearance",
72 feature = "NSButton",
73 feature = "NSControl",
74 feature = "NSResponder",
75 feature = "NSView"
76))]
77extern_conformance!(
78 unsafe impl NSAppearanceCustomization for NSStatusBarButton {}
79);
80
81#[cfg(all(
82 feature = "NSButton",
83 feature = "NSControl",
84 feature = "NSResponder",
85 feature = "NSView"
86))]
87extern_conformance!(
88 unsafe impl NSCoding for NSStatusBarButton {}
89);
90
91#[cfg(all(
92 feature = "NSButton",
93 feature = "NSControl",
94 feature = "NSDragging",
95 feature = "NSResponder",
96 feature = "NSView"
97))]
98extern_conformance!(
99 unsafe impl NSDraggingDestination for NSStatusBarButton {}
100);
101
102#[cfg(all(
103 feature = "NSButton",
104 feature = "NSControl",
105 feature = "NSResponder",
106 feature = "NSView"
107))]
108extern_conformance!(
109 unsafe impl NSObjectProtocol for NSStatusBarButton {}
110);
111
112#[cfg(all(
113 feature = "NSButton",
114 feature = "NSControl",
115 feature = "NSResponder",
116 feature = "NSUserInterfaceCompression",
117 feature = "NSView"
118))]
119extern_conformance!(
120 unsafe impl NSUserInterfaceCompression for NSStatusBarButton {}
121);
122
123#[cfg(all(
124 feature = "NSButton",
125 feature = "NSControl",
126 feature = "NSResponder",
127 feature = "NSUserInterfaceItemIdentification",
128 feature = "NSView"
129))]
130extern_conformance!(
131 unsafe impl NSUserInterfaceItemIdentification for NSStatusBarButton {}
132);
133
134#[cfg(all(
135 feature = "NSButton",
136 feature = "NSControl",
137 feature = "NSResponder",
138 feature = "NSUserInterfaceValidation",
139 feature = "NSView"
140))]
141extern_conformance!(
142 unsafe impl NSUserInterfaceValidations for NSStatusBarButton {}
143);
144
145#[cfg(all(
146 feature = "NSButton",
147 feature = "NSControl",
148 feature = "NSResponder",
149 feature = "NSView"
150))]
151impl NSStatusBarButton {
152 extern_methods!(
153 #[unsafe(method(appearsDisabled))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn appearsDisabled(&self) -> bool;
157
158 #[unsafe(method(setAppearsDisabled:))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn setAppearsDisabled(&self, appears_disabled: bool);
162 );
163}
164
165#[cfg(all(
167 feature = "NSButton",
168 feature = "NSControl",
169 feature = "NSResponder",
170 feature = "NSView"
171))]
172impl NSStatusBarButton {
173 extern_methods!(
174 #[cfg(feature = "NSImage")]
175 #[unsafe(method(buttonWithTitle:image:target:action:))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn buttonWithTitle_image_target_action(
189 title: &NSString,
190 image: &NSImage,
191 target: Option<&AnyObject>,
192 action: Option<Sel>,
193 mtm: MainThreadMarker,
194 ) -> Retained<Self>;
195
196 #[unsafe(method(buttonWithTitle:target:action:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn buttonWithTitle_target_action(
208 title: &NSString,
209 target: Option<&AnyObject>,
210 action: Option<Sel>,
211 mtm: MainThreadMarker,
212 ) -> Retained<Self>;
213
214 #[cfg(feature = "NSImage")]
215 #[unsafe(method(buttonWithImage:target:action:))]
225 #[unsafe(method_family = none)]
226 pub unsafe fn buttonWithImage_target_action(
227 image: &NSImage,
228 target: Option<&AnyObject>,
229 action: Option<Sel>,
230 mtm: MainThreadMarker,
231 ) -> Retained<Self>;
232
233 #[unsafe(method(checkboxWithTitle:target:action:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn checkboxWithTitle_target_action(
245 title: &NSString,
246 target: Option<&AnyObject>,
247 action: Option<Sel>,
248 mtm: MainThreadMarker,
249 ) -> Retained<Self>;
250
251 #[unsafe(method(radioButtonWithTitle:target:action:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn radioButtonWithTitle_target_action(
263 title: &NSString,
264 target: Option<&AnyObject>,
265 action: Option<Sel>,
266 mtm: MainThreadMarker,
267 ) -> Retained<Self>;
268 );
269}
270
271#[cfg(all(
273 feature = "NSButton",
274 feature = "NSControl",
275 feature = "NSResponder",
276 feature = "NSView"
277))]
278impl NSStatusBarButton {
279 extern_methods!(
280 #[unsafe(method(initWithFrame:))]
281 #[unsafe(method_family = init)]
282 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
283
284 #[unsafe(method(initWithCoder:))]
285 #[unsafe(method_family = init)]
286 pub unsafe fn initWithCoder(
287 this: Allocated<Self>,
288 coder: &NSCoder,
289 ) -> Option<Retained<Self>>;
290 );
291}
292
293#[cfg(all(
295 feature = "NSButton",
296 feature = "NSControl",
297 feature = "NSResponder",
298 feature = "NSView"
299))]
300impl NSStatusBarButton {
301 extern_methods!(
302 #[unsafe(method(init))]
303 #[unsafe(method_family = init)]
304 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
305 );
306}
307
308#[cfg(all(
310 feature = "NSButton",
311 feature = "NSControl",
312 feature = "NSResponder",
313 feature = "NSView"
314))]
315impl NSStatusBarButton {
316 extern_methods!(
317 #[unsafe(method(new))]
318 #[unsafe(method_family = new)]
319 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
320 );
321}