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