1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[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);
}

// NS_ENUM
#[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);
}

// NS_ENUM
#[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);
}

// NS_ENUM
#[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!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UNNotificationSettings;

    unsafe impl ClassType for UNNotificationSettings {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for UNNotificationSettings {}

unsafe impl NSCopying for UNNotificationSettings {}

unsafe impl NSObjectProtocol for UNNotificationSettings {}

unsafe impl NSSecureCoding for UNNotificationSettings {}

extern_methods!(
    unsafe impl UNNotificationSettings {
        #[method(authorizationStatus)]
        pub unsafe fn authorizationStatus(&self) -> UNAuthorizationStatus;

        #[method(soundSetting)]
        pub unsafe fn soundSetting(&self) -> UNNotificationSetting;

        #[method(badgeSetting)]
        pub unsafe fn badgeSetting(&self) -> UNNotificationSetting;

        #[method(alertSetting)]
        pub unsafe fn alertSetting(&self) -> UNNotificationSetting;

        #[method(notificationCenterSetting)]
        pub unsafe fn notificationCenterSetting(&self) -> UNNotificationSetting;

        #[method(lockScreenSetting)]
        pub unsafe fn lockScreenSetting(&self) -> UNNotificationSetting;

        #[method(carPlaySetting)]
        pub unsafe fn carPlaySetting(&self) -> UNNotificationSetting;

        #[method(alertStyle)]
        pub unsafe fn alertStyle(&self) -> UNAlertStyle;

        #[method(showPreviewsSetting)]
        pub unsafe fn showPreviewsSetting(&self) -> UNShowPreviewsSetting;

        #[method(criticalAlertSetting)]
        pub unsafe fn criticalAlertSetting(&self) -> UNNotificationSetting;

        #[method(providesAppNotificationSettings)]
        pub unsafe fn providesAppNotificationSettings(&self) -> bool;

        #[method(announcementSetting)]
        pub unsafe fn announcementSetting(&self) -> UNNotificationSetting;

        #[method(timeSensitiveSetting)]
        pub unsafe fn timeSensitiveSetting(&self) -> UNNotificationSetting;

        #[method(scheduledDeliverySetting)]
        pub unsafe fn scheduledDeliverySetting(&self) -> UNNotificationSetting;

        #[method(directMessagesSetting)]
        pub unsafe fn directMessagesSetting(&self) -> UNNotificationSetting;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl UNNotificationSettings {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);