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
88extern_conformance!(
89    unsafe impl NSObjectProtocol for MPNowPlayingInfoLanguageOption {}
90);
91
92impl MPNowPlayingInfoLanguageOption {
93    extern_methods!(
94        #[unsafe(method(initWithType:languageTag:characteristics:displayName:identifier:))]
95        #[unsafe(method_family = init)]
96        pub unsafe fn initWithType_languageTag_characteristics_displayName_identifier(
97            this: Allocated<Self>,
98            language_option_type: MPNowPlayingInfoLanguageOptionType,
99            language_tag: &NSString,
100            language_option_characteristics: Option<&NSArray<NSString>>,
101            display_name: &NSString,
102            identifier: &NSString,
103        ) -> Retained<Self>;
104
105        /// Represents a special case that is used to
106        /// represent the best legible language option based on system preferences.
107        /// See AVPlayerItem-selectMediaOptionAutomaticallyInMediaSelectionGroup
108        #[unsafe(method(isAutomaticLegibleLanguageOption))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn isAutomaticLegibleLanguageOption(&self) -> bool;
111
112        /// Represents a special case that is used to
113        /// represent the best audible language option based on system preferences.
114        /// See AVPlayerItem-selectMediaOptionAutomaticallyInMediaSelectionGroup
115        #[unsafe(method(isAutomaticAudibleLanguageOption))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn isAutomaticAudibleLanguageOption(&self) -> bool;
118
119        /// The type of language option.
120        #[unsafe(method(languageOptionType))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn languageOptionType(&self) -> MPNowPlayingInfoLanguageOptionType;
123
124        /// The IETF BCP 47 language tag.
125        /// A nil languageTag reprsents that this option should be disabled.
126        /// A languageTag with the value of MPLangaugeOptionAutoLangaugeTag represents
127        /// that the best langauge based on the system preferences should be used.
128        #[unsafe(method(languageTag))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn languageTag(&self) -> Option<Retained<NSString>>;
131
132        /// Characteristics describing the content of the language options.
133        /// See the LanguageOptionCharacteristics for the most commonly used values.
134        #[unsafe(method(languageOptionCharacteristics))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn languageOptionCharacteristics(&self) -> Option<Retained<NSArray<NSString>>>;
137
138        /// A user presentable display name for this option.
139        #[unsafe(method(displayName))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn displayName(&self) -> Option<Retained<NSString>>;
142
143        /// A unique identifier representing this option.
144        #[unsafe(method(identifier))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
147    );
148}
149
150/// Methods declared on superclass `NSObject`.
151impl MPNowPlayingInfoLanguageOption {
152    extern_methods!(
153        #[unsafe(method(init))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
156
157        #[unsafe(method(new))]
158        #[unsafe(method_family = new)]
159        pub unsafe fn new() -> Retained<Self>;
160    );
161}
162
163extern_class!(
164    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoptiongroup?language=objc)
165    #[unsafe(super(NSObject))]
166    #[derive(Debug, PartialEq, Eq, Hash)]
167    pub struct MPNowPlayingInfoLanguageOptionGroup;
168);
169
170extern_conformance!(
171    unsafe impl NSObjectProtocol for MPNowPlayingInfoLanguageOptionGroup {}
172);
173
174impl MPNowPlayingInfoLanguageOptionGroup {
175    extern_methods!(
176        #[unsafe(method(initWithLanguageOptions:defaultLanguageOption:allowEmptySelection:))]
177        #[unsafe(method_family = init)]
178        pub unsafe fn initWithLanguageOptions_defaultLanguageOption_allowEmptySelection(
179            this: Allocated<Self>,
180            language_options: &NSArray<MPNowPlayingInfoLanguageOption>,
181            default_language_option: Option<&MPNowPlayingInfoLanguageOption>,
182            allow_empty_selection: bool,
183        ) -> Retained<Self>;
184
185        /// The available language options within this group.
186        #[unsafe(method(languageOptions))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn languageOptions(&self) -> Retained<NSArray<MPNowPlayingInfoLanguageOption>>;
189
190        /// The default language option, if any, within this group.
191        #[unsafe(method(defaultLanguageOption))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn defaultLanguageOption(
194            &self,
195        ) -> Option<Retained<MPNowPlayingInfoLanguageOption>>;
196
197        /// Indicates whether a selection in this group is required at all times.
198        #[unsafe(method(allowEmptySelection))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn allowEmptySelection(&self) -> bool;
201    );
202}
203
204/// Methods declared on superclass `NSObject`.
205impl MPNowPlayingInfoLanguageOptionGroup {
206    extern_methods!(
207        #[unsafe(method(init))]
208        #[unsafe(method_family = init)]
209        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
210
211        #[unsafe(method(new))]
212        #[unsafe(method_family = new)]
213        pub unsafe fn new() -> Retained<Self>;
214    );
215}