addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. void speechSynthesizer_didFinishSpeaking_(
    1. NSSpeechSynthesizer,
    2. bool
    )?,
  3. void speechSynthesizer_willSpeakWord_ofString_(
    1. NSSpeechSynthesizer,
    2. NSRange,
    3. NSString
    )?,
  4. void speechSynthesizer_willSpeakPhoneme_(
    1. NSSpeechSynthesizer,
    2. int
    )?,
  5. void speechSynthesizer_didEncounterErrorAtIndex_ofString_message_(
    1. NSSpeechSynthesizer,
    2. DartNSUInteger,
    3. NSString,
    4. NSString,
    )?,
  6. void speechSynthesizer_didEncounterSyncMessage_(
    1. NSSpeechSynthesizer,
    2. NSString
    )?,
  7. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSSpeechSynthesizerDelegate protocol to an existing objc.ObjCProtocolBuilder.

Note: You cannot call this method after you have called builder.build.

Implementation

static void addToBuilder(
  objc.ObjCProtocolBuilder builder, {
  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,
}) {
  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);
}