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::Block<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::Block<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        #[deprecated = "Use Intents framework for initiating playback queues."]
64        #[optional]
65        #[unsafe(method(playableContentManager:initializePlaybackQueueWithContentItems:completionHandler:))]
66        #[unsafe(method_family = none)]
67        unsafe fn playableContentManager_initializePlaybackQueueWithContentItems_completionHandler(
68            &self,
69            content_manager: &MPPlayableContentManager,
70            content_items: Option<&NSArray>,
71            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
72        );
73
74        #[cfg(all(
75            feature = "MPPlayableContentManager",
76            feature = "MPPlayableContentManagerContext"
77        ))]
78        /// This method is called when the content server notifies the manager that the current context has changed.
79        #[deprecated = "Use CarPlay framework"]
80        #[optional]
81        #[unsafe(method(playableContentManager:didUpdateContext:))]
82        #[unsafe(method_family = none)]
83        unsafe fn playableContentManager_didUpdateContext(
84            &self,
85            content_manager: &MPPlayableContentManager,
86            context: &MPPlayableContentManagerContext,
87        );
88    }
89);