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 unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
59
60 #[unsafe(method(initWithCoder:))]
61 #[unsafe(method_family = init)]
62 pub unsafe fn initWithCoder(
63 this: Allocated<Self>,
64 coder: &NSCoder,
65 ) -> Option<Retained<Self>>;
66
67 #[unsafe(method(title))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn title(&self) -> Retained<NSString>;
71
72 #[unsafe(method(setTitle:))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn setTitle(&self, title: &NSString);
76
77 #[cfg(feature = "UIImage")]
78 #[unsafe(method(image))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
82
83 #[cfg(feature = "UIImage")]
84 #[unsafe(method(setImage:))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn setImage(&self, image: Option<&UIImage>);
88
89 #[unsafe(method(discoverabilityTitle))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn discoverabilityTitle(&self) -> Option<Retained<NSString>>;
93
94 #[unsafe(method(setDiscoverabilityTitle:))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn setDiscoverabilityTitle(&self, discoverability_title: Option<&NSString>);
98
99 #[unsafe(method(action))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn action(&self) -> Option<Sel>;
103
104 #[unsafe(method(input))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn input(&self) -> Option<Retained<NSString>>;
107
108 #[unsafe(method(modifierFlags))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn modifierFlags(&self) -> UIKeyModifierFlags;
111
112 #[unsafe(method(propertyList))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn propertyList(&self) -> Option<Retained<AnyObject>>;
116
117 #[unsafe(method(attributes))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn attributes(&self) -> UIMenuElementAttributes;
121
122 #[unsafe(method(setAttributes:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn setAttributes(&self, attributes: UIMenuElementAttributes);
126
127 #[unsafe(method(state))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn state(&self) -> UIMenuElementState;
131
132 #[unsafe(method(setState:))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn setState(&self, state: UIMenuElementState);
136
137 #[unsafe(method(alternates))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn alternates(&self) -> Retained<NSArray<UICommandAlternate>>;
141
142 #[unsafe(method(wantsPriorityOverSystemBehavior))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn wantsPriorityOverSystemBehavior(&self) -> bool;
147
148 #[unsafe(method(setWantsPriorityOverSystemBehavior:))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn setWantsPriorityOverSystemBehavior(
152 &self,
153 wants_priority_over_system_behavior: bool,
154 );
155
156 #[unsafe(method(allowsAutomaticLocalization))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn allowsAutomaticLocalization(&self) -> bool;
160
161 #[unsafe(method(setAllowsAutomaticLocalization:))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn setAllowsAutomaticLocalization(&self, allows_automatic_localization: bool);
165
166 #[unsafe(method(allowsAutomaticMirroring))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn allowsAutomaticMirroring(&self) -> bool;
172
173 #[unsafe(method(setAllowsAutomaticMirroring:))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn setAllowsAutomaticMirroring(&self, allows_automatic_mirroring: bool);
177
178 #[cfg(feature = "UIImage")]
179 #[unsafe(method(commandWithTitle:image:action:input:modifierFlags:propertyList:))]
196 #[unsafe(method_family = none)]
197 pub unsafe fn commandWithTitle_image_action_input_modifierFlags_propertyList(
198 title: &NSString,
199 image: Option<&UIImage>,
200 action: Sel,
201 input: &NSString,
202 modifier_flags: UIKeyModifierFlags,
203 property_list: Option<&AnyObject>,
204 mtm: MainThreadMarker,
205 ) -> Retained<Self>;
206
207 #[cfg(feature = "UIImage")]
208 #[unsafe(method(commandWithTitle:image:action:input:modifierFlags:propertyList:alternates:))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn commandWithTitle_image_action_input_modifierFlags_propertyList_alternates(
229 title: &NSString,
230 image: Option<&UIImage>,
231 action: Sel,
232 input: &NSString,
233 modifier_flags: UIKeyModifierFlags,
234 property_list: Option<&AnyObject>,
235 alternates: &NSArray<UICommandAlternate>,
236 mtm: MainThreadMarker,
237 ) -> Retained<Self>;
238
239 #[unsafe(method(keyCommandWithInput:modifierFlags:action:))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn keyCommandWithInput_modifierFlags_action(
242 input: &NSString,
243 modifier_flags: UIKeyModifierFlags,
244 action: Sel,
245 mtm: MainThreadMarker,
246 ) -> Retained<Self>;
247
248 #[deprecated]
249 #[unsafe(method(keyCommandWithInput:modifierFlags:action:discoverabilityTitle:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn keyCommandWithInput_modifierFlags_action_discoverabilityTitle(
252 input: &NSString,
253 modifier_flags: UIKeyModifierFlags,
254 action: Sel,
255 discoverability_title: &NSString,
256 mtm: MainThreadMarker,
257 ) -> Retained<Self>;
258
259 #[cfg(feature = "UIImage")]
260 #[unsafe(method(commandWithTitle:image:action:propertyList:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn commandWithTitle_image_action_propertyList(
263 title: &NSString,
264 image: Option<&UIImage>,
265 action: Sel,
266 property_list: Option<&AnyObject>,
267 mtm: MainThreadMarker,
268 ) -> Retained<Self>;
269
270 #[cfg(feature = "UIImage")]
271 #[unsafe(method(commandWithTitle:image:action:propertyList:alternates:))]
272 #[unsafe(method_family = none)]
273 pub unsafe fn commandWithTitle_image_action_propertyList_alternates(
274 title: &NSString,
275 image: Option<&UIImage>,
276 action: Sel,
277 property_list: Option<&AnyObject>,
278 alternates: &NSArray<UICommandAlternate>,
279 mtm: MainThreadMarker,
280 ) -> Retained<Self>;
281 );
282}
283
284#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
286impl UIKeyCommand {
287 extern_methods!(
288 #[unsafe(method(new))]
289 #[unsafe(method_family = new)]
290 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
291 );
292}