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))]
33unsafe impl NSAccessibility for NSStatusBarButton {}
34
35#[cfg(all(
36 feature = "NSAccessibilityProtocols",
37 feature = "NSButton",
38 feature = "NSControl",
39 feature = "NSResponder",
40 feature = "NSView"
41))]
42unsafe impl NSAccessibilityButton for NSStatusBarButton {}
43
44#[cfg(all(
45 feature = "NSAccessibilityProtocols",
46 feature = "NSButton",
47 feature = "NSControl",
48 feature = "NSResponder",
49 feature = "NSView"
50))]
51unsafe impl NSAccessibilityElementProtocol for NSStatusBarButton {}
52
53#[cfg(all(
54 feature = "NSAnimation",
55 feature = "NSButton",
56 feature = "NSControl",
57 feature = "NSResponder",
58 feature = "NSView"
59))]
60unsafe impl NSAnimatablePropertyContainer for NSStatusBarButton {}
61
62#[cfg(all(
63 feature = "NSAppearance",
64 feature = "NSButton",
65 feature = "NSControl",
66 feature = "NSResponder",
67 feature = "NSView"
68))]
69unsafe impl NSAppearanceCustomization for NSStatusBarButton {}
70
71#[cfg(all(
72 feature = "NSButton",
73 feature = "NSControl",
74 feature = "NSResponder",
75 feature = "NSView"
76))]
77unsafe impl NSCoding for NSStatusBarButton {}
78
79#[cfg(all(
80 feature = "NSButton",
81 feature = "NSControl",
82 feature = "NSDragging",
83 feature = "NSResponder",
84 feature = "NSView"
85))]
86unsafe impl NSDraggingDestination for NSStatusBarButton {}
87
88#[cfg(all(
89 feature = "NSButton",
90 feature = "NSControl",
91 feature = "NSResponder",
92 feature = "NSView"
93))]
94unsafe impl NSObjectProtocol for NSStatusBarButton {}
95
96#[cfg(all(
97 feature = "NSButton",
98 feature = "NSControl",
99 feature = "NSResponder",
100 feature = "NSUserInterfaceCompression",
101 feature = "NSView"
102))]
103unsafe impl NSUserInterfaceCompression for NSStatusBarButton {}
104
105#[cfg(all(
106 feature = "NSButton",
107 feature = "NSControl",
108 feature = "NSResponder",
109 feature = "NSUserInterfaceItemIdentification",
110 feature = "NSView"
111))]
112unsafe impl NSUserInterfaceItemIdentification for NSStatusBarButton {}
113
114#[cfg(all(
115 feature = "NSButton",
116 feature = "NSControl",
117 feature = "NSResponder",
118 feature = "NSUserInterfaceValidation",
119 feature = "NSView"
120))]
121unsafe impl NSUserInterfaceValidations for NSStatusBarButton {}
122
123#[cfg(all(
124 feature = "NSButton",
125 feature = "NSControl",
126 feature = "NSResponder",
127 feature = "NSView"
128))]
129impl NSStatusBarButton {
130 extern_methods!(
131 #[unsafe(method(appearsDisabled))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn appearsDisabled(&self) -> bool;
135
136 #[unsafe(method(setAppearsDisabled:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn setAppearsDisabled(&self, appears_disabled: bool);
140 );
141}
142
143#[cfg(all(
145 feature = "NSButton",
146 feature = "NSControl",
147 feature = "NSResponder",
148 feature = "NSView"
149))]
150impl NSStatusBarButton {
151 extern_methods!(
152 #[cfg(feature = "NSImage")]
153 #[unsafe(method(buttonWithTitle:image:target:action:))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn buttonWithTitle_image_target_action(
167 title: &NSString,
168 image: &NSImage,
169 target: Option<&AnyObject>,
170 action: Option<Sel>,
171 mtm: MainThreadMarker,
172 ) -> Retained<Self>;
173
174 #[unsafe(method(buttonWithTitle:target:action:))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn buttonWithTitle_target_action(
186 title: &NSString,
187 target: Option<&AnyObject>,
188 action: Option<Sel>,
189 mtm: MainThreadMarker,
190 ) -> Retained<Self>;
191
192 #[cfg(feature = "NSImage")]
193 #[unsafe(method(buttonWithImage:target:action:))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn buttonWithImage_target_action(
205 image: &NSImage,
206 target: Option<&AnyObject>,
207 action: Option<Sel>,
208 mtm: MainThreadMarker,
209 ) -> Retained<Self>;
210
211 #[unsafe(method(checkboxWithTitle:target:action:))]
221 #[unsafe(method_family = none)]
222 pub unsafe fn checkboxWithTitle_target_action(
223 title: &NSString,
224 target: Option<&AnyObject>,
225 action: Option<Sel>,
226 mtm: MainThreadMarker,
227 ) -> Retained<Self>;
228
229 #[unsafe(method(radioButtonWithTitle:target:action:))]
239 #[unsafe(method_family = none)]
240 pub unsafe fn radioButtonWithTitle_target_action(
241 title: &NSString,
242 target: Option<&AnyObject>,
243 action: Option<Sel>,
244 mtm: MainThreadMarker,
245 ) -> Retained<Self>;
246 );
247}
248
249#[cfg(all(
251 feature = "NSButton",
252 feature = "NSControl",
253 feature = "NSResponder",
254 feature = "NSView"
255))]
256impl NSStatusBarButton {
257 extern_methods!(
258 #[unsafe(method(initWithFrame:))]
259 #[unsafe(method_family = init)]
260 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
261
262 #[unsafe(method(initWithCoder:))]
263 #[unsafe(method_family = init)]
264 pub unsafe fn initWithCoder(
265 this: Allocated<Self>,
266 coder: &NSCoder,
267 ) -> Option<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(init))]
281 #[unsafe(method_family = init)]
282 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
283 );
284}
285
286#[cfg(all(
288 feature = "NSButton",
289 feature = "NSControl",
290 feature = "NSResponder",
291 feature = "NSView"
292))]
293impl NSStatusBarButton {
294 extern_methods!(
295 #[unsafe(method(new))]
296 #[unsafe(method_family = new)]
297 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
298 );
299}