objc2_app_kit/generated/
NSComboButton.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSComboButtonStyle(pub NSInteger);
15impl NSComboButtonStyle {
16 #[doc(alias = "NSComboButtonStyleSplit")]
18 pub const Split: Self = Self(0);
19 #[doc(alias = "NSComboButtonStyleUnified")]
21 pub const Unified: Self = Self(1);
22}
23
24unsafe impl Encode for NSComboButtonStyle {
25 const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for NSComboButtonStyle {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32extern_class!(
33 #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
35 #[derive(Debug, PartialEq, Eq, Hash)]
36 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
37 pub struct NSComboButton;
38);
39
40#[cfg(all(
41 feature = "NSAccessibilityProtocols",
42 feature = "NSControl",
43 feature = "NSResponder",
44 feature = "NSView"
45))]
46extern_conformance!(
47 unsafe impl NSAccessibility for NSComboButton {}
48);
49
50#[cfg(all(
51 feature = "NSAccessibilityProtocols",
52 feature = "NSControl",
53 feature = "NSResponder",
54 feature = "NSView"
55))]
56extern_conformance!(
57 unsafe impl NSAccessibilityElementProtocol for NSComboButton {}
58);
59
60#[cfg(all(
61 feature = "NSAnimation",
62 feature = "NSControl",
63 feature = "NSResponder",
64 feature = "NSView"
65))]
66extern_conformance!(
67 unsafe impl NSAnimatablePropertyContainer for NSComboButton {}
68);
69
70#[cfg(all(
71 feature = "NSAppearance",
72 feature = "NSControl",
73 feature = "NSResponder",
74 feature = "NSView"
75))]
76extern_conformance!(
77 unsafe impl NSAppearanceCustomization for NSComboButton {}
78);
79
80#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
81extern_conformance!(
82 unsafe impl NSCoding for NSComboButton {}
83);
84
85#[cfg(all(
86 feature = "NSControl",
87 feature = "NSDragging",
88 feature = "NSResponder",
89 feature = "NSView"
90))]
91extern_conformance!(
92 unsafe impl NSDraggingDestination for NSComboButton {}
93);
94
95#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
96extern_conformance!(
97 unsafe impl NSObjectProtocol for NSComboButton {}
98);
99
100#[cfg(all(
101 feature = "NSControl",
102 feature = "NSResponder",
103 feature = "NSUserInterfaceItemIdentification",
104 feature = "NSView"
105))]
106extern_conformance!(
107 unsafe impl NSUserInterfaceItemIdentification for NSComboButton {}
108);
109
110#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
111impl NSComboButton {
112 extern_methods!(
113 #[cfg(feature = "NSMenu")]
114 #[unsafe(method(comboButtonWithTitle:menu:target:action:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn comboButtonWithTitle_menu_target_action(
126 title: &NSString,
127 menu: Option<&NSMenu>,
128 target: Option<&AnyObject>,
129 action: Option<Sel>,
130 mtm: MainThreadMarker,
131 ) -> Retained<Self>;
132
133 #[cfg(all(feature = "NSImage", feature = "NSMenu"))]
134 #[unsafe(method(comboButtonWithImage:menu:target:action:))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn comboButtonWithImage_menu_target_action(
146 image: &NSImage,
147 menu: Option<&NSMenu>,
148 target: Option<&AnyObject>,
149 action: Option<Sel>,
150 mtm: MainThreadMarker,
151 ) -> Retained<Self>;
152
153 #[cfg(all(feature = "NSImage", feature = "NSMenu"))]
154 #[unsafe(method(comboButtonWithTitle:image:menu:target:action:))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn comboButtonWithTitle_image_menu_target_action(
168 title: &NSString,
169 image: &NSImage,
170 menu: Option<&NSMenu>,
171 target: Option<&AnyObject>,
172 action: Option<Sel>,
173 mtm: MainThreadMarker,
174 ) -> Retained<Self>;
175
176 #[unsafe(method(title))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn title(&self) -> Retained<NSString>;
180
181 #[unsafe(method(setTitle:))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn setTitle(&self, title: &NSString);
185
186 #[cfg(feature = "NSImage")]
187 #[unsafe(method(image))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
191
192 #[cfg(feature = "NSImage")]
193 #[unsafe(method(setImage:))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn setImage(&self, image: Option<&NSImage>);
197
198 #[cfg(feature = "NSCell")]
199 #[unsafe(method(imageScaling))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn imageScaling(&self) -> NSImageScaling;
203
204 #[cfg(feature = "NSCell")]
205 #[unsafe(method(setImageScaling:))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn setImageScaling(&self, image_scaling: NSImageScaling);
209
210 #[cfg(feature = "NSMenu")]
211 #[unsafe(method(menu))]
213 #[unsafe(method_family = none)]
214 pub unsafe fn menu(&self) -> Retained<NSMenu>;
215
216 #[cfg(feature = "NSMenu")]
217 #[unsafe(method(setMenu:))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn setMenu(&self, menu: &NSMenu);
221
222 #[unsafe(method(style))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn style(&self) -> NSComboButtonStyle;
226
227 #[unsafe(method(setStyle:))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn setStyle(&self, style: NSComboButtonStyle);
231 );
232}
233
234#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
236impl NSComboButton {
237 extern_methods!(
238 #[unsafe(method(initWithFrame:))]
239 #[unsafe(method_family = init)]
240 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
241
242 #[unsafe(method(initWithCoder:))]
243 #[unsafe(method_family = init)]
244 pub unsafe fn initWithCoder(
245 this: Allocated<Self>,
246 coder: &NSCoder,
247 ) -> Option<Retained<Self>>;
248 );
249}
250
251#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
253impl NSComboButton {
254 extern_methods!(
255 #[unsafe(method(init))]
256 #[unsafe(method_family = init)]
257 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
258 );
259}
260
261#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
263impl NSComboButton {
264 extern_methods!(
265 #[unsafe(method(new))]
266 #[unsafe(method_family = new)]
267 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
268 );
269}