Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
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 | interface nsIHTMLObjectResizeListener; |
michael@0 | 10 | |
michael@0 | 11 | [scriptable, uuid(8b396020-69d3-451f-80c1-1a96a7da25a9)] |
michael@0 | 12 | |
michael@0 | 13 | interface nsIHTMLObjectResizer : nsISupports |
michael@0 | 14 | { |
michael@0 | 15 | %{C++ |
michael@0 | 16 | typedef short EResizerLocation; |
michael@0 | 17 | %} |
michael@0 | 18 | const short eTopLeft = 0; |
michael@0 | 19 | const short eTop = 1; |
michael@0 | 20 | const short eTopRight = 2; |
michael@0 | 21 | const short eLeft = 3; |
michael@0 | 22 | const short eRight = 4; |
michael@0 | 23 | const short eBottomLeft = 5; |
michael@0 | 24 | const short eBottom = 6; |
michael@0 | 25 | const short eBottomRight = 7; |
michael@0 | 26 | |
michael@0 | 27 | /** |
michael@0 | 28 | * the element currently displaying resizers |
michael@0 | 29 | */ |
michael@0 | 30 | readonly attribute nsIDOMElement resizedObject; |
michael@0 | 31 | |
michael@0 | 32 | /** |
michael@0 | 33 | * a boolean indicating if object resizing is enabled in the editor |
michael@0 | 34 | */ |
michael@0 | 35 | attribute boolean objectResizingEnabled; |
michael@0 | 36 | |
michael@0 | 37 | /** |
michael@0 | 38 | * Shows active resizers around an element's frame |
michael@0 | 39 | * @param aResizedElement [IN] a DOM Element |
michael@0 | 40 | */ |
michael@0 | 41 | void showResizers(in nsIDOMElement aResizedElement); |
michael@0 | 42 | |
michael@0 | 43 | /** |
michael@0 | 44 | * Hide resizers if they are visible |
michael@0 | 45 | */ |
michael@0 | 46 | void hideResizers(); |
michael@0 | 47 | |
michael@0 | 48 | /** |
michael@0 | 49 | * Refresh visible resizers |
michael@0 | 50 | */ |
michael@0 | 51 | void refreshResizers(); |
michael@0 | 52 | |
michael@0 | 53 | /** |
michael@0 | 54 | * event callback when a mouse button is pressed |
michael@0 | 55 | * @param aX [IN] horizontal position of the pointer |
michael@0 | 56 | * @param aY [IN] vertical position of the pointer |
michael@0 | 57 | * @param aTarget [IN] the element triggering the event |
michael@0 | 58 | * @param aMouseEvent [IN] the event |
michael@0 | 59 | */ |
michael@0 | 60 | void mouseDown(in long aX, in long aY, |
michael@0 | 61 | in nsIDOMElement aTarget, in nsIDOMEvent aMouseEvent); |
michael@0 | 62 | |
michael@0 | 63 | /** |
michael@0 | 64 | * event callback when a mouse button is released |
michael@0 | 65 | * @param aX [IN] horizontal position of the pointer |
michael@0 | 66 | * @param aY [IN] vertical position of the pointer |
michael@0 | 67 | * @param aTarget [IN] the element triggering the event |
michael@0 | 68 | */ |
michael@0 | 69 | void mouseUp(in long aX, in long aY, |
michael@0 | 70 | in nsIDOMElement aTarget); |
michael@0 | 71 | |
michael@0 | 72 | /** |
michael@0 | 73 | * event callback when the mouse pointer is moved |
michael@0 | 74 | * @param aMouseEvent [IN] the event |
michael@0 | 75 | */ |
michael@0 | 76 | void mouseMove(in nsIDOMEvent aMouseEvent); |
michael@0 | 77 | |
michael@0 | 78 | /* Event Listeners */ |
michael@0 | 79 | |
michael@0 | 80 | /** |
michael@0 | 81 | * Creates a resize listener that can be used to get notifications |
michael@0 | 82 | * that the user started to resize an object or finalized such an operation |
michael@0 | 83 | * @param aListener [IN] an instance of nsIHTMLObjectResizeListener |
michael@0 | 84 | */ |
michael@0 | 85 | void addObjectResizeEventListener(in nsIHTMLObjectResizeListener aListener); |
michael@0 | 86 | |
michael@0 | 87 | /** |
michael@0 | 88 | * Deletes a resize listener |
michael@0 | 89 | * @param aListener [IN] an instance of nsIHTMLObjectResizeListener |
michael@0 | 90 | */ |
michael@0 | 91 | void removeObjectResizeEventListener(in nsIHTMLObjectResizeListener aListener); |
michael@0 | 92 | }; |
michael@0 | 93 |