objc2-media-player 0.3.2

Bindings to the MediaPlayer 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/mediaplayer/mpmediaitemcollection?language=objc)
    #[unsafe(super(MPMediaEntity, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "MPMediaEntity")]
    pub struct MPMediaItemCollection;
);

#[cfg(feature = "MPMediaEntity")]
extern_conformance!(
    unsafe impl NSCoding for MPMediaItemCollection {}
);

#[cfg(feature = "MPMediaEntity")]
extern_conformance!(
    unsafe impl NSObjectProtocol for MPMediaItemCollection {}
);

#[cfg(feature = "MPMediaEntity")]
extern_conformance!(
    unsafe impl NSSecureCoding for MPMediaItemCollection {}
);

#[cfg(feature = "MPMediaEntity")]
impl MPMediaItemCollection {
    extern_methods!(
        #[cfg(feature = "MPMediaItem")]
        #[unsafe(method(collectionWithItems:))]
        #[unsafe(method_family = none)]
        pub unsafe fn collectionWithItems(
            items: &NSArray<MPMediaItem>,
        ) -> Retained<MPMediaItemCollection>;

        #[cfg(feature = "MPMediaItem")]
        #[unsafe(method(initWithItems:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithItems(
            this: Allocated<Self>,
            items: &NSArray<MPMediaItem>,
        ) -> Retained<Self>;

        #[cfg(feature = "MPMediaItem")]
        #[unsafe(method(items))]
        #[unsafe(method_family = none)]
        pub unsafe fn items(&self) -> Retained<NSArray<MPMediaItem>>;

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

        #[unsafe(method(count))]
        #[unsafe(method_family = none)]
        pub unsafe fn count(&self) -> NSUInteger;

        #[cfg(feature = "MPMediaItem")]
        #[unsafe(method(mediaTypes))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaTypes(&self) -> MPMediaType;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "MPMediaEntity")]
impl MPMediaItemCollection {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}