implement static method

NSTextCheckingClient implement({
  1. required NSAttributedString? annotatedSubstringForProposedRange_actualRange_(
    1. NSRange,
    2. NSRangePointer
    ),
  2. required void setAnnotations_range_(
    1. NSDictionary,
    2. NSRange
    ),
  3. required void addAnnotations_range_(
    1. NSDictionary,
    2. NSRange
    ),
  4. required void removeAnnotation_range_(
    1. DartNSAttributedStringKey,
    2. NSRange
    ),
  5. required void replaceCharactersInRange_withAnnotatedString_(
    1. NSRange,
    2. NSAttributedString
    ),
  6. required void selectAndShowRange_(
    1. NSRange range
    ),
  7. required NSView? viewForRange_firstRect_actualRange_(
    1. NSRange,
    2. NSRectPointer,
    3. NSRangePointer
    ),
  8. required NSCandidateListTouchBarItem? candidateListTouchBarItem(),
  9. required void insertText_replacementRange_(
    1. ObjCObjectBase,
    2. NSRange
    ),
  10. required void doCommandBySelector_(
    1. Pointer<ObjCSelector> aSelector
    ),
  11. required void setMarkedText_selectedRange_replacementRange_(
    1. ObjCObjectBase,
    2. NSRange,
    3. NSRange
    ),
  12. required void unmarkText(),
  13. required NSRange selectedRange(),
  14. required NSRange markedRange(),
  15. required bool hasMarkedText(),
  16. required NSAttributedString? attributedSubstringForProposedRange_actualRange_(
    1. NSRange,
    2. NSRangePointer
    ),
  17. required NSArray validAttributesForMarkedText(),
  18. required NSRect firstRectForCharacterRange_actualRange_(
    1. NSRange,
    2. NSRangePointer
    ),
  19. required DartNSInteger characterIndexForPoint_(
    1. NSPoint point
    ),
  20. NSAttributedString attributedString()?,
  21. DartCGFloat fractionOfDistanceThroughGlyphForPoint_(
    1. NSPoint
    )?,
  22. DartCGFloat baselineDeltaForCharacterAtIndex_(
    1. DartNSUInteger
    )?,
  23. DartNSInteger windowLevel()?,
  24. bool drawsVerticallyForCharacterAtIndex_(
    1. DartNSUInteger
    )?,
  25. NSTextCursorAccessoryPlacement preferredTextAccessoryPlacement()?,
  26. NSRect unionRectInVisibleSelectedRange()?,
  27. NSRect documentVisibleRect()?,
  28. bool supportsAdaptiveImageGlyph()?,
  29. void insertAdaptiveImageGlyph_replacementRange_(
    1. NSAdaptiveImageGlyph,
    2. NSRange
    )?,
  30. NSTextInputTraitType autocorrectionType()?,
  31. void setAutocorrectionType_(
    1. NSTextInputTraitType
    )?,
  32. NSTextInputTraitType spellCheckingType()?,
  33. void setSpellCheckingType_(
    1. NSTextInputTraitType
    )?,
  34. NSTextInputTraitType grammarCheckingType()?,
  35. void setGrammarCheckingType_(
    1. NSTextInputTraitType
    )?,
  36. NSTextInputTraitType smartQuotesType()?,
  37. void setSmartQuotesType_(
    1. NSTextInputTraitType
    )?,
  38. NSTextInputTraitType smartDashesType()?,
  39. void setSmartDashesType_(
    1. NSTextInputTraitType
    )?,
  40. NSTextInputTraitType smartInsertDeleteType()?,
  41. void setSmartInsertDeleteType_(
    1. NSTextInputTraitType
    )?,
  42. NSTextInputTraitType textReplacementType()?,
  43. void setTextReplacementType_(
    1. NSTextInputTraitType
    )?,
  44. NSTextInputTraitType dataDetectionType()?,
  45. void setDataDetectionType_(
    1. NSTextInputTraitType
    )?,
  46. NSTextInputTraitType linkDetectionType()?,
  47. void setLinkDetectionType_(
    1. NSTextInputTraitType
    )?,
  48. NSTextInputTraitType textCompletionType()?,
  49. void setTextCompletionType_(
    1. NSTextInputTraitType
    )?,
  50. NSTextInputTraitType inlinePredictionType()?,
  51. void setInlinePredictionType_(
    1. NSTextInputTraitType
    )?,
  52. NSTextInputTraitType mathExpressionCompletionType()?,
  53. void setMathExpressionCompletionType_(
    1. NSTextInputTraitType
    )?,
  54. NSWritingToolsBehavior writingToolsBehavior()?,
  55. void setWritingToolsBehavior_(
    1. NSWritingToolsBehavior
    )?,
  56. NSWritingToolsResultOptions allowedWritingToolsResultOptions()?,
  57. void setAllowedWritingToolsResultOptions_(
    1. NSWritingToolsResultOptions
    )?,
  58. bool $keepIsolateAlive = true,
})
override

