use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UNNotificationServiceExtension;
);
extern_conformance!(
unsafe impl NSObjectProtocol for UNNotificationServiceExtension {}
);
impl UNNotificationServiceExtension {
extern_methods!(
#[cfg(all(
feature = "UNNotificationContent",
feature = "UNNotificationRequest",
feature = "block2"
))]
#[unsafe(method(didReceiveNotificationRequest:withContentHandler:))]
#[unsafe(method_family = none)]
pub fn didReceiveNotificationRequest_withContentHandler(
&self,
request: &UNNotificationRequest,
content_handler: &block2::DynBlock<dyn Fn(NonNull<UNNotificationContent>)>,
);
#[unsafe(method(serviceExtensionTimeWillExpire))]
#[unsafe(method_family = none)]
pub fn serviceExtensionTimeWillExpire(&self);
);
}
impl UNNotificationServiceExtension {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for UNNotificationServiceExtension {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}