QLPreviewPanelDelegate Protocol Reference

Conforms to
Availability
Available in OS X v10.6 and later.
Companion guide
Declared in
QLPreviewPanel.h
Related sample code

Overview

QLPreviewPanelDelegate is the protocol for the delegate of the Quick Look preview panel (QLPreviewPanel) object.

You can implement these methods to perform custom tasks in response to events in the preview panel.

Tasks

Optional Methods

Instance Methods

previewPanel:handleEvent:

Invoked by the preview panel when it receives an event it doesn't handle. This method is optional.

- (BOOL)previewPanel:(QLPreviewPanel *)panel handleEvent:(NSEvent *)event
Parameters
panel

The preview panel.

event

The event that the preview panel was not able to handle.

Return Value

YES if the receiver handled the event, otherwise NO.

Availability
  • Available in OS X v10.6 and later.
Declared In
QLPreviewPanel.h

previewPanel:sourceFrameOnScreenForPreviewItem:

Returns the screen rectangle for a given preview item. This method is optional.

- (NSRect)previewPanel:(QLPreviewPanel *)panel sourceFrameOnScreenForPreviewItem:(id <QLPreviewItem>)item
Parameters
panel

The preview panel.

item

The preview item for which the screen rectangle is required.

Return Value

The screen rectangle for the given preview item. Return NSZeroRect if there is no origin point (this will produce a fade of the panel).

Discussion

This method is invoked when the preview panel opens or closes to provide a zoom effect. You should return—in screen coordinates—the rectangle that displays the specified preview item.

Availability
  • Available in OS X v10.6 and later.
Declared In
QLPreviewPanel.h

previewPanel:transitionImageForPreviewItem:contentRect:

Returns the image to use for the transition zoom effect for a given item. This method is optional.

- (NSImage *)previewPanel:(QLPreviewPanel *)panel transitionImageForPreviewItem:(id <QLPreviewItem>)item contentRect:(NSRect *)contentRect
Parameters
panel

The preview panel.

item

The preview item for which the transition image is required.

contentRect

The rectangle within a preview image that actually represents the content of the document (for icons, the actual rectangle is typically smaller than the icon itself).

Return Value

The image to use for the transition zoom effect for the item.

Discussion

This method is invoked when the preview panel opens or closes to provide a smooth transition when zooming.

Availability
  • Available in OS X v10.6 and later.
Declared In
QLPreviewPanel.h