icrate/generated/AppKit/
NSSpeechSynthesizer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use crate::common::*;
4use crate::AppKit::*;
5use crate::CoreData::*;
6use crate::Foundation::*;
7
8typed_enum!(
9    pub type NSSpeechSynthesizerVoiceName = NSString;
10);
11
12typed_enum!(
13    pub type NSVoiceAttributeKey = NSString;
14);
15
16extern_static!(NSVoiceName: &'static NSVoiceAttributeKey);
17
18extern_static!(NSVoiceIdentifier: &'static NSVoiceAttributeKey);
19
20extern_static!(NSVoiceAge: &'static NSVoiceAttributeKey);
21
22extern_static!(NSVoiceGender: &'static NSVoiceAttributeKey);
23
24extern_static!(NSVoiceDemoText: &'static NSVoiceAttributeKey);
25
26extern_static!(NSVoiceLocaleIdentifier: &'static NSVoiceAttributeKey);
27
28extern_static!(NSVoiceSupportedCharacters: &'static NSVoiceAttributeKey);
29
30extern_static!(NSVoiceIndividuallySpokenCharacters: &'static NSVoiceAttributeKey);
31
32typed_enum!(
33    pub type NSSpeechDictionaryKey = NSString;
34);
35
36extern_static!(NSSpeechDictionaryLocaleIdentifier: &'static NSSpeechDictionaryKey);
37
38extern_static!(NSSpeechDictionaryModificationDate: &'static NSSpeechDictionaryKey);
39
40extern_static!(NSSpeechDictionaryPronunciations: &'static NSSpeechDictionaryKey);
41
42extern_static!(NSSpeechDictionaryAbbreviations: &'static NSSpeechDictionaryKey);
43
44extern_static!(NSSpeechDictionaryEntrySpelling: &'static NSSpeechDictionaryKey);
45
46extern_static!(NSSpeechDictionaryEntryPhonemes: &'static NSSpeechDictionaryKey);
47
48typed_enum!(
49    pub type NSVoiceGenderName = NSString;
50);
51
52extern_static!(NSVoiceGenderNeuter: &'static NSVoiceGenderName);
53
54extern_static!(NSVoiceGenderMale: &'static NSVoiceGenderName);
55
56extern_static!(NSVoiceGenderFemale: &'static NSVoiceGenderName);
57
58extern_static!(NSVoiceGenderNeutral: &'static NSVoiceGenderName);
59
60typed_enum!(
61    pub type NSSpeechPropertyKey = NSString;
62);
63
64extern_static!(NSSpeechStatusProperty: &'static NSSpeechPropertyKey);
65
66extern_static!(NSSpeechErrorsProperty: &'static NSSpeechPropertyKey);
67
68extern_static!(NSSpeechInputModeProperty: &'static NSSpeechPropertyKey);
69
70extern_static!(NSSpeechCharacterModeProperty: &'static NSSpeechPropertyKey);
71
72extern_static!(NSSpeechNumberModeProperty: &'static NSSpeechPropertyKey);
73
74extern_static!(NSSpeechRateProperty: &'static NSSpeechPropertyKey);
75
76extern_static!(NSSpeechPitchBaseProperty: &'static NSSpeechPropertyKey);
77
78extern_static!(NSSpeechPitchModProperty: &'static NSSpeechPropertyKey);
79
80extern_static!(NSSpeechVolumeProperty: &'static NSSpeechPropertyKey);
81
82extern_static!(NSSpeechSynthesizerInfoProperty: &'static NSSpeechPropertyKey);
83
84extern_static!(NSSpeechRecentSyncProperty: &'static NSSpeechPropertyKey);
85
86extern_static!(NSSpeechPhonemeSymbolsProperty: &'static NSSpeechPropertyKey);
87
88extern_static!(NSSpeechCurrentVoiceProperty: &'static NSSpeechPropertyKey);
89
90extern_static!(NSSpeechCommandDelimiterProperty: &'static NSSpeechPropertyKey);
91
92extern_static!(NSSpeechResetProperty: &'static NSSpeechPropertyKey);
93
94extern_static!(NSSpeechOutputToFileURLProperty: &'static NSSpeechPropertyKey);
95
96extern_static!(NSVoiceLanguage: &'static NSVoiceAttributeKey);
97
98ns_enum!(
99    #[underlying(NSUInteger)]
100    pub enum NSSpeechBoundary {
101        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
102        NSSpeechImmediateBoundary = 0,
103        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
104        NSSpeechWordBoundary = 1,
105        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
106        NSSpeechSentenceBoundary = 2,
107    }
108);
109
110extern_class!(
111    #[derive(Debug, PartialEq, Eq, Hash)]
112    #[cfg(feature = "AppKit_NSSpeechSynthesizer")]
113    #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
114    pub struct NSSpeechSynthesizer;
115
116    #[cfg(feature = "AppKit_NSSpeechSynthesizer")]
117    unsafe impl ClassType for NSSpeechSynthesizer {
118        type Super = NSObject;
119        type Mutability = InteriorMutable;
120    }
121);
122
123#[cfg(feature = "AppKit_NSSpeechSynthesizer")]
124unsafe impl NSObjectProtocol for NSSpeechSynthesizer {}
125
126extern_methods!(
127    #[cfg(feature = "AppKit_NSSpeechSynthesizer")]
128    unsafe impl NSSpeechSynthesizer {
129        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
130        #[method_id(@__retain_semantics Init initWithVoice:)]
131        pub unsafe fn initWithVoice(
132            this: Allocated<Self>,
133            voice: Option<&NSSpeechSynthesizerVoiceName>,
134        ) -> Option<Id<Self>>;
135
136        #[cfg(feature = "Foundation_NSString")]
137        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
138        #[method(startSpeakingString:)]
139        pub unsafe fn startSpeakingString(&self, string: &NSString) -> bool;
140
141        #[cfg(all(feature = "Foundation_NSString", feature = "Foundation_NSURL"))]
142        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
143        #[method(startSpeakingString:toURL:)]
144        pub unsafe fn startSpeakingString_toURL(&self, string: &NSString, url: &NSURL) -> bool;
145
146        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
147        #[method(isSpeaking)]
148        pub unsafe fn isSpeaking(&self) -> bool;
149
150        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
151        #[method(stopSpeaking)]
152        pub unsafe fn stopSpeaking(&self);
153
154        #[method(stopSpeakingAtBoundary:)]
155        pub unsafe fn stopSpeakingAtBoundary(&self, boundary: NSSpeechBoundary);
156
157        #[method(pauseSpeakingAtBoundary:)]
158        pub unsafe fn pauseSpeakingAtBoundary(&self, boundary: NSSpeechBoundary);
159
160        #[method(continueSpeaking)]
161        pub unsafe fn continueSpeaking(&self);
162
163        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
164        #[method_id(@__retain_semantics Other delegate)]
165        pub unsafe fn delegate(
166            &self,
167        ) -> Option<Id<ProtocolObject<dyn NSSpeechSynthesizerDelegate>>>;
168
169        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
170        #[method(setDelegate:)]
171        pub unsafe fn setDelegate(
172            &self,
173            delegate: Option<&ProtocolObject<dyn NSSpeechSynthesizerDelegate>>,
174        );
175
176        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
177        #[method_id(@__retain_semantics Other voice)]
178        pub unsafe fn voice(&self) -> Option<Id<NSSpeechSynthesizerVoiceName>>;
179
180        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
181        #[method(setVoice:)]
182        pub unsafe fn setVoice(&self, voice: Option<&NSSpeechSynthesizerVoiceName>) -> bool;
183
184        #[method(rate)]
185        pub unsafe fn rate(&self) -> c_float;
186
187        #[method(setRate:)]
188        pub unsafe fn setRate(&self, rate: c_float);
189
190        #[method(volume)]
191        pub unsafe fn volume(&self) -> c_float;
192
193        #[method(setVolume:)]
194        pub unsafe fn setVolume(&self, volume: c_float);
195
196        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
197        #[method(usesFeedbackWindow)]
198        pub unsafe fn usesFeedbackWindow(&self) -> bool;
199
200        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
201        #[method(setUsesFeedbackWindow:)]
202        pub unsafe fn setUsesFeedbackWindow(&self, uses_feedback_window: bool);
203
204        #[cfg(feature = "Foundation_NSDictionary")]
205        #[method(addSpeechDictionary:)]
206        pub unsafe fn addSpeechDictionary(
207            &self,
208            speech_dictionary: &NSDictionary<NSSpeechDictionaryKey, AnyObject>,
209        );
210
211        #[cfg(feature = "Foundation_NSString")]
212        #[method_id(@__retain_semantics Other phonemesFromText:)]
213        pub unsafe fn phonemesFromText(&self, text: &NSString) -> Id<NSString>;
214
215        #[cfg(feature = "Foundation_NSError")]
216        #[method_id(@__retain_semantics Other objectForProperty:error:_)]
217        pub unsafe fn objectForProperty_error(
218            &self,
219            property: &NSSpeechPropertyKey,
220        ) -> Result<Id<AnyObject>, Id<NSError>>;
221
222        #[cfg(feature = "Foundation_NSError")]
223        #[method(setObject:forProperty:error:_)]
224        pub unsafe fn setObject_forProperty_error(
225            &self,
226            object: Option<&AnyObject>,
227            property: &NSSpeechPropertyKey,
228        ) -> Result<(), Id<NSError>>;
229
230        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
231        #[method(isAnyApplicationSpeaking)]
232        pub unsafe fn isAnyApplicationSpeaking() -> bool;
233
234        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
235        #[method_id(@__retain_semantics Other defaultVoice)]
236        pub unsafe fn defaultVoice() -> Id<NSSpeechSynthesizerVoiceName>;
237
238        #[cfg(feature = "Foundation_NSArray")]
239        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
240        #[method_id(@__retain_semantics Other availableVoices)]
241        pub unsafe fn availableVoices() -> Id<NSArray<NSSpeechSynthesizerVoiceName>>;
242
243        #[cfg(feature = "Foundation_NSDictionary")]
244        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
245        #[method_id(@__retain_semantics Other attributesForVoice:)]
246        pub unsafe fn attributesForVoice(
247            voice: &NSSpeechSynthesizerVoiceName,
248        ) -> Id<NSDictionary<NSVoiceAttributeKey, AnyObject>>;
249    }
250);
251
252extern_methods!(
253    /// Methods declared on superclass `NSObject`
254    #[cfg(feature = "AppKit_NSSpeechSynthesizer")]
255    unsafe impl NSSpeechSynthesizer {
256        #[method_id(@__retain_semantics Init init)]
257        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
258
259        #[method_id(@__retain_semantics New new)]
260        pub unsafe fn new() -> Id<Self>;
261    }
262);
263
264extern_protocol!(
265    #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
266    pub unsafe trait NSSpeechSynthesizerDelegate:
267        NSObjectProtocol + IsMainThreadOnly
268    {
269        #[cfg(feature = "AppKit_NSSpeechSynthesizer")]
270        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
271        #[optional]
272        #[method(speechSynthesizer:didFinishSpeaking:)]
273        unsafe fn speechSynthesizer_didFinishSpeaking(
274            &self,
275            sender: &NSSpeechSynthesizer,
276            finished_speaking: bool,
277        );
278
279        #[cfg(all(
280            feature = "AppKit_NSSpeechSynthesizer",
281            feature = "Foundation_NSString"
282        ))]
283        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
284        #[optional]
285        #[method(speechSynthesizer:willSpeakWord:ofString:)]
286        unsafe fn speechSynthesizer_willSpeakWord_ofString(
287            &self,
288            sender: &NSSpeechSynthesizer,
289            character_range: NSRange,
290            string: &NSString,
291        );
292
293        #[cfg(feature = "AppKit_NSSpeechSynthesizer")]
294        #[deprecated = "Use AVSpeechSynthesizer in AVFoundation instead"]
295        #[optional]
296        #[method(speechSynthesizer:willSpeakPhoneme:)]
297        unsafe fn speechSynthesizer_willSpeakPhoneme(
298            &self,
299            sender: &NSSpeechSynthesizer,
300            phoneme_opcode: c_short,
301        );
302
303        #[cfg(all(
304            feature = "AppKit_NSSpeechSynthesizer",
305            feature = "Foundation_NSString"
306        ))]
307        #[optional]
308        #[method(speechSynthesizer:didEncounterErrorAtIndex:ofString:message:)]
309        unsafe fn speechSynthesizer_didEncounterErrorAtIndex_ofString_message(
310            &self,
311            sender: &NSSpeechSynthesizer,
312            character_index: NSUInteger,
313            string: &NSString,
314            message: &NSString,
315        );
316
317        #[cfg(all(
318            feature = "AppKit_NSSpeechSynthesizer",
319            feature = "Foundation_NSString"
320        ))]
321        #[optional]
322        #[method(speechSynthesizer:didEncounterSyncMessage:)]
323        unsafe fn speechSynthesizer_didEncounterSyncMessage(
324            &self,
325            sender: &NSSpeechSynthesizer,
326            message: &NSString,
327        );
328    }
329
330    unsafe impl ProtocolType for dyn NSSpeechSynthesizerDelegate {}
331);
332
333typed_enum!(
334    pub type NSSpeechMode = NSString;
335);
336
337extern_static!(NSSpeechModeText: &'static NSSpeechMode);
338
339extern_static!(NSSpeechModePhoneme: &'static NSSpeechMode);
340
341extern_static!(NSSpeechModeNormal: &'static NSSpeechMode);
342
343extern_static!(NSSpeechModeLiteral: &'static NSSpeechMode);
344
345typed_enum!(
346    pub type NSSpeechStatusKey = NSString;
347);
348
349extern_static!(NSSpeechStatusOutputBusy: &'static NSSpeechStatusKey);
350
351extern_static!(NSSpeechStatusOutputPaused: &'static NSSpeechStatusKey);
352
353extern_static!(NSSpeechStatusNumberOfCharactersLeft: &'static NSSpeechStatusKey);
354
355extern_static!(NSSpeechStatusPhonemeCode: &'static NSSpeechStatusKey);
356
357typed_enum!(
358    pub type NSSpeechErrorKey = NSString;
359);
360
361extern_static!(NSSpeechErrorCount: &'static NSSpeechErrorKey);
362
363extern_static!(NSSpeechErrorOldestCode: &'static NSSpeechErrorKey);
364
365extern_static!(NSSpeechErrorOldestCharacterOffset: &'static NSSpeechErrorKey);
366
367extern_static!(NSSpeechErrorNewestCode: &'static NSSpeechErrorKey);
368
369extern_static!(NSSpeechErrorNewestCharacterOffset: &'static NSSpeechErrorKey);
370
371typed_enum!(
372    pub type NSSpeechSynthesizerInfoKey = NSString;
373);
374
375extern_static!(NSSpeechSynthesizerInfoIdentifier: &'static NSSpeechSynthesizerInfoKey);
376
377extern_static!(NSSpeechSynthesizerInfoVersion: &'static NSSpeechSynthesizerInfoKey);
378
379typed_enum!(
380    pub type NSSpeechPhonemeInfoKey = NSString;
381);
382
383extern_static!(NSSpeechPhonemeInfoOpcode: &'static NSSpeechPhonemeInfoKey);
384
385extern_static!(NSSpeechPhonemeInfoSymbol: &'static NSSpeechPhonemeInfoKey);
386
387extern_static!(NSSpeechPhonemeInfoExample: &'static NSSpeechPhonemeInfoKey);
388
389extern_static!(NSSpeechPhonemeInfoHiliteStart: &'static NSSpeechPhonemeInfoKey);
390
391extern_static!(NSSpeechPhonemeInfoHiliteEnd: &'static NSSpeechPhonemeInfoKey);
392
393typed_enum!(
394    pub type NSSpeechCommandDelimiterKey = NSString;
395);
396
397extern_static!(NSSpeechCommandPrefix: &'static NSSpeechCommandDelimiterKey);
398
399extern_static!(NSSpeechCommandSuffix: &'static NSSpeechCommandDelimiterKey);