objc2-user-notifications 0.3.2

Bindings to the UserNotifications framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationsoundname?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type UNNotificationSoundName = NSString;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationsound?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UNNotificationSound;
);

extern_conformance!(
    unsafe impl NSCoding for UNNotificationSound {}
);

extern_conformance!(
    unsafe impl NSCopying for UNNotificationSound {}
);

unsafe impl CopyingHelper for UNNotificationSound {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for UNNotificationSound {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for UNNotificationSound {}
);

impl UNNotificationSound {
    extern_methods!(
        #[unsafe(method(defaultSound))]
        #[unsafe(method_family = none)]
        pub fn defaultSound() -> Retained<UNNotificationSound>;

        #[unsafe(method(defaultRingtoneSound))]
        #[unsafe(method_family = none)]
        pub fn defaultRingtoneSound() -> Retained<UNNotificationSound>;

        #[unsafe(method(defaultCriticalSound))]
        #[unsafe(method_family = none)]
        pub fn defaultCriticalSound() -> Retained<UNNotificationSound>;

        #[unsafe(method(defaultCriticalSoundWithAudioVolume:))]
        #[unsafe(method_family = none)]
        pub fn defaultCriticalSoundWithAudioVolume(volume: c_float) -> Retained<Self>;

        #[unsafe(method(soundNamed:))]
        #[unsafe(method_family = none)]
        pub fn soundNamed(name: &UNNotificationSoundName) -> Retained<Self>;

        #[unsafe(method(ringtoneSoundNamed:))]
        #[unsafe(method_family = none)]
        pub fn ringtoneSoundNamed(name: &UNNotificationSoundName) -> Retained<Self>;

        #[unsafe(method(criticalSoundNamed:))]
        #[unsafe(method_family = none)]
        pub fn criticalSoundNamed(name: &UNNotificationSoundName) -> Retained<Self>;

        #[unsafe(method(criticalSoundNamed:withAudioVolume:))]
        #[unsafe(method_family = none)]
        pub fn criticalSoundNamed_withAudioVolume(
            name: &UNNotificationSoundName,
            volume: c_float,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl UNNotificationSound {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}