objc2_ui_kit/generated/
UILocalNotification.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::*;
6#[cfg(feature = "objc2-core-location")]
7use objc2_core_location::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilocalnotification?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
18    pub struct UILocalNotification;
19);
20
21extern_conformance!(
22    unsafe impl NSCoding for UILocalNotification {}
23);
24
25extern_conformance!(
26    unsafe impl NSCopying for UILocalNotification {}
27);
28
29unsafe impl CopyingHelper for UILocalNotification {
30    type Result = Self;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for UILocalNotification {}
35);
36
37impl UILocalNotification {
38    extern_methods!(
39        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
40        #[unsafe(method(init))]
41        #[unsafe(method_family = init)]
42        pub fn init(this: Allocated<Self>) -> Retained<Self>;
43
44        /// # Safety
45        ///
46        /// `coder` possibly has further requirements.
47        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
48        #[unsafe(method(initWithCoder:))]
49        #[unsafe(method_family = init)]
50        pub unsafe fn initWithCoder(
51            this: Allocated<Self>,
52            coder: &NSCoder,
53        ) -> Option<Retained<Self>>;
54
55        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
56        #[unsafe(method(fireDate))]
57        #[unsafe(method_family = none)]
58        pub fn fireDate(&self) -> Option<Retained<NSDate>>;
59
60        /// Setter for [`fireDate`][Self::fireDate].
61        ///
62        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
63        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
64        #[unsafe(method(setFireDate:))]
65        #[unsafe(method_family = none)]
66        pub fn setFireDate(&self, fire_date: Option<&NSDate>);
67
68        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
69        #[unsafe(method(timeZone))]
70        #[unsafe(method_family = none)]
71        pub fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
72
73        /// Setter for [`timeZone`][Self::timeZone].
74        ///
75        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
76        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
77        #[unsafe(method(setTimeZone:))]
78        #[unsafe(method_family = none)]
79        pub fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
80
81        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
82        #[unsafe(method(repeatInterval))]
83        #[unsafe(method_family = none)]
84        pub fn repeatInterval(&self) -> NSCalendarUnit;
85
86        /// Setter for [`repeatInterval`][Self::repeatInterval].
87        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
88        #[unsafe(method(setRepeatInterval:))]
89        #[unsafe(method_family = none)]
90        pub fn setRepeatInterval(&self, repeat_interval: NSCalendarUnit);
91
92        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
93        #[unsafe(method(repeatCalendar))]
94        #[unsafe(method_family = none)]
95        pub fn repeatCalendar(&self) -> Option<Retained<NSCalendar>>;
96
97        /// Setter for [`repeatCalendar`][Self::repeatCalendar].
98        ///
99        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
100        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
101        #[unsafe(method(setRepeatCalendar:))]
102        #[unsafe(method_family = none)]
103        pub fn setRepeatCalendar(&self, repeat_calendar: Option<&NSCalendar>);
104
105        #[cfg(feature = "objc2-core-location")]
106        #[unsafe(method(region))]
107        #[unsafe(method_family = none)]
108        pub fn region(&self) -> Option<Retained<CLRegion>>;
109
110        #[cfg(feature = "objc2-core-location")]
111        /// Setter for [`region`][Self::region].
112        ///
113        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
114        #[unsafe(method(setRegion:))]
115        #[unsafe(method_family = none)]
116        pub fn setRegion(&self, region: Option<&CLRegion>);
117
118        #[unsafe(method(regionTriggersOnce))]
119        #[unsafe(method_family = none)]
120        pub fn regionTriggersOnce(&self) -> bool;
121
122        /// Setter for [`regionTriggersOnce`][Self::regionTriggersOnce].
123        #[unsafe(method(setRegionTriggersOnce:))]
124        #[unsafe(method_family = none)]
125        pub fn setRegionTriggersOnce(&self, region_triggers_once: bool);
126
127        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
128        #[unsafe(method(alertBody))]
129        #[unsafe(method_family = none)]
130        pub fn alertBody(&self) -> Option<Retained<NSString>>;
131
132        /// Setter for [`alertBody`][Self::alertBody].
133        ///
134        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
135        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
136        #[unsafe(method(setAlertBody:))]
137        #[unsafe(method_family = none)]
138        pub fn setAlertBody(&self, alert_body: Option<&NSString>);
139
140        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
141        #[unsafe(method(hasAction))]
142        #[unsafe(method_family = none)]
143        pub fn hasAction(&self) -> bool;
144
145        /// Setter for [`hasAction`][Self::hasAction].
146        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
147        #[unsafe(method(setHasAction:))]
148        #[unsafe(method_family = none)]
149        pub fn setHasAction(&self, has_action: bool);
150
151        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
152        #[unsafe(method(alertAction))]
153        #[unsafe(method_family = none)]
154        pub fn alertAction(&self) -> Option<Retained<NSString>>;
155
156        /// Setter for [`alertAction`][Self::alertAction].
157        ///
158        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
159        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
160        #[unsafe(method(setAlertAction:))]
161        #[unsafe(method_family = none)]
162        pub fn setAlertAction(&self, alert_action: Option<&NSString>);
163
164        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
165        #[unsafe(method(alertLaunchImage))]
166        #[unsafe(method_family = none)]
167        pub fn alertLaunchImage(&self) -> Option<Retained<NSString>>;
168
169        /// Setter for [`alertLaunchImage`][Self::alertLaunchImage].
170        ///
171        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
172        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
173        #[unsafe(method(setAlertLaunchImage:))]
174        #[unsafe(method_family = none)]
175        pub fn setAlertLaunchImage(&self, alert_launch_image: Option<&NSString>);
176
177        #[unsafe(method(alertTitle))]
178        #[unsafe(method_family = none)]
179        pub fn alertTitle(&self) -> Option<Retained<NSString>>;
180
181        /// Setter for [`alertTitle`][Self::alertTitle].
182        ///
183        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
184        #[unsafe(method(setAlertTitle:))]
185        #[unsafe(method_family = none)]
186        pub fn setAlertTitle(&self, alert_title: Option<&NSString>);
187
188        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
189        #[unsafe(method(soundName))]
190        #[unsafe(method_family = none)]
191        pub fn soundName(&self) -> Option<Retained<NSString>>;
192
193        /// Setter for [`soundName`][Self::soundName].
194        ///
195        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
196        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
197        #[unsafe(method(setSoundName:))]
198        #[unsafe(method_family = none)]
199        pub fn setSoundName(&self, sound_name: Option<&NSString>);
200
201        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
202        #[unsafe(method(applicationIconBadgeNumber))]
203        #[unsafe(method_family = none)]
204        pub fn applicationIconBadgeNumber(&self) -> NSInteger;
205
206        /// Setter for [`applicationIconBadgeNumber`][Self::applicationIconBadgeNumber].
207        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
208        #[unsafe(method(setApplicationIconBadgeNumber:))]
209        #[unsafe(method_family = none)]
210        pub fn setApplicationIconBadgeNumber(&self, application_icon_badge_number: NSInteger);
211
212        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
213        #[unsafe(method(userInfo))]
214        #[unsafe(method_family = none)]
215        pub fn userInfo(&self) -> Option<Retained<NSDictionary>>;
216
217        /// Setter for [`userInfo`][Self::userInfo].
218        ///
219        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
220        ///
221        /// # Safety
222        ///
223        /// `user_info` generic should be of the correct type.
224        #[deprecated = "Use UserNotifications Framework's UNNotificationRequest"]
225        #[unsafe(method(setUserInfo:))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary>);
228
229        #[unsafe(method(category))]
230        #[unsafe(method_family = none)]
231        pub fn category(&self) -> Option<Retained<NSString>>;
232
233        /// Setter for [`category`][Self::category].
234        ///
235        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
236        #[unsafe(method(setCategory:))]
237        #[unsafe(method_family = none)]
238        pub fn setCategory(&self, category: Option<&NSString>);
239    );
240}
241
242/// Methods declared on superclass `NSObject`.
243impl UILocalNotification {
244    extern_methods!(
245        #[unsafe(method(new))]
246        #[unsafe(method_family = new)]
247        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
248    );
249}
250
251extern "C" {
252    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilocalnotificationdefaultsoundname?language=objc)
253    #[deprecated = "Use UserNotifications Framework's +[UNNotificationSound defaultSound]"]
254    pub static UILocalNotificationDefaultSoundName: &'static NSString;
255}