michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIDOMEventTarget.idl" michael@0: michael@0: interface nsIDOMEventListener; michael@0: interface nsIDOMBlob; michael@0: michael@0: [scriptable, builtinclass, uuid(39ea2c73-7711-4cea-9f73-3166c24dfa69)] michael@0: interface nsIDOMFileReader : nsIDOMEventTarget michael@0: { michael@0: [implicit_jscontext] michael@0: void readAsArrayBuffer(in nsIDOMBlob filedata); michael@0: void readAsBinaryString(in nsIDOMBlob filedata); michael@0: void readAsText(in nsIDOMBlob filedata, [optional] in DOMString encoding); michael@0: void readAsDataURL(in nsIDOMBlob file); michael@0: michael@0: void abort(); michael@0: michael@0: const unsigned short EMPTY = 0; michael@0: const unsigned short LOADING = 1; michael@0: const unsigned short DONE = 2; michael@0: readonly attribute unsigned short readyState; michael@0: michael@0: [implicit_jscontext] michael@0: readonly attribute jsval result; michael@0: michael@0: // This is a DOMError michael@0: readonly attribute nsISupports error; michael@0: michael@0: [implicit_jscontext] attribute jsval onloadstart; michael@0: [implicit_jscontext] attribute jsval onprogress; michael@0: [implicit_jscontext] attribute jsval onload; michael@0: [implicit_jscontext] attribute jsval onabort; michael@0: [implicit_jscontext] attribute jsval onerror; michael@0: [implicit_jscontext] attribute jsval onloadend; michael@0: }; michael@0: michael@0: %{ C++ michael@0: #define NS_FILEREADER_CID \ michael@0: {0x06aa7c21, 0xfe05, 0x4cf2, \ michael@0: {0xb1, 0xc4, 0x0c, 0x71, 0x26, 0xa4, 0xf7, 0x13}} michael@0: #define NS_FILEREADER_CONTRACTID \ michael@0: "@mozilla.org/files/filereader;1" michael@0: %}