|
1 /* -*- Mode: C++; 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 "nsISupports.idl" |
|
7 |
|
8 /** |
|
9 * @status UNDER_DEVELOPMENT |
|
10 */ |
|
11 |
|
12 interface imgIRequest; |
|
13 |
|
14 [scriptable, uuid(87c27f98-37dc-4b64-a8cd-92003624bcee)] |
|
15 interface nsIImageDocument : nsISupports { |
|
16 |
|
17 /* Whether the pref for image resizing has been set. */ |
|
18 readonly attribute boolean imageResizingEnabled; |
|
19 |
|
20 /* Whether the image is overflowing visible area. */ |
|
21 readonly attribute boolean imageIsOverflowing; |
|
22 |
|
23 /* Whether the image has been resized to fit visible area. */ |
|
24 readonly attribute boolean imageIsResized; |
|
25 |
|
26 /* The image request being displayed in the content area */ |
|
27 readonly attribute imgIRequest imageRequest; |
|
28 |
|
29 /* Resize the image to fit visible area. */ |
|
30 [binaryname(DOMShrinkToFit)] |
|
31 void shrinkToFit(); |
|
32 |
|
33 /* Restore image original size. */ |
|
34 [binaryname(DOMRestoreImage)] |
|
35 void restoreImage(); |
|
36 |
|
37 /* Restore the image, trying to keep a certain pixel in the same position. |
|
38 * The coordinate system is that of the shrunken image. |
|
39 */ |
|
40 [binaryname(DOMRestoreImageTo)] |
|
41 void restoreImageTo(in long x, in long y); |
|
42 |
|
43 /* A helper method for switching between states. |
|
44 * The switching logic is as follows. If the image has been resized |
|
45 * restore image original size, otherwise if the image is overflowing |
|
46 * current visible area resize the image to fit the area. |
|
47 */ |
|
48 [binaryname(DOMToggleImageSize)] |
|
49 void toggleImageSize(); |
|
50 }; |