1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/public/nsIDOMFile.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,76 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +%{C++ 1.12 +namespace mozilla { 1.13 +namespace dom { 1.14 +namespace indexedDB { 1.15 +class FileInfo; 1.16 +class FileManager; 1.17 +} 1.18 +} 1.19 +} 1.20 + 1.21 +%} 1.22 + 1.23 +[ptr] native FileInfo(mozilla::dom::indexedDB::FileInfo); 1.24 +[ptr] native FileManager(mozilla::dom::indexedDB::FileManager); 1.25 + 1.26 +interface nsIDOMFileError; 1.27 +interface nsIInputStream; 1.28 +interface nsIURI; 1.29 +interface nsIPrincipal; 1.30 +interface nsIDOMBlob; 1.31 + 1.32 +[scriptable, builtinclass, uuid(b1723fac-4814-4429-82cb-dc54ba0d46d6)] 1.33 +interface nsIDOMBlob : nsISupports 1.34 +{ 1.35 + readonly attribute unsigned long long size; 1.36 + readonly attribute DOMString type; 1.37 + 1.38 + [noscript] readonly attribute nsIInputStream internalStream; 1.39 + // The caller is responsible for releasing the internalUrl from the 1.40 + // blob: protocol handler 1.41 + [noscript] DOMString getInternalUrl(in nsIPrincipal principal); 1.42 + 1.43 + [optional_argc] nsIDOMBlob slice([optional] in long long start, 1.44 + [optional] in long long end, 1.45 + [optional] in DOMString contentType); 1.46 + 1.47 + // Get internal id of stored file. Returns -1 if it is not a stored file. 1.48 + // Intended only for testing. It can be called on any thread. 1.49 + [notxpcom] long long getFileId(); 1.50 + 1.51 + // Called when the blob was successfully stored in a database or when 1.52 + // the blob is initialized from a database. It can be called on any thread. 1.53 + [notxpcom] void addFileInfo(in FileInfo aFileInfo); 1.54 + 1.55 + // Called before the blob is stored in a database to decide if it can be 1.56 + // shared or needs to be copied. It can be called on any thread. 1.57 + [notxpcom] FileInfo getFileInfo(in FileManager aFileManager); 1.58 + 1.59 + // Return true if this blob is a memory file. 1.60 + [notxpcom] bool isMemoryFile(); 1.61 +}; 1.62 + 1.63 +[scriptable, builtinclass, uuid(4e7d1a8b-e2d5-4304-a753-4affb731660c)] 1.64 +interface nsIDOMFile : nsIDOMBlob 1.65 +{ 1.66 + readonly attribute DOMString name; 1.67 + 1.68 + readonly attribute DOMString path; 1.69 + 1.70 + [implicit_jscontext] 1.71 + readonly attribute jsval lastModifiedDate; 1.72 + 1.73 + readonly attribute DOMString mozFullPath; 1.74 + 1.75 + // This performs no security checks! 1.76 + [noscript] readonly attribute DOMString mozFullPathInternal; 1.77 + 1.78 + [noscript] readonly attribute uint64_t mozLastModifiedDate; 1.79 +};