objc2_media_player/generated/
MPMediaEntity.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
10/// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpmediaentitypersistentid?language=objc)
11pub type MPMediaEntityPersistentID = u64;
12
13extern "C" {
14    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpmediaentitypropertypersistentid?language=objc)
15    pub static MPMediaEntityPropertyPersistentID: &'static NSString;
16}
17
18extern_class!(
19    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpmediaentity?language=objc)
20    #[unsafe(super(NSObject))]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    pub struct MPMediaEntity;
23);
24
25extern_conformance!(
26    unsafe impl NSCoding for MPMediaEntity {}
27);
28
29extern_conformance!(
30    unsafe impl NSObjectProtocol for MPMediaEntity {}
31);
32
33extern_conformance!(
34    unsafe impl NSSecureCoding for MPMediaEntity {}
35);
36
37impl MPMediaEntity {
38    extern_methods!(
39        #[unsafe(method(canFilterByProperty:))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn canFilterByProperty(property: &NSString) -> bool;
42
43        #[cfg(feature = "block2")]
44        #[unsafe(method(enumerateValuesForProperties:usingBlock:))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn enumerateValuesForProperties_usingBlock(
47            &self,
48            properties: &NSSet<NSString>,
49            block: &block2::DynBlock<dyn Fn(NonNull<NSString>, NonNull<AnyObject>, NonNull<Bool>)>,
50        );
51
52        #[unsafe(method(objectForKeyedSubscript:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn objectForKeyedSubscript(
55            &self,
56            key: &AnyObject,
57        ) -> Option<Retained<AnyObject>>;
58
59        #[unsafe(method(valueForProperty:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn valueForProperty(&self, property: &NSString) -> Option<Retained<AnyObject>>;
62
63        #[unsafe(method(persistentID))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn persistentID(&self) -> MPMediaEntityPersistentID;
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl MPMediaEntity {
71    extern_methods!(
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new() -> Retained<Self>;
79    );
80}