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