|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsIDOMHTMLElement.idl" |
|
7 |
|
8 /** |
|
9 * The nsIDOMHTMLCanvasElement interface is the interface to a HTML |
|
10 * <canvas> element. |
|
11 * |
|
12 * For more information on this interface, please see |
|
13 * http://www.whatwg.org/specs/web-apps/current-work/#graphics |
|
14 * |
|
15 * @status UNDER_DEVELOPMENT |
|
16 */ |
|
17 |
|
18 interface nsIDOMBlob; |
|
19 interface nsIDOMFile; |
|
20 interface nsIVariant; |
|
21 interface nsIInputStreamCallback; |
|
22 |
|
23 [scriptable, uuid(8978d1c5-2981-4678-a1c3-b0b7bae04fbc)] |
|
24 interface nsIDOMHTMLCanvasElement : nsISupports |
|
25 { |
|
26 attribute unsigned long width; |
|
27 attribute unsigned long height; |
|
28 attribute boolean mozOpaque; |
|
29 |
|
30 // Valid calls are: |
|
31 // toDataURL(); -- defaults to image/png |
|
32 // toDataURL(type); -- uses given type |
|
33 // toDataURL(type, params); -- uses given type, and any valid parameters |
|
34 [implicit_jscontext] |
|
35 DOMString toDataURL([optional] in DOMString type, |
|
36 [optional] in jsval params); |
|
37 |
|
38 // Valid calls are |
|
39 // mozGetAsFile(name); -- defaults to image/png |
|
40 // mozGetAsFile(name, type); -- uses given type |
|
41 nsIDOMFile mozGetAsFile(in DOMString name, [optional] in DOMString type); |
|
42 |
|
43 // A Mozilla-only extension to get a canvas context backed by double-buffered |
|
44 // shared memory. Only privileged callers can call this. |
|
45 nsISupports MozGetIPCContext(in DOMString contextId); |
|
46 |
|
47 // A Mozilla-only extension that returns the canvas' image data as a data |
|
48 // stream in the desired image format. |
|
49 void mozFetchAsStream(in nsIInputStreamCallback callback, |
|
50 [optional] in DOMString type); |
|
51 }; |
|
52 |