objc2_media_player/generated/
MPPlayableContentManager.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// MPPlayableContentManager is a class that manages the interactions between a
12    /// media application and an external media player interface. The application
13    /// provides the content manager with a data source, which allows the media player
14    /// to browse the media content offered by the application, as well as a delegate,
15    /// which allows the media player to relay non-media remote playback commands to the application.
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpplayablecontentmanager?language=objc)
18    #[unsafe(super(NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[deprecated = "Use CarPlay framework"]
21    pub struct MPPlayableContentManager;
22);
23
24extern_conformance!(
25    unsafe impl NSObjectProtocol for MPPlayableContentManager {}
26);
27
28impl MPPlayableContentManager {
29    extern_methods!(
30        #[cfg(feature = "MPPlayableContentDataSource")]
31        #[deprecated = "Use CarPlay framework"]
32        #[unsafe(method(dataSource))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn dataSource(
35            &self,
36        ) -> Option<Retained<ProtocolObject<dyn MPPlayableContentDataSource>>>;
37
38        #[cfg(feature = "MPPlayableContentDataSource")]
39        /// Setter for [`dataSource`][Self::dataSource].
40        ///
41        /// This is a [weak property][objc2::topics::weak_property].
42        #[deprecated = "Use CarPlay framework"]
43        #[unsafe(method(setDataSource:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn setDataSource(
46            &self,
47            data_source: Option<&ProtocolObject<dyn MPPlayableContentDataSource>>,
48        );
49
50        #[cfg(feature = "MPPlayableContentDelegate")]
51        #[deprecated = "Use CarPlay framework"]
52        #[unsafe(method(delegate))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn delegate(
55            &self,
56        ) -> Option<Retained<ProtocolObject<dyn MPPlayableContentDelegate>>>;
57
58        #[cfg(feature = "MPPlayableContentDelegate")]
59        /// Setter for [`delegate`][Self::delegate].
60        ///
61        /// This is a [weak property][objc2::topics::weak_property].
62        #[deprecated = "Use CarPlay framework"]
63        #[unsafe(method(setDelegate:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn setDelegate(
66            &self,
67            delegate: Option<&ProtocolObject<dyn MPPlayableContentDelegate>>,
68        );
69
70        #[cfg(feature = "MPPlayableContentManagerContext")]
71        #[deprecated = "Use CarPlay framework"]
72        #[unsafe(method(context))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn context(&self) -> Retained<MPPlayableContentManagerContext>;
75
76        /// Tells the content manager which MPContentItems are currently playing based on their identifiers.
77        #[deprecated = "Use CarPlay framework"]
78        #[unsafe(method(nowPlayingIdentifiers))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn nowPlayingIdentifiers(&self) -> Retained<NSArray<NSString>>;
81
82        /// Setter for [`nowPlayingIdentifiers`][Self::nowPlayingIdentifiers].
83        ///
84        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
85        #[deprecated = "Use CarPlay framework"]
86        #[unsafe(method(setNowPlayingIdentifiers:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn setNowPlayingIdentifiers(&self, now_playing_identifiers: &NSArray<NSString>);
89
90        /// Returns the application's instance of the content manager.
91        #[deprecated = "Use CarPlay framework"]
92        #[unsafe(method(sharedContentManager))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn sharedContentManager() -> Retained<Self>;
95
96        /// Tells the content manager that the data source has changed and that we need to
97        /// reload data from the data source.
98        #[deprecated = "Use CarPlay framework"]
99        #[unsafe(method(reloadData))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn reloadData(&self);
102
103        /// Used to begin a synchronized update to multiple MPContentItems at once.
104        #[deprecated = "Use CarPlay framework"]
105        #[unsafe(method(beginUpdates))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn beginUpdates(&self);
108
109        /// Ends a synchronized update.
110        #[deprecated = "Use CarPlay framework"]
111        #[unsafe(method(endUpdates))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn endUpdates(&self);
114    );
115}
116
117/// Methods declared on superclass `NSObject`.
118impl MPPlayableContentManager {
119    extern_methods!(
120        #[unsafe(method(init))]
121        #[unsafe(method_family = init)]
122        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
123
124        #[unsafe(method(new))]
125        #[unsafe(method_family = new)]
126        pub unsafe fn new() -> Retained<Self>;
127    );
128}