objc2_user_notifications/generated/
UNNotificationSettings.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9#[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#[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#[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#[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 #[unsafe(super(NSObject))]
104 #[derive(Debug, PartialEq, Eq, Hash)]
105 pub struct UNNotificationSettings;
106);
107
108unsafe impl NSCoding for UNNotificationSettings {}
109
110unsafe impl NSCopying for UNNotificationSettings {}
111
112unsafe impl CopyingHelper for UNNotificationSettings {
113 type Result = Self;
114}
115
116unsafe impl NSObjectProtocol for UNNotificationSettings {}
117
118unsafe impl NSSecureCoding for UNNotificationSettings {}
119
120impl UNNotificationSettings {
121 extern_methods!(
122 #[unsafe(method(authorizationStatus))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn authorizationStatus(&self) -> UNAuthorizationStatus;
125
126 #[unsafe(method(soundSetting))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn soundSetting(&self) -> UNNotificationSetting;
129
130 #[unsafe(method(badgeSetting))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn badgeSetting(&self) -> UNNotificationSetting;
133
134 #[unsafe(method(alertSetting))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn alertSetting(&self) -> UNNotificationSetting;
137
138 #[unsafe(method(notificationCenterSetting))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn notificationCenterSetting(&self) -> UNNotificationSetting;
141
142 #[unsafe(method(lockScreenSetting))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn lockScreenSetting(&self) -> UNNotificationSetting;
145
146 #[unsafe(method(carPlaySetting))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn carPlaySetting(&self) -> UNNotificationSetting;
149
150 #[unsafe(method(alertStyle))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn alertStyle(&self) -> UNAlertStyle;
153
154 #[unsafe(method(showPreviewsSetting))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn showPreviewsSetting(&self) -> UNShowPreviewsSetting;
157
158 #[unsafe(method(criticalAlertSetting))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn criticalAlertSetting(&self) -> UNNotificationSetting;
161
162 #[unsafe(method(providesAppNotificationSettings))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn providesAppNotificationSettings(&self) -> bool;
165
166 #[unsafe(method(announcementSetting))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn announcementSetting(&self) -> UNNotificationSetting;
169
170 #[unsafe(method(timeSensitiveSetting))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn timeSensitiveSetting(&self) -> UNNotificationSetting;
173
174 #[unsafe(method(scheduledDeliverySetting))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn scheduledDeliverySetting(&self) -> UNNotificationSetting;
177
178 #[unsafe(method(directMessagesSetting))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn directMessagesSetting(&self) -> UNNotificationSetting;
181
182 #[unsafe(method(init))]
183 #[unsafe(method_family = init)]
184 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
185 );
186}
187
188impl UNNotificationSettings {
190 extern_methods!(
191 #[unsafe(method(new))]
192 #[unsafe(method_family = new)]
193 pub unsafe fn new() -> Retained<Self>;
194 );
195}