30 lines
1.1 KiB
C
30 lines
1.1 KiB
C
#include <CoreFoundation/CoreFoundation.h>
|
|
#include <CoreServices/CoreServices.h>
|
|
#include <QuickLook/QuickLook.h>
|
|
#include "opml-lib.h"
|
|
|
|
OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options);
|
|
void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview);
|
|
|
|
/* -----------------------------------------------------------------------------
|
|
Generate a preview for file
|
|
|
|
This function's job is to create preview for designated file
|
|
----------------------------------------------------------------------------- */
|
|
|
|
OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options)
|
|
{
|
|
CFBundleRef bundle = QLPreviewRequestGetGeneratorBundle(preview);
|
|
CFDataRef data = generateHTML(url, bundle, false);
|
|
if (data) {
|
|
QLPreviewRequestSetDataRepresentation(preview, data, kUTTypeHTML, NULL);
|
|
CFRelease(data);
|
|
}
|
|
return noErr;
|
|
}
|
|
|
|
void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview)
|
|
{
|
|
// Implement only if supported
|
|
}
|