OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Use the <code>chrome.fileSystem</code> API to create, read, navigate, | 5 // Use the <code>chrome.fileSystem</code> API to create, read, navigate, |
6 // and write to the user's local file system. With this API, Chrome Apps can | 6 // and write to the user's local file system. With this API, Chrome Apps can |
7 // read and write to a user-selected location. For example, a text editor app | 7 // read and write to a user-selected location. For example, a text editor app |
8 // can use the API to read and write local documents. All failures are notified | 8 // can use the API to read and write local documents. All failures are notified |
9 // via chrome.runtime.lastError. | 9 // via chrome.runtime.lastError. |
10 namespace fileSystem { | 10 namespace fileSystem { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 openDirectory | 52 openDirectory |
53 }; | 53 }; |
54 | 54 |
55 // Type of a change happened to a child entry within a tracked directory. | 55 // Type of a change happened to a child entry within a tracked directory. |
56 enum ChildChangeType { | 56 enum ChildChangeType { |
57 created, | 57 created, |
58 removed, | 58 removed, |
59 changed | 59 changed |
60 }; | 60 }; |
61 | 61 |
62 dictionary ChooseEntryOptions { | 62 [nodoc] dictionary ChooseEntryOptions { |
benwells
2014/10/24 05:34:51
I think this one shouldn't change.
mtomasz
2014/10/24 05:36:42
Oops. Done.
| |
63 // Type of the prompt to show. The default is 'openFile'. | 63 // Type of the prompt to show. The default is 'openFile'. |
64 ChooseEntryType? type; | 64 ChooseEntryType? type; |
65 | 65 |
66 // The suggested file name that will be presented to the user as the | 66 // The suggested file name that will be presented to the user as the |
67 // default name to read or write. This is optional. | 67 // default name to read or write. This is optional. |
68 DOMString? suggestedName; | 68 DOMString? suggestedName; |
69 | 69 |
70 // The optional list of accept options for this file opener. Each option | 70 // The optional list of accept options for this file opener. Each option |
71 // will be presented as a unique group to the end-user. | 71 // will be presented as a unique group to the end-user. |
72 AcceptOption[]? accepts; | 72 AcceptOption[]? accepts; |
73 | 73 |
74 // Whether to accept all file types, in addition to the options specified | 74 // Whether to accept all file types, in addition to the options specified |
75 // in the accepts argument. The default is true. If the accepts field is | 75 // in the accepts argument. The default is true. If the accepts field is |
76 // unset or contains no valid entries, this will always be reset to true. | 76 // unset or contains no valid entries, this will always be reset to true. |
77 boolean? acceptsAllTypes; | 77 boolean? acceptsAllTypes; |
78 | 78 |
79 // Whether to accept multiple files. This is only supported for openFile and | 79 // Whether to accept multiple files. This is only supported for openFile and |
80 // openWritableFile. The callback to chooseEntry will be called with a list | 80 // openWritableFile. The callback to chooseEntry will be called with a list |
81 // of entries if this is set to true. Otherwise it will be called with a | 81 // of entries if this is set to true. Otherwise it will be called with a |
82 // single Entry. | 82 // single Entry. |
83 boolean? acceptsMultiple; | 83 boolean? acceptsMultiple; |
84 }; | 84 }; |
85 | 85 |
86 // Change to an entry within a tracked directory. | 86 // Change to an entry within a tracked directory. |
87 dictionary ChildChange { | 87 [nodoc] dictionary ChildChange { |
88 [instanceOf=Entry] object entry; | 88 [instanceOf=Entry] object entry; |
89 ChildChangeType type; | 89 ChildChangeType type; |
90 }; | 90 }; |
91 | 91 |
92 // Event notifying about a change in a file or a directory, including its | 92 // Event notifying about a change in a file or a directory, including its |
93 // contents. | 93 // contents. |
94 dictionary EntryChangedEvent { | 94 [nodoc] dictionary EntryChangedEvent { |
95 // Tracked entry. | 95 // Tracked entry. |
96 [instanceOf=Entry] object target; | 96 [instanceOf=Entry] object target; |
97 | 97 |
98 // List of changed entries within the tracked directory in order they | 98 // List of changed entries within the tracked directory in order they |
99 // happened. May not be available for some types of file systems. | 99 // happened. May not be available for some types of file systems. |
100 ChildChange[]? childChanges; | 100 ChildChange[]? childChanges; |
101 }; | 101 }; |
102 | 102 |
103 // Event notifying about a tracked file or a directory being removed. | 103 // Event notifying about a tracked file or a directory being removed. |
104 dictionary EntryRemovedEvent { | 104 [nodoc] dictionary EntryRemovedEvent { |
105 [instanceOf=Entry] object target; | 105 [instanceOf=Entry] object target; |
106 }; | 106 }; |
107 | 107 |
108 callback GetDisplayPathCallback = void (DOMString displayPath); | 108 callback GetDisplayPathCallback = void (DOMString displayPath); |
109 callback EntryCallback = void ([instanceOf=Entry] object entry); | 109 callback EntryCallback = void ([instanceOf=Entry] object entry); |
110 callback EntriesCallback = void ( | 110 callback EntriesCallback = void ( |
111 [instanceOf=Entry] optional object entry, | 111 [instanceOf=Entry] optional object entry, |
112 [instanceOf=FileEntry] optional object[] fileEntries); | 112 [instanceOf=FileEntry] optional object[] fileEntries); |
113 callback IsWritableCallback = void (boolean isWritable); | 113 callback IsWritableCallback = void (boolean isWritable); |
114 callback IsRestorableCallback = void (boolean isRestorable); | 114 callback IsRestorableCallback = void (boolean isRestorable); |
115 callback GetObservedEntriesCallback = void ( | 115 [nodoc] callback GetObservedEntriesCallback = void ( |
116 [instanceOf=Entry] object[] entries); | 116 [instanceOf=Entry] object[] entries); |
117 | 117 |
118 interface Functions { | 118 interface Functions { |
119 // Get the display path of an Entry object. The display path is based on | 119 // Get the display path of an Entry object. The display path is based on |
120 // the full path of the file or directory on the local file system, but may | 120 // the full path of the file or directory on the local file system, but may |
121 // be made more readable for display purposes. | 121 // be made more readable for display purposes. |
122 static void getDisplayPath([instanceOf=Entry] object entry, | 122 static void getDisplayPath([instanceOf=Entry] object entry, |
123 GetDisplayPathCallback callback); | 123 GetDisplayPathCallback callback); |
124 | 124 |
125 // Get a writable Entry from another Entry. This call will fail with a | 125 // Get a writable Entry from another Entry. This call will fail with a |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 }; | 179 }; |
180 | 180 |
181 interface Events { | 181 interface Events { |
182 // Called when an observed entry is changed. | 182 // Called when an observed entry is changed. |
183 [nodoc] static void onEntryChanged(EntryChangedEvent event); | 183 [nodoc] static void onEntryChanged(EntryChangedEvent event); |
184 | 184 |
185 // Called when an observed entry is removed. | 185 // Called when an observed entry is removed. |
186 [nodoc] static void onEntryRemoved(EntryRemovedEvent event); | 186 [nodoc] static void onEntryRemoved(EntryRemovedEvent event); |
187 }; | 187 }; |
188 }; | 188 }; |
OLD | NEW |