addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. required NSArray writableTypesForPasteboard_(
    1. NSPasteboard pasteboard
    ),
  3. NSPasteboardWritingOptions writingOptionsForType_pasteboard_(
    1. DartNSPasteboardType,
    2. NSPasteboard
    )?,
  4. required ObjCObjectBase? pasteboardPropertyListForType_(
    1. NSString aClassName
    ),
  5. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSPasteboardWriting 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 objc.NSArray Function(NSPasteboard) writableTypesForPasteboard_,
  NSPasteboardWritingOptions Function(DartNSPasteboardType, NSPasteboard)?
  writingOptionsForType_pasteboard_,
  required objc.ObjCObjectBase? Function(DartNSAnimatablePropertyKey)
  pasteboardPropertyListForType_,
  bool $keepIsolateAlive = true,
}) {
  NSPasteboardWriting.writableTypesForPasteboard_.implement(
    builder,
    writableTypesForPasteboard_,
  );
  NSPasteboardWriting.writingOptionsForType_pasteboard_.implement(
    builder,
    writingOptionsForType_pasteboard_,
  );
  NSPasteboardWriting.pasteboardPropertyListForType_.implement(
    builder,
    pasteboardPropertyListForType_,
  );
  builder.addProtocol($protocol);
}