addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. required NSTextRange documentRange(),
  3. required NSTextLocation? enumerateTextElementsFromLocation_options_usingBlock_(
    1. NSTextLocation?,
    2. NSTextContentManagerEnumerationOptions,
    3. ObjCBlock<Bool Function(NSTextElement)>
    ),
  4. required void replaceContentsInRange_withTextElements_(
    1. NSTextRange,
    2. NSArray?
    ),
  5. required void synchronizeToBackingStore_(
    1. ObjCBlock<Void Function(NSError?)>?
    ),
  6. NSTextLocation? locationFromLocation_withOffset_(
    1. NSTextLocation,
    2. DartNSInteger
    )?,
  7. DartNSInteger offsetFromLocation_toLocation_(
    1. NSTextLocation,
    2. NSTextLocation
    )?,
  8. NSTextRange? adjustedRangeFromRange_forEditingTextSelection_(
    1. NSTextRange,
    2. bool
    )?,
  9. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSTextElementProvider 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, {
  required NSTextRange Function() documentRange,
  required NSTextLocation? Function(
    NSTextLocation?,
    NSTextContentManagerEnumerationOptions,
    objc.ObjCBlock<ffi.Bool Function(NSTextElement)>,
  )
  enumerateTextElementsFromLocation_options_usingBlock_,
  required void Function(NSTextRange, objc.NSArray?)
  replaceContentsInRange_withTextElements_,
  required void Function(objc.ObjCBlock<ffi.Void Function(objc.NSError?)>?)
  synchronizeToBackingStore_,
  NSTextLocation? Function(NSTextLocation, DartNSInteger)?
  locationFromLocation_withOffset_,
  DartNSInteger Function(NSTextLocation, NSTextLocation)?
  offsetFromLocation_toLocation_,
  NSTextRange? Function(NSTextRange, bool)?
  adjustedRangeFromRange_forEditingTextSelection_,
  bool $keepIsolateAlive = true,
}) {
  NSTextElementProvider.documentRange.implement(builder, documentRange);
  NSTextElementProvider.enumerateTextElementsFromLocation_options_usingBlock_
      .implement(
        builder,
        enumerateTextElementsFromLocation_options_usingBlock_,
      );
  NSTextElementProvider.replaceContentsInRange_withTextElements_.implement(
    builder,
    replaceContentsInRange_withTextElements_,
  );
  NSTextElementProvider.synchronizeToBackingStore_.implement(
    builder,
    synchronizeToBackingStore_,
  );
  NSTextElementProvider.locationFromLocation_withOffset_.implement(
    builder,
    locationFromLocation_withOffset_,
  );
  NSTextElementProvider.offsetFromLocation_toLocation_.implement(
    builder,
    offsetFromLocation_toLocation_,
  );
  NSTextElementProvider.adjustedRangeFromRange_forEditingTextSelection_
      .implement(builder, adjustedRangeFromRange_forEditingTextSelection_);
  builder.addProtocol($protocol);
}