objc2_user_notifications/generated/
UNNotificationServiceExtension.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
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct UNNotificationServiceExtension;
14);
15
16unsafe impl NSObjectProtocol for UNNotificationServiceExtension {}
17
18impl UNNotificationServiceExtension {
19    extern_methods!(
20        #[cfg(all(
21            feature = "UNNotificationContent",
22            feature = "UNNotificationRequest",
23            feature = "block2"
24        ))]
25        #[unsafe(method(didReceiveNotificationRequest:withContentHandler:))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn didReceiveNotificationRequest_withContentHandler(
28            &self,
29            request: &UNNotificationRequest,
30            content_handler: &block2::Block<dyn Fn(NonNull<UNNotificationContent>)>,
31        );
32
33        #[unsafe(method(serviceExtensionTimeWillExpire))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn serviceExtensionTimeWillExpire(&self);
36    );
37}
38
39/// Methods declared on superclass `NSObject`.
40impl UNNotificationServiceExtension {
41    extern_methods!(
42        #[unsafe(method(init))]
43        #[unsafe(method_family = init)]
44        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
45
46        #[unsafe(method(new))]
47        #[unsafe(method_family = new)]
48        pub unsafe fn new() -> Retained<Self>;
49    );
50}