objc2_ui_kit/generated/
UIApplicationShortcutItem.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 UIApplicationShortcutIconType(pub NSInteger);
15impl UIApplicationShortcutIconType {
16 #[doc(alias = "UIApplicationShortcutIconTypeCompose")]
17 pub const Compose: Self = Self(0);
18 #[doc(alias = "UIApplicationShortcutIconTypePlay")]
19 pub const Play: Self = Self(1);
20 #[doc(alias = "UIApplicationShortcutIconTypePause")]
21 pub const Pause: Self = Self(2);
22 #[doc(alias = "UIApplicationShortcutIconTypeAdd")]
23 pub const Add: Self = Self(3);
24 #[doc(alias = "UIApplicationShortcutIconTypeLocation")]
25 pub const Location: Self = Self(4);
26 #[doc(alias = "UIApplicationShortcutIconTypeSearch")]
27 pub const Search: Self = Self(5);
28 #[doc(alias = "UIApplicationShortcutIconTypeShare")]
29 pub const Share: Self = Self(6);
30 #[doc(alias = "UIApplicationShortcutIconTypeProhibit")]
31 pub const Prohibit: Self = Self(7);
32 #[doc(alias = "UIApplicationShortcutIconTypeContact")]
33 pub const Contact: Self = Self(8);
34 #[doc(alias = "UIApplicationShortcutIconTypeHome")]
35 pub const Home: Self = Self(9);
36 #[doc(alias = "UIApplicationShortcutIconTypeMarkLocation")]
37 pub const MarkLocation: Self = Self(10);
38 #[doc(alias = "UIApplicationShortcutIconTypeFavorite")]
39 pub const Favorite: Self = Self(11);
40 #[doc(alias = "UIApplicationShortcutIconTypeLove")]
41 pub const Love: Self = Self(12);
42 #[doc(alias = "UIApplicationShortcutIconTypeCloud")]
43 pub const Cloud: Self = Self(13);
44 #[doc(alias = "UIApplicationShortcutIconTypeInvitation")]
45 pub const Invitation: Self = Self(14);
46 #[doc(alias = "UIApplicationShortcutIconTypeConfirmation")]
47 pub const Confirmation: Self = Self(15);
48 #[doc(alias = "UIApplicationShortcutIconTypeMail")]
49 pub const Mail: Self = Self(16);
50 #[doc(alias = "UIApplicationShortcutIconTypeMessage")]
51 pub const Message: Self = Self(17);
52 #[doc(alias = "UIApplicationShortcutIconTypeDate")]
53 pub const Date: Self = Self(18);
54 #[doc(alias = "UIApplicationShortcutIconTypeTime")]
55 pub const Time: Self = Self(19);
56 #[doc(alias = "UIApplicationShortcutIconTypeCapturePhoto")]
57 pub const CapturePhoto: Self = Self(20);
58 #[doc(alias = "UIApplicationShortcutIconTypeCaptureVideo")]
59 pub const CaptureVideo: Self = Self(21);
60 #[doc(alias = "UIApplicationShortcutIconTypeTask")]
61 pub const Task: Self = Self(22);
62 #[doc(alias = "UIApplicationShortcutIconTypeTaskCompleted")]
63 pub const TaskCompleted: Self = Self(23);
64 #[doc(alias = "UIApplicationShortcutIconTypeAlarm")]
65 pub const Alarm: Self = Self(24);
66 #[doc(alias = "UIApplicationShortcutIconTypeBookmark")]
67 pub const Bookmark: Self = Self(25);
68 #[doc(alias = "UIApplicationShortcutIconTypeShuffle")]
69 pub const Shuffle: Self = Self(26);
70 #[doc(alias = "UIApplicationShortcutIconTypeAudio")]
71 pub const Audio: Self = Self(27);
72 #[doc(alias = "UIApplicationShortcutIconTypeUpdate")]
73 pub const Update: Self = Self(28);
74}
75
76unsafe impl Encode for UIApplicationShortcutIconType {
77 const ENCODING: Encoding = NSInteger::ENCODING;
78}
79
80unsafe impl RefEncode for UIApplicationShortcutIconType {
81 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
82}
83
84extern_class!(
85 #[unsafe(super(NSObject))]
87 #[derive(Debug, PartialEq, Eq, Hash)]
88 pub struct UIApplicationShortcutIcon;
89);
90
91extern_conformance!(
92 unsafe impl NSCopying for UIApplicationShortcutIcon {}
93);
94
95unsafe impl CopyingHelper for UIApplicationShortcutIcon {
96 type Result = Self;
97}
98
99extern_conformance!(
100 unsafe impl NSObjectProtocol for UIApplicationShortcutIcon {}
101);
102
103impl UIApplicationShortcutIcon {
104 extern_methods!(
105 #[unsafe(method(iconWithType:))]
106 #[unsafe(method_family = none)]
107 pub fn iconWithType(r#type: UIApplicationShortcutIconType) -> Retained<Self>;
108
109 #[unsafe(method(iconWithTemplateImageName:))]
110 #[unsafe(method_family = none)]
111 pub fn iconWithTemplateImageName(template_image_name: &NSString) -> Retained<Self>;
112
113 #[unsafe(method(iconWithSystemImageName:))]
114 #[unsafe(method_family = none)]
115 pub fn iconWithSystemImageName(system_image_name: &NSString) -> Retained<Self>;
116 );
117}
118
119impl UIApplicationShortcutIcon {
121 extern_methods!(
122 #[unsafe(method(init))]
123 #[unsafe(method_family = init)]
124 pub fn init(this: Allocated<Self>) -> Retained<Self>;
125
126 #[unsafe(method(new))]
127 #[unsafe(method_family = new)]
128 pub fn new() -> Retained<Self>;
129 );
130}
131
132impl DefaultRetained for UIApplicationShortcutIcon {
133 #[inline]
134 fn default_retained() -> Retained<Self> {
135 Self::new()
136 }
137}
138
139extern_class!(
140 #[unsafe(super(NSObject))]
142 #[derive(Debug, PartialEq, Eq, Hash)]
143 pub struct UIApplicationShortcutItem;
144);
145
146extern_conformance!(
147 unsafe impl NSCopying for UIApplicationShortcutItem {}
148);
149
150unsafe impl CopyingHelper for UIApplicationShortcutItem {
151 type Result = Self;
152}
153
154extern_conformance!(
155 unsafe impl NSMutableCopying for UIApplicationShortcutItem {}
156);
157
158unsafe impl MutableCopyingHelper for UIApplicationShortcutItem {
159 type Result = UIMutableApplicationShortcutItem;
160}
161
162extern_conformance!(
163 unsafe impl NSObjectProtocol for UIApplicationShortcutItem {}
164);
165
166impl UIApplicationShortcutItem {
167 extern_methods!(
168 #[unsafe(method(init))]
169 #[unsafe(method_family = init)]
170 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
171
172 #[unsafe(method(initWithType:localizedTitle:localizedSubtitle:icon:userInfo:))]
176 #[unsafe(method_family = init)]
177 pub unsafe fn initWithType_localizedTitle_localizedSubtitle_icon_userInfo(
178 this: Allocated<Self>,
179 r#type: &NSString,
180 localized_title: &NSString,
181 localized_subtitle: Option<&NSString>,
182 icon: Option<&UIApplicationShortcutIcon>,
183 user_info: Option<&NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>,
184 ) -> Retained<Self>;
185
186 #[unsafe(method(initWithType:localizedTitle:))]
187 #[unsafe(method_family = init)]
188 pub fn initWithType_localizedTitle(
189 this: Allocated<Self>,
190 r#type: &NSString,
191 localized_title: &NSString,
192 ) -> Retained<Self>;
193
194 #[unsafe(method(type))]
195 #[unsafe(method_family = none)]
196 pub fn r#type(&self) -> Retained<NSString>;
197
198 #[unsafe(method(localizedTitle))]
199 #[unsafe(method_family = none)]
200 pub fn localizedTitle(&self) -> Retained<NSString>;
201
202 #[unsafe(method(localizedSubtitle))]
203 #[unsafe(method_family = none)]
204 pub fn localizedSubtitle(&self) -> Option<Retained<NSString>>;
205
206 #[unsafe(method(icon))]
207 #[unsafe(method_family = none)]
208 pub fn icon(&self) -> Option<Retained<UIApplicationShortcutIcon>>;
209
210 #[unsafe(method(userInfo))]
211 #[unsafe(method_family = none)]
212 pub fn userInfo(
213 &self,
214 ) -> Option<Retained<NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>>;
215
216 #[unsafe(method(targetContentIdentifier))]
217 #[unsafe(method_family = none)]
218 pub fn targetContentIdentifier(&self) -> Option<Retained<AnyObject>>;
219 );
220}
221
222impl UIApplicationShortcutItem {
224 extern_methods!(
225 #[unsafe(method(new))]
226 #[unsafe(method_family = new)]
227 pub unsafe fn new() -> Retained<Self>;
228 );
229}
230
231extern_class!(
232 #[unsafe(super(UIApplicationShortcutItem, NSObject))]
234 #[derive(Debug, PartialEq, Eq, Hash)]
235 pub struct UIMutableApplicationShortcutItem;
236);
237
238extern_conformance!(
239 unsafe impl NSCopying for UIMutableApplicationShortcutItem {}
240);
241
242unsafe impl CopyingHelper for UIMutableApplicationShortcutItem {
243 type Result = UIApplicationShortcutItem;
244}
245
246extern_conformance!(
247 unsafe impl NSMutableCopying for UIMutableApplicationShortcutItem {}
248);
249
250unsafe impl MutableCopyingHelper for UIMutableApplicationShortcutItem {
251 type Result = Self;
252}
253
254extern_conformance!(
255 unsafe impl NSObjectProtocol for UIMutableApplicationShortcutItem {}
256);
257
258impl UIMutableApplicationShortcutItem {
259 extern_methods!(
260 #[unsafe(method(type))]
261 #[unsafe(method_family = none)]
262 pub fn r#type(&self) -> Retained<NSString>;
263
264 #[unsafe(method(setType:))]
268 #[unsafe(method_family = none)]
269 pub fn setType(&self, r#type: &NSString);
270
271 #[unsafe(method(localizedTitle))]
272 #[unsafe(method_family = none)]
273 pub fn localizedTitle(&self) -> Retained<NSString>;
274
275 #[unsafe(method(setLocalizedTitle:))]
279 #[unsafe(method_family = none)]
280 pub fn setLocalizedTitle(&self, localized_title: &NSString);
281
282 #[unsafe(method(localizedSubtitle))]
283 #[unsafe(method_family = none)]
284 pub fn localizedSubtitle(&self) -> Option<Retained<NSString>>;
285
286 #[unsafe(method(setLocalizedSubtitle:))]
290 #[unsafe(method_family = none)]
291 pub fn setLocalizedSubtitle(&self, localized_subtitle: Option<&NSString>);
292
293 #[unsafe(method(icon))]
294 #[unsafe(method_family = none)]
295 pub fn icon(&self) -> Option<Retained<UIApplicationShortcutIcon>>;
296
297 #[unsafe(method(setIcon:))]
301 #[unsafe(method_family = none)]
302 pub fn setIcon(&self, icon: Option<&UIApplicationShortcutIcon>);
303
304 #[unsafe(method(userInfo))]
305 #[unsafe(method_family = none)]
306 pub fn userInfo(
307 &self,
308 ) -> Option<Retained<NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>>;
309
310 #[unsafe(method(setUserInfo:))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn setUserInfo(
320 &self,
321 user_info: Option<&NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>,
322 );
323
324 #[unsafe(method(targetContentIdentifier))]
325 #[unsafe(method_family = none)]
326 pub fn targetContentIdentifier(&self) -> Option<Retained<AnyObject>>;
327
328 #[unsafe(method(setTargetContentIdentifier:))]
336 #[unsafe(method_family = none)]
337 pub unsafe fn setTargetContentIdentifier(
338 &self,
339 target_content_identifier: Option<&AnyObject>,
340 );
341 );
342}
343
344impl UIMutableApplicationShortcutItem {
346 extern_methods!(
347 #[unsafe(method(init))]
348 #[unsafe(method_family = init)]
349 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
350
351 #[unsafe(method(initWithType:localizedTitle:localizedSubtitle:icon:userInfo:))]
355 #[unsafe(method_family = init)]
356 pub unsafe fn initWithType_localizedTitle_localizedSubtitle_icon_userInfo(
357 this: Allocated<Self>,
358 r#type: &NSString,
359 localized_title: &NSString,
360 localized_subtitle: Option<&NSString>,
361 icon: Option<&UIApplicationShortcutIcon>,
362 user_info: Option<&NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>,
363 ) -> Retained<Self>;
364
365 #[unsafe(method(initWithType:localizedTitle:))]
366 #[unsafe(method_family = init)]
367 pub fn initWithType_localizedTitle(
368 this: Allocated<Self>,
369 r#type: &NSString,
370 localized_title: &NSString,
371 ) -> Retained<Self>;
372 );
373}
374
375impl UIMutableApplicationShortcutItem {
377 extern_methods!(
378 #[unsafe(method(new))]
379 #[unsafe(method_family = new)]
380 pub unsafe fn new() -> Retained<Self>;
381 );
382}