|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #include "nsISupports.idl" |
|
8 #include "nsITransferable.idl" |
|
9 |
|
10 |
|
11 %{ C++ |
|
12 #include "nsSize.h" |
|
13 %} |
|
14 |
|
15 native nsSize (nsSize); |
|
16 |
|
17 |
|
18 interface nsIDOMDocument; |
|
19 interface nsIDOMNode; |
|
20 interface nsIDOMDataTransfer; |
|
21 |
|
22 [scriptable, uuid(fde41f6a-c710-46f8-a0a8-1ff76ca4ff57)] |
|
23 interface nsIDragSession : nsISupports |
|
24 { |
|
25 /** |
|
26 * Set the current state of the drag, whether it can be dropped or not. |
|
27 * usually the target "frame" sets this so the native system can render the correct feedback |
|
28 */ |
|
29 attribute boolean canDrop; |
|
30 |
|
31 /** |
|
32 * Indicates if the drop event should be dispatched only to chrome. |
|
33 */ |
|
34 attribute boolean onlyChromeDrop; |
|
35 |
|
36 /** |
|
37 * Sets the action (copy, move, link, et.c) for the current drag |
|
38 */ |
|
39 attribute unsigned long dragAction; |
|
40 |
|
41 /** |
|
42 * Sets the current width and height of the drag target area. |
|
43 * It will contain the current size of the Frame that the drag is currently in |
|
44 */ |
|
45 [noscript] attribute nsSize targetSize; |
|
46 |
|
47 /** |
|
48 * Get the number of items that were dropped |
|
49 */ |
|
50 readonly attribute unsigned long numDropItems; |
|
51 |
|
52 /** |
|
53 * The document where the drag was started, which will be null if the |
|
54 * drag originated outside the application. Useful for determining if a drop |
|
55 * originated in the same document. |
|
56 */ |
|
57 readonly attribute nsIDOMDocument sourceDocument; |
|
58 |
|
59 /** |
|
60 * The dom node that was originally dragged to start the session, which will be null if the |
|
61 * drag originated outside the application. |
|
62 */ |
|
63 readonly attribute nsIDOMNode sourceNode; |
|
64 |
|
65 /** |
|
66 * The data transfer object for the current drag. |
|
67 */ |
|
68 attribute nsIDOMDataTransfer dataTransfer; |
|
69 |
|
70 /** |
|
71 * Get data from a Drag&Drop. Can be called while the drag is in process |
|
72 * or after the drop has completed. |
|
73 * |
|
74 * @param aTransferable the transferable for the data to be put into |
|
75 * @param aItemIndex which of multiple drag items, zero-based |
|
76 */ |
|
77 void getData ( in nsITransferable aTransferable, in unsigned long aItemIndex ) ; |
|
78 |
|
79 /** |
|
80 * Check to set if any of the native data on the clipboard matches this data flavor |
|
81 */ |
|
82 boolean isDataFlavorSupported ( in string aDataFlavor ) ; |
|
83 |
|
84 }; |
|
85 |
|
86 |
|
87 %{ C++ |
|
88 |
|
89 %} |