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:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn comboButtonWithTitle_menu_target_action(
131            title: &NSString,
132            menu: Option<&NSMenu>,
133            target: Option<&AnyObject>,
134            action: Option<Sel>,
135            mtm: MainThreadMarker,
136        ) -> Retained<Self>;
137
138        #[cfg(all(feature = "NSImage", feature = "NSMenu"))]
139        #[unsafe(method(comboButtonWithImage:menu:target:action:))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn comboButtonWithImage_menu_target_action(
156            image: &NSImage,
157            menu: Option<&NSMenu>,
158            target: Option<&AnyObject>,
159            action: Option<Sel>,
160            mtm: MainThreadMarker,
161        ) -> Retained<Self>;
162
163        #[cfg(all(feature = "NSImage", feature = "NSMenu"))]
164        #[unsafe(method(comboButtonWithTitle:image:menu:target:action:))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn comboButtonWithTitle_image_menu_target_action(
183            title: &NSString,
184            image: &NSImage,
185            menu: Option<&NSMenu>,
186            target: Option<&AnyObject>,
187            action: Option<Sel>,
188            mtm: MainThreadMarker,
189        ) -> Retained<Self>;
190
191        #[unsafe(method(title))]
193        #[unsafe(method_family = none)]
194        pub fn title(&self) -> Retained<NSString>;
195
196        #[unsafe(method(setTitle:))]
200        #[unsafe(method_family = none)]
201        pub fn setTitle(&self, title: &NSString);
202
203        #[cfg(feature = "NSImage")]
204        #[unsafe(method(image))]
206        #[unsafe(method_family = none)]
207        pub fn image(&self) -> Option<Retained<NSImage>>;
208
209        #[cfg(feature = "NSImage")]
210        #[unsafe(method(setImage:))]
212        #[unsafe(method_family = none)]
213        pub fn setImage(&self, image: Option<&NSImage>);
214
215        #[cfg(feature = "NSCell")]
216        #[unsafe(method(imageScaling))]
218        #[unsafe(method_family = none)]
219        pub fn imageScaling(&self) -> NSImageScaling;
220
221        #[cfg(feature = "NSCell")]
222        #[unsafe(method(setImageScaling:))]
224        #[unsafe(method_family = none)]
225        pub fn setImageScaling(&self, image_scaling: NSImageScaling);
226
227        #[cfg(feature = "NSMenu")]
228        #[unsafe(method(menu))]
230        #[unsafe(method_family = none)]
231        pub fn menu(&self) -> Retained<NSMenu>;
232
233        #[cfg(feature = "NSMenu")]
234        #[unsafe(method(setMenu:))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn setMenu(&self, menu: &NSMenu);
238
239        #[unsafe(method(style))]
241        #[unsafe(method_family = none)]
242        pub fn style(&self) -> NSComboButtonStyle;
243
244        #[unsafe(method(setStyle:))]
246        #[unsafe(method_family = none)]
247        pub fn setStyle(&self, style: NSComboButtonStyle);
248    );
249}
250
251#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
253impl NSComboButton {
254    extern_methods!(
255        #[unsafe(method(initWithFrame:))]
256        #[unsafe(method_family = init)]
257        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
258
259        #[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(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
273impl NSComboButton {
274    extern_methods!(
275        #[unsafe(method(init))]
276        #[unsafe(method_family = init)]
277        pub fn init(this: Allocated<Self>) -> Retained<Self>;
278    );
279}
280
281#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
283impl NSComboButton {
284    extern_methods!(
285        #[unsafe(method(new))]
286        #[unsafe(method_family = new)]
287        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
288    );
289}