Skip to main content

objc2_foundation/generated/
NSOrthography.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern_class!(
9    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsorthography?language=objc)
10    #[unsafe(super(NSObject))]
11    #[derive(Debug, PartialEq, Eq, Hash)]
12    pub struct NSOrthography;
13);
14
15#[cfg(feature = "NSObject")]
16extern_conformance!(
17    unsafe impl NSCoding for NSOrthography {}
18);
19
20#[cfg(feature = "NSObject")]
21extern_conformance!(
22    unsafe impl NSCopying for NSOrthography {}
23);
24
25#[cfg(feature = "NSObject")]
26unsafe impl CopyingHelper for NSOrthography {
27    type Result = Self;
28}
29
30extern_conformance!(
31    unsafe impl NSObjectProtocol for NSOrthography {}
32);
33
34#[cfg(feature = "NSObject")]
35extern_conformance!(
36    unsafe impl NSSecureCoding for NSOrthography {}
37);
38
39impl NSOrthography {
40    extern_methods!(
41        #[cfg(feature = "NSString")]
42        #[unsafe(method(dominantScript))]
43        #[unsafe(method_family = none)]
44        pub fn dominantScript(&self) -> Retained<NSString>;
45
46        #[cfg(all(feature = "NSArray", feature = "NSDictionary", feature = "NSString"))]
47        #[unsafe(method(languageMap))]
48        #[unsafe(method_family = none)]
49        pub fn languageMap(&self) -> Retained<NSDictionary<NSString, NSArray<NSString>>>;
50
51        #[cfg(all(feature = "NSArray", feature = "NSDictionary", feature = "NSString"))]
52        #[unsafe(method(initWithDominantScript:languageMap:))]
53        #[unsafe(method_family = init)]
54        pub fn initWithDominantScript_languageMap(
55            this: Allocated<Self>,
56            script: &NSString,
57            map: &NSDictionary<NSString, NSArray<NSString>>,
58        ) -> Retained<Self>;
59
60        #[cfg(feature = "NSCoder")]
61        /// # Safety
62        ///
63        /// `coder` possibly has further requirements.
64        #[unsafe(method(initWithCoder:))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn initWithCoder(
67            this: Allocated<Self>,
68            coder: &NSCoder,
69        ) -> Option<Retained<Self>>;
70    );
71}
72
73/// Methods declared on superclass `NSObject`.
74impl NSOrthography {
75    extern_methods!(
76        #[unsafe(method(init))]
77        #[unsafe(method_family = init)]
78        pub fn init(this: Allocated<Self>) -> Retained<Self>;
79
80        #[unsafe(method(new))]
81        #[unsafe(method_family = new)]
82        pub fn new() -> Retained<Self>;
83    );
84}
85
86impl DefaultRetained for NSOrthography {
87    #[inline]
88    fn default_retained() -> Retained<Self> {
89        Self::new()
90    }
91}
92
93/// NSOrthographyExtended.
94impl NSOrthography {
95    extern_methods!(
96        #[cfg(all(feature = "NSArray", feature = "NSString"))]
97        #[unsafe(method(languagesForScript:))]
98        #[unsafe(method_family = none)]
99        pub fn languagesForScript(&self, script: &NSString) -> Option<Retained<NSArray<NSString>>>;
100
101        #[cfg(feature = "NSString")]
102        #[unsafe(method(dominantLanguageForScript:))]
103        #[unsafe(method_family = none)]
104        pub fn dominantLanguageForScript(&self, script: &NSString) -> Option<Retained<NSString>>;
105
106        #[cfg(feature = "NSString")]
107        #[unsafe(method(dominantLanguage))]
108        #[unsafe(method_family = none)]
109        pub fn dominantLanguage(&self) -> Retained<NSString>;
110
111        #[cfg(all(feature = "NSArray", feature = "NSString"))]
112        #[unsafe(method(allScripts))]
113        #[unsafe(method_family = none)]
114        pub fn allScripts(&self) -> Retained<NSArray<NSString>>;
115
116        #[cfg(all(feature = "NSArray", feature = "NSString"))]
117        #[unsafe(method(allLanguages))]
118        #[unsafe(method_family = none)]
119        pub fn allLanguages(&self) -> Retained<NSArray<NSString>>;
120
121        #[cfg(feature = "NSString")]
122        #[unsafe(method(defaultOrthographyForLanguage:))]
123        #[unsafe(method_family = none)]
124        pub fn defaultOrthographyForLanguage(language: &NSString) -> Retained<Self>;
125    );
126}
127
128/// NSOrthographyCreation.
129impl NSOrthography {
130    extern_methods!(
131        #[cfg(all(feature = "NSArray", feature = "NSDictionary", feature = "NSString"))]
132        #[unsafe(method(orthographyWithDominantScript:languageMap:))]
133        #[unsafe(method_family = none)]
134        pub fn orthographyWithDominantScript_languageMap(
135            script: &NSString,
136            map: &NSDictionary<NSString, NSArray<NSString>>,
137        ) -> Retained<Self>;
138    );
139}