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