Skip to content

QuickLook iOS xcode9 beta1

Vincent Dondain edited this page Jun 5, 2017 · 2 revisions

#QuickLook.framework

diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewController.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewController.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewController.h	2016-09-25 10:26:46.000000000 -0400
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewController.h	2017-05-25 00:26:34.000000000 -0400
@@ -133,7 +133,6 @@
  */
 - (UIView* _Nullable)previewController:(QLPreviewController *)controller transitionViewForPreviewItem:(id <QLPreviewItem>)item NS_AVAILABLE_IOS(10_0);
 
-
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewingController.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewingController.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewingController.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewingController.h	2017-05-25 00:26:34.000000000 -0400
@@ -0,0 +1,56 @@
+//
+//  QLPreviewingController.h
+//  Mobile Quick Look
+//
+//  Copyright 2016 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <QuickLook/QLBase.h>
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef void(^QLPreviewItemLoadingBlock)(NSError * _Nullable error);
+
+/**
+ The controller that implements the QLPreviewingController protocol must at least implement one of the two following methods:
+ -[QLPreviewingController preparePreviewOfSearchableItemWithIdentifier:queryString:completionHandler:], to generate previews for Spotlight searchable items.
+ -[QLPreviewingController preparePreviewOfFileAtURL:completionHandler:], to generate previews for file URLs.
+ */
+QL_EXPORT @protocol QLPreviewingController <NSObject>
+
+@optional
+
+/**
+ @abstract
+ Use this method to prepare the content of the view controller with the data that the searchable item represents.
+ 
+ @discussion
+ This method will be called only once. It will be called in the main thread before presenting the view controller.
+ Heavy work potentially blocking the main thread should be avoided in this method.
+ 
+ @param identifier The identifier of the CSSearchableItem the user interacted with in Spotlight.
+ @param queryString The query string the user entered in Spotlight before interacting with the CSSearchableItem.
+ @param handler The completion handler should be called whenever the view is ready to be displayed. A loading spinner will be shown until the handler is called.
+ It can be called asynchronously after the method has returned.
+ */
+- (void)preparePreviewOfSearchableItemWithIdentifier:(NSString *)identifier queryString:(NSString * _Nullable)queryString completionHandler:(QLPreviewItemLoadingBlock)handler NS_SWIFT_NAME(preparePreviewOfSearchableItem(identifier:queryString:completionHandler:));
+
+/**
+ @abstract
+ Use this method to prepare the content of the view controller with the given file URL.
+
+ @discussion
+ This method will be called only once. It will be called in the main thread before presenting the view controller.
+ Heavy work potentially blocking the main thread should be avoided in this method.
+ 
+ @param URL The URL of the file the user is about to preview.
+ @param handler The completion handler should be called whenever the view is ready to be displayed. A loading spinner will be shown until the handler is called.
+ It can be called asynchronously after the method has returned.
+ */
+- (void)preparePreviewOfFileAtURL:(NSURL *)URL completionHandler:(QLPreviewItemLoadingBlock)handler NS_SWIFT_NAME(preparePreviewOfFile(at:completionHandler:));
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailProvider.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailProvider.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailProvider.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailProvider.h	2017-05-25 00:26:34.000000000 -0400
@@ -0,0 +1,31 @@
+//
+//  QLThumbnailProvider.h
+//  Mobile Quick Look
+//
+//  Copyright 2016 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <QuickLook/QLBase.h>
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class QLFileThumbnailRequest, QLThumbnailReply;
+
+NS_CLASS_AVAILABLE_IOS(11_0) QL_EXPORT @interface QLThumbnailProvider : NSObject
+
+/**
+ Subclass this method to provide a QLThumbnailReply that either contains a drawing block or an image file URL.
+ 
+ 
+ @param request An object which contains information about the thumbnail that should be provided. It contains the URL of the file to provide a thumbnail for.
+ @param handler Call the completion handler with a QLThumbnailReply if you can provide a thumbnail, or with an NSError if you cannot.
+                If an error is passed or reply is nil, no thumbnail will be drawn.
+                The handler can be called asynchronously after the method has returned.
+ */
+- (void)provideThumbnailForFileRequest:(QLFileThumbnailRequest *)request completionHandler:(void (^)(QLThumbnailReply * _Nullable reply, NSError * _Nullable error))handler NS_SWIFT_NAME(provideThumbnail(for:_:));
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailReply.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailReply.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailReply.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailReply.h	2017-05-25 00:26:34.000000000 -0400
@@ -0,0 +1,59 @@
+//
+//  QLThumbnailReply.h
+//  Mobile Quick Look
+//
+//  Copyright 2016 Apple Inc. All rights reserved.
+//
+
+#import <CoreGraphics/CoreGraphics.h>
+#import <Foundation/Foundation.h>
+#import <QuickLook/QLBase.h>
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ To provide a thumbnail for a request, you have to return a QLThumbnailReply object.
+ 
+ @discussion To provide a thumbnail, you have two options:
+ 1. Draw the thumbnail, by providing a QLThumbnailReply created with a drawing block.
+ 2. Pass the thumbnail file URL, by providing a QLThumbnailReply created with a file URL.
+ */
+NS_CLASS_AVAILABLE_IOS(11_0) QL_EXPORT @interface QLThumbnailReply : NSObject
+
+- (instancetype)init NS_UNAVAILABLE;
+
+/**
+ You can create a reply with a drawing block that will draw into a given context with the coordinate system of Core Graphics.
+ 
+ @param contextSize The desired size of the context that will be passed to the drawing block.
+ It should be as close as possible to the maximumSize of the QLFileThumbnailRequest. It can be smaller than maximumSize, not larger.
+ Ideally, at least either contextSize's width matches maximumSize's width or contextSize's height matches maximumSize's height.
+ The context size will be scaled to QLFileThumbnailRequest's scale value (if you pass (x, y), the size of the context will be (scale * x, scale * y)).
+ @param drawingBlock The thumbnail should be drawn into the context passed to this block. It is a context of type CGBitmapContext, set up to be used with the coordinate system of Core Graphics.
+ Return YES if the thumbnail was successfully drawn into the context. Return NO otherwise.
+ */
++ (instancetype)replyWithContextSize:(CGSize)contextSize drawingBlock:(BOOL (^)(CGContextRef context))drawingBlock;
+
+/**
+ You can create a reply with a drawing block that will draw into the current context with the coordinate system of UIKit.
+ 
+ @param contextSize The desired size of the context that will be passed to the drawing block.
+ It should be as close as possible to the maximumSize of the QLFileThumbnailRequest. It can be smaller than maximumSize, not larger.
+ Ideally, at least either contextSize's width matches maximumSize's width or contextSize's height matches maximumSize's height.
+ The context size will be scaled to QLFileThumbnailRequest's scale value (if you pass (x, y), the size of the context will be (scale * x, scale * y)).
+ @param drawingBlock A block that draws the thumbnail into the current context which you can access via UIGraphicsGetCurrentContext().
+ It is a context of type CGBitmapContext, set up to be used with the coordinate system of UIKit.
+ Return YES if the thumbnail was successfully drawn into the current context. Return NO otherwise.
+ */
++ (instancetype)replyWithContextSize:(CGSize)contextSize currentContextDrawingBlock:(BOOL (^)())drawingBlock;
+
+/**
+ You can create a reply object with a file URL of an image that will be used as the thumbnail.
+ The image will be downscaled to fit the size of the QLFileThumbnailRequest if necessary.
+ */
++ (instancetype)replyWithImageFileURL:(NSURL *)fileURL;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailRequest.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailRequest.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailRequest.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailRequest.h	2017-05-25 00:26:34.000000000 -0400
@@ -0,0 +1,26 @@
+//
+//  QLPreviewingController.h
+//  Mobile Quick Look
+//
+//  Copyright 2016 Apple Inc. All rights reserved.
+//
+
+#import <CoreGraphics/CoreGraphics.h>
+#import <Foundation/Foundation.h>
+#import <QuickLook/QLBase.h>
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ @abstract This class contains information about the thumbnail that should be provided.
+ */
+NS_CLASS_AVAILABLE_IOS(11_0) QL_EXPORT @interface QLFileThumbnailRequest : NSObject
+
+@property (nonatomic, readonly) CGSize maximumSize;
+@property (nonatomic, readonly) CGFloat scale;
+@property (nonatomic, copy, readonly) NSURL* fileURL;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.apinotes /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.apinotes
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.apinotes	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.apinotes	2017-05-25 00:26:34.000000000 -0400
@@ -0,0 +1,8 @@
+---
+Name: QuickLook
+Classes:
+- Name: QLPreviewController
+  Methods:
+  - Selector: 'canPreviewItem:'
+    SwiftName: canPreview(_:)
+    MethodKind: Class
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.h	2016-09-25 11:16:55.000000000 -0400
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.h	2017-05-25 00:26:34.000000000 -0400
@@ -13,8 +13,12 @@
 #include <QuickLook/QLBase.h>
 
 #if __OBJC__
+#import <QuickLook/QLPreviewingController.h>
 #import <QuickLook/QLPreviewController.h>
 #import <QuickLook/QLPreviewItem.h>
+#import <QuickLook/QLThumbnailProvider.h>
+#import <QuickLook/QLThumbnailRequest.h>
+#import <QuickLook/QLThumbnailReply.h>
 #endif
 
 #endif
Clone this wiki locally