dom/interfaces/devicestorage/nsIDOMDeviceStorage.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/interfaces/devicestorage/nsIDOMDeviceStorage.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "domstubs.idl"
     1.9 +#include "nsIDOMEventTarget.idl"
    1.10 +interface nsIDOMBlob;
    1.11 +interface nsIDOMDOMRequest;
    1.12 +interface nsIDOMDOMCursor;
    1.13 +interface nsIDOMDeviceStorageChangeEvent;
    1.14 +interface nsIDOMEventListener;
    1.15 +interface nsIFile;
    1.16 +
    1.17 +%{C++
    1.18 +struct DeviceStorageFileDescriptor;
    1.19 +%}
    1.20 +[ptr] native DeviceStorageFdPtr(DeviceStorageFileDescriptor);
    1.21 +
    1.22 +[scriptable, uuid(8b724547-3c78-4244-969a-f00a1f4ae0c3), builtinclass]
    1.23 +interface nsIDOMDeviceStorage : nsIDOMEventTarget
    1.24 +{
    1.25 +    [implicit_jscontext] attribute jsval onchange;
    1.26 +    nsIDOMDOMRequest add(in nsIDOMBlob aBlob);
    1.27 +    nsIDOMDOMRequest addNamed(in nsIDOMBlob aBlob, in DOMString aName);
    1.28 +
    1.29 +    nsIDOMDOMRequest get([Null(Stringify)] in DOMString aName);
    1.30 +    nsIDOMDOMRequest getEditable([Null(Stringify)] in DOMString aName);
    1.31 +    nsIDOMDOMRequest delete([Null(Stringify)] in DOMString aName);
    1.32 +
    1.33 +    nsIDOMDOMRequest freeSpace();
    1.34 +    nsIDOMDOMRequest usedSpace();
    1.35 +    nsIDOMDOMRequest available();
    1.36 +
    1.37 +    // Note that the storageName is just a name (like sdcard), and doesn't
    1.38 +    // include any path information.
    1.39 +    readonly attribute DOMString storageName;
    1.40 +
    1.41 +    // Determines if this storage area is the one which will be used by default
    1.42 +    // for storing new files.
    1.43 +    readonly attribute bool default;
    1.44 +
    1.45 +    // Note: aFileDescriptor is reference counted, which is why we're using
    1.46 +    //       a pointer rather than a reference.
    1.47 +    [noscript] nsIDOMDOMRequest createFileDescriptor(in DOMString aName,
    1.48 +                                                     in DeviceStorageFdPtr aFileDescriptor);
    1.49 +};

mercurial