objc2_media_player/generated/
MPPlayableContentDelegate.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_protocol!(
11    /// The MPPlayableContentDelegate is a protocol that allows for external media
12    /// players to send playback commands to an application. For instance,
13    /// the user could browse the application's media content (provided by the
14    /// MPPlayableContentDataSource) and selects a content item to play. If the media
15    /// player decides that it wants to play the item, it will ask the application's
16    /// content delegate to initiate playback.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpplayablecontentdelegate?language=objc)
19    #[deprecated = "Use CarPlay framework"]
20    pub unsafe trait MPPlayableContentDelegate: NSObjectProtocol {
21        #[cfg(all(feature = "MPPlayableContentManager", feature = "block2"))]
22        /// This method is called when a media player interface wants to play a requested
23        /// content item. The application should call the completion handler with an
24        /// appropriate error if there was an error beginning playback for the item.
25        #[deprecated = "Use CarPlay framework"]
26        #[optional]
27        #[unsafe(method(playableContentManager:initiatePlaybackOfContentItemAtIndexPath:completionHandler:))]
28        #[unsafe(method_family = none)]
29        unsafe fn playableContentManager_initiatePlaybackOfContentItemAtIndexPath_completionHandler(
30            &self,
31            content_manager: &MPPlayableContentManager,
32            index_path: &NSIndexPath,
33            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
34        );
35
36        #[cfg(all(feature = "MPPlayableContentManager", feature = "block2"))]
37        /// This method is called when a media player interface wants the now playing
38        /// app to setup a playback queue for later playback. The application should
39        /// load content into its play queue but not start playback until a Play command is
40        /// received or if the playable content manager requests to play something else.
41        /// The app should call the provided completion handler once it is ready to play
42        /// something.
43        #[deprecated = "Use Intents framework for initiating playback queues."]
44        #[optional]
45        #[unsafe(method(playableContentManager:initializePlaybackQueueWithCompletionHandler:))]
46        #[unsafe(method_family = none)]
47        unsafe fn playableContentManager_initializePlaybackQueueWithCompletionHandler(
48            &self,
49            content_manager: &MPPlayableContentManager,
50            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
51        );
52
53        #[cfg(all(feature = "MPPlayableContentManager", feature = "block2"))]
54        /// This method is called when a media player interface wants the now playing
55        /// app to setup a playback queue for later playback. The application should
56        /// load content into its play queue based on the provided content items and
57        /// prepare it for playback, but not start playback until a Play command is
58        /// received or if the playable content manager requests to play something else.
59        /// A nil contentItems array means that the app should prepare its queue with
60        /// anything it deems appropriate.
61        /// The app should call the provided completion handler once it is ready to play
62        /// something.
63        ///
64        /// # Safety
65        ///
66        /// `content_items` generic should be of the correct type.
67        #[deprecated = "Use Intents framework for initiating playback queues."]
68        #[optional]
69        #[unsafe(method(playableContentManager:initializePlaybackQueueWithContentItems:completionHandler:))]
70        #[unsafe(method_family = none)]
71        unsafe fn playableContentManager_initializePlaybackQueueWithContentItems_completionHandler(
72            &self,
73            content_manager: &MPPlayableContentManager,
74            content_items: Option<&NSArray>,
75            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
76        );
77
78        #[cfg(all(
79            feature = "MPPlayableContentManager",
80            feature = "MPPlayableContentManagerContext"
81        ))]
82        /// This method is called when the content server notifies the manager that the current context has changed.
83        #[deprecated = "Use CarPlay framework"]
84        #[optional]
85        #[unsafe(method(playableContentManager:didUpdateContext:))]
86        #[unsafe(method_family = none)]
87        unsafe fn playableContentManager_didUpdateContext(
88            &self,
89            content_manager: &MPPlayableContentManager,
90            context: &MPPlayableContentManagerContext,
91        );
92    }
93);