michael@0: /* -*- Mode: IDL; 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 "nsIDOMHTMLElement.idl" michael@0: michael@0: /** michael@0: * The nsIDOMHTMLCanvasElement interface is the interface to a HTML michael@0: * element. michael@0: * michael@0: * For more information on this interface, please see michael@0: * http://www.whatwg.org/specs/web-apps/current-work/#graphics michael@0: * michael@0: * @status UNDER_DEVELOPMENT michael@0: */ michael@0: michael@0: interface nsIDOMBlob; michael@0: interface nsIDOMFile; michael@0: interface nsIVariant; michael@0: interface nsIInputStreamCallback; michael@0: michael@0: [scriptable, uuid(8978d1c5-2981-4678-a1c3-b0b7bae04fbc)] michael@0: interface nsIDOMHTMLCanvasElement : nsISupports michael@0: { michael@0: attribute unsigned long width; michael@0: attribute unsigned long height; michael@0: attribute boolean mozOpaque; michael@0: michael@0: // Valid calls are: michael@0: // toDataURL(); -- defaults to image/png michael@0: // toDataURL(type); -- uses given type michael@0: // toDataURL(type, params); -- uses given type, and any valid parameters michael@0: [implicit_jscontext] michael@0: DOMString toDataURL([optional] in DOMString type, michael@0: [optional] in jsval params); michael@0: michael@0: // Valid calls are michael@0: // mozGetAsFile(name); -- defaults to image/png michael@0: // mozGetAsFile(name, type); -- uses given type michael@0: nsIDOMFile mozGetAsFile(in DOMString name, [optional] in DOMString type); michael@0: michael@0: // A Mozilla-only extension to get a canvas context backed by double-buffered michael@0: // shared memory. Only privileged callers can call this. michael@0: nsISupports MozGetIPCContext(in DOMString contextId); michael@0: michael@0: // A Mozilla-only extension that returns the canvas' image data as a data michael@0: // stream in the desired image format. michael@0: void mozFetchAsStream(in nsIInputStreamCallback callback, michael@0: [optional] in DOMString type); michael@0: }; michael@0: