NSSharingServiceDelegate

Trait NSSharingServiceDelegate 

Source
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 { ... }
}
Available on crate feature NSSharingService only.
Expand description

Provided Methods§

Source

unsafe fn sharingService_willShareItems( &self, sharing_service: &NSSharingService, items: &NSArray, )
where Self: Sized + Message,

§Safety

items generic should be of the correct type.

Source

unsafe fn sharingService_didFailToShareItems_error( &self, sharing_service: &NSSharingService, items: &NSArray, error: &NSError, )
where Self: Sized + Message,

§Safety

items generic should be of the correct type.

Source

unsafe fn sharingService_didShareItems( &self, sharing_service: &NSSharingService, items: &NSArray, )
where Self: Sized + Message,

§Safety

items generic should be of the correct type.

Source

unsafe fn sharingService_sourceFrameOnScreenForShareItem( &self, sharing_service: &NSSharingService, item: &AnyObject, ) -> NSRect
where Self: Sized + Message,

§Safety

item should be of the correct type.

Source

unsafe fn sharingService_transitionImageForShareItem_contentRect( &self, sharing_service: &NSSharingService, item: &AnyObject, content_rect: NonNull<NSRect>, ) -> Option<Retained<NSImage>>
where Self: Sized + Message,

Available on crate feature NSImage only.

When non-nil, the image returned would be used for the transitioning animation. When nil, the transitioning animation is disabled.

§Safety
  • item should be of the correct type.
  • content_rect must be a valid pointer.
Source

unsafe fn sharingService_sourceWindowForShareItems_sharingContentScope( &self, sharing_service: &NSSharingService, items: &NSArray, sharing_content_scope: NonNull<NSSharingContentScope>, ) -> Option<Retained<NSWindow>>
where Self: Sized + Message,

Available on crate features NSResponder and NSWindow only.
§Safety
  • items generic should be of the correct type.
  • sharing_content_scope must be a valid pointer.
Source

unsafe fn anchoringViewForSharingService_showRelativeToRect_preferredEdge( &self, sharing_service: &NSSharingService, positioning_rect: NonNull<NSRect>, preferred_edge: NonNull<NSRectEdge>, ) -> Option<Retained<NSView>>
where Self: Sized + Message,

Available on crate features 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.

§Safety
  • positioning_rect must be a valid pointer.
  • preferred_edge must be a valid pointer.

Trait Implementations§

Source§

impl ProtocolType for dyn NSSharingServiceDelegate

Source§

const NAME: &'static str = "NSSharingServiceDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn NSSharingServiceDelegate

Implementations on Foreign Types§

Source§

impl<T> NSSharingServiceDelegate for ProtocolObject<T>

Implementors§