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!(
    /// MPPlayableContentManager is a class that manages the interactions between a
    /// media application and an external media player interface. The application
    /// provides the content manager with a data source, which allows the media player
    /// to browse the media content offered by the application, as well as a delegate,
    /// which allows the media player to relay non-media remote playback commands to the application.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpplayablecontentmanager?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "Use CarPlay framework"]
    pub struct MPPlayableContentManager;
);

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

impl MPPlayableContentManager {
    extern_methods!(
        #[cfg(feature = "MPPlayableContentDataSource")]
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(dataSource))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataSource(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn MPPlayableContentDataSource>>>;

        #[cfg(feature = "MPPlayableContentDataSource")]
        /// Setter for [`dataSource`][Self::dataSource].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(setDataSource:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDataSource(
            &self,
            data_source: Option<&ProtocolObject<dyn MPPlayableContentDataSource>>,
        );

        #[cfg(feature = "MPPlayableContentDelegate")]
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn MPPlayableContentDelegate>>>;

        #[cfg(feature = "MPPlayableContentDelegate")]
        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn MPPlayableContentDelegate>>,
        );

        #[cfg(feature = "MPPlayableContentManagerContext")]
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(context))]
        #[unsafe(method_family = none)]
        pub unsafe fn context(&self) -> Retained<MPPlayableContentManagerContext>;

        /// Tells the content manager which MPContentItems are currently playing based on their identifiers.
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(nowPlayingIdentifiers))]
        #[unsafe(method_family = none)]
        pub unsafe fn nowPlayingIdentifiers(&self) -> Retained<NSArray<NSString>>;

        /// Setter for [`nowPlayingIdentifiers`][Self::nowPlayingIdentifiers].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(setNowPlayingIdentifiers:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNowPlayingIdentifiers(&self, now_playing_identifiers: &NSArray<NSString>);

        /// Returns the application's instance of the content manager.
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(sharedContentManager))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedContentManager() -> Retained<Self>;

        /// Tells the content manager that the data source has changed and that we need to
        /// reload data from the data source.
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(reloadData))]
        #[unsafe(method_family = none)]
        pub unsafe fn reloadData(&self);

        /// Used to begin a synchronized update to multiple MPContentItems at once.
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(beginUpdates))]
        #[unsafe(method_family = none)]
        pub unsafe fn beginUpdates(&self);

        /// Ends a synchronized update.
        #[deprecated = "Use CarPlay framework"]
        #[unsafe(method(endUpdates))]
        #[unsafe(method_family = none)]
        pub unsafe fn endUpdates(&self);
    );
}

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