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

use crate::*;

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

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

impl MPMusicPlayerQueueDescriptor {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

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

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

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

impl MPMusicPlayerMediaItemQueueDescriptor {
    extern_methods!(
        #[cfg(feature = "MPMediaQuery")]
        #[unsafe(method(initWithQuery:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithQuery(this: Allocated<Self>, query: &MPMediaQuery) -> Retained<Self>;

        #[cfg(all(feature = "MPMediaEntity", feature = "MPMediaItemCollection"))]
        #[unsafe(method(initWithItemCollection:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithItemCollection(
            this: Allocated<Self>,
            item_collection: &MPMediaItemCollection,
        ) -> Retained<Self>;

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

        #[cfg(all(feature = "MPMediaEntity", feature = "MPMediaItemCollection"))]
        #[unsafe(method(itemCollection))]
        #[unsafe(method_family = none)]
        pub unsafe fn itemCollection(&self) -> Retained<MPMediaItemCollection>;

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

        #[cfg(all(feature = "MPMediaEntity", feature = "MPMediaItem"))]
        /// Setter for [`startItem`][Self::startItem].
        #[unsafe(method(setStartItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStartItem(&self, start_item: Option<&MPMediaItem>);

        #[cfg(all(feature = "MPMediaEntity", feature = "MPMediaItem"))]
        #[unsafe(method(setStartTime:forItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStartTime_forItem(
            &self,
            start_time: NSTimeInterval,
            media_item: &MPMediaItem,
        );

        #[cfg(all(feature = "MPMediaEntity", feature = "MPMediaItem"))]
        #[unsafe(method(setEndTime:forItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEndTime_forItem(&self, end_time: NSTimeInterval, media_item: &MPMediaItem);
    );
}

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

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

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

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

impl MPMusicPlayerStoreQueueDescriptor {
    extern_methods!(
        #[unsafe(method(initWithStoreIDs:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithStoreIDs(
            this: Allocated<Self>,
            store_i_ds: &NSArray<NSString>,
        ) -> Retained<Self>;

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

        /// Setter for [`storeIDs`][Self::storeIDs].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setStoreIDs:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStoreIDs(&self, store_i_ds: Option<&NSArray<NSString>>);

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

        /// Setter for [`startItemID`][Self::startItemID].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setStartItemID:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStartItemID(&self, start_item_id: Option<&NSString>);

        #[unsafe(method(setStartTime:forItemWithStoreID:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStartTime_forItemWithStoreID(
            &self,
            start_time: NSTimeInterval,
            store_id: &NSString,
        );

        #[unsafe(method(setEndTime:forItemWithStoreID:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEndTime_forItemWithStoreID(
            &self,
            end_time: NSTimeInterval,
            store_id: &NSString,
        );
    );
}

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

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

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

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

impl MPMusicPlayerPlayParameters {
    extern_methods!(
        /// # Safety
        ///
        /// `dictionary` generic should be of the correct type.
        #[unsafe(method(initWithDictionary:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDictionary(
            this: Allocated<Self>,
            dictionary: &NSDictionary<NSString, AnyObject>,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(dictionary))]
        #[unsafe(method_family = none)]
        pub unsafe fn dictionary(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl MPMusicPlayerPlayParameters {
    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>;
    );
}

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

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

impl MPMusicPlayerPlayParametersQueueDescriptor {
    extern_methods!(
        #[unsafe(method(initWithPlayParametersQueue:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithPlayParametersQueue(
            this: Allocated<Self>,
            play_parameters_queue: &NSArray<MPMusicPlayerPlayParameters>,
        ) -> Retained<Self>;

        #[unsafe(method(playParametersQueue))]
        #[unsafe(method_family = none)]
        pub unsafe fn playParametersQueue(&self) -> Retained<NSArray<MPMusicPlayerPlayParameters>>;

        /// Setter for [`playParametersQueue`][Self::playParametersQueue].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPlayParametersQueue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPlayParametersQueue(
            &self,
            play_parameters_queue: &NSArray<MPMusicPlayerPlayParameters>,
        );

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

        /// Setter for [`startItemPlayParameters`][Self::startItemPlayParameters].
        #[unsafe(method(setStartItemPlayParameters:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStartItemPlayParameters(
            &self,
            start_item_play_parameters: Option<&MPMusicPlayerPlayParameters>,
        );

        #[unsafe(method(setStartTime:forItemWithPlayParameters:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStartTime_forItemWithPlayParameters(
            &self,
            start_time: NSTimeInterval,
            play_parameters: &MPMusicPlayerPlayParameters,
        );

        #[unsafe(method(setEndTime:forItemWithPlayParameters:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEndTime_forItemWithPlayParameters(
            &self,
            end_time: NSTimeInterval,
            play_parameters: &MPMusicPlayerPlayParameters,
        );
    );
}

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

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