objc2-av-foundation 0.3.2

Bindings to the AVFoundation framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// AVMediaSelectionGroup provides a collection of mutually exclusive options for the presentation of media within an asset.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmediaselectiongroup?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMediaSelectionGroup;
);

extern_conformance!(
    unsafe impl NSCopying for AVMediaSelectionGroup {}
);

unsafe impl CopyingHelper for AVMediaSelectionGroup {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMediaSelectionGroup {}
);

impl AVMediaSelectionGroup {
    extern_methods!(
        /// A collection of mutually exclusive media selection options.
        ///
        /// An NSArray of AVMediaSelectionOption*.
        #[unsafe(method(options))]
        #[unsafe(method_family = none)]
        pub unsafe fn options(&self) -> Retained<NSArray<AVMediaSelectionOption>>;

        /// Indicates the default option in the group, i.e. the option that's intended for use in the absence of a specific end-user selection or preference.
        ///
        /// Can be nil, indicating that without a specific end-user selection or preference, no option in the group is intended to be selected.
        #[unsafe(method(defaultOption))]
        #[unsafe(method_family = none)]
        pub unsafe fn defaultOption(&self) -> Option<Retained<AVMediaSelectionOption>>;

        /// Indicates whether it's possible to present none of the options in the group when an associated AVPlayerItem is played.
        ///
        /// If allowsEmptySelection is YES, all of the available media options in the group can be deselected by passing nil
        /// as the specified AVMediaSelectionOption to -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:].
        #[unsafe(method(allowsEmptySelection))]
        #[unsafe(method_family = none)]
        pub unsafe fn allowsEmptySelection(&self) -> bool;

        /// Returns the instance of AVMediaSelectionOption with properties that match the specified property list.
        ///
        /// - Parameter plist: A property list previously obtained from an option in the group via -[AVMediaSelectionOption propertyList].
        ///
        /// - Returns: If the specified properties match those of an option in the group, an instance of AVMediaSelectionOption. Otherwise nil.
        ///
        /// # Safety
        ///
        /// `plist` should be of the correct type.
        #[unsafe(method(mediaSelectionOptionWithPropertyList:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaSelectionOptionWithPropertyList(
            &self,
            plist: &AnyObject,
        ) -> Option<Retained<AVMediaSelectionOption>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVMediaSelectionGroup {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// AVMediaSelectionOptionFiltering.
///
/// Filtering of media selection options.
///
/// The AVMediaSelectionOptionFiltering category is provided for convenience in filtering the media selection options in a group
/// according to playability, locale, and media characteristics.
/// Note that it's possible to implement additional filtering behaviors by using -[NSArray indexesOfObjectsPassingTest:].
impl AVMediaSelectionGroup {
    extern_methods!(
        /// Filters an array of AVMediaSelectionOptions according to whether they are playable.
        ///
        /// - Parameter mediaSelectionOptions: An array of AVMediaSelectionOption to be filtered according to whether they are playable.
        ///
        /// - Returns: An instance of NSArray containing the media selection options of the specified NSArray that are playable.
        #[unsafe(method(playableMediaSelectionOptionsFromArray:))]
        #[unsafe(method_family = none)]
        pub unsafe fn playableMediaSelectionOptionsFromArray(
            media_selection_options: &NSArray<AVMediaSelectionOption>,
        ) -> Retained<NSArray<AVMediaSelectionOption>>;

        /// Filters an array of AVMediaSelectionOptions according to whether their locales match any language identifier in the specified array of preferred languages. The returned array is sorted according to the order of preference of the language each matches.
        ///
        /// - Parameter mediaSelectionOptions: An array of AVMediaSelectionOptions to be filtered and sorted.
        /// - Parameter preferredLanguages: An array of language identifiers in order of preference, each of which is an IETF BCP 47 (RFC 4646) language identifier. If your goal is to provide the best match for the end user's preferred languages without consideration of your app's available localizations, pass [NSLocale preferredLanguages] as the value of preferredLanguages. However, if you want to filter the available choices in order to obtain the best match among the localizations that are available for your app, pass [NSBundle preferredLocalizationsFromArray:[[NSBundle mainBundle] localizations] forPreferences:[NSLocale preferredLanguages]] instead. The latter choice is normally more appropriate for strings intended for display as part of the app's UI.
        ///
        /// - Returns: An instance of NSArray containing media selection options of the specified NSArray that match a preferred language, sorted according to the order of preference of the language each matches.
        #[unsafe(method(mediaSelectionOptionsFromArray:filteredAndSortedAccordingToPreferredLanguages:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaSelectionOptionsFromArray_filteredAndSortedAccordingToPreferredLanguages(
            media_selection_options: &NSArray<AVMediaSelectionOption>,
            preferred_languages: &NSArray<NSString>,
        ) -> Retained<NSArray<AVMediaSelectionOption>>;

        /// Filters an array of AVMediaSelectionOptions according to locale.
        ///
        /// - Parameter mediaSelectionOptions: An array of AVMediaSelectionOption to be filtered by locale.
        /// - Parameter locale: The NSLocale that must be matched for a media selection option to be copied to the output array.
        ///
        /// - Returns: An instance of NSArray containing the media selection options of the specified NSArray that match the specified locale.
        #[unsafe(method(mediaSelectionOptionsFromArray:withLocale:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaSelectionOptionsFromArray_withLocale(
            media_selection_options: &NSArray<AVMediaSelectionOption>,
            locale: &NSLocale,
        ) -> Retained<NSArray<AVMediaSelectionOption>>;

        #[cfg(feature = "AVMediaFormat")]
        /// Filters an array of AVMediaSelectionOptions according to one or more media characteristics.
        ///
        /// - Parameter mediaSelectionOptions: An array of AVMediaSelectionOptions to be filtered by media characteristic.
        /// - Parameter mediaCharacteristics: The media characteristics that must be matched for a media selection option to be copied to the output array.
        ///
        /// - Returns: An instance of NSArray containing the media selection options of the specified NSArray that match the specified
        /// media characteristics.
        #[unsafe(method(mediaSelectionOptionsFromArray:withMediaCharacteristics:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaSelectionOptionsFromArray_withMediaCharacteristics(
            media_selection_options: &NSArray<AVMediaSelectionOption>,
            media_characteristics: &NSArray<AVMediaCharacteristic>,
        ) -> Retained<NSArray<AVMediaSelectionOption>>;

