implement static method

NSTextContentStorageDelegate implement({
  1. NSTextParagraph? textContentStorage_textParagraphWithRange_(
    1. NSTextContentStorage,
    2. NSRange
    )?,
  2. NSTextElement? textContentManager_textElementAtLocation_(
    1. NSTextContentManager,
    2. NSTextLocation
    )?,
  3. bool textContentManager_shouldEnumerateTextElement_options_(
    1. NSTextContentManager,
    2. NSTextElement,
    3. NSTextContentManagerEnumerationOptions
    )?,
  4. bool $keepIsolateAlive = true,
})
override

Builds an object that implements the NSTextContentStorageDelegate 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 NSTextContentStorageDelegate implement({
  NSTextParagraph? Function(NSTextContentStorage, NSRange)?
  textContentStorage_textParagraphWithRange_,
  NSTextElement? Function(NSTextContentManager, NSTextLocation)?
  textContentManager_textElementAtLocation_,
  bool Function(
    NSTextContentManager,
    NSTextElement,
    NSTextContentManagerEnumerationOptions,
  )?
  textContentManager_shouldEnumerateTextElement_options_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(
    debugName: 'NSTextContentStorageDelegate',
  );
  NSTextContentStorageDelegate.textContentStorage_textParagraphWithRange_
      .implement(builder, textContentStorage_textParagraphWithRange_);
  NSTextContentStorageDelegate.textContentManager_textElementAtLocation_
      .implement(builder, textContentManager_textElementAtLocation_);
  NSTextContentStorageDelegate
      .textContentManager_shouldEnumerateTextElement_options_
      .implement(
        builder,
        textContentManager_shouldEnumerateTextElement_options_,
      );
  builder.addProtocol($protocol);
  return NSTextContentStorageDelegate.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}