Builds an object that implements the NSTextCheckingClient 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 NSTextCheckingClient implement({
  required NSAttributedString? Function(NSRange, NSRangePointer)
  annotatedSubstringForProposedRange_actualRange_,
  required void Function(objc.NSDictionary, NSRange) setAnnotations_range_,
  required void Function(objc.NSDictionary, NSRange) addAnnotations_range_,
  required void Function(DartNSAttributedStringKey, NSRange)
  removeAnnotation_range_,
  required void Function(NSRange, NSAttributedString)
  replaceCharactersInRange_withAnnotatedString_,
  required void Function(NSRange) selectAndShowRange_,
  required NSView? Function(NSRange, NSRectPointer, NSRangePointer)
  viewForRange_firstRect_actualRange_,
  required NSCandidateListTouchBarItem? Function() candidateListTouchBarItem,
  required void Function(objc.ObjCObjectBase, NSRange)
  insertText_replacementRange_,
  required void Function(ffi.Pointer<objc.ObjCSelector>) doCommandBySelector_,
  required void Function(objc.ObjCObjectBase, NSRange, NSRange)
  setMarkedText_selectedRange_replacementRange_,
  required void Function() unmarkText,
  required NSRange Function() selectedRange,
  required NSRange Function() markedRange,
  required bool Function() hasMarkedText,
  required NSAttributedString? Function(NSRange, NSRangePointer)
  attributedSubstringForProposedRange_actualRange_,
  required objc.NSArray Function() validAttributesForMarkedText,
  required NSRect Function(NSRange, NSRangePointer)
  firstRectForCharacterRange_actualRange_,
  required DartNSUInteger Function(NSPoint) characterIndexForPoint_,
  NSAttributedString Function()? attributedString,
  DartCGFloat Function(NSPoint)? fractionOfDistanceThroughGlyphForPoint_,
  DartCGFloat Function(DartNSUInteger)? baselineDeltaForCharacterAtIndex_,
  DartNSInteger Function()? windowLevel,
  bool Function(DartNSUInteger)? drawsVerticallyForCharacterAtIndex_,
  NSTextCursorAccessoryPlacement Function()? preferredTextAccessoryPlacement,
  NSRect Function()? unionRectInVisibleSelectedRange,
  NSRect Function()? documentVisibleRect,
  bool Function()? supportsAdaptiveImageGlyph,
  void Function(NSAdaptiveImageGlyph, NSRange)?
  insertAdaptiveImageGlyph_replacementRange_,
  NSTextInputTraitType Function()? autocorrectionType,
  void Function(NSTextInputTraitType)? setAutocorrectionType_,
  NSTextInputTraitType Function()? spellCheckingType,
  void Function(NSTextInputTraitType)? setSpellCheckingType_,
  NSTextInputTraitType Function()? grammarCheckingType,
  void Function(NSTextInputTraitType)? setGrammarCheckingType_,
  NSTextInputTraitType Function()? smartQuotesType,
  void Function(NSTextInputTraitType)? setSmartQuotesType_,
  NSTextInputTraitType Function()? smartDashesType,
  void Function(NSTextInputTraitType)? setSmartDashesType_,
  NSTextInputTraitType Function()? smartInsertDeleteType,
  void Function(NSTextInputTraitType)? setSmartInsertDeleteType_,
  NSTextInputTraitType Function()? textReplacementType,
  void Function(NSTextInputTraitType)? setTextReplacementType_,
  NSTextInputTraitType Function()? dataDetectionType,
  void Function(NSTextInputTraitType)? setDataDetectionType_,
  NSTextInputTraitType Function()? linkDetectionType,
  void Function(NSTextInputTraitType)? setLinkDetectionType_,
  NSTextInputTraitType Function()? textCompletionType,
  void Function(NSTextInputTraitType)? setTextCompletionType_,
  NSTextInputTraitType Function()? inlinePredictionType,
  void Function(NSTextInputTraitType)? setInlinePredictionType_,
  NSTextInputTraitType Function()? mathExpressionCompletionType,
  void Function(NSTextInputTraitType)? setMathExpressionCompletionType_,
  NSWritingToolsBehavior Function()? writingToolsBehavior,
  void Function(NSWritingToolsBehavior)? setWritingToolsBehavior_,
  NSWritingToolsResultOptions Function()? allowedWritingToolsResultOptions,
  void Function(NSWritingToolsResultOptions)?
  setAllowedWritingToolsResultOptions_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(debugName: 'NSTextCheckingClient');
  NSTextCheckingClient.annotatedSubstringForProposedRange_actualRange_
      .implement(builder, annotatedSubstringForProposedRange_actualRange_);
  NSTextCheckingClient.setAnnotations_range_.implement(
    builder,
    setAnnotations_range_,
  );
  NSTextCheckingClient.addAnnotations_range_.implement(
    builder,
    addAnnotations_range_,
  );
  NSTextCheckingClient.removeAnnotation_range_.implement(
    builder,
    removeAnnotation_range_,
  );
  NSTextCheckingClient.replaceCharactersInRange_withAnnotatedString_
      .implement(builder, replaceCharactersInRange_withAnnotatedString_);
  NSTextCheckingClient.selectAndShowRange_.implement(
    builder,
    selectAndShowRange_,
  );
  NSTextCheckingClient.viewForRange_firstRect_actualRange_.implement(
    builder,
    viewForRange_firstRect_actualRange_,
  );
  NSTextCheckingClient.candidateListTouchBarItem.implement(
    builder,
    candidateListTouchBarItem,
  );
  NSTextCheckingClient.insertText_replacementRange_.implement(
    builder,
    insertText_replacementRange_,
  );
  NSTextCheckingClient.doCommandBySelector_.implement(
    builder,
    doCommandBySelector_,
  );
  NSTextCheckingClient.setMarkedText_selectedRange_replacementRange_
      .implement(builder, setMarkedText_selectedRange_replacementRange_);
  NSTextCheckingClient.unmarkText.implement(builder, unmarkText);
  NSTextCheckingClient.selectedRange.implement(builder, selectedRange);
  NSTextCheckingClient.markedRange.implement(builder, markedRange);
  NSTextCheckingClient.hasMarkedText.implement(builder, hasMarkedText);
  NSTextCheckingClient.attributedSubstringForProposedRange_actualRange_
      .implement(builder, attributedSubstringForProposedRange_actualRange_);
  NSTextCheckingClient.validAttributesForMarkedText.implement(
    builder,
    validAttributesForMarkedText,
  );
  NSTextCheckingClient.firstRectForCharacterRange_actualRange_.implement(
    builder,
    firstRectForCharacterRange_actualRange_,
  );
  NSTextCheckingClient.characterIndexForPoint_.implement(
    builder,
    characterIndexForPoint_,
  );
  NSTextCheckingClient.attributedString.implement(builder, attributedString);
  NSTextCheckingClient.fractionOfDistanceThroughGlyphForPoint_.implement(
    builder,
    fractionOfDistanceThroughGlyphForPoint_,
  );
  NSTextCheckingClient.baselineDeltaForCharacterAtIndex_.implement(
    builder,
    baselineDeltaForCharacterAtIndex_,
  );
  NSTextCheckingClient.windowLevel.implement(builder, windowLevel);
  NSTextCheckingClient.drawsVerticallyForCharacterAtIndex_.implement(
    builder,
    drawsVerticallyForCharacterAtIndex_,
  );
  NSTextCheckingClient.preferredTextAccessoryPlacement.implement(
    builder,
    preferredTextAccessoryPlacement,
  );
  NSTextCheckingClient.unionRectInVisibleSelectedRange.implement(
    builder,
    unionRectInVisibleSelectedRange,
  );
  NSTextCheckingClient.documentVisibleRect.implement(
    builder,
    documentVisibleRect,
  );
  NSTextCheckingClient.supportsAdaptiveImageGlyph.implement(
    builder,
    supportsAdaptiveImageGlyph,
  );
  NSTextCheckingClient.insertAdaptiveImageGlyph_replacementRange_.implement(
    builder,
    insertAdaptiveImageGlyph_replacementRange_,
  );
  NSTextCheckingClient.autocorrectionType.implement(
    builder,
    autocorrectionType,
  );
  NSTextCheckingClient.setAutocorrectionType_.implement(
    builder,
    setAutocorrectionType_,
  );
  NSTextCheckingClient.spellCheckingType.implement(
    builder,
    spellCheckingType,
  );
  NSTextCheckingClient.setSpellCheckingType_.implement(
    builder,
    setSpellCheckingType_,
  );
  NSTextCheckingClient.grammarCheckingType.implement(
    builder,
    grammarCheckingType,
  );
  NSTextCheckingClient.setGrammarCheckingType_.implement(
    builder,
    setGrammarCheckingType_,
  );
  NSTextCheckingClient.smartQuotesType.implement(builder, smartQuotesType);
  NSTextCheckingClient.setSmartQuotesType_.implement(
    builder,
    setSmartQuotesType_,
  );
  NSTextCheckingClient.smartDashesType.implement(builder, smartDashesType);
  NSTextCheckingClient.setSmartDashesType_.implement(
    builder,
    setSmartDashesType_,
  );
  NSTextCheckingClient.smartInsertDeleteType.implement(
    builder,
    smartInsertDeleteType,
  );
  NSTextCheckingClient.setSmartInsertDeleteType_.implement(
    builder,
    setSmartInsertDeleteType_,
  );
  NSTextCheckingClient.textReplacementType.implement(
    builder,
    textReplacementType,
  );
  NSTextCheckingClient.setTextReplacementType_.implement(
    builder,
    setTextReplacementType_,
  );
  NSTextCheckingClient.dataDetectionType.implement(
    builder,
    dataDetectionType,
  );
  NSTextCheckingClient.setDataDetectionType_.implement(
    builder,
    setDataDetectionType_,
  );
  NSTextCheckingClient.linkDetectionType.implement(
    builder,
    linkDetectionType,
  );
  NSTextCheckingClient.setLinkDetectionType_.implement(
    builder,
    setLinkDetectionType_,
  );
  NSTextCheckingClient.textCompletionType.implement(
    builder,
    textCompletionType,
  );
  NSTextCheckingClient.setTextCompletionType_.implement(
    builder,
    setTextCompletionType_,
  );
  NSTextCheckingClient.inlinePredictionType.implement(
    builder,
    inlinePredictionType,
  );
  NSTextCheckingClient.setInlinePredictionType_.implement(
    builder,
    setInlinePredictionType_,
  );
  NSTextCheckingClient.mathExpressionCompletionType.implement(
    builder,
    mathExpressionCompletionType,
  );
  NSTextCheckingClient.setMathExpressionCompletionType_.implement(
    builder,
    setMathExpressionCompletionType_,
  );
  NSTextCheckingClient.writingToolsBehavior.implement(
    builder,
    writingToolsBehavior,
  );
  NSTextCheckingClient.setWritingToolsBehavior_.implement(
    builder,
    setWritingToolsBehavior_,
  );
  NSTextCheckingClient.allowedWritingToolsResultOptions.implement(
    builder,
    allowedWritingToolsResultOptions,
  );
  NSTextCheckingClient.setAllowedWritingToolsResultOptions_.implement(
    builder,
    setAllowedWritingToolsResultOptions_,
  );
  builder.addProtocol($protocol);
  return NSTextCheckingClient.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}