        #[cfg(feature = "AVMediaFormat")]
        /// Filters an array of AVMediaSelectionOptions according to whether they lack one or more media characteristics.
        ///
        /// - Parameter mediaSelectionOptions: An array of AVMediaSelectionOptions to be filtered by media characteristic.
        /// - Parameter mediaCharacteristics: The media characteristics that must not be present for a media selection option to be copied to the output array.
        ///
        /// - Returns: An instance of NSArray containing the media selection options of the specified NSArray that lack the specified
        /// media characteristics.
        #[unsafe(method(mediaSelectionOptionsFromArray:withoutMediaCharacteristics:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaSelectionOptionsFromArray_withoutMediaCharacteristics(
            media_selection_options: &NSArray<AVMediaSelectionOption>,
            media_characteristics: &NSArray<AVMediaCharacteristic>,
        ) -> Retained<NSArray<AVMediaSelectionOption>>;
    );
}

extern_class!(
    /// AVMediaSelectionOption represents a specific option for the presentation of media within a group of options.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmediaselectionoption?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMediaSelectionOption;
);

extern_conformance!(
    unsafe impl NSCopying for AVMediaSelectionOption {}
);

unsafe impl CopyingHelper for AVMediaSelectionOption {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMediaSelectionOption {}
);

impl AVMediaSelectionOption {
    extern_methods!(
        #[cfg(feature = "AVMediaFormat")]
        /// The media type of the media data, e.g. AVMediaTypeAudio, AVMediaTypeSubtitle, etc.
        #[unsafe(method(mediaType))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaType(&self) -> Retained<AVMediaType>;

        /// The mediaSubTypes of the media data associated with the option.
        ///
        /// An NSArray of NSNumbers carrying four character codes (of type FourCharCode) as defined in CoreAudioTypes.h for audio media and in CMFormatDescription.h for video media.
        /// Also see CMFormatDescriptionGetMediaSubType in CMFormatDescription.h for more information about media subtypes.
        ///
        /// Note that if no information is available about the encoding of the media presented when a media option is selected, the value of mediaSubTypes will be an empty array. This can occur, for example, with streaming media. In these cases the value of mediaSubTypes should simply not be used as a criteria for selection.
        #[unsafe(method(mediaSubTypes))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaSubTypes(&self) -> Retained<NSArray<NSNumber>>;

        #[cfg(feature = "AVMediaFormat")]
        /// Reports whether the media selection option includes media with the specified media characteristic.
        ///
        /// - Parameter mediaCharacteristic: The media characteristic of interest, e.g. AVMediaCharacteristicVisual, AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, etc.
        ///
        /// - Returns: YES if the media selection option includes media with the specified characteristic, otherwise NO.
        #[unsafe(method(hasMediaCharacteristic:))]
        #[unsafe(method_family = none)]
        pub unsafe fn hasMediaCharacteristic(
            &self,
            media_characteristic: &AVMediaCharacteristic,
        ) -> bool;

        /// Indicates whether a media selection option is playable.
        ///
        /// If the media data associated with the option cannot be decoded or otherwise rendered, playable is NO.
        #[unsafe(method(isPlayable))]
        #[unsafe(method_family = none)]
        pub unsafe fn isPlayable(&self) -> bool;

        /// Indicates the RFC 4646 language tag associated with the option. May be nil.
        #[unsafe(method(extendedLanguageTag))]
        #[unsafe(method_family = none)]
        pub unsafe fn extendedLanguageTag(&self) -> Option<Retained<NSString>>;

        /// Indicates the locale for which the media option was authored.
        ///
        /// Use -[NSLocale objectForKey:NSLocaleLanguageCode] to obtain the language code of the locale. See NSLocale.h for additional information.
        #[unsafe(method(locale))]
        #[unsafe(method_family = none)]
        pub unsafe fn locale(&self) -> Option<Retained<NSLocale>>;

        #[cfg(feature = "AVMetadataItem")]
        /// Provides an array of AVMetadataItems for each common metadata key for which a value is available.
        ///
        /// The array of AVMetadataItems can be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:], according to locale via +[AVMetadataItem metadataItemsFromArray:withLocale:],
        /// or according to key via +[AVMetadataItem metadataItemsFromArray:withKey:keySpace:].
        /// Example: to obtain the name (or title) of a media selection option in any of the user's preferred languages.
        /// ```objc
        /// NSString *title = nil;
        /// NSArray *titles = [AVMetadataItem metadataItemsFromArray:[mediaSelectionOption commonMetadata] withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon];
        /// if ([titles count] > 0)
        /// {
        /// // Try to get a title that matches one of the user's preferred languages.
        /// NSArray *titlesForPreferredLanguages = [AVMetadataItem metadataItemsFromArray:titles filteredAndSortedAccordingToPreferredLanguages:[NSLocale preferredLanguages]];
        /// if ([titlesForPreferredLanguages count] > 0)
        /// {
        /// title = [[titlesForPreferredLanguages objectAtIndex:0] stringValue];
        /// }
        ///
        /// // No matches in any of the preferred languages. Just use the primary title metadata we find.
        /// if (title == nil)
        /// {
        /// title = [[titles objectAtIndex:0] stringValue];
        /// }
        /// }
        /// ```
        #[unsafe(method(commonMetadata))]
        #[unsafe(method_family = none)]
        pub unsafe fn commonMetadata(&self) -> Retained<NSArray<AVMetadataItem>>;

        /// Provides an NSArray of NSStrings, each representing a metadata format that contains metadata associated with the option (e.g. ID3, iTunes metadata, etc.).
        ///
        /// Metadata formats are defined in AVMetadataFormat.h.
        #[unsafe(method(availableMetadataFormats))]
        #[unsafe(method_family = none)]
        pub unsafe fn availableMetadataFormats(&self) -> Retained<NSArray<NSString>>;

        #[cfg(feature = "AVMetadataItem")]
        /// Provides an NSArray of AVMetadataItems, one for each metadata item in the container of the specified format.
        ///
        /// - Parameter format: The metadata format for which items are requested.
        ///
        /// - Returns: An NSArray containing AVMetadataItems.
        #[unsafe(method(metadataForFormat:))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadataForFormat(
            &self,
            format: &NSString,
        ) -> Retained<NSArray<AVMetadataItem>>;

