objc2_av_foundation/generated/
AVMediaSelection.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_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmediaselection?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct AVMediaSelection;
15);
16
17extern_conformance!(
18    unsafe impl NSCopying for AVMediaSelection {}
19);
20
21unsafe impl CopyingHelper for AVMediaSelection {
22    type Result = Self;
23}
24
25extern_conformance!(
26    unsafe impl NSMutableCopying for AVMediaSelection {}
27);
28
29unsafe impl MutableCopyingHelper for AVMediaSelection {
30    type Result = AVMutableMediaSelection;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for AVMediaSelection {}
35);
36
37impl AVMediaSelection {
38    extern_methods!(
39        #[cfg(feature = "AVAsset")]
40        #[unsafe(method(asset))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn asset(&self) -> Option<Retained<AVAsset>>;
43
44        #[cfg(feature = "AVMediaSelectionGroup")]
45        /// Indicates the media selection option that's currently selected from the specified group. May be nil.
46        ///
47        /// Parameter `mediaSelectionGroup`: A media selection group obtained from the receiver's asset.
48        ///
49        /// Returns: An instance of AVMediaSelectionOption that describes the currently selection option in the group.
50        ///
51        /// If the value of the property allowsEmptySelection of the AVMediaSelectionGroup is YES, the currently selected option in the group may be nil.
52        #[unsafe(method(selectedMediaOptionInMediaSelectionGroup:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn selectedMediaOptionInMediaSelectionGroup(
55            &self,
56            media_selection_group: &AVMediaSelectionGroup,
57        ) -> Option<Retained<AVMediaSelectionOption>>;
58
59        #[cfg(feature = "AVMediaSelectionGroup")]
60        /// Indicates that specified media selection group is subject to automatic media selection.
61        ///
62        /// Parameter `mediaSelectionGroup`: A media selection group obtained from the receiver's asset.
63        ///
64        /// Returns: YES if the group is subject to automatic media selection.
65        ///
66        /// Automatic application of media selection criteria is suspended in any group in which a specific selection has been made via an invocation of -selectMediaOption:inMediaSelectionGroup:.
67        #[unsafe(method(mediaSelectionCriteriaCanBeAppliedAutomaticallyToMediaSelectionGroup:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn mediaSelectionCriteriaCanBeAppliedAutomaticallyToMediaSelectionGroup(
70            &self,
71            media_selection_group: &AVMediaSelectionGroup,
72        ) -> bool;
73    );
74}
75
76/// Methods declared on superclass `NSObject`.
77impl AVMediaSelection {
78    extern_methods!(
79        #[unsafe(method(init))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83        #[unsafe(method(new))]
84        #[unsafe(method_family = new)]
85        pub unsafe fn new() -> Retained<Self>;
86    );
87}
88
89extern_class!(
90    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmutablemediaselection?language=objc)
91    #[unsafe(super(AVMediaSelection, NSObject))]
92    #[derive(Debug, PartialEq, Eq, Hash)]
93    pub struct AVMutableMediaSelection;
94);
95
96extern_conformance!(
97    unsafe impl NSCopying for AVMutableMediaSelection {}
98);
99
100unsafe impl CopyingHelper for AVMutableMediaSelection {
101    type Result = AVMediaSelection;
102}
103
104extern_conformance!(
105    unsafe impl NSMutableCopying for AVMutableMediaSelection {}
106);
107
108unsafe impl MutableCopyingHelper for AVMutableMediaSelection {
109    type Result = Self;
110}
111
112extern_conformance!(
113    unsafe impl NSObjectProtocol for AVMutableMediaSelection {}
114);
115
116impl AVMutableMediaSelection {
117    extern_methods!(
118        #[cfg(feature = "AVMediaSelectionGroup")]
119        /// Selects the media option described by the specified instance of AVMediaSelectionOption in the specified AVMediaSelectionGroup and deselects all other options in that group.
120        ///
121        /// Parameter `mediaSelectionOption`: The option to select.
122        ///
123        /// Parameter `mediaSelectionGroup`: The media selection group, obtained from the receiver's asset, that contains the specified option.
124        ///
125        /// If the specified media selection option isn't a member of the specified media selection group, no change in presentation state will result.
126        /// If the value of the property allowsEmptySelection of the AVMediaSelectionGroup is YES, you can pass nil for mediaSelectionOption to deselect all media selection options in the group.
127        #[unsafe(method(selectMediaOption:inMediaSelectionGroup:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn selectMediaOption_inMediaSelectionGroup(
130            &self,
131            media_selection_option: Option<&AVMediaSelectionOption>,
132            media_selection_group: &AVMediaSelectionGroup,
133        );
134    );
135}
136
137/// Methods declared on superclass `NSObject`.
138impl AVMutableMediaSelection {
139    extern_methods!(
140        #[unsafe(method(init))]
141        #[unsafe(method_family = init)]
142        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
143
144        #[unsafe(method(new))]
145        #[unsafe(method_family = new)]
146        pub unsafe fn new() -> Retained<Self>;
147    );
148}