objc2_ui_kit/generated/
UIKeyCommand.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(UICommand, UIMenuElement, NSObject))]
13 #[thread_kind = MainThreadOnly]
14 #[derive(Debug, PartialEq, Eq, Hash)]
15 #[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
16 pub struct UIKeyCommand;
17);
18
19#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
20extern_conformance!(
21 unsafe impl NSCoding for UIKeyCommand {}
22);
23
24#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
25extern_conformance!(
26 unsafe impl NSCopying for UIKeyCommand {}
27);
28
29#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
30unsafe impl CopyingHelper for UIKeyCommand {
31 type Result = Self;
32}
33
34#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
35extern_conformance!(
36 unsafe impl NSObjectProtocol for UIKeyCommand {}
37);
38
39#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
40extern_conformance!(
41 unsafe impl NSSecureCoding for UIKeyCommand {}
42);
43
44#[cfg(all(
45 feature = "UICommand",
46 feature = "UIMenuElement",
47 feature = "UIMenuLeaf"
48))]
49extern_conformance!(
50 unsafe impl UIMenuLeaf for UIKeyCommand {}
51);
52
53#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
54impl UIKeyCommand {
55 extern_methods!(
56 #[unsafe(method(init))]
57 #[unsafe(method_family = init)]
58 pub fn init(this: Allocated<Self>) -> Retained<Self>;
59
60 #[unsafe(method(initWithCoder:))]
64 #[unsafe(method_family = init)]
65 pub unsafe fn initWithCoder(
66 this: Allocated<Self>,
67 coder: &NSCoder,
68 ) -> Option<Retained<Self>>;
69
70 #[unsafe(method(title))]
72 #[unsafe(method_family = none)]
73 pub fn title(&self) -> Retained<NSString>;
74
75 #[unsafe(method(setTitle:))]
79 #[unsafe(method_family = none)]
80 pub fn setTitle(&self, title: &NSString);
81
82 #[cfg(feature = "UIImage")]
83 #[unsafe(method(image))]
85 #[unsafe(method_family = none)]
86 pub fn image(&self) -> Option<Retained<UIImage>>;
87
88 #[cfg(feature = "UIImage")]
89 #[unsafe(method(setImage:))]
93 #[unsafe(method_family = none)]
94 pub fn setImage(&self, image: Option<&UIImage>);
95
96 #[unsafe(method(discoverabilityTitle))]
98 #[unsafe(method_family = none)]
99 pub fn discoverabilityTitle(&self) -> Option<Retained<NSString>>;
100
101 #[unsafe(method(setDiscoverabilityTitle:))]
105 #[unsafe(method_family = none)]
106 pub fn setDiscoverabilityTitle(&self, discoverability_title: Option<&NSString>);
107
108 #[unsafe(method(action))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn action(&self) -> Option<Sel>;
112
113 #[unsafe(method(input))]
114 #[unsafe(method_family = none)]
115 pub fn input(&self) -> Option<Retained<NSString>>;
116
117 #[unsafe(method(modifierFlags))]
118 #[unsafe(method_family = none)]
119 pub fn modifierFlags(&self) -> UIKeyModifierFlags;
120
121 #[unsafe(method(propertyList))]
123 #[unsafe(method_family = none)]
124 pub fn propertyList(&self) -> Option<Retained<AnyObject>>;
125
126 #[unsafe(method(attributes))]
128 #[unsafe(method_family = none)]
129 pub fn attributes(&self) -> UIMenuElementAttributes;
130
131 #[unsafe(method(setAttributes:))]
133 #[unsafe(method_family = none)]
134 pub fn setAttributes(&self, attributes: UIMenuElementAttributes);
135
136 #[unsafe(method(state))]
138 #[unsafe(method_family = none)]
139 pub fn state(&self) -> UIMenuElementState;
140
141 #[unsafe(method(setState:))]
143 #[unsafe(method_family = none)]
144 pub fn setState(&self, state: UIMenuElementState);
145
146 #[unsafe(method(alternates))]
148 #[unsafe(method_family = none)]
149 pub fn alternates(&self) -> Retained<NSArray<UICommandAlternate>>;
150
151 #[unsafe(method(wantsPriorityOverSystemBehavior))]
154 #[unsafe(method_family = none)]
155 pub fn wantsPriorityOverSystemBehavior(&self) -> bool;
156
157 #[unsafe(method(setWantsPriorityOverSystemBehavior:))]
159 #[unsafe(method_family = none)]
160 pub fn setWantsPriorityOverSystemBehavior(&self, wants_priority_over_system_behavior: bool);
161
162 #[unsafe(method(allowsAutomaticLocalization))]
164 #[unsafe(method_family = none)]
165 pub fn allowsAutomaticLocalization(&self) -> bool;
166
167 #[unsafe(method(setAllowsAutomaticLocalization:))]
169 #[unsafe(method_family = none)]
170 pub fn setAllowsAutomaticLocalization(&self, allows_automatic_localization: bool);
171
172 #[unsafe(method(allowsAutomaticMirroring))]
176 #[unsafe(method_family = none)]
177 pub fn allowsAutomaticMirroring(&self) -> bool;
178
179 #[unsafe(method(setAllowsAutomaticMirroring:))]
181 #[unsafe(method_family = none)]
182 pub fn setAllowsAutomaticMirroring(&self, allows_automatic_mirroring: bool);
183
184 #[cfg(feature = "UIImage")]
185 #[unsafe(method(commandWithTitle:image:action:input:modifierFlags:propertyList:))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn commandWithTitle_image_action_input_modifierFlags_propertyList(
209 title: &NSString,
210 image: Option<&UIImage>,
211 action: Sel,
212 input: &NSString,
213 modifier_flags: UIKeyModifierFlags,
214 property_list: Option<&AnyObject>,
215 mtm: MainThreadMarker,
216 ) -> Retained<Self>;
217
218 #[cfg(feature = "UIImage")]
219 #[unsafe(method(commandWithTitle:image:action:input:modifierFlags:propertyList:alternates:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn commandWithTitle_image_action_input_modifierFlags_propertyList_alternates(
245 title: &NSString,
246 image: Option<&UIImage>,
247 action: Sel,
248 input: &NSString,
249 modifier_flags: UIKeyModifierFlags,
250 property_list: Option<&AnyObject>,
251 alternates: &NSArray<UICommandAlternate>,
252 mtm: MainThreadMarker,
253 ) -> Retained<Self>;
254
255 #[unsafe(method(keyCommandWithInput:modifierFlags:action:))]
259 #[unsafe(method_family = none)]
260 pub unsafe fn keyCommandWithInput_modifierFlags_action(
261 input: &NSString,
262 modifier_flags: UIKeyModifierFlags,
263 action: Sel,
264 mtm: MainThreadMarker,
265 ) -> Retained<Self>;
266
267 #[deprecated]
271 #[unsafe(method(keyCommandWithInput:modifierFlags:action:discoverabilityTitle:))]
272 #[unsafe(method_family = none)]
273 pub unsafe fn keyCommandWithInput_modifierFlags_action_discoverabilityTitle(
274 input: &NSString,
275 modifier_flags: UIKeyModifierFlags,
276 action: Sel,
277 discoverability_title: &NSString,
278 mtm: MainThreadMarker,
279 ) -> Retained<Self>;
280
281 #[cfg(feature = "UIImage")]
282 #[unsafe(method(commandWithTitle:image:action:propertyList:))]
287 #[unsafe(method_family = none)]
288 pub unsafe fn commandWithTitle_image_action_propertyList(
289 title: &NSString,
290 image: Option<&UIImage>,
291 action: Sel,
292 property_list: Option<&AnyObject>,
293 mtm: MainThreadMarker,
294 ) -> Retained<Self>;
295
296 #[cfg(feature = "UIImage")]
297 #[unsafe(method(commandWithTitle:image:action:propertyList:alternates:))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn commandWithTitle_image_action_propertyList_alternates(
304 title: &NSString,
305 image: Option<&UIImage>,
306 action: Sel,
307 property_list: Option<&AnyObject>,
308 alternates: &NSArray<UICommandAlternate>,
309 mtm: MainThreadMarker,
310 ) -> Retained<Self>;
311 );
312}
313
314#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
316impl UIKeyCommand {
317 extern_methods!(
318 #[unsafe(method(new))]
319 #[unsafe(method_family = new)]
320 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
321 );
322}