QLPreviewPanelDataSource

Trait QLPreviewPanelDataSource 

Source
pub unsafe trait QLPreviewPanelDataSource {
    // Provided methods
    unsafe fn numberOfPreviewItemsInPreviewPanel(
        &self,
        panel: Option<&QLPreviewPanel>,
    ) -> NSInteger
       where Self: Sized + Message { ... }
    unsafe fn previewPanel_previewItemAtIndex(
        &self,
        panel: Option<&QLPreviewPanel>,
        index: NSInteger,
    ) -> Option<Retained<ProtocolObject<dyn QLPreviewItem>>>
       where Self: Sized + Message { ... }
}
Available on crate feature QLPreviewPanel only.
Expand description

A protocol that the Quick Look preview panel uses to access the contents of its data source object.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn numberOfPreviewItemsInPreviewPanel( &self, panel: Option<&QLPreviewPanel>, ) -> NSInteger
where Self: Sized + Message,

Available on crate feature objc2-app-kit only.

Returns the number of items that the preview panel should preview.

  • Parameters:

  • panel: The preview panel.

  • Returns: The number of items the preview panel should display.

§Safety

panel might not allow None.

Source

unsafe fn previewPanel_previewItemAtIndex( &self, panel: Option<&QLPreviewPanel>, index: NSInteger, ) -> Option<Retained<ProtocolObject<dyn QLPreviewItem>>>
where Self: Sized + Message,

Available on crate features QLPreviewItem and objc2-app-kit only.

Returns the item that the preview panel should preview at a given index.

  • Parameters:

  • panel: The preview panel.

  • index: The index of the item to preview.

  • Returns: The item that the preview panel should preview at index index.

§Safety

panel might not allow None.

Trait Implementations§

Source§

impl ProtocolType for dyn QLPreviewPanelDataSource

Source§

const NAME: &'static str = "QLPreviewPanelDataSource"

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 QLPreviewPanelDataSource

Implementations on Foreign Types§

Source§

impl<T> QLPreviewPanelDataSource for ProtocolObject<T>

Implementors§