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