objc2_foundation/generated/
NSSpellServer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsspellserver?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct NSSpellServer;
14);
15
16extern_conformance!(
17    unsafe impl NSObjectProtocol for NSSpellServer {}
18);
19
20impl NSSpellServer {
21    extern_methods!(
22        #[unsafe(method(delegate))]
23        #[unsafe(method_family = none)]
24        pub unsafe fn delegate(
25            &self,
26        ) -> Option<Retained<ProtocolObject<dyn NSSpellServerDelegate>>>;
27
28        /// Setter for [`delegate`][Self::delegate].
29        #[unsafe(method(setDelegate:))]
30        #[unsafe(method_family = none)]
31        pub unsafe fn setDelegate(
32            &self,
33            delegate: Option<&ProtocolObject<dyn NSSpellServerDelegate>>,
34        );
35
36        #[cfg(feature = "NSString")]
37        #[unsafe(method(registerLanguage:byVendor:))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn registerLanguage_byVendor(
40            &self,
41            language: Option<&NSString>,
42            vendor: Option<&NSString>,
43        ) -> bool;
44
45        #[cfg(feature = "NSString")]
46        #[unsafe(method(isWordInUserDictionaries:caseSensitive:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn isWordInUserDictionaries_caseSensitive(
49            &self,
50            word: &NSString,
51            flag: bool,
52        ) -> bool;
53
54        #[unsafe(method(run))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn run(&self);
57    );
58}
59
60/// Methods declared on superclass `NSObject`.
61impl NSSpellServer {
62    extern_methods!(
63        #[unsafe(method(init))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
66
67        #[unsafe(method(new))]
68        #[unsafe(method_family = new)]
69        pub unsafe fn new() -> Retained<Self>;
70    );
71}
72
73extern "C" {
74    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsgrammarrange?language=objc)
75    #[cfg(feature = "NSString")]
76    pub static NSGrammarRange: &'static NSString;
77}
78
79extern "C" {
80    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsgrammaruserdescription?language=objc)
81    #[cfg(feature = "NSString")]
82    pub static NSGrammarUserDescription: &'static NSString;
83}
84
85extern "C" {
86    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsgrammarcorrections?language=objc)
87    #[cfg(feature = "NSString")]
88    pub static NSGrammarCorrections: &'static NSString;
89}
90
91extern_protocol!(
92    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsspellserverdelegate?language=objc)
93    pub unsafe trait NSSpellServerDelegate: NSObjectProtocol {
94        #[cfg(all(feature = "NSRange", feature = "NSString"))]
95        #[optional]
96        #[unsafe(method(spellServer:findMisspelledWordInString:language:wordCount:countOnly:))]
97        #[unsafe(method_family = none)]
98        unsafe fn spellServer_findMisspelledWordInString_language_wordCount_countOnly(
99            &self,
100            sender: &NSSpellServer,
101            string_to_check: &NSString,
102            language: &NSString,
103            word_count: NonNull<NSInteger>,
104            count_only: bool,
105        ) -> NSRange;
106
107        #[cfg(all(feature = "NSArray", feature = "NSString"))]
108        #[optional]
109        #[unsafe(method(spellServer:suggestGuessesForWord:inLanguage:))]
110        #[unsafe(method_family = none)]
111        unsafe fn spellServer_suggestGuessesForWord_inLanguage(
112            &self,
113            sender: &NSSpellServer,
114            word: &NSString,
115            language: &NSString,
116        ) -> Option<Retained<NSArray<NSString>>>;
117
118        #[cfg(feature = "NSString")]
119        #[optional]
120        #[unsafe(method(spellServer:didLearnWord:inLanguage:))]
121        #[unsafe(method_family = none)]
122        unsafe fn spellServer_didLearnWord_inLanguage(
123            &self,
124            sender: &NSSpellServer,
125            word: &NSString,
126            language: &NSString,
127        );
128
129        #[cfg(feature = "NSString")]
130        #[optional]
131        #[unsafe(method(spellServer:didForgetWord:inLanguage:))]
132        #[unsafe(method_family = none)]
133        unsafe fn spellServer_didForgetWord_inLanguage(
134            &self,
135            sender: &NSSpellServer,
136            word: &NSString,
137            language: &NSString,
138        );
139
140        #[cfg(all(feature = "NSArray", feature = "NSRange", feature = "NSString"))]
141        #[optional]
142        #[unsafe(method(spellServer:suggestCompletionsForPartialWordRange:inString:language:))]
143        #[unsafe(method_family = none)]
144        unsafe fn spellServer_suggestCompletionsForPartialWordRange_inString_language(
145            &self,
146            sender: &NSSpellServer,
147            range: NSRange,
148            string: &NSString,
149            language: &NSString,
150        ) -> Option<Retained<NSArray<NSString>>>;
151
152        #[cfg(all(
153            feature = "NSArray",
154            feature = "NSDictionary",
155            feature = "NSRange",
156            feature = "NSString"
157        ))]
158        #[optional]
159        #[unsafe(method(spellServer:checkGrammarInString:language:details:))]
160        #[unsafe(method_family = none)]
161        unsafe fn spellServer_checkGrammarInString_language_details(
162            &self,
163            sender: &NSSpellServer,
164            string_to_check: &NSString,
165            language: Option<&NSString>,
166            details: Option<&mut Option<Retained<NSArray<NSDictionary<NSString, AnyObject>>>>>,
167        ) -> NSRange;
168
169        #[cfg(all(
170            feature = "NSArray",
171            feature = "NSDictionary",
172            feature = "NSOrthography",
173            feature = "NSString",
174            feature = "NSTextCheckingResult"
175        ))]
176        #[optional]
177        #[unsafe(method(spellServer:checkString:offset:types:options:orthography:wordCount:))]
178        #[unsafe(method_family = none)]
179        unsafe fn spellServer_checkString_offset_types_options_orthography_wordCount(
180            &self,
181            sender: &NSSpellServer,
182            string_to_check: &NSString,
183            offset: NSUInteger,
184            checking_types: NSTextCheckingTypes,
185            options: Option<&NSDictionary<NSString, AnyObject>>,
186            orthography: Option<&NSOrthography>,
187            word_count: NonNull<NSInteger>,
188        ) -> Option<Retained<NSArray<NSTextCheckingResult>>>;
189
190        #[cfg(feature = "NSString")]
191        #[optional]
192        #[unsafe(method(spellServer:recordResponse:toCorrection:forWord:language:))]
193        #[unsafe(method_family = none)]
194        unsafe fn spellServer_recordResponse_toCorrection_forWord_language(
195            &self,
196            sender: &NSSpellServer,
197            response: NSUInteger,
198            correction: &NSString,
199            word: &NSString,
200            language: &NSString,
201        );
202    }
203);