forked from microsoft/WinObjC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUIDocument.h
More file actions
105 lines (95 loc) · 4.99 KB
/
UIDocument.h
File metadata and controls
105 lines (95 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//******************************************************************************
//
// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************
#pragma once
#import <UIKit/UIKitExport.h>
#import <Foundation/NSFilePresenter.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSProgressReporting.h>
@class NSString, NSURL, NSDate, NSError, NSDictionary, NSUndoManager, NSUserActivity;
typedef NSInteger UIDocumentChangeKind;
enum {
UIDocumentChangeDone,
UIDocumentChangeUndone,
UIDocumentChangeRedone,
UIDocumentChangeCleared,
};
typedef NSInteger UIDocumentSaveOperation;
enum {
UIDocumentSaveForCreating,
UIDocumentSaveForOverwriting,
};
typedef NSInteger UIDocumentState;
enum {
UIDocumentStateNormal = 0,
UIDocumentStateClosed = 1 << 0,
UIDocumentStateInConflict = 1 << 1,
UIDocumentStateSavingError = 1 << 2,
UIDocumentStateEditingDisabled = 1 << 3,
UIDocumentStateProgressAvailable = 1 << 4,
};
UIKIT_EXPORT NSString* const NSUserActivityDocumentURLKey;
UIKIT_EXPORT NSString* const UIDocumentStateChangedNotification;
UIKIT_EXPORT_CLASS
@interface UIDocument : NSObject <NSFilePresenter, NSObject, NSProgressReporting>
- (instancetype)initWithFileURL:(NSURL*)url STUB_METHOD;
@property (readonly) NSURL* fileURL STUB_PROPERTY;
@property (readonly, copy) NSString* localizedName STUB_PROPERTY;
@property (readonly, copy) NSString* fileType STUB_PROPERTY;
@property (copy) NSDate* fileModificationDate STUB_PROPERTY;
@property (readonly) UIDocumentState documentState STUB_PROPERTY;
- (void)closeWithCompletionHandler:(void (^)(BOOL))completionHandler STUB_METHOD;
- (id)contentsForType:(NSString*)typeName error:(NSError* _Nullable*)outError STUB_METHOD;
- (void)saveToURL:(NSURL*)url
forSaveOperation:(UIDocumentSaveOperation)saveOperation
completionHandler:(void (^)(BOOL))completionHandler STUB_METHOD;
- (BOOL)writeContents:(id)contents
andAttributes:(NSDictionary*)additionalFileAttributes
safelyToURL:(NSURL*)url
forSaveOperation:(UIDocumentSaveOperation)saveOperation
error:(NSError* _Nullable*)outError STUB_METHOD;
- (BOOL)writeContents:(id)contents
toURL:(NSURL*)url
forSaveOperation:(UIDocumentSaveOperation)saveOperation
originalContentsURL:(NSURL*)originalContentsURL
error:(NSError* _Nullable*)outError STUB_METHOD;
- (NSString*)savingFileType STUB_METHOD;
- (NSDictionary*)fileAttributesToWriteToURL:(NSURL*)url
forSaveOperation:(UIDocumentSaveOperation)saveOperation
error:(NSError* _Nullable*)outError STUB_METHOD;
- (NSString*)fileNameExtensionForType:(NSString*)typeName saveOperation:(UIDocumentSaveOperation)saveOperation STUB_METHOD;
- (void)openWithCompletionHandler:(void (^)(BOOL))completionHandler STUB_METHOD;
- (BOOL)loadFromContents:(id)contents ofType:(NSString*)typeName error:(NSError* _Nullable*)outError STUB_METHOD;
- (BOOL)readFromURL:(NSURL*)url error:(NSError* _Nullable*)outError STUB_METHOD;
- (void)performAsynchronousFileAccessUsingBlock:(void (^)(void))block STUB_METHOD;
- (void)revertToContentsOfURL:(NSURL*)url completionHandler:(void (^)(BOOL))completionHandler STUB_METHOD;
- (void)disableEditing STUB_METHOD;
- (void)enableEditing STUB_METHOD;
- (BOOL)hasUnsavedChanges STUB_METHOD;
- (void)updateChangeCount:(UIDocumentChangeKind)change STUB_METHOD;
@property (strong) NSUndoManager* undoManager STUB_PROPERTY;
- (id)changeCountTokenForSaveOperation:(UIDocumentSaveOperation)saveOperation STUB_METHOD;
- (void)updateChangeCountWithToken:(id)changeCountToken forSaveOperation:(UIDocumentSaveOperation)saveOperation STUB_METHOD;
- (void)autosaveWithCompletionHandler:(void (^)(BOOL))completionHandler STUB_METHOD;
@property (nonatomic, strong) NSUserActivity* userActivity STUB_PROPERTY;
- (void)restoreUserActivityState:(NSUserActivity*)activity STUB_METHOD;
- (void)updateUserActivityState:(NSUserActivity*)activity STUB_METHOD;
- (void)handleError:(NSError*)error userInteractionPermitted:(BOOL)userInteractionPermitted STUB_METHOD;
- (void)finishedHandlingError:(NSError*)error recovered:(BOOL)recovered STUB_METHOD;
- (void)userInteractionNoLongerPermittedForError:(NSError*)error STUB_METHOD;
@property (readonly, copy) NSURL* presentedItemURL STUB_PROPERTY;
@property (readonly, retain) NSOperationQueue* presentedItemOperationQueue STUB_PROPERTY;
@property (readonly) NSProgress* progress STUB_PROPERTY;
@end