dom/interfaces/devicestorage/nsIDOMDeviceStorage.idl
author Ryan VanderMeulen <ryanvm@gmail.com>
Mon, 14 Apr 2014 16:16:18 -0400
changeset 196901 376496720a0e662039298fcfdde08ff911e23695
parent 196893 fa82f32d0c397317d19c92a60538b4562f8bed0f
child 197215 b54fdf8bb4860ced8f64b7540485157b69ebed11
permissions -rw-r--r--
Backed out changesets ddbac34527fe and fa82f32d0c39 (bug 991812) for B2G bustage. CLOSED TREE

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "domstubs.idl"
#include "nsIDOMEventTarget.idl"
interface nsIDOMBlob;
interface nsIDOMDOMRequest;
interface nsIDOMDOMCursor;
interface nsIDOMDeviceStorageChangeEvent;
interface nsIDOMEventListener;
interface nsIFile;

%{C++
class DeviceStorageFileDescriptor;
%}
[ptr] native DeviceStorageFdPtr(DeviceStorageFileDescriptor);

[scriptable, uuid(8b724547-3c78-4244-969a-f00a1f4ae0c3), builtinclass]
interface nsIDOMDeviceStorage : nsIDOMEventTarget
{
    [implicit_jscontext] attribute jsval onchange;
    nsIDOMDOMRequest add(in nsIDOMBlob aBlob);
    nsIDOMDOMRequest addNamed(in nsIDOMBlob aBlob, in DOMString aName);

    nsIDOMDOMRequest get([Null(Stringify)] in DOMString aName);
    nsIDOMDOMRequest getEditable([Null(Stringify)] in DOMString aName);
    nsIDOMDOMRequest delete([Null(Stringify)] in DOMString aName);

    nsIDOMDOMRequest freeSpace();
    nsIDOMDOMRequest usedSpace();
    nsIDOMDOMRequest available();

    // Note that the storageName is just a name (like sdcard), and doesn't
    // include any path information.
    readonly attribute DOMString storageName;

    // Determines if this storage area is the one which will be used by default
    // for storing new files.
    readonly attribute bool default;

    // Note: aFileDescriptor is reference counted, which is why we're using
    //       a pointer rather than a reference.
    [noscript] nsIDOMDOMRequest createFileDescriptor(in DOMString aName,
                                                     in DeviceStorageFdPtr aFileDescriptor);
};