objc2_media_player/generated/
MPPlayableContentDataSource.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    /// MPPlayableContentDataSource is a protocol that application objects conform to
12    /// if they want to support external media players, such as vehicle head units.
13    /// Data sources are responsible for providing metadata about your media to these
14    /// systems in a meaningful way, so that features like user interfaces and play
15    /// queues can be setup automatically.
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpplayablecontentdatasource?language=objc)
18    #[deprecated = "Use CarPlay framework"]
19    pub unsafe trait MPPlayableContentDataSource: NSObjectProtocol {
20        #[cfg(feature = "block2")]
21        /// Tells the data source to begin loading content items that are children of the
22        /// item specified by indexPath. This is provided so that applications can begin
23        /// asynchronous batched loading of content before MediaPlayer begins asking for
24        /// content items to display.
25        /// Client applications should always call the completion handler after loading
26        /// has finished, if this method is implemented.
27        #[deprecated = "Use CarPlay framework"]
28        #[optional]
29        #[unsafe(method(beginLoadingChildItemsAtIndexPath:completionHandler:))]
30        #[unsafe(method_family = none)]
31        unsafe fn beginLoadingChildItemsAtIndexPath_completionHandler(
32            &self,
33            index_path: &NSIndexPath,
34            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
35        );
36
37        /// Tells MediaPlayer whether the content provided by the data source supports
38        /// playback progress as a property of its metadata.
39        /// If this method is not implemented, MediaPlayer will assume that progress is
40        /// not supported for any content items.
41        #[deprecated = "Use CarPlay framework"]
42        #[optional]
43        #[unsafe(method(childItemsDisplayPlaybackProgressAtIndexPath:))]
44        #[unsafe(method_family = none)]
45        unsafe fn childItemsDisplayPlaybackProgressAtIndexPath(
46            &self,
47            index_path: &NSIndexPath,
48        ) -> bool;
49
50        #[cfg(all(feature = "MPContentItem", feature = "block2"))]
51        /// Provides a content item for the provided identifier.
52        /// Provide nil if there is no content item corresponding to the identifier.
53        /// Provide an error if there is an error that will not allow content items
54        /// to be retrieved.
55        /// Client applications should always call the completion handler after loading
56        /// has finished, if this method is implemented.
57        #[deprecated = "Use CarPlay framework"]
58        #[optional]
59        #[unsafe(method(contentItemForIdentifier:completionHandler:))]
60        #[unsafe(method_family = none)]
61        unsafe fn contentItemForIdentifier_completionHandler(
62            &self,
63            identifier: &NSString,
64            completion_handler: &block2::DynBlock<dyn Fn(*mut MPContentItem, *mut NSError)>,
65        );
66
67        /// Returns the number of child nodes at the specified index path. In a virtual
68        /// filesystem, this would be the number of files in a specific folder. An empty
69        /// index path represents the root node.
70        #[deprecated = "Use CarPlay framework"]
71        #[unsafe(method(numberOfChildItemsAtIndexPath:))]
72        #[unsafe(method_family = none)]
73        unsafe fn numberOfChildItemsAtIndexPath(&self, index_path: &NSIndexPath) -> NSInteger;
74
75        #[cfg(feature = "MPContentItem")]
76        /// Returns the content item at the specified index path. If the content item is
77        /// mutated after returning, its updated contents will be sent to MediaPlayer.
78        #[deprecated = "Use CarPlay framework"]
79        #[unsafe(method(contentItemAtIndexPath:))]
80        #[unsafe(method_family = none)]
81        unsafe fn contentItemAtIndexPath(
82            &self,
83            index_path: &NSIndexPath,
84        ) -> Option<Retained<MPContentItem>>;
85    }
86);