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))]
46unsafe impl NSAccessibility for NSComboButton {}
47
48#[cfg(all(
49 feature = "NSAccessibilityProtocols",
50 feature = "NSControl",
51 feature = "NSResponder",
52 feature = "NSView"
53))]
54unsafe impl NSAccessibilityElementProtocol for NSComboButton {}
55
56#[cfg(all(
57 feature = "NSAnimation",
58 feature = "NSControl",
59 feature = "NSResponder",
60 feature = "NSView"
61))]
62unsafe impl NSAnimatablePropertyContainer for NSComboButton {}
63
64#[cfg(all(
65 feature = "NSAppearance",
66 feature = "NSControl",
67 feature = "NSResponder",
68 feature = "NSView"
69))]
70unsafe impl NSAppearanceCustomization for NSComboButton {}
71
72#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
73unsafe impl NSCoding for NSComboButton {}
74
75#[cfg(all(
76 feature = "NSControl",
77 feature = "NSDragging",
78 feature = "NSResponder",
79 feature = "NSView"
80))]
81unsafe impl NSDraggingDestination for NSComboButton {}
82
83#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
84unsafe impl NSObjectProtocol for NSComboButton {}
85
86#[cfg(all(
87 feature = "NSControl",
88 feature = "NSResponder",
89 feature = "NSUserInterfaceItemIdentification",
90 feature = "NSView"
91))]
92unsafe impl NSUserInterfaceItemIdentification for NSComboButton {}
93
94#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
95impl NSComboButton {
96 extern_methods!(
97 #[cfg(feature = "NSMenu")]
98 #[unsafe(method(comboButtonWithTitle:menu:target:action:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn comboButtonWithTitle_menu_target_action(
110 title: &NSString,
111 menu: Option<&NSMenu>,
112 target: Option<&AnyObject>,
113 action: Option<Sel>,
114 mtm: MainThreadMarker,
115 ) -> Retained<Self>;
116
117 #[cfg(all(feature = "NSImage", feature = "NSMenu"))]
118 #[unsafe(method(comboButtonWithImage:menu:target:action:))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn comboButtonWithImage_menu_target_action(
130 image: &NSImage,
131 menu: Option<&NSMenu>,
132 target: Option<&AnyObject>,
133 action: Option<Sel>,
134 mtm: MainThreadMarker,
135 ) -> Retained<Self>;
136
137 #[cfg(all(feature = "NSImage", feature = "NSMenu"))]
138 #[unsafe(method(comboButtonWithTitle:image:menu:target:action:))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn comboButtonWithTitle_image_menu_target_action(
152 title: &NSString,
153 image: &NSImage,
154 menu: Option<&NSMenu>,
155 target: Option<&AnyObject>,
156 action: Option<Sel>,
157 mtm: MainThreadMarker,
158 ) -> Retained<Self>;
159
160 #[unsafe(method(title))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn title(&self) -> Retained<NSString>;
164
165 #[unsafe(method(setTitle:))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn setTitle(&self, title: &NSString);
169
170 #[cfg(feature = "NSImage")]
171 #[unsafe(method(image))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
175
176 #[cfg(feature = "NSImage")]
177 #[unsafe(method(setImage:))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn setImage(&self, image: Option<&NSImage>);
181
182 #[cfg(feature = "NSCell")]
183 #[unsafe(method(imageScaling))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn imageScaling(&self) -> NSImageScaling;
187
188 #[cfg(feature = "NSCell")]
189 #[unsafe(method(setImageScaling:))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn setImageScaling(&self, image_scaling: NSImageScaling);
193
194 #[cfg(feature = "NSMenu")]
195 #[unsafe(method(menu))]
197 #[unsafe(method_family = none)]
198 pub unsafe fn menu(&self) -> Retained<NSMenu>;
199
200 #[cfg(feature = "NSMenu")]
201 #[unsafe(method(setMenu:))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn setMenu(&self, menu: &NSMenu);
205
206 #[unsafe(method(style))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn style(&self) -> NSComboButtonStyle;
210
211 #[unsafe(method(setStyle:))]
213 #[unsafe(method_family = none)]
214 pub unsafe fn setStyle(&self, style: NSComboButtonStyle);
215 );
216}
217
218#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
220impl NSComboButton {
221 extern_methods!(
222 #[unsafe(method(initWithFrame:))]
223 #[unsafe(method_family = init)]
224 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
225
226 #[unsafe(method(initWithCoder:))]
227 #[unsafe(method_family = init)]
228 pub unsafe fn initWithCoder(
229 this: Allocated<Self>,
230 coder: &NSCoder,
231 ) -> Option<Retained<Self>>;
232 );
233}
234
235#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
237impl NSComboButton {
238 extern_methods!(
239 #[unsafe(method(init))]
240 #[unsafe(method_family = init)]
241 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
242 );
243}
244
245#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
247impl NSComboButton {
248 extern_methods!(
249 #[unsafe(method(new))]
250 #[unsafe(method_family = new)]
251 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
252 );
253}