Introduction to Quick Look Programming Guide
Quick Look is a technology introduced in OS X version 10.5 that enables client applications, such as Spotlight and the Finder, to display thumbnail images and full-size previews of documents. For documents of common content types—notably HTML, RTF, plain text, TIFF, PNG, JPEG, PDF, DAE, and QuickTime movies—this support is automatic. However, applications with documents that are of less common or even private content types can still take advantage of the Quick Look feature. Those applications can include Quick Look generators: plug-ins that convert a given document from its native format into a format that Quick Look can display to users.
This document describes the Quick Look technology and explains how you, as an application developer, can create a generator so Quick Look can display thumbnail and preview images of your documents. Although Quick Look generators are designed as CFPlugIn-style bundles, all the gritty details of plug-in implementation are handled for you. And although the programmatic interface for Quick Look generators is an ANSI C interface, you can write generators using Objective-C code that calls methods of the Cocoa frameworks.
Organization of This Document
The Quick Look Programming Guide has the following chapters:
“Quick Look and the User Experience” describes what the Quick Look technology does and points out the advantages for applications that make use of the technology. it also defines terms that have special meaning in Quick Look.
“Quick Look Architecture” describes the various components of Quick Look, including their roles and how they communicate with each other.
“Creating and Configuring a Quick Look Project” explains how to create a Quick Look generator project and how to specify the properties of a generator.
“Overview of Generator Implementation” summarizes the approaches for generating thumbnails and previews and identifies the best contexts for each approach.
“Drawing Thumbnails and Previews In a Graphics Context” shows how to draw thumbnails and previews in graphics context optimized for bitmap, single-page vector, and multipage vector graphics.
“Dynamically Generating Previews” discusses how you can dynamically generate text-based previews in a supported content type such as RTF or HTML; for HTML previews it also shows how you can include attachments such as images.
“Saving Previews and Thumbnails in the Document” describes the approach where the application saves the thumbnail or preview image in the document and the generator simply retrieves the image for Quick Look. It also describes the function to use when the image data returned to Quick Look is in a format supported by the Image I/O framework.
“Assigning Core Graphics Images to Thumbnails” shows how you can return an image (as a CGImage object) when that image is not in a format supported by the Image I/O framework.
“Canceling Previews and Thumbnails” explains how you can, when requested by Quick Look, cancel the generation of previews and thumbnails.
“Debugging and Testing a Generator” describes the tools and techniques you can use to debug and test a Quick Look generator.
Consult the following documents for descriptions of Quick Look generator functions and constants:
Because generating a thumbnail or preview image often requires drawing or the creation of an image, the following documents might be of help: