objc2_app_kit/generated/
NSButtonTouchBarItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSTouchBarItem, NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 #[cfg(feature = "NSTouchBarItem")]
15 pub struct NSButtonTouchBarItem;
16);
17
18#[cfg(feature = "NSTouchBarItem")]
19extern_conformance!(
20 unsafe impl NSCoding for NSButtonTouchBarItem {}
21);
22
23#[cfg(feature = "NSTouchBarItem")]
24extern_conformance!(
25 unsafe impl NSObjectProtocol for NSButtonTouchBarItem {}
26);
27
28#[cfg(feature = "NSTouchBarItem")]
29impl NSButtonTouchBarItem {
30 extern_methods!(
31 #[unsafe(method(buttonTouchBarItemWithIdentifier:title:target:action:))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn buttonTouchBarItemWithIdentifier_title_target_action(
38 identifier: &NSTouchBarItemIdentifier,
39 title: &NSString,
40 target: Option<&AnyObject>,
41 action: Option<Sel>,
42 mtm: MainThreadMarker,
43 ) -> Retained<Self>;
44
45 #[cfg(feature = "NSImage")]
46 #[unsafe(method(buttonTouchBarItemWithIdentifier:image:target:action:))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn buttonTouchBarItemWithIdentifier_image_target_action(
53 identifier: &NSTouchBarItemIdentifier,
54 image: &NSImage,
55 target: Option<&AnyObject>,
56 action: Option<Sel>,
57 mtm: MainThreadMarker,
58 ) -> Retained<Self>;
59
60 #[cfg(feature = "NSImage")]
61 #[unsafe(method(buttonTouchBarItemWithIdentifier:title:image:target:action:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn buttonTouchBarItemWithIdentifier_title_image_target_action(
68 identifier: &NSTouchBarItemIdentifier,
69 title: &NSString,
70 image: &NSImage,
71 target: Option<&AnyObject>,
72 action: Option<Sel>,
73 mtm: MainThreadMarker,
74 ) -> Retained<Self>;
75
76 #[unsafe(method(title))]
77 #[unsafe(method_family = none)]
78 pub fn title(&self) -> Retained<NSString>;
79
80 #[unsafe(method(setTitle:))]
84 #[unsafe(method_family = none)]
85 pub fn setTitle(&self, title: &NSString);
86
87 #[cfg(feature = "NSImage")]
88 #[unsafe(method(image))]
89 #[unsafe(method_family = none)]
90 pub fn image(&self) -> Option<Retained<NSImage>>;
91
92 #[cfg(feature = "NSImage")]
93 #[unsafe(method(setImage:))]
95 #[unsafe(method_family = none)]
96 pub fn setImage(&self, image: Option<&NSImage>);
97
98 #[cfg(feature = "NSColor")]
99 #[unsafe(method(bezelColor))]
100 #[unsafe(method_family = none)]
101 pub fn bezelColor(&self) -> Option<Retained<NSColor>>;
102
103 #[cfg(feature = "NSColor")]
104 #[unsafe(method(setBezelColor:))]
108 #[unsafe(method_family = none)]
109 pub fn setBezelColor(&self, bezel_color: Option<&NSColor>);
110
111 #[unsafe(method(target))]
112 #[unsafe(method_family = none)]
113 pub fn target(&self) -> Option<Retained<AnyObject>>;
114
115 #[unsafe(method(setTarget:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
125
126 #[unsafe(method(action))]
127 #[unsafe(method_family = none)]
128 pub fn action(&self) -> Option<Sel>;
129
130 #[unsafe(method(setAction:))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn setAction(&self, action: Option<Sel>);
138
139 #[unsafe(method(isEnabled))]
140 #[unsafe(method_family = none)]
141 pub fn isEnabled(&self) -> bool;
142
143 #[unsafe(method(setEnabled:))]
145 #[unsafe(method_family = none)]
146 pub fn setEnabled(&self, enabled: bool);
147
148 #[unsafe(method(customizationLabel))]
150 #[unsafe(method_family = none)]
151 pub fn customizationLabel(&self) -> Retained<NSString>;
152
153 #[unsafe(method(setCustomizationLabel:))]
157 #[unsafe(method_family = none)]
158 pub fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
159 );
160}
161
162#[cfg(feature = "NSTouchBarItem")]
164impl NSButtonTouchBarItem {
165 extern_methods!(
166 #[unsafe(method(initWithIdentifier:))]
167 #[unsafe(method_family = init)]
168 pub fn initWithIdentifier(
169 this: Allocated<Self>,
170 identifier: &NSTouchBarItemIdentifier,
171 ) -> Retained<Self>;
172
173 #[unsafe(method(initWithCoder:))]
177 #[unsafe(method_family = init)]
178 pub unsafe fn initWithCoder(
179 this: Allocated<Self>,
180 coder: &NSCoder,
181 ) -> Option<Retained<Self>>;
182
183 #[unsafe(method(init))]
184 #[unsafe(method_family = init)]
185 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
186 );
187}
188
189#[cfg(feature = "NSTouchBarItem")]
191impl NSButtonTouchBarItem {
192 extern_methods!(
193 #[unsafe(method(new))]
194 #[unsafe(method_family = new)]
195 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
196 );
197}