editor/idl/nsIHTMLAbsPosEditor.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsISupports.idl"
michael@0 7 #include "domstubs.idl"
michael@0 8
michael@0 9 [scriptable, uuid(91375f52-20e6-4757-9835-eb04fabe5498)]
michael@0 10
michael@0 11 interface nsIHTMLAbsPosEditor : nsISupports
michael@0 12 {
michael@0 13 /**
michael@0 14 * true if the selection container is absolutely positioned
michael@0 15 */
michael@0 16 readonly attribute boolean selectionContainerAbsolutelyPositioned;
michael@0 17
michael@0 18 /**
michael@0 19 * this contains the absolutely positioned element currently edited
michael@0 20 * or null
michael@0 21 */
michael@0 22 readonly attribute nsIDOMElement positionedElement;
michael@0 23
michael@0 24 /**
michael@0 25 * true if Absolute Positioning handling is enabled in the editor
michael@0 26 */
michael@0 27 attribute boolean absolutePositioningEnabled;
michael@0 28
michael@0 29
michael@0 30 /* Utility methods */
michael@0 31
michael@0 32 /**
michael@0 33 * true if Snap To Grid is enabled in the editor.
michael@0 34 */
michael@0 35 attribute boolean snapToGridEnabled;
michael@0 36
michael@0 37 /**
michael@0 38 * sets the grid size in pixels.
michael@0 39 * @param aSizeInPixels [IN] the size of the grid in pixels
michael@0 40 */
michael@0 41 attribute unsigned long gridSize;
michael@0 42
michael@0 43 /* Selection-based methods */
michael@0 44
michael@0 45 /**
michael@0 46 * returns the deepest absolutely positioned container of the selection
michael@0 47 * if it exists or null.
michael@0 48 */
michael@0 49 readonly attribute nsIDOMElement absolutelyPositionedSelectionContainer;
michael@0 50
michael@0 51 /**
michael@0 52 * extracts the selection from the normal flow of the document and
michael@0 53 * positions it.
michael@0 54 * @param aEnabled [IN] true to absolutely position the selection,
michael@0 55 * false to put it back in the normal flow
michael@0 56 */
michael@0 57 void absolutePositionSelection(in boolean aEnabled);
michael@0 58
michael@0 59 /**
michael@0 60 * adds aChange to the z-index of the currently positioned element.
michael@0 61 * @param aChange [IN] relative change to apply to current z-index
michael@0 62 */
michael@0 63 void relativeChangeZIndex(in long aChange);
michael@0 64
michael@0 65 /* Element-based methods */
michael@0 66
michael@0 67 /**
michael@0 68 * extracts an element from the normal flow of the document and
michael@0 69 * positions it, and puts it back in the normal flow.
michael@0 70 * @param aElement [IN] the element
michael@0 71 * @param aEnabled [IN] true to absolutely position the element,
michael@0 72 * false to put it back in the normal flow
michael@0 73 */
michael@0 74 void absolutelyPositionElement(in nsIDOMElement aElement,
michael@0 75 in boolean aEnabled);
michael@0 76
michael@0 77 /**
michael@0 78 * sets the position of an element; warning it does NOT check if the
michael@0 79 * element is already positioned or not and that's on purpose.
michael@0 80 * @param aElement [IN] the element
michael@0 81 * @param aX [IN] the x position in pixels.
michael@0 82 * @param aY [IN] the y position in pixels.
michael@0 83 */
michael@0 84 void setElementPosition(in nsIDOMElement aElement, in long aX, in long aY);
michael@0 85
michael@0 86 /**
michael@0 87 * returns the absolute z-index of a positioned element. Never returns 'auto'.
michael@0 88 * @return the z-index of the element
michael@0 89 * @param aElement [IN] the element.
michael@0 90 */
michael@0 91 long getElementZIndex(in nsIDOMElement aElement);
michael@0 92
michael@0 93 /**
michael@0 94 * sets the z-index of an element.
michael@0 95 * @param aElement [IN] the element
michael@0 96 * @param aZorder [IN] the z-index
michael@0 97 */
michael@0 98 void setElementZIndex(in nsIDOMElement aElement, in long aZorder);
michael@0 99
michael@0 100 /**
michael@0 101 * adds aChange to the z-index of an arbitrary element.
michael@0 102 * @return the new z-index of the element
michael@0 103 * @param aElement [IN] the element
michael@0 104 * @param aChange [IN] relative change to apply to current z-index of
michael@0 105 * the element
michael@0 106 */
michael@0 107 long relativeChangeElementZIndex(in nsIDOMElement aElement, in long aChange);
michael@0 108
michael@0 109 /* Other */
michael@0 110
michael@0 111 /**
michael@0 112 * shows a grabber attached to an arbitrary element. The grabber is an image
michael@0 113 * positioned on the left hand side of the top border of the element. Dragging
michael@0 114 * and dropping it allows to change the element's absolute position in the
michael@0 115 * document. See chrome://editor/content/images/grabber.gif
michael@0 116 * @param aElement [IN] the element
michael@0 117 */
michael@0 118 void showGrabberOnElement(in nsIDOMElement aElement);
michael@0 119
michael@0 120 /**
michael@0 121 * hide the grabber if it shown.
michael@0 122 */
michael@0 123 void hideGrabber();
michael@0 124
michael@0 125 /**
michael@0 126 * refreshes the grabber if it shown, possibly updating its position or
michael@0 127 * even hiding it.
michael@0 128 */
michael@0 129 void refreshGrabber();
michael@0 130
michael@0 131 };
michael@0 132

mercurial