objc2_ui_kit/generated/
UIApplicationShortcutItem.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiapplicationshortcuticontype?language=objc)
11// NS_ENUM
12#[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    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiapplicationshortcuticon?language=objc)
86    #[unsafe(super(NSObject))]
87    #[derive(Debug, PartialEq, Eq, Hash)]
88    pub struct UIApplicationShortcutIcon;
89);
90
91unsafe impl NSCopying for UIApplicationShortcutIcon {}
92
93unsafe impl CopyingHelper for UIApplicationShortcutIcon {
94    type Result = Self;
95}
96
97unsafe impl NSObjectProtocol for UIApplicationShortcutIcon {}
98
99impl UIApplicationShortcutIcon {
100    extern_methods!(
101        #[unsafe(method(iconWithType:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn iconWithType(r#type: UIApplicationShortcutIconType) -> Retained<Self>;
104
105        #[unsafe(method(iconWithTemplateImageName:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn iconWithTemplateImageName(template_image_name: &NSString) -> Retained<Self>;
108
109        #[unsafe(method(iconWithSystemImageName:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn iconWithSystemImageName(system_image_name: &NSString) -> Retained<Self>;
112    );
113}
114
115/// Methods declared on superclass `NSObject`.
116impl UIApplicationShortcutIcon {
117    extern_methods!(
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121
122        #[unsafe(method(new))]
123        #[unsafe(method_family = new)]
124        pub unsafe fn new() -> Retained<Self>;
125    );
126}
127
128extern_class!(
129    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiapplicationshortcutitem?language=objc)
130    #[unsafe(super(NSObject))]
131    #[derive(Debug, PartialEq, Eq, Hash)]
132    pub struct UIApplicationShortcutItem;
133);
134
135unsafe impl NSCopying for UIApplicationShortcutItem {}
136
137unsafe impl CopyingHelper for UIApplicationShortcutItem {
138    type Result = Self;
139}
140
141unsafe impl NSMutableCopying for UIApplicationShortcutItem {}
142
143unsafe impl MutableCopyingHelper for UIApplicationShortcutItem {
144    type Result = UIMutableApplicationShortcutItem;
145}
146
147unsafe impl NSObjectProtocol for UIApplicationShortcutItem {}
148
149impl UIApplicationShortcutItem {
150    extern_methods!(
151        #[unsafe(method(init))]
152        #[unsafe(method_family = init)]
153        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
154
155        #[unsafe(method(initWithType:localizedTitle:localizedSubtitle:icon:userInfo:))]
156        #[unsafe(method_family = init)]
157        pub unsafe fn initWithType_localizedTitle_localizedSubtitle_icon_userInfo(
158            this: Allocated<Self>,
159            r#type: &NSString,
160            localized_title: &NSString,
161            localized_subtitle: Option<&NSString>,
162            icon: Option<&UIApplicationShortcutIcon>,
163            user_info: Option<&NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>,
164        ) -> Retained<Self>;
165
166        #[unsafe(method(initWithType:localizedTitle:))]
167        #[unsafe(method_family = init)]
168        pub unsafe fn initWithType_localizedTitle(
169            this: Allocated<Self>,
170            r#type: &NSString,
171            localized_title: &NSString,
172        ) -> Retained<Self>;
173
174        #[unsafe(method(type))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn r#type(&self) -> Retained<NSString>;
177
178        #[unsafe(method(localizedTitle))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn localizedTitle(&self) -> Retained<NSString>;
181
182        #[unsafe(method(localizedSubtitle))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn localizedSubtitle(&self) -> Option<Retained<NSString>>;
185
186        #[unsafe(method(icon))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn icon(&self) -> Option<Retained<UIApplicationShortcutIcon>>;
189
190        #[unsafe(method(userInfo))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn userInfo(
193            &self,
194        ) -> Option<Retained<NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>>;
195
196        #[unsafe(method(targetContentIdentifier))]
197        #[unsafe(method_family = none)]
198        pub unsafe fn targetContentIdentifier(&self) -> Option<Retained<AnyObject>>;
199    );
200}
201
202/// Methods declared on superclass `NSObject`.
203impl UIApplicationShortcutItem {
204    extern_methods!(
205        #[unsafe(method(new))]
206        #[unsafe(method_family = new)]
207        pub unsafe fn new() -> Retained<Self>;
208    );
209}
210
211extern_class!(
212    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uimutableapplicationshortcutitem?language=objc)
213    #[unsafe(super(UIApplicationShortcutItem, NSObject))]
214    #[derive(Debug, PartialEq, Eq, Hash)]
215    pub struct UIMutableApplicationShortcutItem;
216);
217
218unsafe impl NSCopying for UIMutableApplicationShortcutItem {}
219
220unsafe impl CopyingHelper for UIMutableApplicationShortcutItem {
221    type Result = UIApplicationShortcutItem;
222}
223
224unsafe impl NSMutableCopying for UIMutableApplicationShortcutItem {}
225
226unsafe impl MutableCopyingHelper for UIMutableApplicationShortcutItem {
227    type Result = Self;
228}
229
230unsafe impl NSObjectProtocol for UIMutableApplicationShortcutItem {}
231
232impl UIMutableApplicationShortcutItem {
233    extern_methods!(
234        #[unsafe(method(type))]
235        #[unsafe(method_family = none)]
236        pub unsafe fn r#type(&self) -> Retained<NSString>;
237
238        /// Setter for [`type`][Self::type].
239        #[unsafe(method(setType:))]
240        #[unsafe(method_family = none)]
241        pub unsafe fn setType(&self, r#type: &NSString);
242
243        #[unsafe(method(localizedTitle))]
244        #[unsafe(method_family = none)]
245        pub unsafe fn localizedTitle(&self) -> Retained<NSString>;
246
247        /// Setter for [`localizedTitle`][Self::localizedTitle].
248        #[unsafe(method(setLocalizedTitle:))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn setLocalizedTitle(&self, localized_title: &NSString);
251
252        #[unsafe(method(localizedSubtitle))]
253        #[unsafe(method_family = none)]
254        pub unsafe fn localizedSubtitle(&self) -> Option<Retained<NSString>>;
255
256        /// Setter for [`localizedSubtitle`][Self::localizedSubtitle].
257        #[unsafe(method(setLocalizedSubtitle:))]
258        #[unsafe(method_family = none)]
259        pub unsafe fn setLocalizedSubtitle(&self, localized_subtitle: Option<&NSString>);
260
261        #[unsafe(method(icon))]
262        #[unsafe(method_family = none)]
263        pub unsafe fn icon(&self) -> Option<Retained<UIApplicationShortcutIcon>>;
264
265        /// Setter for [`icon`][Self::icon].
266        #[unsafe(method(setIcon:))]
267        #[unsafe(method_family = none)]
268        pub unsafe fn setIcon(&self, icon: Option<&UIApplicationShortcutIcon>);
269
270        #[unsafe(method(userInfo))]
271        #[unsafe(method_family = none)]
272        pub unsafe fn userInfo(
273            &self,
274        ) -> Option<Retained<NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>>;
275
276        /// Setter for [`userInfo`][Self::userInfo].
277        #[unsafe(method(setUserInfo:))]
278        #[unsafe(method_family = none)]
279        pub unsafe fn setUserInfo(
280            &self,
281            user_info: Option<&NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>,
282        );
283
284        #[unsafe(method(targetContentIdentifier))]
285        #[unsafe(method_family = none)]
286        pub unsafe fn targetContentIdentifier(&self) -> Option<Retained<AnyObject>>;
287
288        /// Setter for [`targetContentIdentifier`][Self::targetContentIdentifier].
289        #[unsafe(method(setTargetContentIdentifier:))]
290        #[unsafe(method_family = none)]
291        pub unsafe fn setTargetContentIdentifier(
292            &self,
293            target_content_identifier: Option<&AnyObject>,
294        );
295    );
296}
297
298/// Methods declared on superclass `UIApplicationShortcutItem`.
299impl UIMutableApplicationShortcutItem {
300    extern_methods!(
301        #[unsafe(method(init))]
302        #[unsafe(method_family = init)]
303        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
304
305        #[unsafe(method(initWithType:localizedTitle:localizedSubtitle:icon:userInfo:))]
306        #[unsafe(method_family = init)]
307        pub unsafe fn initWithType_localizedTitle_localizedSubtitle_icon_userInfo(
308            this: Allocated<Self>,
309            r#type: &NSString,
310            localized_title: &NSString,
311            localized_subtitle: Option<&NSString>,
312            icon: Option<&UIApplicationShortcutIcon>,
313            user_info: Option<&NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>,
314        ) -> Retained<Self>;
315
316        #[unsafe(method(initWithType:localizedTitle:))]
317        #[unsafe(method_family = init)]
318        pub unsafe fn initWithType_localizedTitle(
319            this: Allocated<Self>,
320            r#type: &NSString,
321            localized_title: &NSString,
322        ) -> Retained<Self>;
323    );
324}
325
326/// Methods declared on superclass `NSObject`.
327impl UIMutableApplicationShortcutItem {
328    extern_methods!(
329        #[unsafe(method(new))]
330        #[unsafe(method_family = new)]
331        pub unsafe fn new() -> Retained<Self>;
332    );
333}