objc2_media_player/generated/
MPNowPlayingInfoLanguageOption.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern "C" {
10 pub static MPLanguageOptionCharacteristicIsMainProgramContent: &'static NSString;
12}
13
14extern "C" {
15 pub static MPLanguageOptionCharacteristicIsAuxiliaryContent: &'static NSString;
17}
18
19extern "C" {
20 pub static MPLanguageOptionCharacteristicContainsOnlyForcedSubtitles: &'static NSString;
22}
23
24extern "C" {
25 pub static MPLanguageOptionCharacteristicTranscribesSpokenDialog: &'static NSString;
27}
28
29extern "C" {
30 pub static MPLanguageOptionCharacteristicDescribesMusicAndSound: &'static NSString;
32}
33
34extern "C" {
35 pub static MPLanguageOptionCharacteristicEasyToRead: &'static NSString;
37}
38
39extern "C" {
40 pub static MPLanguageOptionCharacteristicDescribesVideo: &'static NSString;
42}
43
44extern "C" {
45 pub static MPLanguageOptionCharacteristicLanguageTranslation: &'static NSString;
47}
48
49extern "C" {
50 pub static MPLanguageOptionCharacteristicDubbedTranslation: &'static NSString;
52}
53
54extern "C" {
55 pub static MPLanguageOptionCharacteristicVoiceOverTranslation: &'static NSString;
57}
58
59#[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 #[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 #[unsafe(method(isAutomaticLegibleLanguageOption))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn isAutomaticLegibleLanguageOption(&self) -> bool;
111
112 #[unsafe(method(isAutomaticAudibleLanguageOption))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn isAutomaticAudibleLanguageOption(&self) -> bool;
118
119 #[unsafe(method(languageOptionType))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn languageOptionType(&self) -> MPNowPlayingInfoLanguageOptionType;
123
124 #[unsafe(method(languageTag))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn languageTag(&self) -> Option<Retained<NSString>>;
131
132 #[unsafe(method(languageOptionCharacteristics))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn languageOptionCharacteristics(&self) -> Option<Retained<NSArray<NSString>>>;
137
138 #[unsafe(method(displayName))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn displayName(&self) -> Option<Retained<NSString>>;
142
143 #[unsafe(method(identifier))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
147 );
148}
149
150impl 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 #[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 #[unsafe(method(languageOptions))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn languageOptions(&self) -> Retained<NSArray<MPNowPlayingInfoLanguageOption>>;
189
190 #[unsafe(method(defaultLanguageOption))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn defaultLanguageOption(
194 &self,
195 ) -> Option<Retained<MPNowPlayingInfoLanguageOption>>;
196
197 #[unsafe(method(allowEmptySelection))]
199 #[unsafe(method_family = none)]
200 pub unsafe fn allowEmptySelection(&self) -> bool;
201 );
202}
203
204impl 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}