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::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

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

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

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

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

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

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

impl UNNotificationAttachment {
    extern_methods!(
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub fn identifier(&self) -> Retained<NSString>;

        #[unsafe(method(URL))]
        #[unsafe(method_family = none)]
        pub fn URL(&self) -> Retained<NSURL>;

        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        pub fn r#type(&self) -> Retained<NSString>;

        /// # Safety
        ///
        /// `options` generic should be of the correct type.
        #[unsafe(method(attachmentWithIdentifier:URL:options:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn attachmentWithIdentifier_URL_options_error(
            identifier: &NSString,
            url: &NSURL,
            options: Option<&NSDictionary>,
        ) -> Result<Retained<Self>, Retained<NSError>>;

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

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

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationattachmentoptionstypehintkey?language=objc)
    pub static UNNotificationAttachmentOptionsTypeHintKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationattachmentoptionsthumbnailhiddenkey?language=objc)
    pub static UNNotificationAttachmentOptionsThumbnailHiddenKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationattachmentoptionsthumbnailclippingrectkey?language=objc)
    pub static UNNotificationAttachmentOptionsThumbnailClippingRectKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/usernotifications/unnotificationattachmentoptionsthumbnailtimekey?language=objc)
    pub static UNNotificationAttachmentOptionsThumbnailTimeKey: &'static NSString;
}