implement static method
NSSpeechSynthesizerDelegate
implement({
- void speechSynthesizer_didFinishSpeaking_()?,
- void speechSynthesizer_willSpeakWord_ofString_(
- NSSpeechSynthesizer,
- NSRange,
- NSString
- void speechSynthesizer_willSpeakPhoneme_()?,
- void speechSynthesizer_didEncounterErrorAtIndex_ofString_message_(
- NSSpeechSynthesizer,
- DartNSUInteger,
- NSString,
- NSString,
- void speechSynthesizer_didEncounterSyncMessage_(
- NSSpeechSynthesizer,
- NSString
- bool $keepIsolateAlive = true,
Builds an object that implements the NSSpeechSynthesizerDelegate protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSSpeechSynthesizerDelegate implement({
void Function(NSSpeechSynthesizer, bool)?
speechSynthesizer_didFinishSpeaking_,
void Function(NSSpeechSynthesizer, NSRange, objc.NSString)?
speechSynthesizer_willSpeakWord_ofString_,
void Function(NSSpeechSynthesizer, int)?
speechSynthesizer_willSpeakPhoneme_,
void Function(
NSSpeechSynthesizer,
DartNSUInteger,
objc.NSString,
objc.NSString,
)?
speechSynthesizer_didEncounterErrorAtIndex_ofString_message_,
void Function(NSSpeechSynthesizer, objc.NSString)?
speechSynthesizer_didEncounterSyncMessage_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSSpeechSynthesizerDelegate',
);
NSSpeechSynthesizerDelegate.speechSynthesizer_didFinishSpeaking_.implement(
builder,
speechSynthesizer_didFinishSpeaking_,
);
NSSpeechSynthesizerDelegate.speechSynthesizer_willSpeakWord_ofString_
.implement(builder, speechSynthesizer_willSpeakWord_ofString_);
NSSpeechSynthesizerDelegate.speechSynthesizer_willSpeakPhoneme_.implement(
builder,
speechSynthesizer_willSpeakPhoneme_,
);
NSSpeechSynthesizerDelegate
.speechSynthesizer_didEncounterErrorAtIndex_ofString_message_
.implement(
builder,
speechSynthesizer_didEncounterErrorAtIndex_ofString_message_,
);
NSSpeechSynthesizerDelegate.speechSynthesizer_didEncounterSyncMessage_
.implement(builder, speechSynthesizer_didEncounterSyncMessage_);
builder.addProtocol($protocol);
return NSSpeechSynthesizerDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}