objc2_media_player/generated/
MPMediaItemCollection.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpmediaitemcollection?language=objc)
11    #[unsafe(super(MPMediaEntity, NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    #[cfg(feature = "MPMediaEntity")]
14    pub struct MPMediaItemCollection;
15);
16
17#[cfg(feature = "MPMediaEntity")]
18unsafe impl NSCoding for MPMediaItemCollection {}
19
20#[cfg(feature = "MPMediaEntity")]
21unsafe impl NSObjectProtocol for MPMediaItemCollection {}
22
23#[cfg(feature = "MPMediaEntity")]
24unsafe impl NSSecureCoding for MPMediaItemCollection {}
25
26#[cfg(feature = "MPMediaEntity")]
27impl MPMediaItemCollection {
28    extern_methods!(
29        #[cfg(feature = "MPMediaItem")]
30        #[unsafe(method(collectionWithItems:))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn collectionWithItems(
33            items: &NSArray<MPMediaItem>,
34        ) -> Retained<MPMediaItemCollection>;
35
36        #[cfg(feature = "MPMediaItem")]
37        #[unsafe(method(initWithItems:))]
38        #[unsafe(method_family = init)]
39        pub unsafe fn initWithItems(
40            this: Allocated<Self>,
41            items: &NSArray<MPMediaItem>,
42        ) -> Retained<Self>;
43
44        #[cfg(feature = "MPMediaItem")]
45        #[unsafe(method(items))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn items(&self) -> Retained<NSArray<MPMediaItem>>;
48
49        #[cfg(feature = "MPMediaItem")]
50        #[unsafe(method(representativeItem))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn representativeItem(&self) -> Option<Retained<MPMediaItem>>;
53
54        #[unsafe(method(count))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn count(&self) -> NSUInteger;
57
58        #[cfg(feature = "MPMediaItem")]
59        #[unsafe(method(mediaTypes))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn mediaTypes(&self) -> MPMediaType;
62    );
63}
64
65/// Methods declared on superclass `NSObject`.
66#[cfg(feature = "MPMediaEntity")]
67impl MPMediaItemCollection {
68    extern_methods!(
69        #[unsafe(method(init))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
72
73        #[unsafe(method(new))]
74        #[unsafe(method_family = new)]
75        pub unsafe fn new() -> Retained<Self>;
76    );
77}