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"))]
20unsafe impl NSCoding for UIKeyCommand {}
21
22#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
23unsafe impl NSCopying for UIKeyCommand {}
24
25#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
26unsafe impl CopyingHelper for UIKeyCommand {
27 type Result = Self;
28}
29
30#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
31unsafe impl NSObjectProtocol for UIKeyCommand {}
32
33#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
34unsafe impl NSSecureCoding for UIKeyCommand {}
35
36#[cfg(all(
37 feature = "UICommand",
38 feature = "UIMenuElement",
39 feature = "UIMenuLeaf"
40))]
41unsafe impl UIMenuLeaf for UIKeyCommand {}
42
43#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
44impl UIKeyCommand {
45 extern_methods!(
46 #[unsafe(method(init))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
49
50 #[unsafe(method(initWithCoder:))]
51 #[unsafe(method_family = init)]
52 pub unsafe fn initWithCoder(
53 this: Allocated<Self>,
54 coder: &NSCoder,
55 ) -> Option<Retained<Self>>;
56
57 #[unsafe(method(title))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn title(&self) -> Retained<NSString>;
61
62 #[unsafe(method(setTitle:))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn setTitle(&self, title: &NSString);
66
67 #[cfg(feature = "UIImage")]
68 #[unsafe(method(image))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
72
73 #[cfg(feature = "UIImage")]
74 #[unsafe(method(setImage:))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn setImage(&self, image: Option<&UIImage>);
78
79 #[unsafe(method(discoverabilityTitle))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn discoverabilityTitle(&self) -> Option<Retained<NSString>>;
83
84 #[unsafe(method(setDiscoverabilityTitle:))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn setDiscoverabilityTitle(&self, discoverability_title: Option<&NSString>);
88
89 #[unsafe(method(action))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn action(&self) -> Option<Sel>;
93
94 #[unsafe(method(input))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn input(&self) -> Option<Retained<NSString>>;
97
98 #[unsafe(method(modifierFlags))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn modifierFlags(&self) -> UIKeyModifierFlags;
101
102 #[unsafe(method(propertyList))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn propertyList(&self) -> Option<Retained<AnyObject>>;
106
107 #[unsafe(method(attributes))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn attributes(&self) -> UIMenuElementAttributes;
111
112 #[unsafe(method(setAttributes:))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn setAttributes(&self, attributes: UIMenuElementAttributes);
116
117 #[unsafe(method(state))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn state(&self) -> UIMenuElementState;
121
122 #[unsafe(method(setState:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn setState(&self, state: UIMenuElementState);
126
127 #[unsafe(method(alternates))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn alternates(&self) -> Retained<NSArray<UICommandAlternate>>;
131
132 #[unsafe(method(wantsPriorityOverSystemBehavior))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn wantsPriorityOverSystemBehavior(&self) -> bool;
137
138 #[unsafe(method(setWantsPriorityOverSystemBehavior:))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn setWantsPriorityOverSystemBehavior(
142 &self,
143 wants_priority_over_system_behavior: bool,
144 );
145
146 #[unsafe(method(allowsAutomaticLocalization))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn allowsAutomaticLocalization(&self) -> bool;
150
151 #[unsafe(method(setAllowsAutomaticLocalization:))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn setAllowsAutomaticLocalization(&self, allows_automatic_localization: bool);
155
156 #[unsafe(method(allowsAutomaticMirroring))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn allowsAutomaticMirroring(&self) -> bool;
162
163 #[unsafe(method(setAllowsAutomaticMirroring:))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn setAllowsAutomaticMirroring(&self, allows_automatic_mirroring: bool);
167
168 #[cfg(feature = "UIImage")]
169 #[unsafe(method(commandWithTitle:image:action:input:modifierFlags:propertyList:))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn commandWithTitle_image_action_input_modifierFlags_propertyList(
188 title: &NSString,
189 image: Option<&UIImage>,
190 action: Sel,
191 input: &NSString,
192 modifier_flags: UIKeyModifierFlags,
193 property_list: Option<&AnyObject>,
194 mtm: MainThreadMarker,
195 ) -> Retained<Self>;
196
197 #[cfg(feature = "UIImage")]
198 #[unsafe(method(commandWithTitle:image:action:input:modifierFlags:propertyList:alternates:))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn commandWithTitle_image_action_input_modifierFlags_propertyList_alternates(
219 title: &NSString,
220 image: Option<&UIImage>,
221 action: Sel,
222 input: &NSString,
223 modifier_flags: UIKeyModifierFlags,
224 property_list: Option<&AnyObject>,
225 alternates: &NSArray<UICommandAlternate>,
226 mtm: MainThreadMarker,
227 ) -> Retained<Self>;
228
229 #[unsafe(method(keyCommandWithInput:modifierFlags:action:))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn keyCommandWithInput_modifierFlags_action(
232 input: &NSString,
233 modifier_flags: UIKeyModifierFlags,
234 action: Sel,
235 mtm: MainThreadMarker,
236 ) -> Retained<Self>;
237
238 #[deprecated]
239 #[unsafe(method(keyCommandWithInput:modifierFlags:action:discoverabilityTitle:))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn keyCommandWithInput_modifierFlags_action_discoverabilityTitle(
242 input: &NSString,
243 modifier_flags: UIKeyModifierFlags,
244 action: Sel,
245 discoverability_title: &NSString,
246 mtm: MainThreadMarker,
247 ) -> Retained<Self>;
248
249 #[cfg(feature = "UIImage")]
250 #[unsafe(method(commandWithTitle:image:action:propertyList:))]
251 #[unsafe(method_family = none)]
252 pub unsafe fn commandWithTitle_image_action_propertyList(
253 title: &NSString,
254 image: Option<&UIImage>,
255 action: Sel,
256 property_list: Option<&AnyObject>,
257 mtm: MainThreadMarker,
258 ) -> Retained<Self>;
259
260 #[cfg(feature = "UIImage")]
261 #[unsafe(method(commandWithTitle:image:action:propertyList:alternates:))]
262 #[unsafe(method_family = none)]
263 pub unsafe fn commandWithTitle_image_action_propertyList_alternates(
264 title: &NSString,
265 image: Option<&UIImage>,
266 action: Sel,
267 property_list: Option<&AnyObject>,
268 alternates: &NSArray<UICommandAlternate>,
269 mtm: MainThreadMarker,
270 ) -> Retained<Self>;
271 );
272}
273
274#[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
276impl UIKeyCommand {
277 extern_methods!(
278 #[unsafe(method(new))]
279 #[unsafe(method_family = new)]
280 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
281 );
282}