peachsim 0.1.2176 → 0.1.2179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +2205 -1861
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +837 -571
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1732 -1396
- package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +2 -2
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +2 -2
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +59 -54
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +2223 -1876
- package/dist-lib/swift-compile.cjs +2 -2
- package/dist-lib/swift-compile.mjs +2 -2
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1587 -1319
- package/dist-lib/vite.cjs +2 -2
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNChangeHistoryEvent.h +116 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNChangeHistoryFetchRequest.h +79 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContact+NSItemProvider.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContact+Predicates.h +60 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContact.h +169 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactFetchRequest.h +72 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactFormatter.h +136 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactProperty.h +47 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactRelation.h +287 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactStore.h +242 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactVCardSerialization.h +62 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactsUserDefaults.h +29 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContainer+Predicates.h +29 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContainer.h +44 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNError.h +64 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNFetchRequest.h +17 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNFetchResult.h +26 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNGroup+Predicates.h +28 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNGroup.h +34 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNInstantMessageAddress.h +52 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNLabeledValue.h +69 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNMutableContact.h +74 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNMutableGroup.h +25 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNMutablePostalAddress.h +35 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNPhoneNumber.h +44 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNPostalAddress.h +50 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNPostalAddressFormatter.h +91 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNSaveRequest.h +136 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNSocialProfile.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/Contacts.apinotes +28 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/Contacts.h +42 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/ContactsDefines.h +14 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/ContactsUI.framework/Headers/CNContactPickerViewController.h +92 -0
- package/sdk/ios/System/Library/Frameworks/ContactsUI.framework/Headers/CNContactViewController.h +157 -0
- package/sdk/ios/System/Library/Frameworks/ContactsUI.framework/Headers/ContactsUI.h +10 -0
- package/sdk/ios/System/Library/Frameworks/ContactsUI.framework/Headers/UIApplicationShortcutIcon+Contacts.h +22 -0
- package/sdk/ios/System/Library/Frameworks/ContactsUI.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchedResultsController.h +8 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKAlarm.h +114 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKCalendar.h +134 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKCalendarItem.h +129 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKError.h +105 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKEvent.h +205 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKEventStore.h +477 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKObject.h +34 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKParticipant.h +115 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKRecurrenceDayOfWeek.h +71 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKRecurrenceEnd.h +61 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKRecurrenceRule.h +193 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKReminder.h +80 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKSource.h +47 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKStructuredLocation.h +28 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKTypes.h +253 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKVirtualConferenceDescriptor.h +109 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKVirtualConferenceProvider.h +63 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EventKit.apinotes +72 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EventKit.h +29 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EventKitDefines.h +30 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PKDefines.h +26 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PKPushCredentials.h +37 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PKPushPayload.h +36 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PKPushRegistry.h +330 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PKVoIPPushMetadata.h +27 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PushKit.apinotes +43 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PushKit.h +12 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Modules/module.modulemap +6 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/ARQuickLookPreviewItem.h +63 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLBase.h +34 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLFilePreviewRequest.h +32 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewController.h +174 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewItem.h +45 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewProvider.h +27 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewReply.h +106 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewSceneActivationConfiguration.h +41 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewingController.h +74 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailProvider.h +37 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailReply.h +67 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailRequest.h +33 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.apinotes +35 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.h +30 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QuickLookUICore.h +12 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Modules/module.modulemap +8 -0
- package/src/core-data-entity-classes.ts +316 -0
- package/src/swift-host.ts +12 -0
- package/src/turbo-source.ts +89 -11
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
//
|
|
2
|
+
// QLPreviewController.h
|
|
3
|
+
// Mobile Quick Look
|
|
4
|
+
//
|
|
5
|
+
// Copyright 2008 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <UIKit/UIKit.h>
|
|
9
|
+
#import <QuickLook/QLBase.h>
|
|
10
|
+
|
|
11
|
+
@protocol QLPreviewItem;
|
|
12
|
+
@protocol QLPreviewControllerDelegate;
|
|
13
|
+
@protocol QLPreviewControllerDataSource;
|
|
14
|
+
|
|
15
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
16
|
+
|
|
17
|
+
NS_CLASS_AVAILABLE_IOS(4_0) QL_EXPORT
|
|
18
|
+
@interface QLPreviewController : UIViewController
|
|
19
|
+
|
|
20
|
+
/*!
|
|
21
|
+
* @abstract Returns YES if QLPreviewController can display this preview item.
|
|
22
|
+
*/
|
|
23
|
+
+ (BOOL)canPreviewItem:(id <QLPreviewItem>)item;
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* Accessing the previewed items
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/*!
|
|
30
|
+
* @abstract The Preview Panel data source.
|
|
31
|
+
*/
|
|
32
|
+
@property(nonatomic, weak, nullable) id <QLPreviewControllerDataSource> dataSource;
|
|
33
|
+
|
|
34
|
+
/*!
|
|
35
|
+
* @abstract Asks the Preview Controller to reload its data from its data source.
|
|
36
|
+
* @discussion This method does not refresh the visible item if it has not changed.
|
|
37
|
+
*/
|
|
38
|
+
- (void)reloadData;
|
|
39
|
+
|
|
40
|
+
/*!
|
|
41
|
+
* @abstract Asks the Preview Controller to recompute the preview of the currently previewed item.
|
|
42
|
+
*/
|
|
43
|
+
- (void)refreshCurrentPreviewItem;
|
|
44
|
+
|
|
45
|
+
/*!
|
|
46
|
+
* @abstract The index of the currently previewed item in the preview panel or NSNotFound if there is none.
|
|
47
|
+
*/
|
|
48
|
+
@property NSInteger currentPreviewItemIndex;
|
|
49
|
+
|
|
50
|
+
/*!
|
|
51
|
+
* @abstract The currently previewed item in the preview panel or nil if there is none.
|
|
52
|
+
*/
|
|
53
|
+
@property(readonly, nullable) id <QLPreviewItem> currentPreviewItem;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* Setting the delegate
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/*!
|
|
62
|
+
* @abstract The Preview Controller delegate.
|
|
63
|
+
* @discussion Should implement the <QLPreviewControllerDelegate> protocol
|
|
64
|
+
*/
|
|
65
|
+
@property(nonatomic, weak, nullable) id <QLPreviewControllerDelegate> delegate;
|
|
66
|
+
|
|
67
|
+
@end
|
|
68
|
+
|
|
69
|
+
/*!
|
|
70
|
+
* @abstract The QLPreviewControllerDataSource protocol declares the methods that the Preview Controller uses to access the contents of its data source object.
|
|
71
|
+
*/
|
|
72
|
+
QL_EXPORT NS_SWIFT_UI_ACTOR @protocol QLPreviewControllerDataSource
|
|
73
|
+
|
|
74
|
+
@required
|
|
75
|
+
|
|
76
|
+
/*!
|
|
77
|
+
* @abstract Returns the number of items that the preview controller should preview.
|
|
78
|
+
* @param controller The Preview Controller.
|
|
79
|
+
* @result The number of items.
|
|
80
|
+
*/
|
|
81
|
+
- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller;
|
|
82
|
+
|
|
83
|
+
/*!
|
|
84
|
+
* @abstract Returns the item that the preview controller should preview.
|
|
85
|
+
* @param controller The Preview Controller.
|
|
86
|
+
* @param index The index of the item to preview.
|
|
87
|
+
* @result An item conforming to the QLPreviewItem protocol.
|
|
88
|
+
*/
|
|
89
|
+
- (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index;
|
|
90
|
+
|
|
91
|
+
@end
|
|
92
|
+
|
|
93
|
+
// QLPreviewItem editing support
|
|
94
|
+
typedef NS_ENUM(NSInteger, QLPreviewItemEditingMode) {
|
|
95
|
+
QLPreviewItemEditingModeDisabled = 0, // The item won't be editable.
|
|
96
|
+
QLPreviewItemEditingModeUpdateContents, // If QLPreviewController supports editing the file type of the preview item, it will automatically overwrite its contents with the edited version of the user.
|
|
97
|
+
QLPreviewItemEditingModeCreateCopy // If QLPreviewController supports editing the file type of the preview item, it will notify its delegate that an edited copy was created. The original document will be unchanged.
|
|
98
|
+
} API_AVAILABLE(ios(13.0));
|
|
99
|
+
|
|
100
|
+
QL_EXPORT @protocol QLPreviewControllerDelegate <NSObject>
|
|
101
|
+
@optional
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
/*!
|
|
105
|
+
* @abstract Invoked before the preview controller is closed.
|
|
106
|
+
*/
|
|
107
|
+
- (void)previewControllerWillDismiss:(QLPreviewController *)controller;
|
|
108
|
+
|
|
109
|
+
/*!
|
|
110
|
+
* @abstract Invoked after the preview controller is closed.
|
|
111
|
+
*/
|
|
112
|
+
- (void)previewControllerDidDismiss:(QLPreviewController *)controller;
|
|
113
|
+
|
|
114
|
+
/*!
|
|
115
|
+
* @abstract Invoked by the preview controller before trying to open an URL tapped in the preview.
|
|
116
|
+
* @result Returns NO to prevent the preview controller from calling -[UIApplication openURL:] on url.
|
|
117
|
+
* @discussion If not implemented, defaults is YES.
|
|
118
|
+
*/
|
|
119
|
+
- (BOOL)previewController:(QLPreviewController *)controller shouldOpenURL:(NSURL *)url forPreviewItem:(id <QLPreviewItem>)item;
|
|
120
|
+
|
|
121
|
+
/*!
|
|
122
|
+
* @abstract Invoked when the preview controller is about to be presented full screen or dismissed from full screen, to provide a zoom effect.
|
|
123
|
+
* @discussion Return the origin of the zoom. It should be relative to view, or screen based if view is not set. The controller will fade in/out if the rect is CGRectZero.
|
|
124
|
+
*/
|
|
125
|
+
- (CGRect)previewController:(QLPreviewController *)controller frameForPreviewItem:(id <QLPreviewItem>)item inSourceView:(UIView * _Nullable * __nonnull)view;
|
|
126
|
+
|
|
127
|
+
/*!
|
|
128
|
+
* @abstract Invoked when the preview controller is about to be presented full screen or dismissed from full screen, to provide a smooth transition when zooming.
|
|
129
|
+
* @param contentRect The rect within the image that actually represents the content of the document. For example, for icons the actual rect is generally smaller than the icon itself.
|
|
130
|
+
* @discussion Return an image the controller will crossfade with when zooming. You can specify the actual "document" content rect in the image in contentRect.
|
|
131
|
+
*/
|
|
132
|
+
- (UIImage * _Nullable)previewController:(QLPreviewController *)controller transitionImageForPreviewItem:(id <QLPreviewItem>)item contentRect:(CGRect *)contentRect;
|
|
133
|
+
|
|
134
|
+
/*!
|
|
135
|
+
* @abstract Invoked when the preview controller is about to be presented full screen or dismissed from full screen, to provide a smooth transition when zooming.
|
|
136
|
+
* @discussion Return the view that will crossfade with the preview.
|
|
137
|
+
*/
|
|
138
|
+
- (UIView* _Nullable)previewController:(QLPreviewController *)controller transitionViewForPreviewItem:(id <QLPreviewItem>)item NS_AVAILABLE_IOS(10_0);
|
|
139
|
+
|
|
140
|
+
/*!
|
|
141
|
+
* @abstract Invoked when the preview controller is loading its data. It is called for each preview item passed to the data source of the preview controller.
|
|
142
|
+
* @discussion The preview controller does not offer the users to edit previews by default, but it is possible to activate this functionality if its delegate either allows it to overwrite the contents of the preview item, or if it takes care of the updated version of the preview item by implementing previewController:didSaveEditedCopyOfPreviewItem:atURL:.
|
|
143
|
+
If the returned value is QLPreviewItemEditingModeUpdateContents and the previewController:didSaveEditedCopyOfPreviewItem:atURL: delegate method is implemented, the preview controller will overwrite the contents of the preview item if this is possible. If not (because the new version of the preview item is of a different type for instance), it will instead call previewController:didSaveEditedCopyOfPreviewItem:atURL:.
|
|
144
|
+
* @param previewItem The preview item for which the controller needs to know how its delegate wants edited versions of the preview item to be handled.
|
|
145
|
+
* @result A value indicating how the preview controller should handle edited versions of the preview item.
|
|
146
|
+
*/
|
|
147
|
+
- (QLPreviewItemEditingMode)previewController:(QLPreviewController *)controller editingModeForPreviewItem:(id <QLPreviewItem>)previewItem API_AVAILABLE(ios(13.0));
|
|
148
|
+
|
|
149
|
+
/*!
|
|
150
|
+
* @abstract Called after the preview controller has successfully overwritten the contents of the file at previewItemURL for the preview item with the edited version of the users.
|
|
151
|
+
* @discussion May be called multiple times in a row when overwriting the preview item with the successive edited versions of the preview item (whenever the users save the changes).
|
|
152
|
+
*/
|
|
153
|
+
- (void)previewController:(QLPreviewController *)controller didUpdateContentsOfPreviewItem:(id<QLPreviewItem>)previewItem API_AVAILABLE(ios(13.0));
|
|
154
|
+
|
|
155
|
+
/*!
|
|
156
|
+
* @abstract This method will be called with an edited copy of the contents of the preview item at previewItemURL.
|
|
157
|
+
* @discussion This can be called after the users save changes in the following cases:
|
|
158
|
+
|
|
159
|
+
- If the returned editing mode of the preview item is QLPreviewItemEditingModeCreateCopy.
|
|
160
|
+
|
|
161
|
+
- If the returned editing mode of the preview item is QLPreviewItemEditingModeUpdateContents and its previewItemURL could not be successfully overwritten. In this case, modifiedContentsURL will point to a temporary file on disk containing the edited copy.
|
|
162
|
+
|
|
163
|
+
- If the returned editing mode of the preview item is QLPreviewItemEditingModeUpdateContents and its content type and the content type of the edited version don't match.
|
|
164
|
+
This means that the file type of modifiedContentsURL may be different from the one of the preview item.
|
|
165
|
+
|
|
166
|
+
Note that this may be called multiple times in a row with the successive edited versions of the preview item (whenever the users save the changes).
|
|
167
|
+
* @param modifiedContentsURL NSURL of a temporary file on disk containing the edited copy of the preview item.
|
|
168
|
+
*/
|
|
169
|
+
- (void)previewController:(QLPreviewController *)controller didSaveEditedCopyOfPreviewItem:(id <QLPreviewItem>)previewItem atURL:(NSURL *)modifiedContentsURL API_AVAILABLE(ios(13.0));
|
|
170
|
+
|
|
171
|
+
@end
|
|
172
|
+
|
|
173
|
+
NS_ASSUME_NONNULL_END
|
|
174
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#if (defined(USE_PUBLIC_QUICKLOOKUICORE_HEADERS) && USE_PUBLIC_QUICKLOOKUICORE_HEADERS) || !__has_include(<QuickLookUICore/QLPreviewItem.h>)
|
|
2
|
+
//
|
|
3
|
+
// QLPreviewItem.h
|
|
4
|
+
// Quick Look
|
|
5
|
+
//
|
|
6
|
+
// Copyright 2008 Apple Inc. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
#include <QuickLook/QLBase.h>
|
|
12
|
+
|
|
13
|
+
/*!
|
|
14
|
+
* @abstract The QLPreviewItem protocol declares the methods that a QLPreviewController instance uses to access the contents of a given item.
|
|
15
|
+
*/
|
|
16
|
+
QL_EXPORT @protocol QLPreviewItem <NSObject>
|
|
17
|
+
|
|
18
|
+
@required
|
|
19
|
+
|
|
20
|
+
/*!
|
|
21
|
+
* @abstract The URL of the item to preview.
|
|
22
|
+
* @discussion The URL must be a file URL.
|
|
23
|
+
*/
|
|
24
|
+
@property(readonly, nullable, nonatomic) NSURL * previewItemURL;
|
|
25
|
+
|
|
26
|
+
@optional
|
|
27
|
+
|
|
28
|
+
/*!
|
|
29
|
+
* @abstract The item's title this will be used as apparent item title.
|
|
30
|
+
* @discussion The title replaces the default item display name. This property is optional.
|
|
31
|
+
*/
|
|
32
|
+
@property(readonly, nullable, nonatomic) NSString * previewItemTitle;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@end
|
|
36
|
+
|
|
37
|
+
/*!
|
|
38
|
+
* @abstract This category makes NSURL instances as suitable items for the Preview Controller.
|
|
39
|
+
*/
|
|
40
|
+
@interface NSURL (QLPreviewConvenienceAdditions) <QLPreviewItem>
|
|
41
|
+
@end
|
|
42
|
+
|
|
43
|
+
#else
|
|
44
|
+
#import <QuickLookUICore/QLPreviewItem.h>
|
|
45
|
+
#endif
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// QLPreviewProvider.h
|
|
3
|
+
// QuickLook
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2020 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#if !defined(USE_PUBLIC_QUICKLOOK_HEADERS) && !defined(USE_PUBLIC_QUICKLOOK_HEADERS_CATALYST) && __has_include(<QuickLookSupport/QLPreviewReply.h>)
|
|
9
|
+
#import <QuickLookSupport/QLPreviewProvider.h>
|
|
10
|
+
#else
|
|
11
|
+
|
|
12
|
+
#import <Foundation/Foundation.h>
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
@abstract Data-based preview extensions should subclass QLPreviewProvider in their principal object. The subclass should conform to QLPreviewingController.
|
|
18
|
+
|
|
19
|
+
*/
|
|
20
|
+
API_AVAILABLE(ios(15.0), macos(12.0)) API_UNAVAILABLE(watchos,tvos) __attribute__((visibility("default")))
|
|
21
|
+
@interface QLPreviewProvider : NSObject <NSExtensionRequestHandling>
|
|
22
|
+
|
|
23
|
+
@end
|
|
24
|
+
|
|
25
|
+
NS_ASSUME_NONNULL_END
|
|
26
|
+
|
|
27
|
+
#endif
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//
|
|
2
|
+
// QLPreviewReply.h
|
|
3
|
+
// Quick Look
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2020 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#if !defined(USE_PUBLIC_QUICKLOOK_HEADERS) && !defined(USE_PUBLIC_QUICKLOOK_HEADERS_CATALYST) && __has_include(<QuickLookSupport/QLPreviewReply.h>)
|
|
9
|
+
#import <QuickLookSupport/QLPreviewReply.h>
|
|
10
|
+
#else
|
|
11
|
+
|
|
12
|
+
#import <Foundation/Foundation.h>
|
|
13
|
+
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
|
|
14
|
+
#import <CoreGraphics/CoreGraphics.h>
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
@abstract QLPreviewReplyAttachment is used to provide data for attachment in html data-based previews.
|
|
20
|
+
*/
|
|
21
|
+
API_AVAILABLE(ios(15.0), macos(12.0)) API_UNAVAILABLE(watchos,tvos) __attribute__((visibility("default")))
|
|
22
|
+
@interface QLPreviewReplyAttachment:NSObject
|
|
23
|
+
|
|
24
|
+
/** The data content of an html preview*/
|
|
25
|
+
@property (readonly) NSData* data;
|
|
26
|
+
|
|
27
|
+
/** The content type of the attachment for an html preview*/
|
|
28
|
+
@property (readonly) UTType* contentType;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
@abstract Create an attachment for html previews by providing the data and mime type of the attachment.
|
|
32
|
+
@param data The data content of an html preview
|
|
33
|
+
@param contentType The UTType of the attachment for an html preview
|
|
34
|
+
*/
|
|
35
|
+
- (instancetype)initWithData:(NSData*)data contentType:(UTType*)contentType;
|
|
36
|
+
|
|
37
|
+
@end
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
@abstract To provide a data-based preview, you have to return a QLPreviewReply object.
|
|
41
|
+
*/
|
|
42
|
+
API_AVAILABLE(ios(15.0), macos(12.0)) API_UNAVAILABLE(watchos,tvos) __attribute__((visibility("default")))
|
|
43
|
+
@interface QLPreviewReply : NSObject
|
|
44
|
+
|
|
45
|
+
/** String encoding for text or html based previews. Defaults to NSUTF8StringEncoding. */
|
|
46
|
+
@property NSStringEncoding stringEncoding;
|
|
47
|
+
|
|
48
|
+
/** Attachments for HTML data previews. The keys of the dictionary are the attachment identifiers (eg foo) that can be referenced with the cid:id URL (eg cid:foo).*/
|
|
49
|
+
@property (copy) NSDictionary<NSString*, QLPreviewReplyAttachment*>* attachments;
|
|
50
|
+
|
|
51
|
+
/** Custom display title for the preview. If left as the empty string, QuickLook will use the file name.*/
|
|
52
|
+
@property (copy) NSString* title;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
@abstract
|
|
56
|
+
Use this method to provide a preview by drawing into a context.
|
|
57
|
+
|
|
58
|
+
@param contextSize The size of your image.
|
|
59
|
+
@param isBitmap Whether the context should be bitmap or vector.
|
|
60
|
+
@param drawingBlock The preview should be drawn into the context passed to this block. The QLPreviewReply passed into this block is the same as the one created by this method and is provided for convenience for any further updates to its properties during the drawing block. Return YES if the preview was successfully drawn into the context. Return NO and populate error otherwise.
|
|
61
|
+
*/
|
|
62
|
+
- (instancetype)initWithContextSize:(CGSize)contextSize isBitmap:(BOOL)isBitmap drawingBlock:(BOOL (^)(CGContextRef context, QLPreviewReply * reply, NSError** error))drawingBlock;
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
@abstract
|
|
67
|
+
Use this method to provide a preview by providing a URL to a file of a supported type.
|
|
68
|
+
|
|
69
|
+
@param fileURL A file URL representing a preview of the previewed URL. Currently supported types include: UTTypeImage, UTTypePDF, UTTypeHTML, UTTypeXML, UTTypePlainText, UTTypeRTF, UTTypeRTFD, UTTypeMovie, UTTypeAudio
|
|
70
|
+
*/
|
|
71
|
+
- (instancetype)initWithFileURL:(NSURL *)fileURL;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
@abstract
|
|
75
|
+
Use this method to provide a preview with data of a supported format.
|
|
76
|
+
|
|
77
|
+
@param contentType The content type of the data.
|
|
78
|
+
@param contentSize A hint for the size you would like to display your content at. If your content has an intrinsic size built in, such as images and PDFs, that will be used as the final size, but providing the correct size here will allow QuickLook to present loading UI at the correct size before you are finished creating the data. QuickLook will use a default size if NSZeroSize is passed in.
|
|
79
|
+
@param dataCreationBlock Create and return data representing the file preview. Supported types include: UTTypeImage, UTTypePDF, UTTypeHTML, UTTypeXML, UTTypePlainText, UTTypeRTF. Heavy lifting should be done inside of the dataCreationBlock instead of when creating the QLPreviewReply. The QLPreviewReply passed into this block is the same as the one created by this method and is provided for convenience for any further updates to its properties, such as attachments, during the data generation. Return the data if successful. Populate error if unsuccessful.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
- (instancetype)initWithDataOfContentType:(UTType *)contentType contentSize:(CGSize)contentSize dataCreationBlock:(NSData * _Nullable (^)(QLPreviewReply * reply, NSError ** error))dataCreationBlock;
|
|
83
|
+
|
|
84
|
+
@end
|
|
85
|
+
|
|
86
|
+
NS_ASSUME_NONNULL_END
|
|
87
|
+
#endif
|
|
88
|
+
|
|
89
|
+
#import <PDFKit/PDFKit.h>
|
|
90
|
+
|
|
91
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
92
|
+
|
|
93
|
+
@interface QLPreviewReply (UI)
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
@abstract
|
|
97
|
+
Use this method to provide a preview with a PDFDocument
|
|
98
|
+
|
|
99
|
+
@param defaultPageSize The size of your pages in the document. If the page size varies, use the first page's size.
|
|
100
|
+
@param documentCreationBlock Create and return the PDFDocument. Heavy lifting should be done inside of the documentCreationBlock instead of when creating the QLPreviewReply. The QLPreviewReply passed into this block is the same as the one created by this method and is provided for convenience for any further updates to its properties during document creation. Return the PDFDocument if successfully created. Populate error if unsuccessful.
|
|
101
|
+
*/
|
|
102
|
+
- (instancetype)initForPDFWithPageSize:(CGSize)defaultPageSize documentCreationBlock:(PDFDocument * _Nullable (^)(QLPreviewReply * reply, NSError ** error))documentCreationBlock;
|
|
103
|
+
|
|
104
|
+
@end
|
|
105
|
+
|
|
106
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// QLPreviewSceneActivationConfiguration.h
|
|
3
|
+
// Mobile Quick Look
|
|
4
|
+
//
|
|
5
|
+
// Copyright 2021 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <UIKit/UIKit.h>
|
|
9
|
+
#import <UIKit/UIWindowSceneActivationConfiguration.h>
|
|
10
|
+
|
|
11
|
+
#import <QuickLook/QLBase.h>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
API_AVAILABLE(ios(15.0))
|
|
17
|
+
API_UNAVAILABLE(visionos)
|
|
18
|
+
NS_SWIFT_NAME(QLPreviewSceneActivationConfiguration.Options)
|
|
19
|
+
QL_EXPORT @interface QLPreviewSceneOptions : NSObject
|
|
20
|
+
/*!
|
|
21
|
+
* @abstract The index of the item to preview initially .
|
|
22
|
+
*/
|
|
23
|
+
@property (assign) NSInteger initialPreviewIndex;
|
|
24
|
+
@end
|
|
25
|
+
|
|
26
|
+
API_AVAILABLE(ios(15.0))
|
|
27
|
+
API_UNAVAILABLE(visionos)
|
|
28
|
+
QL_EXPORT @interface QLPreviewSceneActivationConfiguration : UIWindowSceneActivationConfiguration
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @abstract Create a new scene configuration to preview items at `urls`.
|
|
32
|
+
* @param urls The urls of the items to preview.
|
|
33
|
+
* @param options Additional information to preview the items.
|
|
34
|
+
*/
|
|
35
|
+
- (instancetype)initWithItemsAtURLs:(NSArray <NSURL *> *)urls options:(nullable QLPreviewSceneOptions *)options NS_DESIGNATED_INITIALIZER;
|
|
36
|
+
|
|
37
|
+
- (instancetype)initWithUserActivity:(NSUserActivity *)userActivity NS_UNAVAILABLE;
|
|
38
|
+
|
|
39
|
+
@end
|
|
40
|
+
|
|
41
|
+
NS_ASSUME_NONNULL_END
|
package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewingController.h
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#if (defined(USE_PUBLIC_QUICKLOOKUICORE_HEADERS) && USE_PUBLIC_QUICKLOOKUICORE_HEADERS) || !__has_include(<QuickLookUICore/QLPreviewingController.h>)
|
|
2
|
+
//
|
|
3
|
+
// QLPreviewingController.h
|
|
4
|
+
// Mobile Quick Look
|
|
5
|
+
//
|
|
6
|
+
// Copyright 2016 Apple Inc. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import <QuickLook/QLBase.h>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
+
|
|
15
|
+
@class QLPreviewReply;
|
|
16
|
+
@class QLFilePreviewRequest;
|
|
17
|
+
/**
|
|
18
|
+
For view based previews, the view controller that implements the QLPreviewingController protocol must at least implement one of the two following methods:
|
|
19
|
+
-[QLPreviewingController preparePreviewOfSearchableItemWithIdentifier:queryString:completionHandler:], to generate previews for Spotlight searchable items.
|
|
20
|
+
-[QLPreviewingController preparePreviewOfFileAtURL:completionHandler:], to generate previews for file URLs.
|
|
21
|
+
|
|
22
|
+
The main preview should be presented by the view controller implementing QLPreviewingController.
|
|
23
|
+
Avoid presenting additional view controllers over your QLPreviewingController.
|
|
24
|
+
For Catalyst compatibility, avoid using gesture recognizers that take interactions over large portions of the view to avoid collisions with standard macOS preview behaviors.
|
|
25
|
+
Avoid holding the file open during the duration of the preview. If access to the file is necessary for interaction, it is best to keep the file open only for the duration of the interaction.
|
|
26
|
+
|
|
27
|
+
For data-based previews, subclass QLPreviewProvider which conforms to this protocol.
|
|
28
|
+
*/
|
|
29
|
+
QL_EXPORT @protocol QLPreviewingController <NSObject>
|
|
30
|
+
|
|
31
|
+
@optional
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
@abstract
|
|
35
|
+
Use this method to prepare the content of the view controller with the data that the searchable item represents.
|
|
36
|
+
|
|
37
|
+
@discussion
|
|
38
|
+
This method will be called only once. It will be called in the main thread before presenting the view controller.
|
|
39
|
+
Heavy work potentially blocking the main thread should be avoided in this method.
|
|
40
|
+
|
|
41
|
+
@param identifier The identifier of the CSSearchableItem the user interacted with in Spotlight.
|
|
42
|
+
@param queryString The query string the user entered in Spotlight before interacting with the CSSearchableItem.
|
|
43
|
+
@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.
|
|
44
|
+
It can be called asynchronously after the method has returned.
|
|
45
|
+
*/
|
|
46
|
+
- (void)preparePreviewOfSearchableItemWithIdentifier:(NSString *)identifier queryString:(NSString * _Nullable)queryString completionHandler:(void (^)(NSError * _Nullable))handler NS_SWIFT_NAME(preparePreviewOfSearchableItem(identifier:queryString:completionHandler:));
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
@abstract
|
|
50
|
+
Use this method to prepare the content of the view controller with the given file URL.
|
|
51
|
+
|
|
52
|
+
@discussion
|
|
53
|
+
This method will be called only once. It will be called in the main thread before presenting the view controller.
|
|
54
|
+
Heavy work potentially blocking the main thread should be avoided in this method.
|
|
55
|
+
|
|
56
|
+
@param url The URL of the file the user is about to preview.
|
|
57
|
+
@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.
|
|
58
|
+
It can be called asynchronously after the method has returned.
|
|
59
|
+
*/
|
|
60
|
+
- (void)preparePreviewOfFileAtURL:(NSURL *)url completionHandler:(void (^)(NSError * _Nullable))handler NS_SWIFT_NAME(preparePreviewOfFile(at:completionHandler:));
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
@abstract Use this method to provide a QLPreviewReply that provides preview in the form of NSData, NSURL, PDFDocument, or a drawing into a context.
|
|
64
|
+
@param request An object which contains information about the preview that should be provided. It contains the URL of the file to provide a preview for.
|
|
65
|
+
@param handler Call the completion handler with a QLPreviewReply if you can provide a preview, or with an NSError if you cannot. If an error is passed or reply is nil, a generic preview will be provided instead. The handler can be called asynchronously after the method has returned.
|
|
66
|
+
*/
|
|
67
|
+
- (void)providePreviewForFileRequest:(QLFilePreviewRequest*)request completionHandler:(void (^)(QLPreviewReply * _Nullable reply, NSError * _Nullable error))handler NS_SWIFT_NAME(providePreview(for:completionHandler:));
|
|
68
|
+
@end
|
|
69
|
+
|
|
70
|
+
NS_ASSUME_NONNULL_END
|
|
71
|
+
|
|
72
|
+
#else
|
|
73
|
+
#import <QuickLookUICore/QLPreviewingController.h>
|
|
74
|
+
#endif
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// QLThumbnailProvider.h
|
|
3
|
+
// Mobile Quick Look
|
|
4
|
+
//
|
|
5
|
+
// Copyright 2016 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#if !defined(USE_PUBLIC_QUICKLOOK_HEADERS) && __has_include(<QuickLookThumbnailing/QLThumbnailProvider.h>)
|
|
9
|
+
#import <QuickLookThumbnailing/QLThumbnailProvider.h>
|
|
10
|
+
#else
|
|
11
|
+
|
|
12
|
+
#import <Foundation/Foundation.h>
|
|
13
|
+
#import <QuickLook/QLBase.h>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
+
|
|
18
|
+
@class QLFileThumbnailRequest, QLThumbnailReply;
|
|
19
|
+
|
|
20
|
+
NS_CLASS_AVAILABLE_IOS(11_0) QL_EXPORT @interface QLThumbnailProvider : NSObject
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
Subclass this method to provide a QLThumbnailReply that either contains a drawing block or an image file URL.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@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.
|
|
27
|
+
@param handler Call the completion handler with a QLThumbnailReply if you can provide a thumbnail, or with an NSError if you cannot.
|
|
28
|
+
If an error is passed or reply is nil, no thumbnail will be drawn.
|
|
29
|
+
The handler can be called asynchronously after the method has returned.
|
|
30
|
+
*/
|
|
31
|
+
- (void)provideThumbnailForFileRequest:(QLFileThumbnailRequest *)request completionHandler:(void (^)(QLThumbnailReply * _Nullable reply, NSError * _Nullable error))handler NS_SWIFT_NAME(provideThumbnail(for:_:));
|
|
32
|
+
|
|
33
|
+
@end
|
|
34
|
+
|
|
35
|
+
NS_ASSUME_NONNULL_END
|
|
36
|
+
|
|
37
|
+
#endif
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
//
|
|
2
|
+
// QLThumbnailReply.h
|
|
3
|
+
// Mobile Quick Look
|
|
4
|
+
//
|
|
5
|
+
// Copyright 2016 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#if !defined(USE_PUBLIC_QUICKLOOK_HEADERS) && __has_include(<QuickLookThumbnailing/QLThumbnailReply.h>)
|
|
9
|
+
#import <QuickLookThumbnailing/QLThumbnailReply.h>
|
|
10
|
+
#else
|
|
11
|
+
|
|
12
|
+
#import <CoreGraphics/CoreGraphics.h>
|
|
13
|
+
#import <Foundation/Foundation.h>
|
|
14
|
+
#import <QuickLook/QLBase.h>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
To provide a thumbnail for a request, you have to return a QLThumbnailReply object.
|
|
21
|
+
|
|
22
|
+
@discussion To provide a thumbnail, you have two options:
|
|
23
|
+
1. Draw the thumbnail, by providing a QLThumbnailReply created with a drawing block.
|
|
24
|
+
2. Pass the thumbnail file URL, by providing a QLThumbnailReply created with a file URL.
|
|
25
|
+
*/
|
|
26
|
+
NS_CLASS_AVAILABLE_IOS(11_0) QL_EXPORT @interface QLThumbnailReply : NSObject
|
|
27
|
+
|
|
28
|
+
- (instancetype)init NS_UNAVAILABLE;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
You can create a reply with a drawing block that will draw into a given context with the coordinate system of Core Graphics.
|
|
32
|
+
|
|
33
|
+
@param contextSize The desired size of the context that will be passed to the drawing block.
|
|
34
|
+
It should be as close as possible to the maximumSize of the QLFileThumbnailRequest and it has to be greater than or equal to its minimumSize.
|
|
35
|
+
|
|
36
|
+
Ideally, at least either contextSize's width matches maximumSize's width or contextSize's height matches maximumSize's height.
|
|
37
|
+
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)).
|
|
38
|
+
@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.
|
|
39
|
+
Return YES if the thumbnail was successfully drawn into the context. Return NO otherwise.
|
|
40
|
+
*/
|
|
41
|
+
+ (instancetype)replyWithContextSize:(CGSize)contextSize drawingBlock:(BOOL (^)(CGContextRef context))drawingBlock;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
You can create a reply with a drawing block that will draw into the current context with the coordinate system of UIKit.
|
|
45
|
+
|
|
46
|
+
@param contextSize The desired size of the context that will be passed to the drawing block.
|
|
47
|
+
It should be as close as possible to the maximumSize of the QLFileThumbnailRequest and it has to be greater than or equal to its minimumSize.
|
|
48
|
+
|
|
49
|
+
Ideally, at least either contextSize's width matches maximumSize's width or contextSize's height matches maximumSize's height.
|
|
50
|
+
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)).
|
|
51
|
+
@param drawingBlock A block that draws the thumbnail into the current context which you can access via UIGraphicsGetCurrentContext().
|
|
52
|
+
It is a context of type CGBitmapContext, set up to be used with the coordinate system of UIKit.
|
|
53
|
+
Return YES if the thumbnail was successfully drawn into the current context. Return NO otherwise.
|
|
54
|
+
*/
|
|
55
|
+
+ (instancetype)replyWithContextSize:(CGSize)contextSize currentContextDrawingBlock:(BOOL (^)(void))drawingBlock;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
You can create a reply object with a file URL of an image that will be used as the thumbnail.
|
|
59
|
+
The image will be downscaled to fit the size of the QLFileThumbnailRequest if necessary.
|
|
60
|
+
*/
|
|
61
|
+
+ (instancetype)replyWithImageFileURL:(NSURL *)fileURL;
|
|
62
|
+
|
|
63
|
+
@end
|
|
64
|
+
|
|
65
|
+
NS_ASSUME_NONNULL_END
|
|
66
|
+
|
|
67
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// QLPreviewingController.h
|
|
3
|
+
// Mobile Quick Look
|
|
4
|
+
//
|
|
5
|
+
// Copyright 2016 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#if !defined(USE_PUBLIC_QUICKLOOK_HEADERS) && __has_include(<QuickLookThumbnailing/QLThumbnailRequest.h>)
|
|
9
|
+
#import <QuickLookThumbnailing/QLThumbnailRequest.h>
|
|
10
|
+
#else
|
|
11
|
+
|
|
12
|
+
#import <CoreGraphics/CoreGraphics.h>
|
|
13
|
+
#import <Foundation/Foundation.h>
|
|
14
|
+
#import <QuickLook/QLBase.h>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
@abstract This class contains information about the thumbnail that should be provided.
|
|
21
|
+
*/
|
|
22
|
+
NS_CLASS_AVAILABLE_IOS(11_0) QL_EXPORT @interface QLFileThumbnailRequest : NSObject
|
|
23
|
+
|
|
24
|
+
@property (nonatomic, readonly) CGSize maximumSize;
|
|
25
|
+
@property (nonatomic, readonly) CGSize minimumSize;
|
|
26
|
+
@property (nonatomic, readonly) CGFloat scale;
|
|
27
|
+
@property (nonatomic, copy, readonly) NSURL* fileURL;
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
NS_ASSUME_NONNULL_END
|
|
32
|
+
|
|
33
|
+
#endif
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
Name: QuickLook
|
|
3
|
+
Classes:
|
|
4
|
+
- Name: QLPreviewController
|
|
5
|
+
Methods:
|
|
6
|
+
- Selector: 'canPreviewItem:'
|
|
7
|
+
SwiftName: canPreview(_:)
|
|
8
|
+
MethodKind: Class
|
|
9
|
+
- Name: QLPreviewReply
|
|
10
|
+
Methods:
|
|
11
|
+
- Selector: "initWithContextSize:isBitmap:drawingBlock:"
|
|
12
|
+
MethodKind: Instance
|
|
13
|
+
SwiftPrivate: true
|
|
14
|
+
- Selector: "initForPDFWithPageSize:documentCreationBlock:"
|
|
15
|
+
MethodKind: Instance
|
|
16
|
+
SwiftPrivate: true
|
|
17
|
+
- Selector: "initWithDataOfContentType:contentSize:dataCreationBlock:"
|
|
18
|
+
MethodKind: Instance
|
|
19
|
+
SwiftPrivate: true
|
|
20
|
+
Properties:
|
|
21
|
+
- Name: stringEncoding
|
|
22
|
+
PropertyKind: Instance
|
|
23
|
+
SwiftPrivate: true
|
|
24
|
+
|
|
25
|
+
SwiftVersions:
|
|
26
|
+
#
|
|
27
|
+
# Swift 4 and below specific conversions
|
|
28
|
+
#
|
|
29
|
+
- Version: 4
|
|
30
|
+
Protocols:
|
|
31
|
+
- Name: QLPreviewControllerDelegate
|
|
32
|
+
Methods:
|
|
33
|
+
- Selector: 'previewController:transitionImageForPreviewItem:contentRect:'
|
|
34
|
+
MethodKind: Instance
|
|
35
|
+
NullabilityOfRet: N
|