1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/DeviceStorage.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,61 @@ 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 +dictionary DeviceStorageEnumerationParameters { 1.10 + Date since; 1.11 +}; 1.12 + 1.13 +interface DeviceStorage : EventTarget { 1.14 + attribute EventHandler onchange; 1.15 + 1.16 + [Throws] 1.17 + DOMRequest? add(Blob? aBlob); 1.18 + [Throws] 1.19 + DOMRequest? addNamed(Blob? aBlob, DOMString aName); 1.20 + 1.21 + [Throws] 1.22 + DOMRequest get(DOMString aName); 1.23 + [Throws] 1.24 + DOMRequest getEditable(DOMString aName); 1.25 + [Throws] 1.26 + DOMRequest delete(DOMString aName); 1.27 + 1.28 + [Throws] 1.29 + DOMCursor enumerate(optional DeviceStorageEnumerationParameters options); 1.30 + [Throws] 1.31 + DOMCursor enumerate(DOMString path, 1.32 + optional DeviceStorageEnumerationParameters options); 1.33 + [Throws] 1.34 + DOMCursor enumerateEditable(optional DeviceStorageEnumerationParameters options); 1.35 + [Throws] 1.36 + DOMCursor enumerateEditable(DOMString path, 1.37 + optional DeviceStorageEnumerationParameters options); 1.38 + 1.39 + [Throws] 1.40 + DOMRequest freeSpace(); 1.41 + [Throws] 1.42 + DOMRequest usedSpace(); 1.43 + [Throws] 1.44 + DOMRequest available(); 1.45 + [Throws] 1.46 + DOMRequest storageStatus(); 1.47 + [Throws] 1.48 + DOMRequest format(); 1.49 + [Throws] 1.50 + DOMRequest mount(); 1.51 + [Throws] 1.52 + DOMRequest unmount(); 1.53 + 1.54 + // Note that the storageName is just a name (like sdcard), and doesn't 1.55 + // include any path information. 1.56 + readonly attribute DOMString storageName; 1.57 + 1.58 + // Determines if this storage area is the one which will be used by default 1.59 + // for storing new files. 1.60 + readonly attribute boolean default; 1.61 + 1.62 + [NewObject] 1.63 + Promise getRoot(); 1.64 +};