content/html/document/public/nsIImageDocument.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/html/document/public/nsIImageDocument.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +/**
    1.12 + * @status UNDER_DEVELOPMENT
    1.13 + */
    1.14 +
    1.15 +interface imgIRequest;
    1.16 +
    1.17 +[scriptable, uuid(87c27f98-37dc-4b64-a8cd-92003624bcee)]
    1.18 +interface nsIImageDocument : nsISupports {
    1.19 +
    1.20 +  /* Whether the pref for image resizing has been set. */
    1.21 +  readonly attribute boolean imageResizingEnabled;
    1.22 +
    1.23 +  /* Whether the image is overflowing visible area. */
    1.24 +  readonly attribute boolean imageIsOverflowing;
    1.25 +
    1.26 +  /* Whether the image has been resized to fit visible area. */
    1.27 +  readonly attribute boolean imageIsResized;
    1.28 +
    1.29 +  /* The image request being displayed in the content area */
    1.30 +  readonly attribute imgIRequest imageRequest;
    1.31 +
    1.32 +  /* Resize the image to fit visible area. */
    1.33 +  [binaryname(DOMShrinkToFit)]
    1.34 +  void shrinkToFit();
    1.35 +
    1.36 +  /* Restore image original size. */
    1.37 +  [binaryname(DOMRestoreImage)]
    1.38 +  void restoreImage();
    1.39 +
    1.40 +  /* Restore the image, trying to keep a certain pixel in the same position.
    1.41 +   * The coordinate system is that of the shrunken image.
    1.42 +   */
    1.43 +  [binaryname(DOMRestoreImageTo)]
    1.44 +  void restoreImageTo(in long x, in long y);
    1.45 +
    1.46 +  /* A helper method for switching between states.
    1.47 +   * The switching logic is as follows. If the image has been resized
    1.48 +   * restore image original size, otherwise if the image is overflowing
    1.49 +   * current visible area resize the image to fit the area.
    1.50 +   */
    1.51 +  [binaryname(DOMToggleImageSize)]
    1.52 +  void toggleImageSize();
    1.53 +};  

mercurial