2003-01-18 11:04:40 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2003-01-18 11:04:40 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @status UNDER_DEVELOPMENT
|
|
|
|
*/
|
|
|
|
|
2005-08-25 20:05:24 +00:00
|
|
|
interface imgIRequest;
|
|
|
|
|
2013-05-06 13:42:00 +00:00
|
|
|
[scriptable, uuid(87c27f98-37dc-4b64-a8cd-92003624bcee)]
|
2003-01-18 11:04:40 +00:00
|
|
|
interface nsIImageDocument : nsISupports {
|
|
|
|
|
|
|
|
/* Whether the pref for image resizing has been set. */
|
|
|
|
readonly attribute boolean imageResizingEnabled;
|
|
|
|
|
|
|
|
/* Whether the image is overflowing visible area. */
|
|
|
|
readonly attribute boolean imageIsOverflowing;
|
|
|
|
|
|
|
|
/* Whether the image has been resized to fit visible area. */
|
|
|
|
readonly attribute boolean imageIsResized;
|
|
|
|
|
2005-08-25 20:05:24 +00:00
|
|
|
/* The image request being displayed in the content area */
|
|
|
|
readonly attribute imgIRequest imageRequest;
|
|
|
|
|
2003-01-18 11:04:40 +00:00
|
|
|
/* Resize the image to fit visible area. */
|
2013-05-06 13:42:00 +00:00
|
|
|
[binaryname(DOMShrinkToFit)]
|
2003-01-18 11:04:40 +00:00
|
|
|
void shrinkToFit();
|
|
|
|
|
2013-05-01 09:12:41 +00:00
|
|
|
/* Restore image original size. */
|
2013-05-06 13:42:00 +00:00
|
|
|
[binaryname(DOMRestoreImage)]
|
2003-01-18 11:04:40 +00:00
|
|
|
void restoreImage();
|
|
|
|
|
2004-09-09 22:40:40 +00:00
|
|
|
/* Restore the image, trying to keep a certain pixel in the same position.
|
|
|
|
* The coordinate system is that of the shrunken image.
|
|
|
|
*/
|
2013-05-06 13:42:00 +00:00
|
|
|
[binaryname(DOMRestoreImageTo)]
|
2004-09-09 22:40:40 +00:00
|
|
|
void restoreImageTo(in long x, in long y);
|
|
|
|
|
2003-01-18 11:04:40 +00:00
|
|
|
/* A helper method for switching between states.
|
|
|
|
* The switching logic is as follows. If the image has been resized
|
|
|
|
* restore image original size, otherwise if the image is overflowing
|
|
|
|
* current visible area resize the image to fit the area.
|
|
|
|
*/
|
2013-05-06 13:42:00 +00:00
|
|
|
[binaryname(DOMToggleImageSize)]
|
2003-01-18 11:04:40 +00:00
|
|
|
void toggleImageSize();
|
|
|
|
};
|