icrate/generated/Foundation/
NSUserNotification.rs1use crate::common::*;
4use crate::Foundation::*;
5
6ns_enum!(
7 #[underlying(NSInteger)]
8 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
9 pub enum NSUserNotificationActivationType {
10 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
11 NSUserNotificationActivationTypeNone = 0,
12 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
13 NSUserNotificationActivationTypeContentsClicked = 1,
14 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
15 NSUserNotificationActivationTypeActionButtonClicked = 2,
16 NSUserNotificationActivationTypeReplied = 3,
17 NSUserNotificationActivationTypeAdditionalActionClicked = 4,
18 }
19);
20
21extern_class!(
22 #[derive(Debug, PartialEq, Eq, Hash)]
23 #[cfg(feature = "Foundation_NSUserNotification")]
24 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
25 pub struct NSUserNotification;
26
27 #[cfg(feature = "Foundation_NSUserNotification")]
28 unsafe impl ClassType for NSUserNotification {
29 type Super = NSObject;
30 type Mutability = InteriorMutable;
31 }
32);
33
34#[cfg(feature = "Foundation_NSUserNotification")]
35unsafe impl NSCopying for NSUserNotification {}
36
37#[cfg(feature = "Foundation_NSUserNotification")]
38unsafe impl NSObjectProtocol for NSUserNotification {}
39
40extern_methods!(
41 #[cfg(feature = "Foundation_NSUserNotification")]
42 unsafe impl NSUserNotification {
43 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
44 #[method_id(@__retain_semantics Init init)]
45 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
46
47 #[cfg(feature = "Foundation_NSString")]
48 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
49 #[method_id(@__retain_semantics Other title)]
50 pub unsafe fn title(&self) -> Option<Id<NSString>>;
51
52 #[cfg(feature = "Foundation_NSString")]
53 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
54 #[method(setTitle:)]
55 pub unsafe fn setTitle(&self, title: Option<&NSString>);
56
57 #[cfg(feature = "Foundation_NSString")]
58 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
59 #[method_id(@__retain_semantics Other subtitle)]
60 pub unsafe fn subtitle(&self) -> Option<Id<NSString>>;
61
62 #[cfg(feature = "Foundation_NSString")]
63 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
64 #[method(setSubtitle:)]
65 pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
66
67 #[cfg(feature = "Foundation_NSString")]
68 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
69 #[method_id(@__retain_semantics Other informativeText)]
70 pub unsafe fn informativeText(&self) -> Option<Id<NSString>>;
71
72 #[cfg(feature = "Foundation_NSString")]
73 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
74 #[method(setInformativeText:)]
75 pub unsafe fn setInformativeText(&self, informative_text: Option<&NSString>);
76
77 #[cfg(feature = "Foundation_NSString")]
78 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
79 #[method_id(@__retain_semantics Other actionButtonTitle)]
80 pub unsafe fn actionButtonTitle(&self) -> Id<NSString>;
81
82 #[cfg(feature = "Foundation_NSString")]
83 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
84 #[method(setActionButtonTitle:)]
85 pub unsafe fn setActionButtonTitle(&self, action_button_title: &NSString);
86
87 #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
88 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
89 #[method_id(@__retain_semantics Other userInfo)]
90 pub unsafe fn userInfo(&self) -> Option<Id<NSDictionary<NSString, AnyObject>>>;
91
92 #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
93 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
94 #[method(setUserInfo:)]
95 pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary<NSString, AnyObject>>);
96
97 #[cfg(feature = "Foundation_NSDate")]
98 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
99 #[method_id(@__retain_semantics Other deliveryDate)]
100 pub unsafe fn deliveryDate(&self) -> Option<Id<NSDate>>;
101
102 #[cfg(feature = "Foundation_NSDate")]
103 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
104 #[method(setDeliveryDate:)]
105 pub unsafe fn setDeliveryDate(&self, delivery_date: Option<&NSDate>);
106
107 #[cfg(feature = "Foundation_NSTimeZone")]
108 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
109 #[method_id(@__retain_semantics Other deliveryTimeZone)]
110 pub unsafe fn deliveryTimeZone(&self) -> Option<Id<NSTimeZone>>;
111
112 #[cfg(feature = "Foundation_NSTimeZone")]
113 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
114 #[method(setDeliveryTimeZone:)]
115 pub unsafe fn setDeliveryTimeZone(&self, delivery_time_zone: Option<&NSTimeZone>);
116
117 #[cfg(feature = "Foundation_NSDateComponents")]
118 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
119 #[method_id(@__retain_semantics Other deliveryRepeatInterval)]
120 pub unsafe fn deliveryRepeatInterval(&self) -> Option<Id<NSDateComponents>>;
121
122 #[cfg(feature = "Foundation_NSDateComponents")]
123 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
124 #[method(setDeliveryRepeatInterval:)]
125 pub unsafe fn setDeliveryRepeatInterval(
126 &self,
127 delivery_repeat_interval: Option<&NSDateComponents>,
128 );
129
130 #[cfg(feature = "Foundation_NSDate")]
131 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
132 #[method_id(@__retain_semantics Other actualDeliveryDate)]
133 pub unsafe fn actualDeliveryDate(&self) -> Option<Id<NSDate>>;
134
135 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
136 #[method(isPresented)]
137 pub unsafe fn isPresented(&self) -> bool;
138
139 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
140 #[method(isRemote)]
141 pub unsafe fn isRemote(&self) -> bool;
142
143 #[cfg(feature = "Foundation_NSString")]
144 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
145 #[method_id(@__retain_semantics Other soundName)]
146 pub unsafe fn soundName(&self) -> Option<Id<NSString>>;
147
148 #[cfg(feature = "Foundation_NSString")]
149 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
150 #[method(setSoundName:)]
151 pub unsafe fn setSoundName(&self, sound_name: Option<&NSString>);
152
153 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
154 #[method(hasActionButton)]
155 pub unsafe fn hasActionButton(&self) -> bool;
156
157 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
158 #[method(setHasActionButton:)]
159 pub unsafe fn setHasActionButton(&self, has_action_button: bool);
160
161 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
162 #[method(activationType)]
163 pub unsafe fn activationType(&self) -> NSUserNotificationActivationType;
164
165 #[cfg(feature = "Foundation_NSString")]
166 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
167 #[method_id(@__retain_semantics Other otherButtonTitle)]
168 pub unsafe fn otherButtonTitle(&self) -> Id<NSString>;
169
170 #[cfg(feature = "Foundation_NSString")]
171 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
172 #[method(setOtherButtonTitle:)]
173 pub unsafe fn setOtherButtonTitle(&self, other_button_title: &NSString);
174
175 #[cfg(feature = "Foundation_NSString")]
176 #[method_id(@__retain_semantics Other identifier)]
177 pub unsafe fn identifier(&self) -> Option<Id<NSString>>;
178
179 #[cfg(feature = "Foundation_NSString")]
180 #[method(setIdentifier:)]
181 pub unsafe fn setIdentifier(&self, identifier: Option<&NSString>);
182
183 #[method(hasReplyButton)]
184 pub unsafe fn hasReplyButton(&self) -> bool;
185
186 #[method(setHasReplyButton:)]
187 pub unsafe fn setHasReplyButton(&self, has_reply_button: bool);
188
189 #[cfg(feature = "Foundation_NSString")]
190 #[method_id(@__retain_semantics Other responsePlaceholder)]
191 pub unsafe fn responsePlaceholder(&self) -> Option<Id<NSString>>;
192
193 #[cfg(feature = "Foundation_NSString")]
194 #[method(setResponsePlaceholder:)]
195 pub unsafe fn setResponsePlaceholder(&self, response_placeholder: Option<&NSString>);
196
197 #[cfg(feature = "Foundation_NSAttributedString")]
198 #[method_id(@__retain_semantics Other response)]
199 pub unsafe fn response(&self) -> Option<Id<NSAttributedString>>;
200
201 #[cfg(all(
202 feature = "Foundation_NSArray",
203 feature = "Foundation_NSUserNotificationAction"
204 ))]
205 #[method_id(@__retain_semantics Other additionalActions)]
206 pub unsafe fn additionalActions(&self) -> Option<Id<NSArray<NSUserNotificationAction>>>;
207
208 #[cfg(all(
209 feature = "Foundation_NSArray",
210 feature = "Foundation_NSUserNotificationAction"
211 ))]
212 #[method(setAdditionalActions:)]
213 pub unsafe fn setAdditionalActions(
214 &self,
215 additional_actions: Option<&NSArray<NSUserNotificationAction>>,
216 );
217
218 #[cfg(feature = "Foundation_NSUserNotificationAction")]
219 #[method_id(@__retain_semantics Other additionalActivationAction)]
220 pub unsafe fn additionalActivationAction(&self) -> Option<Id<NSUserNotificationAction>>;
221 }
222);
223
224extern_methods!(
225 #[cfg(feature = "Foundation_NSUserNotification")]
227 unsafe impl NSUserNotification {
228 #[method_id(@__retain_semantics New new)]
229 pub unsafe fn new() -> Id<Self>;
230 }
231);
232
233extern_class!(
234 #[derive(Debug, PartialEq, Eq, Hash)]
235 #[cfg(feature = "Foundation_NSUserNotificationAction")]
236 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
237 pub struct NSUserNotificationAction;
238
239 #[cfg(feature = "Foundation_NSUserNotificationAction")]
240 unsafe impl ClassType for NSUserNotificationAction {
241 type Super = NSObject;
242 type Mutability = InteriorMutable;
243 }
244);
245
246#[cfg(feature = "Foundation_NSUserNotificationAction")]
247unsafe impl NSCopying for NSUserNotificationAction {}
248
249#[cfg(feature = "Foundation_NSUserNotificationAction")]
250unsafe impl NSObjectProtocol for NSUserNotificationAction {}
251
252extern_methods!(
253 #[cfg(feature = "Foundation_NSUserNotificationAction")]
254 unsafe impl NSUserNotificationAction {
255 #[cfg(feature = "Foundation_NSString")]
256 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
257 #[method_id(@__retain_semantics Other actionWithIdentifier:title:)]
258 pub unsafe fn actionWithIdentifier_title(
259 identifier: Option<&NSString>,
260 title: Option<&NSString>,
261 ) -> Id<Self>;
262
263 #[cfg(feature = "Foundation_NSString")]
264 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
265 #[method_id(@__retain_semantics Other identifier)]
266 pub unsafe fn identifier(&self) -> Option<Id<NSString>>;
267
268 #[cfg(feature = "Foundation_NSString")]
269 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
270 #[method_id(@__retain_semantics Other title)]
271 pub unsafe fn title(&self) -> Option<Id<NSString>>;
272 }
273);
274
275extern_methods!(
276 #[cfg(feature = "Foundation_NSUserNotificationAction")]
278 unsafe impl NSUserNotificationAction {
279 #[method_id(@__retain_semantics Init init)]
280 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
281
282 #[method_id(@__retain_semantics New new)]
283 pub unsafe fn new() -> Id<Self>;
284 }
285);
286
287extern_static!(NSUserNotificationDefaultSoundName: &'static NSString);
288
289extern_class!(
290 #[derive(Debug, PartialEq, Eq, Hash)]
291 #[cfg(feature = "Foundation_NSUserNotificationCenter")]
292 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
293 pub struct NSUserNotificationCenter;
294
295 #[cfg(feature = "Foundation_NSUserNotificationCenter")]
296 unsafe impl ClassType for NSUserNotificationCenter {
297 type Super = NSObject;
298 type Mutability = InteriorMutable;
299 }
300);
301
302#[cfg(feature = "Foundation_NSUserNotificationCenter")]
303unsafe impl NSObjectProtocol for NSUserNotificationCenter {}
304
305extern_methods!(
306 #[cfg(feature = "Foundation_NSUserNotificationCenter")]
307 unsafe impl NSUserNotificationCenter {
308 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
309 #[method_id(@__retain_semantics Other defaultUserNotificationCenter)]
310 pub unsafe fn defaultUserNotificationCenter() -> Id<NSUserNotificationCenter>;
311
312 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
313 #[method_id(@__retain_semantics Other delegate)]
314 pub unsafe fn delegate(
315 &self,
316 ) -> Option<Id<ProtocolObject<dyn NSUserNotificationCenterDelegate>>>;
317
318 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
319 #[method(setDelegate:)]
320 pub unsafe fn setDelegate(
321 &self,
322 delegate: Option<&ProtocolObject<dyn NSUserNotificationCenterDelegate>>,
323 );
324
325 #[cfg(all(
326 feature = "Foundation_NSArray",
327 feature = "Foundation_NSUserNotification"
328 ))]
329 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
330 #[method_id(@__retain_semantics Other scheduledNotifications)]
331 pub unsafe fn scheduledNotifications(&self) -> Id<NSArray<NSUserNotification>>;
332
333 #[cfg(all(
334 feature = "Foundation_NSArray",
335 feature = "Foundation_NSUserNotification"
336 ))]
337 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
338 #[method(setScheduledNotifications:)]
339 pub unsafe fn setScheduledNotifications(
340 &self,
341 scheduled_notifications: &NSArray<NSUserNotification>,
342 );
343
344 #[cfg(feature = "Foundation_NSUserNotification")]
345 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
346 #[method(scheduleNotification:)]
347 pub unsafe fn scheduleNotification(&self, notification: &NSUserNotification);
348
349 #[cfg(feature = "Foundation_NSUserNotification")]
350 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
351 #[method(removeScheduledNotification:)]
352 pub unsafe fn removeScheduledNotification(&self, notification: &NSUserNotification);
353
354 #[cfg(all(
355 feature = "Foundation_NSArray",
356 feature = "Foundation_NSUserNotification"
357 ))]
358 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
359 #[method_id(@__retain_semantics Other deliveredNotifications)]
360 pub unsafe fn deliveredNotifications(&self) -> Id<NSArray<NSUserNotification>>;
361
362 #[cfg(feature = "Foundation_NSUserNotification")]
363 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
364 #[method(deliverNotification:)]
365 pub unsafe fn deliverNotification(&self, notification: &NSUserNotification);
366
367 #[cfg(feature = "Foundation_NSUserNotification")]
368 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
369 #[method(removeDeliveredNotification:)]
370 pub unsafe fn removeDeliveredNotification(&self, notification: &NSUserNotification);
371
372 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
373 #[method(removeAllDeliveredNotifications)]
374 pub unsafe fn removeAllDeliveredNotifications(&self);
375 }
376);
377
378extern_methods!(
379 #[cfg(feature = "Foundation_NSUserNotificationCenter")]
381 unsafe impl NSUserNotificationCenter {
382 #[method_id(@__retain_semantics Init init)]
383 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
384
385 #[method_id(@__retain_semantics New new)]
386 pub unsafe fn new() -> Id<Self>;
387 }
388);
389
390extern_protocol!(
391 pub unsafe trait NSUserNotificationCenterDelegate: NSObjectProtocol {
392 #[cfg(all(
393 feature = "Foundation_NSUserNotification",
394 feature = "Foundation_NSUserNotificationCenter"
395 ))]
396 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
397 #[optional]
398 #[method(userNotificationCenter:didDeliverNotification:)]
399 unsafe fn userNotificationCenter_didDeliverNotification(
400 &self,
401 center: &NSUserNotificationCenter,
402 notification: &NSUserNotification,
403 );
404
405 #[cfg(all(
406 feature = "Foundation_NSUserNotification",
407 feature = "Foundation_NSUserNotificationCenter"
408 ))]
409 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
410 #[optional]
411 #[method(userNotificationCenter:didActivateNotification:)]
412 unsafe fn userNotificationCenter_didActivateNotification(
413 &self,
414 center: &NSUserNotificationCenter,
415 notification: &NSUserNotification,
416 );
417
418 #[cfg(all(
419 feature = "Foundation_NSUserNotification",
420 feature = "Foundation_NSUserNotificationCenter"
421 ))]
422 #[deprecated = "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"]
423 #[optional]
424 #[method(userNotificationCenter:shouldPresentNotification:)]
425 unsafe fn userNotificationCenter_shouldPresentNotification(
426 &self,
427 center: &NSUserNotificationCenter,
428 notification: &NSUserNotification,
429 ) -> bool;
430 }
431
432 unsafe impl ProtocolType for dyn NSUserNotificationCenterDelegate {}
433);