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
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 #[unsafe(method(isAutomaticLegibleLanguageOption))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn isAutomaticLegibleLanguageOption(&self) -> bool;
109
110 #[unsafe(method(isAutomaticAudibleLanguageOption))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn isAutomaticAudibleLanguageOption(&self) -> bool;
116
117 #[unsafe(method(languageOptionType))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn languageOptionType(&self) -> MPNowPlayingInfoLanguageOptionType;
121
122 #[unsafe(method(languageTag))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn languageTag(&self) -> Option<Retained<NSString>>;
129
130 #[unsafe(method(languageOptionCharacteristics))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn languageOptionCharacteristics(&self) -> Option<Retained<NSArray<NSString>>>;
135
136 #[unsafe(method(displayName))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn displayName(&self) -> Option<Retained<NSString>>;
140
141 #[unsafe(method(identifier))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
145 );
146}
147
148impl 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 #[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 #[unsafe(method(languageOptions))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn languageOptions(&self) -> Retained<NSArray<MPNowPlayingInfoLanguageOption>>;
185
186 #[unsafe(method(defaultLanguageOption))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn defaultLanguageOption(
190 &self,
191 ) -> Option<Retained<MPNowPlayingInfoLanguageOption>>;
192
193 #[unsafe(method(allowEmptySelection))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn allowEmptySelection(&self) -> bool;
197 );
198}
199
200impl 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}