use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UNAuthorizationStatus(pub NSInteger);
impl UNAuthorizationStatus {
#[doc(alias = "UNAuthorizationStatusNotDetermined")]
pub const NotDetermined: Self = Self(0);
#[doc(alias = "UNAuthorizationStatusDenied")]
pub const Denied: Self = Self(1);
#[doc(alias = "UNAuthorizationStatusAuthorized")]
pub const Authorized: Self = Self(2);
#[doc(alias = "UNAuthorizationStatusProvisional")]
pub const Provisional: Self = Self(3);
#[doc(alias = "UNAuthorizationStatusEphemeral")]
pub const Ephemeral: Self = Self(4);
}
unsafe impl Encode for UNAuthorizationStatus {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UNAuthorizationStatus {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UNShowPreviewsSetting(pub NSInteger);
impl UNShowPreviewsSetting {
#[doc(alias = "UNShowPreviewsSettingAlways")]
pub const Always: Self = Self(0);
#[doc(alias = "UNShowPreviewsSettingWhenAuthenticated")]
pub const WhenAuthenticated: Self = Self(1);
#[doc(alias = "UNShowPreviewsSettingNever")]
pub const Never: Self = Self(2);
}
unsafe impl Encode for UNShowPreviewsSetting {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UNShowPreviewsSetting {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UNNotificationSetting(pub NSInteger);
impl UNNotificationSetting {
#[doc(alias = "UNNotificationSettingNotSupported")]
pub const NotSupported: Self = Self(0);
#[doc(alias = "UNNotificationSettingDisabled")]
pub const Disabled: Self = Self(1);
#[doc(alias = "UNNotificationSettingEnabled")]
pub const Enabled: Self = Self(2);
}
unsafe impl Encode for UNNotificationSetting {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UNNotificationSetting {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UNAlertStyle(pub NSInteger);
impl UNAlertStyle {
#[doc(alias = "UNAlertStyleNone")]
pub const None: Self = Self(0);
#[doc(alias = "UNAlertStyleBanner")]
pub const Banner: Self = Self(1);
#[doc(alias = "UNAlertStyleAlert")]
pub const Alert: Self = Self(2);
}
unsafe impl Encode for UNAlertStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UNAlertStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UNNotificationSettings;
);
extern_conformance!(
unsafe impl NSCoding for UNNotificationSettings {}
);
extern_conformance!(
unsafe impl NSCopying for UNNotificationSettings {}
);
unsafe impl CopyingHelper for UNNotificationSettings {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UNNotificationSettings {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UNNotificationSettings {}
);
impl UNNotificationSettings {
extern_methods!(
#[unsafe(method(authorizationStatus))]
#[unsafe(method_family = none)]
pub fn authorizationStatus(&self) -> UNAuthorizationStatus;
#[unsafe(method(soundSetting))]
#[unsafe(method_family = none)]
pub fn soundSetting(&self) -> UNNotificationSetting;
#[unsafe(method(badgeSetting))]
#[unsafe(method_family = none)]
pub fn badgeSetting(&self) -> UNNotificationSetting;
#[unsafe(method(alertSetting))]
#[unsafe(method_family = none)]
pub fn alertSetting(&self) -> UNNotificationSetting;
#[unsafe(method(notificationCenterSetting))]
#[unsafe(method_family = none)]
pub fn notificationCenterSetting(&self) -> UNNotificationSetting;
#[unsafe(method(lockScreenSetting))]
#[unsafe(method_family = none)]
pub fn lockScreenSetting(&self) -> UNNotificationSetting;
#[unsafe(method(carPlaySetting))]
#[unsafe(method_family = none)]
pub fn carPlaySetting(&self) -> UNNotificationSetting;
#[unsafe(method(alertStyle))]
#[unsafe(method_family = none)]
pub fn alertStyle(&self) -> UNAlertStyle;
#[unsafe(method(showPreviewsSetting))]
#[unsafe(method_family = none)]
pub fn showPreviewsSetting(&self) -> UNShowPreviewsSetting;
#[unsafe(method(criticalAlertSetting))]
#[unsafe(method_family = none)]
pub fn criticalAlertSetting(&self) -> UNNotificationSetting;
#[unsafe(method(providesAppNotificationSettings))]
#[unsafe(method_family = none)]
pub fn providesAppNotificationSettings(&self) -> bool;
#[unsafe(method(announcementSetting))]
#[unsafe(method_family = none)]
pub fn announcementSetting(&self) -> UNNotificationSetting;
#[unsafe(method(timeSensitiveSetting))]
#[unsafe(method_family = none)]
pub fn timeSensitiveSetting(&self) -> UNNotificationSetting;
#[unsafe(method(scheduledDeliverySetting))]
#[unsafe(method_family = none)]
pub fn scheduledDeliverySetting(&self) -> UNNotificationSetting;
#[unsafe(method(directMessagesSetting))]
#[unsafe(method_family = none)]
pub fn directMessagesSetting(&self) -> UNNotificationSetting;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl UNNotificationSettings {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}