objc2_media_player/generated/
MPNowPlayingInfoLanguageOption.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 "C" {
10    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicismainprogramcontent?language=objc)
11    pub static MPLanguageOptionCharacteristicIsMainProgramContent: &'static NSString;
12}
13
14extern "C" {
15    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicisauxiliarycontent?language=objc)
16    pub static MPLanguageOptionCharacteristicIsAuxiliaryContent: &'static NSString;
17}
18
19extern "C" {
20    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristiccontainsonlyforcedsubtitles?language=objc)
21    pub static MPLanguageOptionCharacteristicContainsOnlyForcedSubtitles: &'static NSString;
22}
23
24extern "C" {
25    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristictranscribesspokendialog?language=objc)
26    pub static MPLanguageOptionCharacteristicTranscribesSpokenDialog: &'static NSString;
27}
28
29extern "C" {
30    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicdescribesmusicandsound?language=objc)
31    pub static MPLanguageOptionCharacteristicDescribesMusicAndSound: &'static NSString;
32}
33
34extern "C" {
35    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristiceasytoread?language=objc)
36    pub static MPLanguageOptionCharacteristicEasyToRead: &'static NSString;
37}
38
39extern "C" {
40    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicdescribesvideo?language=objc)
41    pub static MPLanguageOptionCharacteristicDescribesVideo: &'static NSString;
42}
43
44extern "C" {
45    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristiclanguagetranslation?language=objc)
46    pub static MPLanguageOptionCharacteristicLanguageTranslation: &'static NSString;
47}
48
49extern "C" {
50    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicdubbedtranslation?language=objc)
51    pub static MPLanguageOptionCharacteristicDubbedTranslation: &'static NSString;
52}
53
54extern "C" {
55    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicvoiceovertranslation?language=objc)
56    pub static MPLanguageOptionCharacteristicVoiceOverTranslation: &'static NSString;
57}
58
59/// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoptiontype?language=objc)
60// NS_ENUM
61#[repr(transparent)]
62#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
63pub struct MPNowPlayingInfoLanguageOptionType(pub NSUInteger);
64impl MPNowPlayingInfoLanguageOptionType {
65    #[doc(alias = "MPNowPlayingInfoLanguageOptionTypeAudible")]
66    pub const Audible: Self = Self(0);
67    #[doc(alias = "MPNowPlayingInfoLanguageOptionTypeLegible")]
68    pub const Legible: Self = Self(1);
69}
70
71unsafe impl Encode for MPNowPlayingInfoLanguageOptionType {
72    const ENCODING: Encoding = NSUInteger::ENCODING;
73}
74
75unsafe impl RefEncode for MPNowPlayingInfoLanguageOptionType {
76    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
77}
78
79extern_class!(
80    /// Represents a single language option option.
81    ///
82    /// See also [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption?language=objc)
83    #[unsafe(super(NSObject))]
84    #[derive(Debug, PartialEq, Eq, Hash)]
85    pub struct MPNowPlayingInfoLanguageOption;
86);
87
88unsafe impl NSObjectProtocol for MPNowPlayingInfoLanguageOption {}
89
90impl MPNowPlayingInfoLanguageOption {
91    extern_methods!(
92        #[unsafe(method(initWithType:languageTag:characteristics:displayName:identifier:))]
93        #[unsafe(method_family = init)]
94        pub unsafe fn initWithType_languageTag_characteristics_displayName_identifier(
95            this: Allocated<Self>,
96            language_option_type: MPNowPlayingInfoLanguageOptionType,
97            language_tag: &NSString,
98            language_option_characteristics: Option<&NSArray<NSString>>,
99            display_name: &NSString,
100            identifier: &NSString,
101        ) -> Retained<Self>;
102
103        /// Represents a special case that is used to
104        /// represent the best legible language option based on system preferences.
105        /// See AVPlayerItem-selectMediaOptionAutomaticallyInMediaSelectionGroup
106        #[unsafe(method(isAutomaticLegibleLanguageOption))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn isAutomaticLegibleLanguageOption(&self) -> bool;
109
110        /// Represents a special case that is used to
111        /// represent the best audible language option based on system preferences.
112        /// See AVPlayerItem-selectMediaOptionAutomaticallyInMediaSelectionGroup
113        #[unsafe(method(isAutomaticAudibleLanguageOption))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn isAutomaticAudibleLanguageOption(&self) -> bool;
116
117        /// The type of language option.
118        #[unsafe(method(languageOptionType))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn languageOptionType(&self) -> MPNowPlayingInfoLanguageOptionType;
121
122        /// The IETF BCP 47 language tag.
123        /// A nil languageTag reprsents that this option should be disabled.
124        /// A languageTag with the value of MPLangaugeOptionAutoLangaugeTag represents
125        /// that the best langauge based on the system preferences should be used.
126        #[unsafe(method(languageTag))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn languageTag(&self) -> Option<Retained<NSString>>;
129
130        /// Characteristics describing the content of the language options.
131        /// See the LanguageOptionCharacteristics for the most commonly used values.
132        #[unsafe(method(languageOptionCharacteristics))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn languageOptionCharacteristics(&self) -> Option<Retained<NSArray<NSString>>>;
135
136        /// A user presentable display name for this option.
137        #[unsafe(method(displayName))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn displayName(&self) -> Option<Retained<NSString>>;
140
141        /// A unique identifier representing this option.
142        #[unsafe(method(identifier))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
145    );
146}
147
148/// Methods declared on superclass `NSObject`.
149impl MPNowPlayingInfoLanguageOption {
150    extern_methods!(
151        #[unsafe(method(init))]
152        #[unsafe(method_family = init)]
153        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
154
155        #[unsafe(method(new))]
156        #[unsafe(method_family = new)]
157        pub unsafe fn new() -> Retained<Self>;
158    );
159}
160
161extern_class!(
162    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoptiongroup?language=objc)
163    #[unsafe(super(NSObject))]
164    #[derive(Debug, PartialEq, Eq, Hash)]
165    pub struct MPNowPlayingInfoLanguageOptionGroup;
166);
167
168unsafe impl NSObjectProtocol for MPNowPlayingInfoLanguageOptionGroup {}
169
170impl MPNowPlayingInfoLanguageOptionGroup {
171    extern_methods!(
172        #[unsafe(method(initWithLanguageOptions:defaultLanguageOption:allowEmptySelection:))]
173        #[unsafe(method_family = init)]
174        pub unsafe fn initWithLanguageOptions_defaultLanguageOption_allowEmptySelection(
175            this: Allocated<Self>,
176            language_options: &NSArray<MPNowPlayingInfoLanguageOption>,
177            default_language_option: Option<&MPNowPlayingInfoLanguageOption>,
178            allow_empty_selection: bool,
179        ) -> Retained<Self>;
180
181        /// The available language options within this group.
182        #[unsafe(method(languageOptions))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn languageOptions(&self) -> Retained<NSArray<MPNowPlayingInfoLanguageOption>>;
185
186        /// The default language option, if any, within this group.
187        #[unsafe(method(defaultLanguageOption))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn defaultLanguageOption(
190            &self,
191        ) -> Option<Retained<MPNowPlayingInfoLanguageOption>>;
192
193        /// Indicates whether a selection in this group is required at all times.
194        #[unsafe(method(allowEmptySelection))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn allowEmptySelection(&self) -> bool;
197    );
198}
199
200/// Methods declared on superclass `NSObject`.
201impl MPNowPlayingInfoLanguageOptionGroup {
202    extern_methods!(
203        #[unsafe(method(init))]
204        #[unsafe(method_family = init)]
205        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
206
207        #[unsafe(method(new))]
208        #[unsafe(method_family = new)]
209        pub unsafe fn new() -> Retained<Self>;
210    );
211}