objc2_user_notifications/generated/
UNNotificationSettings.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unauthorizationstatus?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct UNAuthorizationStatus(pub NSInteger);
14impl UNAuthorizationStatus {
15    #[doc(alias = "UNAuthorizationStatusNotDetermined")]
16    pub const NotDetermined: Self = Self(0);
17    #[doc(alias = "UNAuthorizationStatusDenied")]
18    pub const Denied: Self = Self(1);
19    #[doc(alias = "UNAuthorizationStatusAuthorized")]
20    pub const Authorized: Self = Self(2);
21    #[doc(alias = "UNAuthorizationStatusProvisional")]
22    pub const Provisional: Self = Self(3);
23    #[doc(alias = "UNAuthorizationStatusEphemeral")]
24    pub const Ephemeral: Self = Self(4);
25}
26
27unsafe impl Encode for UNAuthorizationStatus {
28    const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for UNAuthorizationStatus {
32    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35/// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unshowpreviewssetting?language=objc)
36// NS_ENUM
37#[repr(transparent)]
38#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
39pub struct UNShowPreviewsSetting(pub NSInteger);
40impl UNShowPreviewsSetting {
41    #[doc(alias = "UNShowPreviewsSettingAlways")]
42    pub const Always: Self = Self(0);
43    #[doc(alias = "UNShowPreviewsSettingWhenAuthenticated")]
44    pub const WhenAuthenticated: Self = Self(1);
45    #[doc(alias = "UNShowPreviewsSettingNever")]
46    pub const Never: Self = Self(2);
47}
48
49unsafe impl Encode for UNShowPreviewsSetting {
50    const ENCODING: Encoding = NSInteger::ENCODING;
51}
52
53unsafe impl RefEncode for UNShowPreviewsSetting {
54    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
55}
56
57/// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationsetting?language=objc)
58// NS_ENUM
59#[repr(transparent)]
60#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
61pub struct UNNotificationSetting(pub NSInteger);
62impl UNNotificationSetting {
63    #[doc(alias = "UNNotificationSettingNotSupported")]
64    pub const NotSupported: Self = Self(0);
65    #[doc(alias = "UNNotificationSettingDisabled")]
66    pub const Disabled: Self = Self(1);
67    #[doc(alias = "UNNotificationSettingEnabled")]
68    pub const Enabled: Self = Self(2);
69}
70
71unsafe impl Encode for UNNotificationSetting {
72    const ENCODING: Encoding = NSInteger::ENCODING;
73}
74
75unsafe impl RefEncode for UNNotificationSetting {
76    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
77}
78
79/// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unalertstyle?language=objc)
80// NS_ENUM
81#[repr(transparent)]
82#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
83pub struct UNAlertStyle(pub NSInteger);
84impl UNAlertStyle {
85    #[doc(alias = "UNAlertStyleNone")]
86    pub const None: Self = Self(0);
87    #[doc(alias = "UNAlertStyleBanner")]
88    pub const Banner: Self = Self(1);
89    #[doc(alias = "UNAlertStyleAlert")]
90    pub const Alert: Self = Self(2);
91}
92
93unsafe impl Encode for UNAlertStyle {
94    const ENCODING: Encoding = NSInteger::ENCODING;
95}
96
97unsafe impl RefEncode for UNAlertStyle {
98    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
99}
100
101extern_class!(
102    /// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationsettings?language=objc)
103    #[unsafe(super(NSObject))]
104    #[derive(Debug, PartialEq, Eq, Hash)]
105    pub struct UNNotificationSettings;
106);
107
108extern_conformance!(
109    unsafe impl NSCoding for UNNotificationSettings {}
110);
111
112extern_conformance!(
113    unsafe impl NSCopying for UNNotificationSettings {}
114);
115
116unsafe impl CopyingHelper for UNNotificationSettings {
117    type Result = Self;
118}
119
120extern_conformance!(
121    unsafe impl NSObjectProtocol for UNNotificationSettings {}
122);
123
124extern_conformance!(
125    unsafe impl NSSecureCoding for UNNotificationSettings {}
126);
127
128impl UNNotificationSettings {
129    extern_methods!(
130        #[unsafe(method(authorizationStatus))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn authorizationStatus(&self) -> UNAuthorizationStatus;
133
134        #[unsafe(method(soundSetting))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn soundSetting(&self) -> UNNotificationSetting;
137
138        #[unsafe(method(badgeSetting))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn badgeSetting(&self) -> UNNotificationSetting;
141
142        #[unsafe(method(alertSetting))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn alertSetting(&self) -> UNNotificationSetting;
145
146        #[unsafe(method(notificationCenterSetting))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn notificationCenterSetting(&self) -> UNNotificationSetting;
149
150        #[unsafe(method(lockScreenSetting))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn lockScreenSetting(&self) -> UNNotificationSetting;
153
154        #[unsafe(method(carPlaySetting))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn carPlaySetting(&self) -> UNNotificationSetting;
157
158        #[unsafe(method(alertStyle))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn alertStyle(&self) -> UNAlertStyle;
161
162        #[unsafe(method(showPreviewsSetting))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn showPreviewsSetting(&self) -> UNShowPreviewsSetting;
165
166        #[unsafe(method(criticalAlertSetting))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn criticalAlertSetting(&self) -> UNNotificationSetting;
169
170        #[unsafe(method(providesAppNotificationSettings))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn providesAppNotificationSettings(&self) -> bool;
173
174        #[unsafe(method(announcementSetting))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn announcementSetting(&self) -> UNNotificationSetting;
177
178        #[unsafe(method(timeSensitiveSetting))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn timeSensitiveSetting(&self) -> UNNotificationSetting;
181
182        #[unsafe(method(scheduledDeliverySetting))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn scheduledDeliverySetting(&self) -> UNNotificationSetting;
185
186        #[unsafe(method(directMessagesSetting))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn directMessagesSetting(&self) -> UNNotificationSetting;
189
190        #[unsafe(method(init))]
191        #[unsafe(method_family = init)]
192        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
193    );
194}
195
196/// Methods declared on superclass `NSObject`.
197impl UNNotificationSettings {
198    extern_methods!(
199        #[unsafe(method(new))]
200        #[unsafe(method_family = new)]
201        pub unsafe fn new() -> Retained<Self>;
202    );
203}