implement static method
NSTextLayoutManagerDelegate
implement({
- NSTextLayoutFragment textLayoutManager_textLayoutFragmentForLocation_inTextElement_()?,
- bool textLayoutManager_shouldBreakLineBeforeLocation_hyphenating_()?,
- NSDictionary? textLayoutManager_renderingAttributesForLink_atLocation_defaultAttributes_(
- NSTextLayoutManager,
- ObjCObjectBase,
- NSTextLocation,
- NSDictionary,
- bool $keepIsolateAlive = true,
Builds an object that implements the NSTextLayoutManagerDelegate 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 NSTextLayoutManagerDelegate implement({
NSTextLayoutFragment Function(
NSTextLayoutManager,
NSTextLocation,
NSTextElement,
)?
textLayoutManager_textLayoutFragmentForLocation_inTextElement_,
bool Function(NSTextLayoutManager, NSTextLocation, bool)?
textLayoutManager_shouldBreakLineBeforeLocation_hyphenating_,
objc.NSDictionary? Function(
NSTextLayoutManager,
objc.ObjCObjectBase,
NSTextLocation,
objc.NSDictionary,
)?
textLayoutManager_renderingAttributesForLink_atLocation_defaultAttributes_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSTextLayoutManagerDelegate',
);
NSTextLayoutManagerDelegate
.textLayoutManager_textLayoutFragmentForLocation_inTextElement_
.implement(
builder,
textLayoutManager_textLayoutFragmentForLocation_inTextElement_,
);
NSTextLayoutManagerDelegate
.textLayoutManager_shouldBreakLineBeforeLocation_hyphenating_
.implement(
builder,
textLayoutManager_shouldBreakLineBeforeLocation_hyphenating_,
);
NSTextLayoutManagerDelegate
.textLayoutManager_renderingAttributesForLink_atLocation_defaultAttributes_
.implement(
builder,
textLayoutManager_renderingAttributesForLink_atLocation_defaultAttributes_,
);
builder.addProtocol($protocol);
return NSTextLayoutManagerDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}