public class UIDocument extends NSObject implements NSFilePresenter, NSProgressReporting, UIUserActivityRestoring
| Modifier and Type | Class and Description |
|---|---|
static interface |
UIDocument.Block_autosaveWithCompletionHandler |
static interface |
UIDocument.Block_closeWithCompletionHandler |
static interface |
UIDocument.Block_openWithCompletionHandler |
static interface |
UIDocument.Block_performAsynchronousFileAccessUsingBlock |
static interface |
UIDocument.Block_revertToContentsOfURLCompletionHandler |
static interface |
UIDocument.Block_saveToURLForSaveOperationCompletionHandler |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_retNSFilePresenter.Block_accommodatePresentedItemDeletionWithCompletionHandler, NSFilePresenter.Block_accommodatePresentedSubitemDeletionAtURLCompletionHandler, NSFilePresenter.Block_relinquishPresentedItemToReader, NSFilePresenter.Block_relinquishPresentedItemToWriter, NSFilePresenter.Block_savePresentedItemChangesWithCompletionHandler| Modifier | Constructor and Description |
|---|---|
protected |
UIDocument(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
void |
accommodatePresentedItemDeletionWithCompletionHandler(NSFilePresenter.Block_accommodatePresentedItemDeletionWithCompletionHandler completionHandler)
Given that something in the system is waiting to delete the presented file or directory, do whatever it takes to ensure that the deleting will succeed and that the receiver's application will behave properly when the deleting has happened, and then invoke the completion handler.
|
void |
accommodatePresentedSubitemDeletionAtURLCompletionHandler(NSURL url,
NSFilePresenter.Block_accommodatePresentedSubitemDeletionAtURLCompletionHandler completionHandler)
Given that something in the system is waiting to delete a file or directory contained by the directory, do whatever it takes to ensure that the deleting will succeed and that the receiver's application will behave properly when the deleting has happened, and then invoke the completion handler.
|
static UIDocument |
alloc() |
static UIDocument |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
void |
autosaveWithCompletionHandler(UIDocument.Block_autosaveWithCompletionHandler completionHandler)
Clients should not need to call this method directly.
|
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
java.lang.Object |
changeCountTokenForSaveOperation(long saveOperation)
Change count tokens can be used to encapsulate the record of document changes being made in a particular save.
|
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
void |
closeWithCompletionHandler(UIDocument.Block_closeWithCompletionHandler completionHandler)
Close the document.
|
java.lang.Object |
contentsForTypeError(java.lang.String typeName,
org.moe.natj.general.ptr.Ptr<NSError> outError)
Typical subclasses will implement this method and return an NSFileWrapper or NSData encapsulating a snapshot of their data to be written to disk during saving.
|
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
void |
disableEditing()
Subclasses should override these methods so that they do not allow the user to edit the document between calls to -disableEditing and -enableEditing.
|
long |
documentState() |
void |
enableEditing() |
NSDictionary<?,?> |
fileAttributesToWriteToURLForSaveOperationError(NSURL url,
long saveOperation,
org.moe.natj.general.ptr.Ptr<NSError> outError)
Called by -saveToURL: before executing asynchronous writing to get a dictionary of attributes understood by NSFileManager for writing to the file.
|
NSDate |
fileModificationDate()
The last known modification date of the document's on-disk representation.
|
java.lang.String |
fileNameExtensionForTypeSaveOperation(java.lang.String typeName,
long saveOperation)
For a specified type, and a particular kind of save operation, return a file name extension that can be appended to a base file name.
|
java.lang.String |
fileType()
The file's UTI.
|
NSURL |
fileURL()
UIKit may call these methods on background threads, so subclasses that override them must have thread safe implementations.
|
void |
finishedHandlingErrorRecovered(NSError error,
boolean recovered)
Called when handling of an error (including any user interaction) is complete.
|
void |
handleErrorUserInteractionPermitted(NSError error,
boolean userInteractionPermitted)
Called by the default implementations of -openWithCompletionHandler: and -saveToURL:forSaveOperation:completionHandler:.
|
static long |
hash_static() |
boolean |
hasUnsavedChanges()
Subclasses should generally not need to override this.
|
UIDocument |
init() |
UIDocument |
initWithFileURL(NSURL url)
The designated initializer.
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
boolean |
loadFromContentsOfTypeError(java.lang.Object contents,
java.lang.String typeName,
org.moe.natj.general.ptr.Ptr<NSError> outError)
Typical subclasses will implement this method to do reading.
|
java.lang.String |
localizedName()
The default implementation derives the name from the URL.
|
static UIDocument |
new_objc() |
NSSet<java.lang.String> |
observedPresentedItemUbiquityAttributes()
The set of ubiquity attributes, which the receiver wishes to be notified about when they change for presentedItemURL.
|
void |
openWithCompletionHandler(UIDocument.Block_openWithCompletionHandler completionHandler)
Subclassing this method without calling super should be avoided.
|
void |
performAsynchronousFileAccessUsingBlock(UIDocument.Block_performAsynchronousFileAccessUsingBlock block)
The default implementations of saveToURL: and openWithCompletionHandler: both use this to serialize file access.
|
void |
presentedItemDidChange()
Be notified that the file or file package's contents or attributes have been been written to.
|
void |
presentedItemDidChangeUbiquityAttributes(NSSet<java.lang.String> attributes)
Be notified that the presented file or file package's ubiquity attributes have changed.
|
void |
presentedItemDidGainVersion(NSFileVersion version)
Be notified that something in the system has added, removed, or resolved a version of the file or file package.
|
void |
presentedItemDidLoseVersion(NSFileVersion version) |
void |
presentedItemDidMoveToURL(NSURL newURL)
Be notified that the file or directory has been moved or renamed, or a directory containing it has been moved or renamed.
|
void |
presentedItemDidResolveConflictVersion(NSFileVersion version) |
NSOperationQueue |
presentedItemOperationQueue()
The operation queue in which all of the other NSFilePresenter messages except -presentedItemURL will be sent to the receiver.
|
NSURL |
presentedItemURL()
The NSURL that locates the file or directory that the receiver is presenting to the user.
|
void |
presentedSubitemAtURLDidGainVersion(NSURL url,
NSFileVersion version)
Be notified that the something in the system has added, removed, or resolved a version of a file or directory contained by the directory.
|
void |
presentedSubitemAtURLDidLoseVersion(NSURL url,
NSFileVersion version) |
void |
presentedSubitemAtURLDidMoveToURL(NSURL oldURL,
NSURL newURL)
Be notified that a file or directory contained by the directory has been moved or renamed.
|
void |
presentedSubitemAtURLDidResolveConflictVersion(NSURL url,
NSFileVersion version) |
void |
presentedSubitemDidAppearAtURL(NSURL url)
Be notified that a file or directory contained by the directory has been added.
|
void |
presentedSubitemDidChangeAtURL(NSURL url)
Be notified that the contents or attributes of a file or directory contained by the directory have been been written to.
|
NSProgress |
progress() |
boolean |
readFromURLError(NSURL url,
org.moe.natj.general.ptr.Ptr<NSError> outError)
Direct calls to this method should not be necessary for typical subclasses where the entire file is read during opening.
|
void |
relinquishPresentedItemToReader(NSFilePresenter.Block_relinquishPresentedItemToReader reader)
Given that something in the system is waiting to read from the presented file or directory, do whatever it takes to ensure that the application will behave properly while that reading is happening, and then invoke the completion handler.
|
void |
relinquishPresentedItemToWriter(NSFilePresenter.Block_relinquishPresentedItemToWriter writer)
Given that something in the system is waiting to write to the presented file or directory, do whatever it takes to ensure that the application will behave properly while that writing is happening, and then invoke the completion handler.
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
restoreUserActivityState(NSUserActivity userActivity) |
void |
revertToContentsOfURLCompletionHandler(NSURL url,
UIDocument.Block_revertToContentsOfURLCompletionHandler completionHandler)
Discard all unsaved document modifications and replace the document's contents by reading a file or file package located by a URL.
|
void |
savePresentedItemChangesWithCompletionHandler(NSFilePresenter.Block_savePresentedItemChangesWithCompletionHandler completionHandler)
Given that something in the system is waiting to read from the presented file or directory, do whatever it takes to ensure that the contents of the presented file or directory is completely up to date, and then invoke the completion handler.
|
void |
saveToURLForSaveOperationCompletionHandler(NSURL url,
long saveOperation,
UIDocument.Block_saveToURLForSaveOperationCompletionHandler completionHandler)
Subclassing this method without calling super should be avoided.
|
java.lang.String |
savingFileType()
The default implementation returns the current file type.
|
void |
setFileModificationDate(NSDate value)
The last known modification date of the document's on-disk representation.
|
void |
setUndoManager(NSUndoManager value)
The document's undo manager.
|
void |
setUserActivity(NSUserActivity value) |
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
NSUndoManager |
undoManager()
The document's undo manager.
|
void |
updateChangeCount(long change)
Record the fact that a change affecting the value returned by -hasUnsavedChanges has occurred.
|
void |
updateChangeCountWithTokenForSaveOperation(java.lang.Object changeCountToken,
long saveOperation) |
void |
updateUserActivityState(NSUserActivity userActivity) |
NSUserActivity |
userActivity() |
void |
userInteractionNoLongerPermittedForError(NSError error)
UIKit calls this method when it is no longer safe to proceed without immediately handling the error, such as when the app is being suspended.
|
static long |
version_static() |
boolean |
writeContentsAndAttributesSafelyToURLForSaveOperationError(java.lang.Object contents,
NSDictionary<?,?> additionalFileAttributes,
NSURL url,
long saveOperation,
org.moe.natj.general.ptr.Ptr<NSError> outError)
This method is responsible for doing document writing in a way that minimizes the danger of leaving the disk to which writing is being done in an inconsistent state in the event of an application crash, system crash, hardware failure, power outage, etc.
|
boolean |
writeContentsToURLForSaveOperationOriginalContentsURLError(java.lang.Object contents,
NSURL url,
long saveOperation,
NSURL originalContentsURL,
org.moe.natj.general.ptr.Ptr<NSError> outError)
Called by -writeContents:andAttributes:safelyToURL:forSaveOperation:error: to write the data to disk.
|
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static UIDocument alloc()
public static UIDocument allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static UIDocument new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public void accommodatePresentedItemDeletionWithCompletionHandler(NSFilePresenter.Block_accommodatePresentedItemDeletionWithCompletionHandler completionHandler)
NSFilePresenterFor example, NSDocument has an implementation of this method that closes the document. That way if the document is in the trash and the user empties the trash the document is simply closed before its file is deleted. This means that emptying the trash will not fail with an alert about the file being "in use" just because the document's file is memory mapped by the application. It also means that the document won't be left open with no document file underneath it. A shoebox application would only implement this method to be robust against surprising things like the user deleting its data directory while the application is running.
The file coordination mechanism does not always send -relinquishPresentedItemToReader: or -relinquishPresentedItemToWriter: to your NSFilePresenter before sending this message. For example, other process' use of -[NSFileCoordinator prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:] can cause this to happen.
accommodatePresentedItemDeletionWithCompletionHandler in interface NSFilePresenterpublic void accommodatePresentedSubitemDeletionAtURLCompletionHandler(NSURL url, NSFilePresenter.Block_accommodatePresentedSubitemDeletionAtURLCompletionHandler completionHandler)
NSFilePresenterThe file coordination mechanism does not always send -relinquishPresentedItemToReader: or -relinquishPresentedItemToWriter: to your NSFilePresenter before sending this message. For example, other process' use of -[NSFileCoordinator prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:] can cause this to happen.
accommodatePresentedSubitemDeletionAtURLCompletionHandler in interface NSFilePresenterpublic void autosaveWithCompletionHandler(UIDocument.Block_autosaveWithCompletionHandler completionHandler)
public java.lang.Object changeCountTokenForSaveOperation(long saveOperation)
public void closeWithCompletionHandler(UIDocument.Block_closeWithCompletionHandler completionHandler)
public java.lang.Object contentsForTypeError(java.lang.String typeName,
org.moe.natj.general.ptr.Ptr<NSError> outError)
public void disableEditing()
public long documentState()
public void enableEditing()
public NSDictionary<?,?> fileAttributesToWriteToURLForSaveOperationError(NSURL url, long saveOperation, org.moe.natj.general.ptr.Ptr<NSError> outError)
public NSDate fileModificationDate()
public java.lang.String fileNameExtensionForTypeSaveOperation(java.lang.String typeName,
long saveOperation)
public java.lang.String fileType()
public NSURL fileURL()
public void finishedHandlingErrorRecovered(NSError error, boolean recovered)
public void handleErrorUserInteractionPermitted(NSError error, boolean userInteractionPermitted)
public boolean hasUnsavedChanges()
public UIDocument init()
public UIDocument initWithFileURL(NSURL url)
public boolean loadFromContentsOfTypeError(java.lang.Object contents,
java.lang.String typeName,
org.moe.natj.general.ptr.Ptr<NSError> outError)
public java.lang.String localizedName()
public void openWithCompletionHandler(UIDocument.Block_openWithCompletionHandler completionHandler)
public void performAsynchronousFileAccessUsingBlock(UIDocument.Block_performAsynchronousFileAccessUsingBlock block)
public void presentedItemDidChange()
NSFilePresenterFor example, NSDocument implements this method to react to both contents changes (like the user overwriting the document file with another application) and attribute changes (like the user toggling the "Hide extension" checkbox in a Finder info panel). It uses modification date checking as described above.
Not all programs use file coordination. Your NSFileProvider may be sent this message without being sent -relinquishPresentedItemToWriter: first. Make your application do the best it can in that case.
presentedItemDidChange in interface NSFilePresenterpublic void presentedItemDidGainVersion(NSFileVersion version)
NSFilePresenterFor example, NSDocument has implementations of these methods that help decide whether to present a versions browser when it has reacquired after relinquishing to a writer, and to react to versions being added and removed while it is presenting the versions browser.
presentedItemDidGainVersion in interface NSFilePresenterpublic void presentedItemDidLoseVersion(NSFileVersion version)
presentedItemDidLoseVersion in interface NSFilePresenterpublic void presentedItemDidMoveToURL(NSURL newURL)
NSFilePresenterThe new URL may have a different file name extension than the current value of the presentedItemURL property.
For example, NSDocument implements this method to handle document file moving and renaming. A shoebox application would only implement this method to be robust against surprising things like the user moving its data directory while the application is running.
Not all programs use file coordination. Your NSFileProvider may be sent this message without being sent -relinquishPresentedItemToWriter: first. Make your application do the best it can in that case.
presentedItemDidMoveToURL in interface NSFilePresenterpublic void presentedItemDidResolveConflictVersion(NSFileVersion version)
presentedItemDidResolveConflictVersion in interface NSFilePresenterpublic NSOperationQueue presentedItemOperationQueue()
NSFilePresenterFor example, NSDocument has a -presentedItemOperationQueue method that returns a private queue. In very simple cases you can return [NSOperationQueue mainQueue], but doing so is often an invitation to deadlocks.
presentedItemOperationQueue in interface NSFilePresenterpublic NSURL presentedItemURL()
NSFilePresenterFor example, NSDocument has a -presentedItemURL method that usually returns [self fileURL]. In a shoebox application that stores the user's data in files somewhere on the user's computer you can implement this method to specify the directory that contains those files.
presentedItemURL in interface NSFilePresenterpublic void presentedSubitemAtURLDidGainVersion(NSURL url, NSFileVersion version)
NSFilePresenterpresentedSubitemAtURLDidGainVersion in interface NSFilePresenterpublic void presentedSubitemAtURLDidLoseVersion(NSURL url, NSFileVersion version)
presentedSubitemAtURLDidLoseVersion in interface NSFilePresenterpublic void presentedSubitemAtURLDidMoveToURL(NSURL oldURL, NSURL newURL)
NSFilePresenterNot all programs use file coordination. Your NSFileProvider may be sent this message without being sent -relinquishPresentedItemToWriter: first. Make your application do the best it can in that case.
presentedSubitemAtURLDidMoveToURL in interface NSFilePresenterpublic void presentedSubitemAtURLDidResolveConflictVersion(NSURL url, NSFileVersion version)
presentedSubitemAtURLDidResolveConflictVersion in interface NSFilePresenterpublic void presentedSubitemDidAppearAtURL(NSURL url)
NSFilePresenterNot all programs use file coordination. Your NSFileProvider may be sent this message without being sent -relinquishPresentedItemToWriter: first. Make your application do the best it can in that case.
presentedSubitemDidAppearAtURL in interface NSFilePresenterpublic void presentedSubitemDidChangeAtURL(NSURL url)
NSFilePresenterNot all programs use file coordination. Your NSFileProvider may be sent this message without being sent -relinquishPresentedItemToWriter: first. Make your application do the best it can in that case.
presentedSubitemDidChangeAtURL in interface NSFilePresenterpublic NSProgress progress()
progress in interface NSProgressReportingpublic boolean readFromURLError(NSURL url, org.moe.natj.general.ptr.Ptr<NSError> outError)
public void restoreUserActivityState(NSUserActivity userActivity)
restoreUserActivityState in interface UIUserActivityRestoringpublic void revertToContentsOfURLCompletionHandler(NSURL url, UIDocument.Block_revertToContentsOfURLCompletionHandler completionHandler)
public void savePresentedItemChangesWithCompletionHandler(NSFilePresenter.Block_savePresentedItemChangesWithCompletionHandler completionHandler)
NSFilePresenterFor example, NSDocument has an implementation of this method that autosaves the document if it has been changed since the last time it was saved or autosaved. That way when another process tries to read the document file it always reads the same version of the document that the user is looking at in your application. (WYSIWGCBF - What You See Is What Gets Copied By Finder.) A shoebox application would also implement this method.
The file coordination mechanism does not always send -relinquishPresentedItemToReader: or -relinquishPresentedItemToWriter: to your NSFilePresenter before sending this message. For example, other process' use of -[NSFileCoordinator prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:] can cause this to happen.
savePresentedItemChangesWithCompletionHandler in interface NSFilePresenterpublic void saveToURLForSaveOperationCompletionHandler(NSURL url, long saveOperation, UIDocument.Block_saveToURLForSaveOperationCompletionHandler completionHandler)
public java.lang.String savingFileType()
public void setFileModificationDate(NSDate value)
public void setUndoManager(NSUndoManager value)
public void setUserActivity(NSUserActivity value)
public NSUndoManager undoManager()
public void updateChangeCount(long change)
public void updateChangeCountWithTokenForSaveOperation(java.lang.Object changeCountToken,
long saveOperation)
public void updateUserActivityState(NSUserActivity userActivity)
public NSUserActivity userActivity()
public void userInteractionNoLongerPermittedForError(NSError error)
public boolean writeContentsAndAttributesSafelyToURLForSaveOperationError(java.lang.Object contents,
NSDictionary<?,?> additionalFileAttributes,
NSURL url,
long saveOperation,
org.moe.natj.general.ptr.Ptr<NSError> outError)
public boolean writeContentsToURLForSaveOperationOriginalContentsURLError(java.lang.Object contents,
NSURL url,
long saveOperation,
NSURL originalContentsURL,
org.moe.natj.general.ptr.Ptr<NSError> outError)
public NSSet<java.lang.String> observedPresentedItemUbiquityAttributes()
NSFilePresenterThis property will normally be checked only at the time addFilePresenter: is called. However, if presentedItemURL is nil at that time, it will instead be checked only at the end of a coordinated write where presentedItemURL became non-nil. The value of this property should not change depending on whether presentedItemURL is currently ubiquitous or is located a ubiquity container.
For example, NSDocument implements this property to always return NSURLIsUbiquitousItemKey, NSURLUbiquitousItemIsSharedKey, and various other properties starting with "NSURLUbiquitousSharedItem". It needsto be notified about changes to these properties in order to implement support for ubiquitous and shared documents.
observedPresentedItemUbiquityAttributes in interface NSFilePresenterpublic void presentedItemDidChangeUbiquityAttributes(NSSet<java.lang.String> attributes)
NSFilePresenterNote that changes to these attributes do not normally align with -presentedItemDidChange notifications.
presentedItemDidChangeUbiquityAttributes in interface NSFilePresenterpublic void relinquishPresentedItemToReader(NSFilePresenter.Block_relinquishPresentedItemToReader reader)
NSFilePresenterA common sequence that your NSFilePresenter must handle is the file coordination mechanism sending this message, then sending -savePresentedItemChangesWithCompletionHandler:, and then, after you have invoked that completion handler, invoking your reacquirer.
relinquishPresentedItemToReader in interface NSFilePresenterpublic void relinquishPresentedItemToWriter(NSFilePresenter.Block_relinquishPresentedItemToWriter writer)
NSFilePresenterA common sequence that your NSFilePresenter must handle is the file coordination mechanism sending this message, then sending -accommodatePresentedItemDeletionWithCompletionHandler: or -savePresentedItemChangesWithCompletionHandler:, and then, after you have invoked that completion handler, invoking your reacquirer. It is also common for your NSFilePresenter to be sent a combination of the -presented... messages listed below in between relinquishing and reacquiring.
relinquishPresentedItemToWriter in interface NSFilePresenter