content/base/public/nsIDOMFileReader.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/public/nsIDOMFileReader.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +/* -*- Mode: C++; 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 "nsIDOMEventTarget.idl"
    1.10 +
    1.11 +interface nsIDOMEventListener;
    1.12 +interface nsIDOMBlob;
    1.13 +
    1.14 +[scriptable, builtinclass, uuid(39ea2c73-7711-4cea-9f73-3166c24dfa69)]
    1.15 +interface nsIDOMFileReader : nsIDOMEventTarget
    1.16 +{
    1.17 +  [implicit_jscontext]
    1.18 +  void readAsArrayBuffer(in nsIDOMBlob filedata);
    1.19 +  void readAsBinaryString(in nsIDOMBlob filedata);
    1.20 +  void readAsText(in nsIDOMBlob filedata, [optional] in DOMString encoding);
    1.21 +  void readAsDataURL(in nsIDOMBlob file);
    1.22 +
    1.23 +  void abort();
    1.24 +
    1.25 +  const unsigned short EMPTY = 0;
    1.26 +  const unsigned short LOADING = 1;
    1.27 +  const unsigned short DONE = 2;
    1.28 +  readonly attribute unsigned short readyState;
    1.29 +
    1.30 +  [implicit_jscontext]
    1.31 +  readonly attribute jsval result;
    1.32 +
    1.33 +  // This is a DOMError
    1.34 +  readonly attribute nsISupports error;
    1.35 +
    1.36 +  [implicit_jscontext] attribute jsval onloadstart;
    1.37 +  [implicit_jscontext] attribute jsval onprogress;
    1.38 +  [implicit_jscontext] attribute jsval onload;
    1.39 +  [implicit_jscontext] attribute jsval onabort;
    1.40 +  [implicit_jscontext] attribute jsval onerror;
    1.41 +  [implicit_jscontext] attribute jsval onloadend;
    1.42 +};
    1.43 +
    1.44 +%{ C++
    1.45 +#define NS_FILEREADER_CID                            \
    1.46 +{0x06aa7c21, 0xfe05, 0x4cf2,                         \
    1.47 +{0xb1, 0xc4, 0x0c, 0x71, 0x26, 0xa4, 0xf7, 0x13}}
    1.48 +#define NS_FILEREADER_CONTRACTID \
    1.49 +"@mozilla.org/files/filereader;1"
    1.50 +%}

mercurial