objc2_accessibility/generated/
AXBrailleTranslator.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// A rule for translating print text to Braille, and back-translating Braille to print text.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/accessibility/axbrailletable?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct AXBrailleTable;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for AXBrailleTable {}
20);
21
22extern_conformance!(
23    unsafe impl NSCopying for AXBrailleTable {}
24);
25
26unsafe impl CopyingHelper for AXBrailleTable {
27    type Result = Self;
28}
29
30extern_conformance!(
31    unsafe impl NSObjectProtocol for AXBrailleTable {}
32);
33
34impl AXBrailleTable {
35    extern_methods!(
36        /// A unique string that identifies this table.
37        #[unsafe(method(identifier))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn identifier(&self) -> Retained<NSString>;
40
41        /// The localized name of this table for user display.
42        #[unsafe(method(localizedName))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn localizedName(&self) -> Retained<NSString>;
45
46        /// The identifier of the provider of this table.
47        #[unsafe(method(providerIdentifier))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn providerIdentifier(&self) -> Retained<NSString>;
50
51        /// The localized name of the provider of this table for user display.
52        #[unsafe(method(localizedProviderName))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn localizedProviderName(&self) -> Retained<NSString>;
55
56        /// The 3-character code from ISO 639-2 for the language this Braille table pertains to.
57        #[unsafe(method(language))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn language(&self) -> Retained<NSString>;
60
61        /// All locales this table supports.
62        #[unsafe(method(locales))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn locales(&self) -> Retained<NSSet<NSLocale>>;
65
66        /// Returns true if this table makes use of eight dots as opposed to six dots.
67        #[unsafe(method(isEightDot))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn isEightDot(&self) -> bool;
70
71        /// All locales supported by existing tables.
72        #[unsafe(method(supportedLocales))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn supportedLocales() -> Retained<NSSet<NSLocale>>;
75
76        /// The default table that provides translations for the given locale's language. Returns nil if there is none.
77        #[unsafe(method(defaultTableForLocale:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn defaultTableForLocale(locale: &NSLocale) -> Option<Retained<AXBrailleTable>>;
80
81        /// All tables that provide translations for the given locale's language.
82        #[unsafe(method(tablesForLocale:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn tablesForLocale(locale: &NSLocale) -> Retained<NSSet<AXBrailleTable>>;
85
86        /// All tables that are not specific to any language.
87        #[unsafe(method(languageAgnosticTables))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn languageAgnosticTables() -> Retained<NSSet<AXBrailleTable>>;
90
91        /// Returns nil if there is no table with the given identifier.
92        #[unsafe(method(initWithIdentifier:))]
93        #[unsafe(method_family = init)]
94        pub unsafe fn initWithIdentifier(
95            this: Allocated<Self>,
96            identifier: &NSString,
97        ) -> Option<Retained<Self>>;
98
99        #[unsafe(method(init))]
100        #[unsafe(method_family = init)]
101        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103        #[unsafe(method(new))]
104        #[unsafe(method_family = new)]
105        pub unsafe fn new() -> Retained<Self>;
106    );
107}
108
109extern_class!(
110    /// The result of translation or back-translation.
111    ///
112    /// See also [Apple's documentation](https://developer.apple.com/documentation/accessibility/axbrailletranslationresult?language=objc)
113    #[unsafe(super(NSObject))]
114    #[derive(Debug, PartialEq, Eq, Hash)]
115    pub struct AXBrailleTranslationResult;
116);
117
118extern_conformance!(
119    unsafe impl NSCoding for AXBrailleTranslationResult {}
120);
121
122extern_conformance!(
123    unsafe impl NSCopying for AXBrailleTranslationResult {}
124);
125
126unsafe impl CopyingHelper for AXBrailleTranslationResult {
127    type Result = Self;
128}
129
130extern_conformance!(
131    unsafe impl NSObjectProtocol for AXBrailleTranslationResult {}
132);
133
134impl AXBrailleTranslationResult {
135    extern_methods!(
136        /// The resulting string after translation or back-translation.
137        #[unsafe(method(resultString))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn resultString(&self) -> Retained<NSString>;
140
141        /// An array of integers that has the same length as the resultString.
142        /// locationMap[i]-th character in the input string corresponds to resultString[i].
143        #[unsafe(method(locationMap))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn locationMap(&self) -> Retained<NSArray<NSNumber>>;
146
147        #[unsafe(method(init))]
148        #[unsafe(method_family = init)]
149        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
150
151        #[unsafe(method(new))]
152        #[unsafe(method_family = new)]
153        pub unsafe fn new() -> Retained<Self>;
154    );
155}
156
157extern_class!(
158    /// Translates print text to Braille and Braille to print text according to the given Braille table.
159    ///
160    /// See also [Apple's documentation](https://developer.apple.com/documentation/accessibility/axbrailletranslator?language=objc)
161    #[unsafe(super(NSObject))]
162    #[derive(Debug, PartialEq, Eq, Hash)]
163    pub struct AXBrailleTranslator;
164);
165
166extern_conformance!(
167    unsafe impl NSObjectProtocol for AXBrailleTranslator {}
168);
169
170impl AXBrailleTranslator {
171    extern_methods!(
172        #[unsafe(method(initWithBrailleTable:))]
173        #[unsafe(method_family = init)]
174        pub unsafe fn initWithBrailleTable(
175            this: Allocated<Self>,
176            braille_table: &AXBrailleTable,
177        ) -> Retained<Self>;
178
179        /// Output Braille uses the unicode Braille characters (0x2800-0x28FF).
180        #[unsafe(method(translatePrintText:))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn translatePrintText(
183            &self,
184            print_text: &NSString,
185        ) -> Retained<AXBrailleTranslationResult>;
186
187        /// Input Braille should use the unicode Braille characters (0x2800-0x28FF).
188        #[unsafe(method(backTranslateBraille:))]
189        #[unsafe(method_family = none)]
190        pub unsafe fn backTranslateBraille(
191            &self,
192            braille: &NSString,
193        ) -> Retained<AXBrailleTranslationResult>;
194
195        #[unsafe(method(init))]
196        #[unsafe(method_family = init)]
197        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
198
199        #[unsafe(method(new))]
200        #[unsafe(method_family = new)]
201        pub unsafe fn new() -> Retained<Self>;
202    );
203}