objc2_user_notifications/generated/
UNNotificationContent.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 pub unsafe trait UNNotificationContentProviding: NSObjectProtocol {}
13);
14
15#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct UNNotificationInterruptionLevel(pub NSUInteger);
20impl UNNotificationInterruptionLevel {
21 #[doc(alias = "UNNotificationInterruptionLevelPassive")]
22 pub const Passive: Self = Self(0);
23 #[doc(alias = "UNNotificationInterruptionLevelActive")]
24 pub const Active: Self = Self(1);
25 #[doc(alias = "UNNotificationInterruptionLevelTimeSensitive")]
26 pub const TimeSensitive: Self = Self(2);
27 #[doc(alias = "UNNotificationInterruptionLevelCritical")]
28 pub const Critical: Self = Self(3);
29}
30
31unsafe impl Encode for UNNotificationInterruptionLevel {
32 const ENCODING: Encoding = NSUInteger::ENCODING;
33}
34
35unsafe impl RefEncode for UNNotificationInterruptionLevel {
36 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39extern_class!(
40 #[unsafe(super(NSObject))]
42 #[derive(Debug, PartialEq, Eq, Hash)]
43 pub struct UNNotificationContent;
44);
45
46extern_conformance!(
47 unsafe impl NSCoding for UNNotificationContent {}
48);
49
50extern_conformance!(
51 unsafe impl NSCopying for UNNotificationContent {}
52);
53
54unsafe impl CopyingHelper for UNNotificationContent {
55 type Result = Self;
56}
57
58extern_conformance!(
59 unsafe impl NSMutableCopying for UNNotificationContent {}
60);
61
62unsafe impl MutableCopyingHelper for UNNotificationContent {
63 type Result = UNMutableNotificationContent;
64}
65
66extern_conformance!(
67 unsafe impl NSObjectProtocol for UNNotificationContent {}
68);
69
70extern_conformance!(
71 unsafe impl NSSecureCoding for UNNotificationContent {}
72);
73
74impl UNNotificationContent {
75 extern_methods!(
76 #[cfg(feature = "UNNotificationAttachment")]
77 #[unsafe(method(attachments))]
78 #[unsafe(method_family = none)]
79 pub fn attachments(&self) -> Retained<NSArray<UNNotificationAttachment>>;
80
81 #[unsafe(method(badge))]
82 #[unsafe(method_family = none)]
83 pub fn badge(&self) -> Option<Retained<NSNumber>>;
84
85 #[unsafe(method(body))]
86 #[unsafe(method_family = none)]
87 pub fn body(&self) -> Retained<NSString>;
88
89 #[unsafe(method(categoryIdentifier))]
90 #[unsafe(method_family = none)]
91 pub fn categoryIdentifier(&self) -> Retained<NSString>;
92
93 #[unsafe(method(launchImageName))]
94 #[unsafe(method_family = none)]
95 pub fn launchImageName(&self) -> Retained<NSString>;
96
97 #[cfg(feature = "UNNotificationSound")]
98 #[unsafe(method(sound))]
99 #[unsafe(method_family = none)]
100 pub fn sound(&self) -> Option<Retained<UNNotificationSound>>;
101
102 #[unsafe(method(subtitle))]
103 #[unsafe(method_family = none)]
104 pub fn subtitle(&self) -> Retained<NSString>;
105
106 #[unsafe(method(threadIdentifier))]
107 #[unsafe(method_family = none)]
108 pub fn threadIdentifier(&self) -> Retained<NSString>;
109
110 #[unsafe(method(title))]
111 #[unsafe(method_family = none)]
112 pub fn title(&self) -> Retained<NSString>;
113
114 #[unsafe(method(userInfo))]
115 #[unsafe(method_family = none)]
116 pub fn userInfo(&self) -> Retained<NSDictionary>;
117
118 #[deprecated = "summaryArgument is ignored"]
120 #[unsafe(method(summaryArgument))]
121 #[unsafe(method_family = none)]
122 pub fn summaryArgument(&self) -> Retained<NSString>;
123
124 #[deprecated = "summaryArgumentCount is ignored"]
129 #[unsafe(method(summaryArgumentCount))]
130 #[unsafe(method_family = none)]
131 pub fn summaryArgumentCount(&self) -> NSUInteger;
132
133 #[unsafe(method(targetContentIdentifier))]
134 #[unsafe(method_family = none)]
135 pub fn targetContentIdentifier(&self) -> Option<Retained<NSString>>;
136
137 #[unsafe(method(interruptionLevel))]
138 #[unsafe(method_family = none)]
139 pub fn interruptionLevel(&self) -> UNNotificationInterruptionLevel;
140
141 #[unsafe(method(relevanceScore))]
142 #[unsafe(method_family = none)]
143 pub fn relevanceScore(&self) -> c_double;
144
145 #[unsafe(method(filterCriteria))]
146 #[unsafe(method_family = none)]
147 pub fn filterCriteria(&self) -> Option<Retained<NSString>>;
148
149 #[unsafe(method(contentByUpdatingWithProvider:error:_))]
155 #[unsafe(method_family = none)]
156 pub fn contentByUpdatingWithProvider_error(
157 &self,
158 provider: &ProtocolObject<dyn UNNotificationContentProviding>,
159 ) -> Result<Retained<UNNotificationContent>, Retained<NSError>>;
160 );
161}
162
163impl UNNotificationContent {
165 extern_methods!(
166 #[unsafe(method(init))]
167 #[unsafe(method_family = init)]
168 pub fn init(this: Allocated<Self>) -> Retained<Self>;
169
170 #[unsafe(method(new))]
171 #[unsafe(method_family = new)]
172 pub fn new() -> Retained<Self>;
173 );
174}
175
176impl DefaultRetained for UNNotificationContent {
177 #[inline]
178 fn default_retained() -> Retained<Self> {
179 Self::new()
180 }
181}
182
183extern_class!(
184 #[unsafe(super(UNNotificationContent, NSObject))]
186 #[derive(Debug, PartialEq, Eq, Hash)]
187 pub struct UNMutableNotificationContent;
188);
189
190extern_conformance!(
191 unsafe impl NSCoding for UNMutableNotificationContent {}
192);
193
194extern_conformance!(
195 unsafe impl NSCopying for UNMutableNotificationContent {}
196);
197
198unsafe impl CopyingHelper for UNMutableNotificationContent {
199 type Result = UNNotificationContent;
200}
201
202extern_conformance!(
203 unsafe impl NSMutableCopying for UNMutableNotificationContent {}
204);
205
206unsafe impl MutableCopyingHelper for UNMutableNotificationContent {
207 type Result = Self;
208}
209
210extern_conformance!(
211 unsafe impl NSObjectProtocol for UNMutableNotificationContent {}
212);
213
214extern_conformance!(
215 unsafe impl NSSecureCoding for UNMutableNotificationContent {}
216);
217
218impl UNMutableNotificationContent {
219 extern_methods!(
220 #[cfg(feature = "UNNotificationAttachment")]
221 #[unsafe(method(attachments))]
222 #[unsafe(method_family = none)]
223 pub fn attachments(&self) -> Retained<NSArray<UNNotificationAttachment>>;
224
225 #[cfg(feature = "UNNotificationAttachment")]
226 #[unsafe(method(setAttachments:))]
230 #[unsafe(method_family = none)]
231 pub fn setAttachments(&self, attachments: &NSArray<UNNotificationAttachment>);
232
233 #[unsafe(method(badge))]
234 #[unsafe(method_family = none)]
235 pub fn badge(&self) -> Option<Retained<NSNumber>>;
236
237 #[unsafe(method(setBadge:))]
241 #[unsafe(method_family = none)]
242 pub fn setBadge(&self, badge: Option<&NSNumber>);
243
244 #[unsafe(method(body))]
245 #[unsafe(method_family = none)]
246 pub fn body(&self) -> Retained<NSString>;
247
248 #[unsafe(method(setBody:))]
252 #[unsafe(method_family = none)]
253 pub fn setBody(&self, body: &NSString);
254
255 #[unsafe(method(categoryIdentifier))]
256 #[unsafe(method_family = none)]
257 pub fn categoryIdentifier(&self) -> Retained<NSString>;
258
259 #[unsafe(method(setCategoryIdentifier:))]
263 #[unsafe(method_family = none)]
264 pub fn setCategoryIdentifier(&self, category_identifier: &NSString);
265
266 #[unsafe(method(launchImageName))]
267 #[unsafe(method_family = none)]
268 pub fn launchImageName(&self) -> Retained<NSString>;
269
270 #[unsafe(method(setLaunchImageName:))]
274 #[unsafe(method_family = none)]
275 pub fn setLaunchImageName(&self, launch_image_name: &NSString);
276
277 #[cfg(feature = "UNNotificationSound")]
278 #[unsafe(method(sound))]
279 #[unsafe(method_family = none)]
280 pub fn sound(&self) -> Option<Retained<UNNotificationSound>>;
281
282 #[cfg(feature = "UNNotificationSound")]
283 #[unsafe(method(setSound:))]
287 #[unsafe(method_family = none)]
288 pub fn setSound(&self, sound: Option<&UNNotificationSound>);
289
290 #[unsafe(method(subtitle))]
291 #[unsafe(method_family = none)]
292 pub fn subtitle(&self) -> Retained<NSString>;
293
294 #[unsafe(method(setSubtitle:))]
298 #[unsafe(method_family = none)]
299 pub fn setSubtitle(&self, subtitle: &NSString);
300
301 #[unsafe(method(threadIdentifier))]
302 #[unsafe(method_family = none)]
303 pub fn threadIdentifier(&self) -> Retained<NSString>;
304
305 #[unsafe(method(setThreadIdentifier:))]
309 #[unsafe(method_family = none)]
310 pub fn setThreadIdentifier(&self, thread_identifier: &NSString);
311
312 #[unsafe(method(title))]
313 #[unsafe(method_family = none)]
314 pub fn title(&self) -> Retained<NSString>;
315
316 #[unsafe(method(setTitle:))]
320 #[unsafe(method_family = none)]
321 pub fn setTitle(&self, title: &NSString);
322
323 #[unsafe(method(userInfo))]
324 #[unsafe(method_family = none)]
325 pub fn userInfo(&self) -> Retained<NSDictionary>;
326
327 #[unsafe(method(setUserInfo:))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn setUserInfo(&self, user_info: &NSDictionary);
337
338 #[deprecated = "summaryArgument is ignored"]
340 #[unsafe(method(summaryArgument))]
341 #[unsafe(method_family = none)]
342 pub fn summaryArgument(&self) -> Retained<NSString>;
343
344 #[deprecated = "summaryArgument is ignored"]
348 #[unsafe(method(setSummaryArgument:))]
349 #[unsafe(method_family = none)]
350 pub fn setSummaryArgument(&self, summary_argument: &NSString);
351
352 #[deprecated = "summaryArgumentCount is ignored"]
357 #[unsafe(method(summaryArgumentCount))]
358 #[unsafe(method_family = none)]
359 pub fn summaryArgumentCount(&self) -> NSUInteger;
360
361 #[deprecated = "summaryArgumentCount is ignored"]
363 #[unsafe(method(setSummaryArgumentCount:))]
364 #[unsafe(method_family = none)]
365 pub fn setSummaryArgumentCount(&self, summary_argument_count: NSUInteger);
366
367 #[unsafe(method(targetContentIdentifier))]
368 #[unsafe(method_family = none)]
369 pub fn targetContentIdentifier(&self) -> Option<Retained<NSString>>;
370
371 #[unsafe(method(setTargetContentIdentifier:))]
375 #[unsafe(method_family = none)]
376 pub fn setTargetContentIdentifier(&self, target_content_identifier: Option<&NSString>);
377
378 #[unsafe(method(interruptionLevel))]
379 #[unsafe(method_family = none)]
380 pub fn interruptionLevel(&self) -> UNNotificationInterruptionLevel;
381
382 #[unsafe(method(setInterruptionLevel:))]
384 #[unsafe(method_family = none)]
385 pub fn setInterruptionLevel(&self, interruption_level: UNNotificationInterruptionLevel);
386
387 #[unsafe(method(relevanceScore))]
388 #[unsafe(method_family = none)]
389 pub fn relevanceScore(&self) -> c_double;
390
391 #[unsafe(method(setRelevanceScore:))]
393 #[unsafe(method_family = none)]
394 pub fn setRelevanceScore(&self, relevance_score: c_double);
395
396 #[unsafe(method(filterCriteria))]
397 #[unsafe(method_family = none)]
398 pub fn filterCriteria(&self) -> Option<Retained<NSString>>;
399
400 #[unsafe(method(setFilterCriteria:))]
404 #[unsafe(method_family = none)]
405 pub fn setFilterCriteria(&self, filter_criteria: Option<&NSString>);
406 );
407}
408
409impl UNMutableNotificationContent {
411 extern_methods!(
412 #[unsafe(method(init))]
413 #[unsafe(method_family = init)]
414 pub fn init(this: Allocated<Self>) -> Retained<Self>;
415
416 #[unsafe(method(new))]
417 #[unsafe(method_family = new)]
418 pub fn new() -> Retained<Self>;
419 );
420}
421
422impl DefaultRetained for UNMutableNotificationContent {
423 #[inline]
424 fn default_retained() -> Retained<Self> {
425 Self::new()
426 }
427}