2009-10-07 08:30:26 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2009-10-07 08:30:26 +00:00
|
|
|
|
|
|
|
#include "nsIDOMEventTarget.idl"
|
|
|
|
|
|
|
|
interface nsIDOMEventListener;
|
2010-10-13 23:25:33 +00:00
|
|
|
interface nsIDOMBlob;
|
2009-10-07 08:30:26 +00:00
|
|
|
|
2014-08-13 22:38:29 +00:00
|
|
|
[builtinclass, uuid(2f34c719-bc14-4546-9fb9-2bab75e56e45)]
|
2011-09-29 16:06:35 +00:00
|
|
|
interface nsIDOMFileReader : nsIDOMEventTarget
|
2009-10-07 08:30:26 +00:00
|
|
|
{
|
2011-07-01 00:50:44 +00:00
|
|
|
[implicit_jscontext]
|
|
|
|
void readAsArrayBuffer(in nsIDOMBlob filedata);
|
2010-10-13 23:25:33 +00:00
|
|
|
void readAsBinaryString(in nsIDOMBlob filedata);
|
|
|
|
void readAsText(in nsIDOMBlob filedata, [optional] in DOMString encoding);
|
|
|
|
void readAsDataURL(in nsIDOMBlob file);
|
2009-10-07 08:30:26 +00:00
|
|
|
|
|
|
|
void abort();
|
|
|
|
|
2009-11-17 02:01:40 +00:00
|
|
|
const unsigned short EMPTY = 0;
|
2009-10-07 08:30:26 +00:00
|
|
|
const unsigned short LOADING = 1;
|
|
|
|
const unsigned short DONE = 2;
|
|
|
|
readonly attribute unsigned short readyState;
|
|
|
|
|
2011-07-01 00:50:44 +00:00
|
|
|
[implicit_jscontext]
|
|
|
|
readonly attribute jsval result;
|
2013-05-18 17:52:06 +00:00
|
|
|
|
|
|
|
// This is a DOMError
|
|
|
|
readonly attribute nsISupports error;
|
2011-09-29 16:06:35 +00:00
|
|
|
|
2012-08-31 03:45:16 +00:00
|
|
|
[implicit_jscontext] attribute jsval onloadstart;
|
|
|
|
[implicit_jscontext] attribute jsval onprogress;
|
|
|
|
[implicit_jscontext] attribute jsval onload;
|
|
|
|
[implicit_jscontext] attribute jsval onabort;
|
|
|
|
[implicit_jscontext] attribute jsval onerror;
|
|
|
|
[implicit_jscontext] attribute jsval onloadend;
|
2009-10-07 08:30:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
%{ C++
|
2009-11-09 20:05:16 +00:00
|
|
|
#define NS_FILEREADER_CID \
|
2009-10-07 08:30:26 +00:00
|
|
|
{0x06aa7c21, 0xfe05, 0x4cf2, \
|
|
|
|
{0xb1, 0xc4, 0x0c, 0x71, 0x26, 0xa4, 0xf7, 0x13}}
|
2009-11-09 20:05:16 +00:00
|
|
|
#define NS_FILEREADER_CONTRACTID \
|
|
|
|
"@mozilla.org/files/filereader;1"
|
2009-10-07 08:30:26 +00:00
|
|
|
%}
|