|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsISupports.idl" |
|
7 |
|
8 %{C++ |
|
9 namespace mozilla { |
|
10 namespace dom { |
|
11 namespace indexedDB { |
|
12 class FileInfo; |
|
13 class FileManager; |
|
14 } |
|
15 } |
|
16 } |
|
17 |
|
18 %} |
|
19 |
|
20 [ptr] native FileInfo(mozilla::dom::indexedDB::FileInfo); |
|
21 [ptr] native FileManager(mozilla::dom::indexedDB::FileManager); |
|
22 |
|
23 interface nsIDOMFileError; |
|
24 interface nsIInputStream; |
|
25 interface nsIURI; |
|
26 interface nsIPrincipal; |
|
27 interface nsIDOMBlob; |
|
28 |
|
29 [scriptable, builtinclass, uuid(b1723fac-4814-4429-82cb-dc54ba0d46d6)] |
|
30 interface nsIDOMBlob : nsISupports |
|
31 { |
|
32 readonly attribute unsigned long long size; |
|
33 readonly attribute DOMString type; |
|
34 |
|
35 [noscript] readonly attribute nsIInputStream internalStream; |
|
36 // The caller is responsible for releasing the internalUrl from the |
|
37 // blob: protocol handler |
|
38 [noscript] DOMString getInternalUrl(in nsIPrincipal principal); |
|
39 |
|
40 [optional_argc] nsIDOMBlob slice([optional] in long long start, |
|
41 [optional] in long long end, |
|
42 [optional] in DOMString contentType); |
|
43 |
|
44 // Get internal id of stored file. Returns -1 if it is not a stored file. |
|
45 // Intended only for testing. It can be called on any thread. |
|
46 [notxpcom] long long getFileId(); |
|
47 |
|
48 // Called when the blob was successfully stored in a database or when |
|
49 // the blob is initialized from a database. It can be called on any thread. |
|
50 [notxpcom] void addFileInfo(in FileInfo aFileInfo); |
|
51 |
|
52 // Called before the blob is stored in a database to decide if it can be |
|
53 // shared or needs to be copied. It can be called on any thread. |
|
54 [notxpcom] FileInfo getFileInfo(in FileManager aFileManager); |
|
55 |
|
56 // Return true if this blob is a memory file. |
|
57 [notxpcom] bool isMemoryFile(); |
|
58 }; |
|
59 |
|
60 [scriptable, builtinclass, uuid(4e7d1a8b-e2d5-4304-a753-4affb731660c)] |
|
61 interface nsIDOMFile : nsIDOMBlob |
|
62 { |
|
63 readonly attribute DOMString name; |
|
64 |
|
65 readonly attribute DOMString path; |
|
66 |
|
67 [implicit_jscontext] |
|
68 readonly attribute jsval lastModifiedDate; |
|
69 |
|
70 readonly attribute DOMString mozFullPath; |
|
71 |
|
72 // This performs no security checks! |
|
73 [noscript] readonly attribute DOMString mozFullPathInternal; |
|
74 |
|
75 [noscript] readonly attribute uint64_t mozLastModifiedDate; |
|
76 }; |