public interface QLPreviewControllerDelegate
| Modifier and Type | Method and Description |
|---|---|
default void |
previewControllerDidDismiss(QLPreviewController controller)
Invoked after the preview controller is closed.
|
default void |
previewControllerDidSaveEditedCopyOfPreviewItemAtURL(QLPreviewController controller,
QLPreviewItem previewItem,
NSURL modifiedContentsURL)
* @abstract This method will be called with an edited copy of the contents of the preview item at previewItemURL.
|
default void |
previewControllerDidUpdateContentsOfPreviewItem(QLPreviewController controller,
QLPreviewItem previewItem)
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.
|
default long |
previewControllerEditingModeForPreviewItem(QLPreviewController controller,
QLPreviewItem previewItem)
* @abstract Invoked when the preview controller is loading its data.
|
default CGRect |
previewControllerFrameForPreviewItemInSourceView(QLPreviewController controller,
QLPreviewItem item,
org.moe.natj.general.ptr.Ptr<UIView> view)
Invoked when the preview controller is about to be presented full screen or dismissed from full screen, to provide a zoom effect.
|
default boolean |
previewControllerShouldOpenURLForPreviewItem(QLPreviewController controller,
NSURL url,
QLPreviewItem item)
Invoked by the preview controller before trying to open an URL tapped in the preview.
|
default UIImage |
previewControllerTransitionImageForPreviewItemContentRect(QLPreviewController controller,
QLPreviewItem item,
CGRect contentRect)
Invoked when the preview controller is about to be presented full screen or dismissed from full screen, to provide a smooth transition when zooming.
|
default UIView |
previewControllerTransitionViewForPreviewItem(QLPreviewController controller,
QLPreviewItem item)
Invoked when the preview controller is about to be presented full screen or dismissed from full screen, to provide a smooth transition when zooming.
|
default void |
previewControllerWillDismiss(QLPreviewController controller)
Invoked before the preview controller is closed.
|
default CGRect previewControllerFrameForPreviewItemInSourceView(QLPreviewController controller, QLPreviewItem item, org.moe.natj.general.ptr.Ptr<UIView> view)
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.
default boolean previewControllerShouldOpenURLForPreviewItem(QLPreviewController controller, NSURL url, QLPreviewItem item)
If not implemented, defaults is YES.
default UIImage previewControllerTransitionImageForPreviewItemContentRect(QLPreviewController controller, QLPreviewItem item, CGRect contentRect)
Return an image the controller will crossfade with when zooming. You can specify the actual "document" content rect in the image in contentRect.
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.default UIView previewControllerTransitionViewForPreviewItem(QLPreviewController controller, QLPreviewItem item)
Return the view that will crossfade with the preview.
default void previewControllerDidDismiss(QLPreviewController controller)
default void previewControllerWillDismiss(QLPreviewController controller)
default void previewControllerDidSaveEditedCopyOfPreviewItemAtURL(QLPreviewController controller, QLPreviewItem previewItem, NSURL modifiedContentsURL)
- If the returned editing mode of the preview item is QLPreviewItemEditingModeCreateCopy.
- 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.
- 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. This means that the file type of modifiedContentsURL may be different from the one of the preview item.
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). * @param modifiedContentsURL NSURL of a temporary file on disk containing the edited copy of the preview item.
default void previewControllerDidUpdateContentsOfPreviewItem(QLPreviewController controller, QLPreviewItem previewItem)
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).
default long previewControllerEditingModeForPreviewItem(QLPreviewController controller, QLPreviewItem previewItem)