Mac Developer Library

Developer

QLPreviewPanel Class Reference

Options
Deployment Target:

On This Page
Language:

QLPreviewPanel

The QLPreviewPanel class implements the Quick Look preview panel—a user interface object that displays the preview of a list of items.

Every application has a single shared instance of QLPreviewPanel (see sharedPreviewPanelExists). The preview panel follows the responder chain and adapts to the first responder willing to control it. A preview panel controller provides the content through methods defined in the QLPreviewPanelDataSource protocol.

You can not subclass QLPreviewPanel; you can, however, customize its behavior using a delegate (see delegate and the QLPreviewPanelDelegate Protocol informal protocol).

  • Returns the shared Quick Look preview panel instance.

    Declaration

    + (QLPreviewPanel *)sharedPreviewPanel

    Return Value

    The shared Quick Look preview panel instance for the application.

    Discussion

    This method creates the panel if it doesn’t exist yet. Use sharedPreviewPanelExists if you want to determine whether the panel exists without creating it.

  • Returns a Boolean value that indicates whether the shared Quick Look preview panel instance has been created.

    Declaration

    + (BOOL)sharedPreviewPanelExists

    Return Value

    YEStrue if the shared Quick Look preview panel instance has been created, otherwise NOfalse.

  • The current first responder accepting to control the preview panel.

    Declaration

    @property(readonly) id currentController

    Discussion

    You should never change the preview panel’s state (its delegate, datasource, and so on) if you are not controlling it.

  • Asks the preview panel to update its current controller.

    Declaration

    - (void)updateController

    Discussion

    The preview panel automatically updates its controller (by searching the responder chain) whenever the main or key window changes. You should only invoke this method if the responder chain changes without explicit notice.

  • dataSource Property

    The preview panel data source.

    Declaration

    @property(assign) id < QLPreviewPanelDataSource > dataSource

  • Asks the preview panel to reload its data from its data source.

    Declaration

    - (void)reloadData

    Discussion

    This method does not refresh the visible item if it has not changed.

  • Asks the preview panel to recompute the preview of the current preview item.

    Declaration

    - (void)refreshCurrentPreviewItem

    Discussion

    This method does not refresh the visible item if it has not changed.

    See Also

    – reloadData

  • The index of the current preview item.

    Declaration

    @property NSInteger currentPreviewItemIndex

    Discussion

    The value is NSNotFound if there is no current preview item.

  • The currently previewed item.

    Declaration

    @property(readonly) id < QLPreviewItem > currentPreviewItem

    Discussion

    The value is nil if there is no current preview item.

  • The preview panel’s display state.

    Declaration

    @property(retain) id displayState

    Discussion

    The value is an opaque object—you cannot create your own display state.

  • Instructs the panel to enter full screen mode.

    Declaration

    - (BOOL)enterFullScreenMode:(NSScreen *)screen withOptions:(NSDictionary *)options

    Parameters

    screen

    This parameter is not currently used—pass nil.

    options

    This parameter is not currently used—pass nil.

    Return Value

    YEStrue if the panel was able to enter full screen mode, otherwise NOfalse.

    Discussion

    If panel is not on-screen, the panel will go directly to full screen mode.

    The panel will choose the appropriate screen depending on where the panel is or, if entering fullscreen directly, where the panel is supposed to zoom from (see QLPreviewPanelDelegate Protocol).

  • Instructs the panel to exit full screen mode.

    Declaration

    - (void)exitFullScreenModeWithOptions:(NSDictionary *)options

    Parameters

    options

    This parameter is not currently used—pass nil.

  • Indicates whether the panel is in full screen mode.

    Declaration

    @property(readonly, getter=isInFullScreenMode) BOOL inFullScreenMode

    Discussion

    The value is YEStrue if the panel is currently open and in full screen mode, otherwise it is NOfalse.