pub unsafe trait NSSharingServiceDelegate: NSObjectProtocol + MainThreadOnly {
// Provided methods
unsafe fn sharingService_willShareItems(
&self,
sharing_service: &NSSharingService,
items: &NSArray,
)
where Self: Sized + Message { ... }
unsafe fn sharingService_didFailToShareItems_error(
&self,
sharing_service: &NSSharingService,
items: &NSArray,
error: &NSError,
)
where Self: Sized + Message { ... }
unsafe fn sharingService_didShareItems(
&self,
sharing_service: &NSSharingService,
items: &NSArray,
)
where Self: Sized + Message { ... }
unsafe fn sharingService_sourceFrameOnScreenForShareItem(
&self,
sharing_service: &NSSharingService,
item: &AnyObject,
) -> NSRect
where Self: Sized + Message { ... }
unsafe fn sharingService_transitionImageForShareItem_contentRect(
&self,
sharing_service: &NSSharingService,
item: &AnyObject,
content_rect: NonNull<NSRect>,
) -> Option<Retained<NSImage>>
where Self: Sized + Message { ... }
unsafe fn sharingService_sourceWindowForShareItems_sharingContentScope(
&self,
sharing_service: &NSSharingService,
items: &NSArray,
sharing_content_scope: NonNull<NSSharingContentScope>,
) -> Option<Retained<NSWindow>>
where Self: Sized + Message { ... }
unsafe fn anchoringViewForSharingService_showRelativeToRect_preferredEdge(
&self,
sharing_service: &NSSharingService,
positioning_rect: NonNull<NSRect>,
preferred_edge: NonNull<NSRectEdge>,
) -> Option<Retained<NSView>>
where Self: Sized + Message { ... }
}
NSSharingService
only.Expand description
Provided Methods§
Available on crate feature NSImage
only.
NSImage
only.When non-nil, the image returned would be used for the transitioning animation. When nil, the transitioning animation is disabled.
NSResponder
and NSWindow
only.Sourceunsafe fn anchoringViewForSharingService_showRelativeToRect_preferredEdge(
&self,
sharing_service: &NSSharingService,
positioning_rect: NonNull<NSRect>,
preferred_edge: NonNull<NSRectEdge>,
) -> Option<Retained<NSView>>
Available on crate features NSResponder
and NSView
only.
unsafe fn anchoringViewForSharingService_showRelativeToRect_preferredEdge( &self, sharing_service: &NSSharingService, positioning_rect: NonNull<NSRect>, preferred_edge: NonNull<NSRectEdge>, ) -> Option<Retained<NSView>>
NSResponder
and NSView
only.The following method is invoked when the service is performed and wants to display its contents in a popover. The delegate should return the view that will act as the anchor of the popover, along with the target rectangle within the bounds of that view and preferred edge of that rectangle for the popover to appear. The delegate may also return nil, indicating that there is no anchoring view currently available, in which case the service may attempt to display the service via some other means.
The service named NSSharingServiceNameCloudSharing prefers to display itself using a popover anchored to an “Add People” or “Share” button. If no such button is available or visible, return nil.