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
16extern_conformance!(
17    unsafe impl NSObjectProtocol for UNNotificationServiceExtension {}
18);
19
20impl UNNotificationServiceExtension {
21    extern_methods!(
22        #[cfg(all(
23            feature = "UNNotificationContent",
24            feature = "UNNotificationRequest",
25            feature = "block2"
26        ))]
27        #[unsafe(method(didReceiveNotificationRequest:withContentHandler:))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn didReceiveNotificationRequest_withContentHandler(
30            &self,
31            request: &UNNotificationRequest,
32            content_handler: &block2::DynBlock<dyn Fn(NonNull<UNNotificationContent>)>,
33        );
34
35        #[unsafe(method(serviceExtensionTimeWillExpire))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn serviceExtensionTimeWillExpire(&self);
38    );
39}
40
41/// Methods declared on superclass `NSObject`.
42impl UNNotificationServiceExtension {
43    extern_methods!(
44        #[unsafe(method(init))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
47
48        #[unsafe(method(new))]
49        #[unsafe(method_family = new)]
50        pub unsafe fn new() -> Retained<Self>;
51    );
52}