        /// If a media selection option in another group is associated with the specified option, returns a reference to the associated option.
        ///
        /// Audible media selection options often have associated legible media selection options; in particular, audible options are typically associated with forced-only subtitle options with the same locale. See AVMediaCharacteristicContainsOnlyForcedSubtitles in AVMediaFormat.h for a discussion of forced-only subtitles.
        ///
        /// - Parameter mediaSelectionGroup: A media selection group in which an associated option is to be sought.
        ///
        /// - Returns: An instance of AVMediaSelectionOption.
        #[unsafe(method(associatedMediaSelectionOptionInMediaSelectionGroup:))]
        #[unsafe(method_family = none)]
        pub unsafe fn associatedMediaSelectionOptionInMediaSelectionGroup(
            &self,
            media_selection_group: &AVMediaSelectionGroup,
        ) -> Option<Retained<AVMediaSelectionOption>>;

        /// Returns a serializable property list that can be used to obtain an instance of AVMediaSelectionOption representing the same option as the receiver via -[AVMediaSelectionGroup mediaSelectionOptionWithPropertyList:].
        ///
        /// - Returns: A serializable property list that's sufficient to identify the option within its group. For serialization utilities, see NSPropertyList.h.
        #[unsafe(method(propertyList))]
        #[unsafe(method_family = none)]
        pub unsafe fn propertyList(&self) -> Retained<AnyObject>;

        /// Provides an NSString suitable for display.
        ///
        /// May use this option's common metadata, media characteristics and locale properties in addition to the provided locale to formulate an NSString intended for display. Will only consider common metadata with the specified locale.
        ///
        /// - Parameter locale: Localize manufactured portions of the string using the specificed locale.
        #[unsafe(method(displayNameWithLocale:))]
        #[unsafe(method_family = none)]
        pub unsafe fn displayNameWithLocale(&self, locale: &NSLocale) -> Retained<NSString>;

        /// Provides an NSString suitable for display using the current system locale.
        ///
        /// May use this option's common metadata, media characteristics and locale properties in addition to the current system locale to formulate an NSString intended for display.
        /// In the event that common metadata is not available in the specified locale, displayName will fall back to considering locales with the multilingual ("mul") then undetermined ("und") locale identifiers.
        /// For a display name strictly with the specified locale use displayNameWithLocale: instead.
        #[unsafe(method(displayName))]
        #[unsafe(method_family = none)]
        pub unsafe fn displayName(&self) -> Retained<NSString>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVMediaSelectionOption {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// AVMediaSelectionGroupCustomMediaSelectionScheme.
impl AVMediaSelectionGroup {
    extern_methods!(
        /// For content that has been authored with the express intent of offering an alternative selection interface for AVMediaSelectionOptions, AVCustomMediaSelectionScheme provides a collection of custom settings for controlling the presentation of the media.
        #[unsafe(method(customMediaSelectionScheme))]
        #[unsafe(method_family = none)]
        pub unsafe fn customMediaSelectionScheme(
            &self,
        ) -> Option<Retained<AVCustomMediaSelectionScheme>>;
    );
}

extern_class!(
    /// For content that has been authored with the express intent of offering an alternative selection interface for AVMediaSelectionOptions, AVCustomMediaSelectionScheme provides a collection of custom settings for controlling the presentation of the media.
    ///
    /// Each selectable setting is associated with a media characteristic that one or more of the AVMediaSelectionOptions in the AVMediaSelectionGroup possesses. By selecting a setting in a user interface based on an AVCustomMediaSelectionScheme, users are essentially indicating a preference for the media characteristic of the selected setting. Selection of a specific AVMediaSelectionOption in the AVMediaSelectionGroup is then derived from the user's indicated preferences. Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcustommediaselectionscheme?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVCustomMediaSelectionScheme;
);

unsafe impl Send for AVCustomMediaSelectionScheme {}

unsafe impl Sync for AVCustomMediaSelectionScheme {}

extern_conformance!(
    unsafe impl NSCopying for AVCustomMediaSelectionScheme {}
);

unsafe impl CopyingHelper for AVCustomMediaSelectionScheme {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVCustomMediaSelectionScheme {}
);

impl AVCustomMediaSelectionScheme {
    extern_methods!(
        /// Indicates whether an alternative selection interface should provide a menu of language choices.
        #[unsafe(method(shouldOfferLanguageSelection))]
        #[unsafe(method_family = none)]
        pub unsafe fn shouldOfferLanguageSelection(&self) -> bool;

        /// Provides available language choices.
        ///
        /// Each string in the array is intended to be interpreted as a BCP 47 language tag.
        #[unsafe(method(availableLanguages))]
        #[unsafe(method_family = none)]
        pub unsafe fn availableLanguages(&self) -> Retained<NSArray<NSString>>;

        /// Provides custom settings.
        #[unsafe(method(selectors))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectors(&self) -> Retained<NSArray<AVMediaPresentationSelector>>;

        /// Provides an array of media presentation settings that can be effective at the same time as the specified language and settings for other selectors of the receiver.
        ///
        /// If the content is authored to provide a collection of AVMediaSelectionOptions that include one or more with all of the combinations of media characteristics of the specified AVMediaPresentationSettings together with all of the settings of the specified AVMediaPresentationSelector, this method will return all of the settings for that selector. However, if one or more of the available combinations are not possessed by any of the AVMediaSelectionOptions, it will return fewer.
        ///
        /// - Parameter selector: The AVMediaPresentationSelector for which complementary settings are requested.
        /// - Parameter language: A BCP 47 language tag chosen among the availableLanguages of the receiver. If no language setting pertains, can be nil.
        /// - Parameter settings: A collection of AVMediaPresentationSettings provided by selectors of the receiver other than the specified selector. Because no two AVMediaPresentationSettings of the same AVMediaPresentationSelector are complementary, an empty array will be returned if you specify more than one setting for any selector.
        #[unsafe(method(mediaPresentationSettingsForSelector:complementaryToLanguage:settings:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaPresentationSettingsForSelector_complementaryToLanguage_settings(
            &self,
            selector: &AVMediaPresentationSelector,
            language: Option<&NSString>,
            settings: &NSArray<AVMediaPresentationSetting>,
        ) -> Retained<NSArray<AVMediaPresentationSetting>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVCustomMediaSelectionScheme {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// For content that has been authored with the express intent of offering an alternative selection interface for AVMediaSelectionOptions, AVMediaPresentationSelector represents a collection of mutually exclusive settings.
    ///
    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmediapresentationselector?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMediaPresentationSelector;
);

unsafe impl Send for AVMediaPresentationSelector {}

unsafe impl Sync for AVMediaPresentationSelector {}

extern_conformance!(
    unsafe impl NSCopying for AVMediaPresentationSelector {}
);

unsafe impl CopyingHelper for AVMediaPresentationSelector {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMediaPresentationSelector {}
);

impl AVMediaPresentationSelector {
    extern_methods!(
        /// Provides the authored identifier for the selector.
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Retained<NSString>;

        /// Returns the display name for the selector that best matches the specified locale identifier.
        #[unsafe(method(displayNameForLocaleIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn displayNameForLocaleIdentifier(
            &self,
            locale_identifier: &NSString,
        ) -> Retained<NSString>;

        /// Provides selectable mutually exclusive settings for the selector.
        #[unsafe(method(settings))]
        #[unsafe(method_family = none)]
        pub unsafe fn settings(&self) -> Retained<NSArray<AVMediaPresentationSetting>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVMediaPresentationSelector {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// For content that has been authored with the express intent of offering an alternative selection interface for AVMediaSelectionOptions, AVMediaPresentationSetting represents a selectable setting for controlling the presentation of the media.
    ///
    /// Each selectable setting is associated with a media characteristic that one or more of the AVMediaSelectionOptions in the AVMediaSelectionGroup possesses. By selecting a setting in a user interface that offers AVMediaPresentationSettings, users are essentially indicating a preference for the media characteristic of the selected setting. Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmediapresentationsetting?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMediaPresentationSetting;
);

unsafe impl Send for AVMediaPresentationSetting {}

unsafe impl Sync for AVMediaPresentationSetting {}

extern_conformance!(
    unsafe impl NSCopying for AVMediaPresentationSetting {}
);

unsafe impl CopyingHelper for AVMediaPresentationSetting {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMediaPresentationSetting {}
);

impl AVMediaPresentationSetting {
    extern_methods!(
        #[cfg(feature = "AVMediaFormat")]
        /// Provides the media characteristic that corresponds to the selectable setting.
        #[unsafe(method(mediaCharacteristic))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaCharacteristic(&self) -> Retained<AVMediaCharacteristic>;

        /// Returns the display name for the selectable setting that best matches the specified locale identifier.
        #[unsafe(method(displayNameForLocaleIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn displayNameForLocaleIdentifier(
            &self,
            locale_identifier: &NSString,
        ) -> Retained<NSString>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVMediaPresentationSetting {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}