editor/idl/nsIHTMLAbsPosEditor.idl

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

     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/. */
     6 #include "nsISupports.idl"
     7 #include "domstubs.idl"
     9 [scriptable, uuid(91375f52-20e6-4757-9835-eb04fabe5498)]
    11 interface nsIHTMLAbsPosEditor : nsISupports
    12 {
    13   /**
    14    * true if the selection container is absolutely positioned
    15    */
    16   readonly attribute boolean selectionContainerAbsolutelyPositioned;
    18   /**
    19    * this contains the absolutely positioned element currently edited
    20    * or null
    21    */
    22   readonly attribute nsIDOMElement positionedElement;
    24   /**
    25    * true if Absolute Positioning handling is enabled in the editor
    26    */
    27   attribute boolean absolutePositioningEnabled;
    30   /* Utility methods */
    32   /**
    33    * true if Snap To Grid is enabled in the editor.
    34    */
    35   attribute boolean snapToGridEnabled;
    37   /**
    38    * sets the grid size in pixels.
    39    * @param aSizeInPixels [IN] the size of the grid in pixels
    40    */
    41   attribute unsigned long gridSize;
    43   /* Selection-based methods */
    45   /**
    46    * returns the deepest absolutely positioned container of the selection
    47    * if it exists or null.
    48    */
    49   readonly attribute nsIDOMElement absolutelyPositionedSelectionContainer;
    51   /**
    52    * extracts the selection from the normal flow of the document and
    53    * positions it.
    54    * @param aEnabled [IN] true to absolutely position the selection,
    55    *                      false to put it back in the normal flow
    56    */
    57   void absolutePositionSelection(in boolean aEnabled);
    59   /**
    60    * adds aChange to the z-index of the currently positioned element.
    61    * @param aChange [IN] relative change to apply to current z-index
    62    */
    63   void relativeChangeZIndex(in long aChange);
    65   /* Element-based methods */
    67   /**
    68    * extracts an element from the normal flow of the document and
    69    * positions it, and puts it back in the normal flow.
    70    * @param aElement [IN] the element
    71    * @param aEnabled [IN] true to absolutely position the element,
    72    *                      false to put it back in the normal flow
    73    */
    74   void absolutelyPositionElement(in nsIDOMElement aElement,
    75                                  in boolean aEnabled);
    77   /**
    78    * sets the position of an element; warning it does NOT check if the
    79    * element is already positioned or not and that's on purpose.
    80    * @param aElement [IN] the element
    81    * @param aX       [IN] the x position in pixels.
    82    * @param aY       [IN] the y position in pixels.
    83    */
    84   void setElementPosition(in nsIDOMElement aElement, in long aX, in long aY);
    86   /**
    87    * returns the absolute z-index of a positioned element. Never returns 'auto'.
    88    * @return         the z-index of the element
    89    * @param aElement [IN] the element.
    90    */
    91   long getElementZIndex(in nsIDOMElement aElement);
    93   /**
    94    * sets the z-index of an element.
    95    * @param aElement [IN] the element
    96    * @param aZorder  [IN] the z-index
    97    */
    98   void setElementZIndex(in nsIDOMElement aElement, in long aZorder);
   100   /**
   101    * adds aChange to the z-index of an arbitrary element.
   102    * @return         the new z-index of the element
   103    * @param aElement [IN] the element
   104    * @param aChange  [IN] relative change to apply to current z-index of
   105    *                      the element
   106    */
   107   long relativeChangeElementZIndex(in nsIDOMElement aElement, in long aChange);
   109   /* Other */
   111   /**
   112    * shows a grabber attached to an arbitrary element. The grabber is an image
   113    * positioned on the left hand side of the top border of the element. Dragging
   114    * and dropping it allows to change the element's absolute position in the
   115    * document. See chrome://editor/content/images/grabber.gif
   116    * @param aElement [IN] the element
   117    */
   118   void showGrabberOnElement(in nsIDOMElement aElement);
   120   /**
   121    * hide the grabber if it shown.
   122    */
   123   void hideGrabber();
   125   /**
   126    * refreshes the grabber if it shown, possibly updating its position or
   127    * even hiding it.
   128    */
   129   void refreshGrabber();
   131 };

mercurial