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 unsafe fn attachments(&self) -> Retained<NSArray<UNNotificationAttachment>>;
80
81 #[unsafe(method(badge))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn badge(&self) -> Option<Retained<NSNumber>>;
84
85 #[unsafe(method(body))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn body(&self) -> Retained<NSString>;
88
89 #[unsafe(method(categoryIdentifier))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn categoryIdentifier(&self) -> Retained<NSString>;
92
93 #[unsafe(method(launchImageName))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn launchImageName(&self) -> Retained<NSString>;
96
97 #[cfg(feature = "UNNotificationSound")]
98 #[unsafe(method(sound))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn sound(&self) -> Option<Retained<UNNotificationSound>>;
101
102 #[unsafe(method(subtitle))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn subtitle(&self) -> Retained<NSString>;
105
106 #[unsafe(method(threadIdentifier))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn threadIdentifier(&self) -> Retained<NSString>;
109
110 #[unsafe(method(title))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn title(&self) -> Retained<NSString>;
113
114 #[unsafe(method(userInfo))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn userInfo(&self) -> Retained<NSDictionary>;
117
118 #[deprecated = "summaryArgument is ignored"]
120 #[unsafe(method(summaryArgument))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn summaryArgument(&self) -> Retained<NSString>;
123
124 #[deprecated = "summaryArgumentCount is ignored"]
129 #[unsafe(method(summaryArgumentCount))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn summaryArgumentCount(&self) -> NSUInteger;
132
133 #[unsafe(method(targetContentIdentifier))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn targetContentIdentifier(&self) -> Option<Retained<NSString>>;
136
137 #[unsafe(method(interruptionLevel))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn interruptionLevel(&self) -> UNNotificationInterruptionLevel;
140
141 #[unsafe(method(relevanceScore))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn relevanceScore(&self) -> c_double;
144
145 #[unsafe(method(filterCriteria))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn filterCriteria(&self) -> Option<Retained<NSString>>;
148
149 #[unsafe(method(contentByUpdatingWithProvider:error:_))]
155 #[unsafe(method_family = none)]
156 pub unsafe 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 unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
169
170 #[unsafe(method(new))]
171 #[unsafe(method_family = new)]
172 pub unsafe fn new() -> Retained<Self>;
173 );
174}
175
176extern_class!(
177 #[unsafe(super(UNNotificationContent, NSObject))]
179 #[derive(Debug, PartialEq, Eq, Hash)]
180 pub struct UNMutableNotificationContent;
181);
182
183extern_conformance!(
184 unsafe impl NSCoding for UNMutableNotificationContent {}
185);
186
187extern_conformance!(
188 unsafe impl NSCopying for UNMutableNotificationContent {}
189);
190
191unsafe impl CopyingHelper for UNMutableNotificationContent {
192 type Result = UNNotificationContent;
193}
194
195extern_conformance!(
196 unsafe impl NSMutableCopying for UNMutableNotificationContent {}
197);
198
199unsafe impl MutableCopyingHelper for UNMutableNotificationContent {
200 type Result = Self;
201}
202
203extern_conformance!(
204 unsafe impl NSObjectProtocol for UNMutableNotificationContent {}
205);
206
207extern_conformance!(
208 unsafe impl NSSecureCoding for UNMutableNotificationContent {}
209);
210
211impl UNMutableNotificationContent {
212 extern_methods!(
213 #[cfg(feature = "UNNotificationAttachment")]
214 #[unsafe(method(attachments))]
215 #[unsafe(method_family = none)]
216 pub unsafe fn attachments(&self) -> Retained<NSArray<UNNotificationAttachment>>;
217
218 #[cfg(feature = "UNNotificationAttachment")]
219 #[unsafe(method(setAttachments:))]
221 #[unsafe(method_family = none)]
222 pub unsafe fn setAttachments(&self, attachments: &NSArray<UNNotificationAttachment>);
223
224 #[unsafe(method(badge))]
225 #[unsafe(method_family = none)]
226 pub unsafe fn badge(&self) -> Option<Retained<NSNumber>>;
227
228 #[unsafe(method(setBadge:))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn setBadge(&self, badge: Option<&NSNumber>);
232
233 #[unsafe(method(body))]
234 #[unsafe(method_family = none)]
235 pub unsafe fn body(&self) -> Retained<NSString>;
236
237 #[unsafe(method(setBody:))]
239 #[unsafe(method_family = none)]
240 pub unsafe fn setBody(&self, body: &NSString);
241
242 #[unsafe(method(categoryIdentifier))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn categoryIdentifier(&self) -> Retained<NSString>;
245
246 #[unsafe(method(setCategoryIdentifier:))]
248 #[unsafe(method_family = none)]
249 pub unsafe fn setCategoryIdentifier(&self, category_identifier: &NSString);
250
251 #[unsafe(method(launchImageName))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn launchImageName(&self) -> Retained<NSString>;
254
255 #[unsafe(method(setLaunchImageName:))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn setLaunchImageName(&self, launch_image_name: &NSString);
259
260 #[cfg(feature = "UNNotificationSound")]
261 #[unsafe(method(sound))]
262 #[unsafe(method_family = none)]
263 pub unsafe fn sound(&self) -> Option<Retained<UNNotificationSound>>;
264
265 #[cfg(feature = "UNNotificationSound")]
266 #[unsafe(method(setSound:))]
268 #[unsafe(method_family = none)]
269 pub unsafe fn setSound(&self, sound: Option<&UNNotificationSound>);
270
271 #[unsafe(method(subtitle))]
272 #[unsafe(method_family = none)]
273 pub unsafe fn subtitle(&self) -> Retained<NSString>;
274
275 #[unsafe(method(setSubtitle:))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn setSubtitle(&self, subtitle: &NSString);
279
280 #[unsafe(method(threadIdentifier))]
281 #[unsafe(method_family = none)]
282 pub unsafe fn threadIdentifier(&self) -> Retained<NSString>;
283
284 #[unsafe(method(setThreadIdentifier:))]
286 #[unsafe(method_family = none)]
287 pub unsafe fn setThreadIdentifier(&self, thread_identifier: &NSString);
288
289 #[unsafe(method(title))]
290 #[unsafe(method_family = none)]
291 pub unsafe fn title(&self) -> Retained<NSString>;
292
293 #[unsafe(method(setTitle:))]
295 #[unsafe(method_family = none)]
296 pub unsafe fn setTitle(&self, title: &NSString);
297
298 #[unsafe(method(userInfo))]
299 #[unsafe(method_family = none)]
300 pub unsafe fn userInfo(&self) -> Retained<NSDictionary>;
301
302 #[unsafe(method(setUserInfo:))]
304 #[unsafe(method_family = none)]
305 pub unsafe fn setUserInfo(&self, user_info: &NSDictionary);
306
307 #[deprecated = "summaryArgument is ignored"]
309 #[unsafe(method(summaryArgument))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn summaryArgument(&self) -> Retained<NSString>;
312
313 #[deprecated = "summaryArgument is ignored"]
315 #[unsafe(method(setSummaryArgument:))]
316 #[unsafe(method_family = none)]
317 pub unsafe fn setSummaryArgument(&self, summary_argument: &NSString);
318
319 #[deprecated = "summaryArgumentCount is ignored"]
324 #[unsafe(method(summaryArgumentCount))]
325 #[unsafe(method_family = none)]
326 pub unsafe fn summaryArgumentCount(&self) -> NSUInteger;
327
328 #[deprecated = "summaryArgumentCount is ignored"]
330 #[unsafe(method(setSummaryArgumentCount:))]
331 #[unsafe(method_family = none)]
332 pub unsafe fn setSummaryArgumentCount(&self, summary_argument_count: NSUInteger);
333
334 #[unsafe(method(targetContentIdentifier))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn targetContentIdentifier(&self) -> Option<Retained<NSString>>;
337
338 #[unsafe(method(setTargetContentIdentifier:))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn setTargetContentIdentifier(
342 &self,
343 target_content_identifier: Option<&NSString>,
344 );
345
346 #[unsafe(method(interruptionLevel))]
347 #[unsafe(method_family = none)]
348 pub unsafe fn interruptionLevel(&self) -> UNNotificationInterruptionLevel;
349
350 #[unsafe(method(setInterruptionLevel:))]
352 #[unsafe(method_family = none)]
353 pub unsafe fn setInterruptionLevel(
354 &self,
355 interruption_level: UNNotificationInterruptionLevel,
356 );
357
358 #[unsafe(method(relevanceScore))]
359 #[unsafe(method_family = none)]
360 pub unsafe fn relevanceScore(&self) -> c_double;
361
362 #[unsafe(method(setRelevanceScore:))]
364 #[unsafe(method_family = none)]
365 pub unsafe fn setRelevanceScore(&self, relevance_score: c_double);
366
367 #[unsafe(method(filterCriteria))]
368 #[unsafe(method_family = none)]
369 pub unsafe fn filterCriteria(&self) -> Option<Retained<NSString>>;
370
371 #[unsafe(method(setFilterCriteria:))]
373 #[unsafe(method_family = none)]
374 pub unsafe fn setFilterCriteria(&self, filter_criteria: Option<&NSString>);
375 );
376}
377
378impl UNMutableNotificationContent {
380 extern_methods!(
381 #[unsafe(method(init))]
382 #[unsafe(method_family = init)]
383 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
384
385 #[unsafe(method(new))]
386 #[unsafe(method_family = new)]
387 pub unsafe fn new() -> Retained<Self>;
388 );
389}