//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsorthography?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSOrthography;
);

#[cfg(feature = "NSObject")]
unsafe impl NSCoding for NSOrthography {}

#[cfg(feature = "NSObject")]
unsafe impl NSCopying for NSOrthography {}

#[cfg(feature = "NSObject")]
unsafe impl CopyingHelper for NSOrthography {
    type Result = Self;
}

unsafe impl NSObjectProtocol for NSOrthography {}

#[cfg(feature = "NSObject")]
unsafe impl NSSecureCoding for NSOrthography {}

impl NSOrthography {
    extern_methods!(
        #[cfg(feature = "NSString")]
        #[unsafe(method(dominantScript))]
        #[unsafe(method_family = none)]
        pub unsafe fn dominantScript(&self) -> Retained<NSString>;

        #[cfg(all(feature = "NSArray", feature = "NSDictionary", feature = "NSString"))]
        #[unsafe(method(languageMap))]
        #[unsafe(method_family = none)]
        pub unsafe fn languageMap(&self) -> Retained<NSDictionary<NSString, NSArray<NSString>>>;

        #[cfg(all(feature = "NSArray", feature = "NSDictionary", feature = "NSString"))]
        #[unsafe(method(initWithDominantScript:languageMap:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDominantScript_languageMap(
            this: Allocated<Self>,
            script: &NSString,
            map: &NSDictionary<NSString, NSArray<NSString>>,
        ) -> Retained<Self>;

        #[cfg(feature = "NSCoder")]
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

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

/// NSOrthographyExtended.
impl NSOrthography {
    extern_methods!(
        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[unsafe(method(languagesForScript:))]
        #[unsafe(method_family = none)]
        pub unsafe fn languagesForScript(
            &self,
            script: &NSString,
        ) -> Option<Retained<NSArray<NSString>>>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(dominantLanguageForScript:))]
        #[unsafe(method_family = none)]
        pub unsafe fn dominantLanguageForScript(
            &self,
            script: &NSString,
        ) -> Option<Retained<NSString>>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(dominantLanguage))]
        #[unsafe(method_family = none)]
        pub unsafe fn dominantLanguage(&self) -> Retained<NSString>;

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[unsafe(method(allScripts))]
        #[unsafe(method_family = none)]
        pub unsafe fn allScripts(&self) -> Retained<NSArray<NSString>>;

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[unsafe(method(allLanguages))]
        #[unsafe(method_family = none)]
        pub unsafe fn allLanguages(&self) -> Retained<NSArray<NSString>>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(defaultOrthographyForLanguage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn defaultOrthographyForLanguage(language: &NSString) -> Retained<Self>;
    );
}

/// NSOrthographyCreation.
impl NSOrthography {
    extern_methods!(
        #[cfg(all(feature = "NSArray", feature = "NSDictionary", feature = "NSString"))]
        #[unsafe(method(orthographyWithDominantScript:languageMap:))]
        #[unsafe(method_family = none)]
        pub unsafe fn orthographyWithDominantScript_languageMap(
            script: &NSString,
            map: &NSDictionary<NSString, NSArray<NSString>>,
        ) -> Retained<Self>;
    );
}
