michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "domstubs.idl" michael@0: michael@0: interface nsIHTMLObjectResizeListener; michael@0: michael@0: [scriptable, uuid(8b396020-69d3-451f-80c1-1a96a7da25a9)] michael@0: michael@0: interface nsIHTMLObjectResizer : nsISupports michael@0: { michael@0: %{C++ michael@0: typedef short EResizerLocation; michael@0: %} michael@0: const short eTopLeft = 0; michael@0: const short eTop = 1; michael@0: const short eTopRight = 2; michael@0: const short eLeft = 3; michael@0: const short eRight = 4; michael@0: const short eBottomLeft = 5; michael@0: const short eBottom = 6; michael@0: const short eBottomRight = 7; michael@0: michael@0: /** michael@0: * the element currently displaying resizers michael@0: */ michael@0: readonly attribute nsIDOMElement resizedObject; michael@0: michael@0: /** michael@0: * a boolean indicating if object resizing is enabled in the editor michael@0: */ michael@0: attribute boolean objectResizingEnabled; michael@0: michael@0: /** michael@0: * Shows active resizers around an element's frame michael@0: * @param aResizedElement [IN] a DOM Element michael@0: */ michael@0: void showResizers(in nsIDOMElement aResizedElement); michael@0: michael@0: /** michael@0: * Hide resizers if they are visible michael@0: */ michael@0: void hideResizers(); michael@0: michael@0: /** michael@0: * Refresh visible resizers michael@0: */ michael@0: void refreshResizers(); michael@0: michael@0: /** michael@0: * event callback when a mouse button is pressed michael@0: * @param aX [IN] horizontal position of the pointer michael@0: * @param aY [IN] vertical position of the pointer michael@0: * @param aTarget [IN] the element triggering the event michael@0: * @param aMouseEvent [IN] the event michael@0: */ michael@0: void mouseDown(in long aX, in long aY, michael@0: in nsIDOMElement aTarget, in nsIDOMEvent aMouseEvent); michael@0: michael@0: /** michael@0: * event callback when a mouse button is released michael@0: * @param aX [IN] horizontal position of the pointer michael@0: * @param aY [IN] vertical position of the pointer michael@0: * @param aTarget [IN] the element triggering the event michael@0: */ michael@0: void mouseUp(in long aX, in long aY, michael@0: in nsIDOMElement aTarget); michael@0: michael@0: /** michael@0: * event callback when the mouse pointer is moved michael@0: * @param aMouseEvent [IN] the event michael@0: */ michael@0: void mouseMove(in nsIDOMEvent aMouseEvent); michael@0: michael@0: /* Event Listeners */ michael@0: michael@0: /** michael@0: * Creates a resize listener that can be used to get notifications michael@0: * that the user started to resize an object or finalized such an operation michael@0: * @param aListener [IN] an instance of nsIHTMLObjectResizeListener michael@0: */ michael@0: void addObjectResizeEventListener(in nsIHTMLObjectResizeListener aListener); michael@0: michael@0: /** michael@0: * Deletes a resize listener michael@0: * @param aListener [IN] an instance of nsIHTMLObjectResizeListener michael@0: */ michael@0: void removeObjectResizeEventListener(in nsIHTMLObjectResizeListener aListener); michael@0: }; michael@0: