objc2-media-player 0.3.2

Bindings to the MediaPlayer framework
Documentation
//! 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 "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicismainprogramcontent?language=objc)
    pub static MPLanguageOptionCharacteristicIsMainProgramContent: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicisauxiliarycontent?language=objc)
    pub static MPLanguageOptionCharacteristicIsAuxiliaryContent: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristiccontainsonlyforcedsubtitles?language=objc)
    pub static MPLanguageOptionCharacteristicContainsOnlyForcedSubtitles: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristictranscribesspokendialog?language=objc)
    pub static MPLanguageOptionCharacteristicTranscribesSpokenDialog: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicdescribesmusicandsound?language=objc)
    pub static MPLanguageOptionCharacteristicDescribesMusicAndSound: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristiceasytoread?language=objc)
    pub static MPLanguageOptionCharacteristicEasyToRead: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicdescribesvideo?language=objc)
    pub static MPLanguageOptionCharacteristicDescribesVideo: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristiclanguagetranslation?language=objc)
    pub static MPLanguageOptionCharacteristicLanguageTranslation: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicdubbedtranslation?language=objc)
    pub static MPLanguageOptionCharacteristicDubbedTranslation: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mplanguageoptioncharacteristicvoiceovertranslation?language=objc)
    pub static MPLanguageOptionCharacteristicVoiceOverTranslation: &'static NSString;
}

/// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoptiontype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MPNowPlayingInfoLanguageOptionType(pub NSUInteger);
impl MPNowPlayingInfoLanguageOptionType {
    #[doc(alias = "MPNowPlayingInfoLanguageOptionTypeAudible")]
    pub const Audible: Self = Self(0);
    #[doc(alias = "MPNowPlayingInfoLanguageOptionTypeLegible")]
    pub const Legible: Self = Self(1);
}

unsafe impl Encode for MPNowPlayingInfoLanguageOptionType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MPNowPlayingInfoLanguageOptionType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// Represents a single language option option.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoption?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPNowPlayingInfoLanguageOption;
);

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

impl MPNowPlayingInfoLanguageOption {
    extern_methods!(
        #[unsafe(method(initWithType:languageTag:characteristics:displayName:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithType_languageTag_characteristics_displayName_identifier(
            this: Allocated<Self>,
            language_option_type: MPNowPlayingInfoLanguageOptionType,
            language_tag: &NSString,
            language_option_characteristics: Option<&NSArray<NSString>>,
            display_name: &NSString,
            identifier: &NSString,
        ) -> Retained<Self>;

        /// Represents a special case that is used to
        /// represent the best legible language option based on system preferences.
        /// See AVPlayerItem-selectMediaOptionAutomaticallyInMediaSelectionGroup
        #[unsafe(method(isAutomaticLegibleLanguageOption))]
        #[unsafe(method_family = none)]
        pub unsafe fn isAutomaticLegibleLanguageOption(&self) -> bool;

        /// Represents a special case that is used to
        /// represent the best audible language option based on system preferences.
        /// See AVPlayerItem-selectMediaOptionAutomaticallyInMediaSelectionGroup
        #[unsafe(method(isAutomaticAudibleLanguageOption))]
        #[unsafe(method_family = none)]
        pub unsafe fn isAutomaticAudibleLanguageOption(&self) -> bool;

        /// The type of language option.
        #[unsafe(method(languageOptionType))]
        #[unsafe(method_family = none)]
        pub unsafe fn languageOptionType(&self) -> MPNowPlayingInfoLanguageOptionType;

        /// The IETF BCP 47 language tag.
        /// A nil languageTag reprsents that this option should be disabled.
        /// A languageTag with the value of MPLangaugeOptionAutoLangaugeTag represents
        /// that the best langauge based on the system preferences should be used.
        #[unsafe(method(languageTag))]
        #[unsafe(method_family = none)]
        pub unsafe fn languageTag(&self) -> Option<Retained<NSString>>;

        /// Characteristics describing the content of the language options.
        /// See the LanguageOptionCharacteristics for the most commonly used values.
        #[unsafe(method(languageOptionCharacteristics))]
        #[unsafe(method_family = none)]
        pub unsafe fn languageOptionCharacteristics(&self) -> Option<Retained<NSArray<NSString>>>;

        /// A user presentable display name for this option.
        #[unsafe(method(displayName))]
        #[unsafe(method_family = none)]
        pub unsafe fn displayName(&self) -> Option<Retained<NSString>>;

        /// A unique identifier representing this option.
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl MPNowPlayingInfoLanguageOption {
    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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfolanguageoptiongroup?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPNowPlayingInfoLanguageOptionGroup;
);

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

impl MPNowPlayingInfoLanguageOptionGroup {
    extern_methods!(
        #[unsafe(method(initWithLanguageOptions:defaultLanguageOption:allowEmptySelection:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLanguageOptions_defaultLanguageOption_allowEmptySelection(
            this: Allocated<Self>,
            language_options: &NSArray<MPNowPlayingInfoLanguageOption>,
            default_language_option: Option<&MPNowPlayingInfoLanguageOption>,
            allow_empty_selection: bool,
        ) -> Retained<Self>;

        /// The available language options within this group.
        #[unsafe(method(languageOptions))]
        #[unsafe(method_family = none)]
        pub unsafe fn languageOptions(&self) -> Retained<NSArray<MPNowPlayingInfoLanguageOption>>;

        /// The default language option, if any, within this group.
        #[unsafe(method(defaultLanguageOption))]
        #[unsafe(method_family = none)]
        pub unsafe fn defaultLanguageOption(
            &self,
        ) -> Option<Retained<MPNowPlayingInfoLanguageOption>>;

        /// Indicates whether a selection in this group is required at all times.
        #[unsafe(method(allowEmptySelection))]
        #[unsafe(method_family = none)]
        pub unsafe fn allowEmptySelection(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl MPNowPlayingInfoLanguageOptionGroup {
    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>;
    );
}