objc2-intents 0.3.2

Bindings to the Intents 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/intents/inmediaitem?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct INMediaItem;
);

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

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

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

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

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

impl INMediaItem {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(all(feature = "INImage", feature = "INMediaItemType"))]
        #[unsafe(method(initWithIdentifier:title:type:artwork:artist:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentifier_title_type_artwork_artist(
            this: Allocated<Self>,
            identifier: Option<&NSString>,
            title: Option<&NSString>,
            r#type: INMediaItemType,
            artwork: Option<&INImage>,
            artist: Option<&NSString>,
        ) -> Retained<Self>;

        #[cfg(all(feature = "INImage", feature = "INMediaItemType"))]
        #[unsafe(method(initWithIdentifier:title:type:artwork:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentifier_title_type_artwork(
            this: Allocated<Self>,
            identifier: Option<&NSString>,
            title: Option<&NSString>,
            r#type: INMediaItemType,
            artwork: Option<&INImage>,
        ) -> Retained<Self>;

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

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

        #[cfg(feature = "INMediaItemType")]
        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        pub unsafe fn r#type(&self) -> INMediaItemType;

        #[cfg(feature = "INImage")]
        #[unsafe(method(artwork))]
        #[unsafe(method_family = none)]
        pub unsafe fn artwork(&self) -> Option<Retained<INImage>>;

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

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