2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @status UNDER_DEVELOPMENT
|
|
|
|
*/
|
|
|
|
|
|
|
|
interface imgIRequest;
|
|
|
|
|
2013-05-06 06:42:00 -07:00
|
|
|
[scriptable, uuid(87c27f98-37dc-4b64-a8cd-92003624bcee)]
|
2007-03-22 10:30:00 -07: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;
|
|
|
|
|
|
|
|
/* The image request being displayed in the content area */
|
|
|
|
readonly attribute imgIRequest imageRequest;
|
|
|
|
|
|
|
|
/* Resize the image to fit visible area. */
|
2013-05-06 06:42:00 -07:00
|
|
|
[binaryname(DOMShrinkToFit)]
|
2007-03-22 10:30:00 -07:00
|
|
|
void shrinkToFit();
|
|
|
|
|
2013-05-01 02:12:41 -07:00
|
|
|
/* Restore image original size. */
|
2013-05-06 06:42:00 -07:00
|
|
|
[binaryname(DOMRestoreImage)]
|
2007-03-22 10:30:00 -07:00
|
|
|
void restoreImage();
|
|
|
|
|
|
|
|
/* 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 06:42:00 -07:00
|
|
|
[binaryname(DOMRestoreImageTo)]
|
2007-03-22 10:30:00 -07:00
|
|
|
void restoreImageTo(in long x, in long y);
|
|
|
|
|
|
|
|
/* 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 06:42:00 -07:00
|
|
|
[binaryname(DOMToggleImageSize)]
|
2007-03-22 10:30:00 -07:00
|
|
|
void toggleImageSize();
|
|
|
|
};
|