implement static method
NSTextContentStorageDelegate
implement({
- NSTextParagraph? textContentStorage_textParagraphWithRange_()?,
- NSTextElement? textContentManager_textElementAtLocation_()?,
- bool textContentManager_shouldEnumerateTextElement_options_()?,
- 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),
);
}