implement static method
NSTextFinderClient
implement({
- bool isSelectable()?,
- bool allowsMultipleSelection()?,
- bool isEditable()?,
- NSString string()?,
- NSString stringAtIndex_effectiveRange_endsWithSearchBoundary_()?,
- DartNSInteger stringLength()?,
- NSRange firstSelectedRange()?,
- NSArray selectedRanges()?,
- void setSelectedRanges_(
- NSArray
- void scrollRangeToVisible_()?,
- bool shouldReplaceCharactersInRanges_withStrings_(
- NSArray,
- NSArray
- void replaceCharactersInRange_withString_(
- NSRange,
- NSString
- void didReplaceCharacters()?,
- NSView contentViewAtIndex_effectiveCharacterRange_()?,
- NSArray? rectsForCharacterRange_()?,
- NSArray visibleCharacterRanges()?,
- void drawCharactersInRange_forContentView_()?,
- bool $keepIsolateAlive = true,
Builds an object that implements the NSTextFinderClient 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 NSTextFinderClient implement({
bool Function()? isSelectable,
bool Function()? allowsMultipleSelection,
bool Function()? isEditable,
objc.NSString Function()? string,
objc.NSString Function(
DartNSUInteger,
NSRangePointer,
ffi.Pointer<ffi.Bool>,
)?
stringAtIndex_effectiveRange_endsWithSearchBoundary_,
DartNSUInteger Function()? stringLength,
NSRange Function()? firstSelectedRange,
objc.NSArray Function()? selectedRanges,
void Function(objc.NSArray)? setSelectedRanges_,
void Function(NSRange)? scrollRangeToVisible_,
bool Function(objc.NSArray, objc.NSArray)?
shouldReplaceCharactersInRanges_withStrings_,
void Function(NSRange, objc.NSString)? replaceCharactersInRange_withString_,
void Function()? didReplaceCharacters,
NSView Function(DartNSUInteger, NSRangePointer)?
contentViewAtIndex_effectiveCharacterRange_,
objc.NSArray? Function(NSRange)? rectsForCharacterRange_,
objc.NSArray Function()? visibleCharacterRanges,
void Function(NSRange, NSView)? drawCharactersInRange_forContentView_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(debugName: 'NSTextFinderClient');
NSTextFinderClient.isSelectable.implement(builder, isSelectable);
NSTextFinderClient.allowsMultipleSelection.implement(
builder,
allowsMultipleSelection,
);
NSTextFinderClient.isEditable.implement(builder, isEditable);
NSTextFinderClient.string.implement(builder, string);
NSTextFinderClient.stringAtIndex_effectiveRange_endsWithSearchBoundary_
.implement(
builder,
stringAtIndex_effectiveRange_endsWithSearchBoundary_,
);
NSTextFinderClient.stringLength.implement(builder, stringLength);
NSTextFinderClient.firstSelectedRange.implement(
builder,
firstSelectedRange,
);
NSTextFinderClient.selectedRanges.implement(builder, selectedRanges);
NSTextFinderClient.setSelectedRanges_.implement(
builder,
setSelectedRanges_,
);
NSTextFinderClient.scrollRangeToVisible_.implement(
builder,
scrollRangeToVisible_,
);
NSTextFinderClient.shouldReplaceCharactersInRanges_withStrings_.implement(
builder,
shouldReplaceCharactersInRanges_withStrings_,
);
NSTextFinderClient.replaceCharactersInRange_withString_.implement(
builder,
replaceCharactersInRange_withString_,
);
NSTextFinderClient.didReplaceCharacters.implement(
builder,
didReplaceCharacters,
);
NSTextFinderClient.contentViewAtIndex_effectiveCharacterRange_.implement(
builder,
contentViewAtIndex_effectiveCharacterRange_,
);
NSTextFinderClient.rectsForCharacterRange_.implement(
builder,
rectsForCharacterRange_,
);
NSTextFinderClient.visibleCharacterRanges.implement(
builder,
visibleCharacterRanges,
);
NSTextFinderClient.drawCharactersInRange_forContentView_.implement(
builder,
drawCharactersInRange_forContentView_,
);
builder.addProtocol($protocol);
return NSTextFinderClient.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}