michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: %{C++ michael@0: namespace mozilla { michael@0: namespace dom { michael@0: namespace indexedDB { michael@0: class FileInfo; michael@0: class FileManager; michael@0: } michael@0: } michael@0: } michael@0: michael@0: %} michael@0: michael@0: [ptr] native FileInfo(mozilla::dom::indexedDB::FileInfo); michael@0: [ptr] native FileManager(mozilla::dom::indexedDB::FileManager); michael@0: michael@0: interface nsIDOMFileError; michael@0: interface nsIInputStream; michael@0: interface nsIURI; michael@0: interface nsIPrincipal; michael@0: interface nsIDOMBlob; michael@0: michael@0: [scriptable, builtinclass, uuid(b1723fac-4814-4429-82cb-dc54ba0d46d6)] michael@0: interface nsIDOMBlob : nsISupports michael@0: { michael@0: readonly attribute unsigned long long size; michael@0: readonly attribute DOMString type; michael@0: michael@0: [noscript] readonly attribute nsIInputStream internalStream; michael@0: // The caller is responsible for releasing the internalUrl from the michael@0: // blob: protocol handler michael@0: [noscript] DOMString getInternalUrl(in nsIPrincipal principal); michael@0: michael@0: [optional_argc] nsIDOMBlob slice([optional] in long long start, michael@0: [optional] in long long end, michael@0: [optional] in DOMString contentType); michael@0: michael@0: // Get internal id of stored file. Returns -1 if it is not a stored file. michael@0: // Intended only for testing. It can be called on any thread. michael@0: [notxpcom] long long getFileId(); michael@0: michael@0: // Called when the blob was successfully stored in a database or when michael@0: // the blob is initialized from a database. It can be called on any thread. michael@0: [notxpcom] void addFileInfo(in FileInfo aFileInfo); michael@0: michael@0: // Called before the blob is stored in a database to decide if it can be michael@0: // shared or needs to be copied. It can be called on any thread. michael@0: [notxpcom] FileInfo getFileInfo(in FileManager aFileManager); michael@0: michael@0: // Return true if this blob is a memory file. michael@0: [notxpcom] bool isMemoryFile(); michael@0: }; michael@0: michael@0: [scriptable, builtinclass, uuid(4e7d1a8b-e2d5-4304-a753-4affb731660c)] michael@0: interface nsIDOMFile : nsIDOMBlob michael@0: { michael@0: readonly attribute DOMString name; michael@0: michael@0: readonly attribute DOMString path; michael@0: michael@0: [implicit_jscontext] michael@0: readonly attribute jsval lastModifiedDate; michael@0: michael@0: readonly attribute DOMString mozFullPath; michael@0: michael@0: // This performs no security checks! michael@0: [noscript] readonly attribute DOMString mozFullPathInternal; michael@0: michael@0: [noscript] readonly attribute uint64_t mozLastModifiedDate; michael@0: };