nsIImageDocument.idl 1.5 KB

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