objc2_user_notifications/generated/
UNNotificationSound.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationsoundname?language=objc)
11// NS_TYPED_EXTENSIBLE_ENUM
12pub type UNNotificationSoundName = NSString;
13
14extern_class!(
15    /// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationsound?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct UNNotificationSound;
19);
20
21extern_conformance!(
22    unsafe impl NSCoding for UNNotificationSound {}
23);
24
25extern_conformance!(
26    unsafe impl NSCopying for UNNotificationSound {}
27);
28
29unsafe impl CopyingHelper for UNNotificationSound {
30    type Result = Self;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for UNNotificationSound {}
35);
36
37extern_conformance!(
38    unsafe impl NSSecureCoding for UNNotificationSound {}
39);
40
41impl UNNotificationSound {
42    extern_methods!(
43        #[unsafe(method(defaultSound))]
44        #[unsafe(method_family = none)]
45        pub fn defaultSound() -> Retained<UNNotificationSound>;
46
47        #[unsafe(method(defaultRingtoneSound))]
48        #[unsafe(method_family = none)]
49        pub fn defaultRingtoneSound() -> Retained<UNNotificationSound>;
50
51        #[unsafe(method(defaultCriticalSound))]
52        #[unsafe(method_family = none)]
53        pub fn defaultCriticalSound() -> Retained<UNNotificationSound>;
54
55        #[unsafe(method(defaultCriticalSoundWithAudioVolume:))]
56        #[unsafe(method_family = none)]
57        pub fn defaultCriticalSoundWithAudioVolume(volume: c_float) -> Retained<Self>;
58
59        #[unsafe(method(soundNamed:))]
60        #[unsafe(method_family = none)]
61        pub fn soundNamed(name: &UNNotificationSoundName) -> Retained<Self>;
62
63        #[unsafe(method(ringtoneSoundNamed:))]
64        #[unsafe(method_family = none)]
65        pub fn ringtoneSoundNamed(name: &UNNotificationSoundName) -> Retained<Self>;
66
67        #[unsafe(method(criticalSoundNamed:))]
68        #[unsafe(method_family = none)]
69        pub fn criticalSoundNamed(name: &UNNotificationSoundName) -> Retained<Self>;
70
71        #[unsafe(method(criticalSoundNamed:withAudioVolume:))]
72        #[unsafe(method_family = none)]
73        pub fn criticalSoundNamed_withAudioVolume(
74            name: &UNNotificationSoundName,
75            volume: c_float,
76        ) -> Retained<Self>;
77
78        #[unsafe(method(init))]
79        #[unsafe(method_family = init)]
80        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
81    );
82}
83
84/// Methods declared on superclass `NSObject`.
85impl UNNotificationSound {
86    extern_methods!(
87        #[unsafe(method(new))]
88        #[unsafe(method_family = new)]
89        pub unsafe fn new() -> Retained<Self>;
90    );
91}