implementAsBlocking static method
NSSharingServiceDelegate
implementAsBlocking({})
Builds an object that implements the NSSharingServiceDelegate protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly. All
methods that can be implemented as blocking listeners will be.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSSharingServiceDelegate implementAsBlocking({
void Function(NSSharingService, objc.NSArray)?
sharingService_willShareItems_,
void Function(NSSharingService, objc.NSArray, objc.NSError)?
sharingService_didFailToShareItems_error_,
void Function(NSSharingService, objc.NSArray)?
sharingService_didShareItems_,
NSRect Function(NSSharingService, objc.ObjCObjectBase)?
sharingService_sourceFrameOnScreenForShareItem_,
NSImage? Function(
NSSharingService,
objc.ObjCObjectBase,
ffi.Pointer<NSRect>,
)?
sharingService_transitionImageForShareItem_contentRect_,
NSWindow? Function(NSSharingService, objc.NSArray, ffi.Pointer<NSInteger>)?
sharingService_sourceWindowForShareItems_sharingContentScope_,
NSView? Function(
NSSharingService,
ffi.Pointer<NSRect>,
ffi.Pointer<NSUInteger>,
)?
anchoringViewForSharingService_showRelativeToRect_preferredEdge_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSSharingServiceDelegate',
);
NSSharingServiceDelegate.sharingService_willShareItems_.implementAsBlocking(
builder,
sharingService_willShareItems_,
);
NSSharingServiceDelegate.sharingService_didFailToShareItems_error_
.implementAsBlocking(
builder,
sharingService_didFailToShareItems_error_,
);
NSSharingServiceDelegate.sharingService_didShareItems_.implementAsBlocking(
builder,
sharingService_didShareItems_,
);
NSSharingServiceDelegate.sharingService_sourceFrameOnScreenForShareItem_
.implement(builder, sharingService_sourceFrameOnScreenForShareItem_);
NSSharingServiceDelegate
.sharingService_transitionImageForShareItem_contentRect_
.implement(
builder,
sharingService_transitionImageForShareItem_contentRect_,
);
NSSharingServiceDelegate
.sharingService_sourceWindowForShareItems_sharingContentScope_
.implement(
builder,
sharingService_sourceWindowForShareItems_sharingContentScope_,
);
NSSharingServiceDelegate
.anchoringViewForSharingService_showRelativeToRect_preferredEdge_
.implement(
builder,
anchoringViewForSharingService_showRelativeToRect_preferredEdge_,
);
builder.addProtocol($protocol);
return NSSharingServiceDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}