michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * 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 "nsITransferable.idl" michael@0: michael@0: michael@0: %{ C++ michael@0: #include "nsSize.h" michael@0: %} michael@0: michael@0: native nsSize (nsSize); michael@0: michael@0: michael@0: interface nsIDOMDocument; michael@0: interface nsIDOMNode; michael@0: interface nsIDOMDataTransfer; michael@0: michael@0: [scriptable, uuid(fde41f6a-c710-46f8-a0a8-1ff76ca4ff57)] michael@0: interface nsIDragSession : nsISupports michael@0: { michael@0: /** michael@0: * Set the current state of the drag, whether it can be dropped or not. michael@0: * usually the target "frame" sets this so the native system can render the correct feedback michael@0: */ michael@0: attribute boolean canDrop; michael@0: michael@0: /** michael@0: * Indicates if the drop event should be dispatched only to chrome. michael@0: */ michael@0: attribute boolean onlyChromeDrop; michael@0: michael@0: /** michael@0: * Sets the action (copy, move, link, et.c) for the current drag michael@0: */ michael@0: attribute unsigned long dragAction; michael@0: michael@0: /** michael@0: * Sets the current width and height of the drag target area. michael@0: * It will contain the current size of the Frame that the drag is currently in michael@0: */ michael@0: [noscript] attribute nsSize targetSize; michael@0: michael@0: /** michael@0: * Get the number of items that were dropped michael@0: */ michael@0: readonly attribute unsigned long numDropItems; michael@0: michael@0: /** michael@0: * The document where the drag was started, which will be null if the michael@0: * drag originated outside the application. Useful for determining if a drop michael@0: * originated in the same document. michael@0: */ michael@0: readonly attribute nsIDOMDocument sourceDocument; michael@0: michael@0: /** michael@0: * The dom node that was originally dragged to start the session, which will be null if the michael@0: * drag originated outside the application. michael@0: */ michael@0: readonly attribute nsIDOMNode sourceNode; michael@0: michael@0: /** michael@0: * The data transfer object for the current drag. michael@0: */ michael@0: attribute nsIDOMDataTransfer dataTransfer; michael@0: michael@0: /** michael@0: * Get data from a Drag&Drop. Can be called while the drag is in process michael@0: * or after the drop has completed. michael@0: * michael@0: * @param aTransferable the transferable for the data to be put into michael@0: * @param aItemIndex which of multiple drag items, zero-based michael@0: */ michael@0: void getData ( in nsITransferable aTransferable, in unsigned long aItemIndex ) ; michael@0: michael@0: /** michael@0: * Check to set if any of the native data on the clipboard matches this data flavor michael@0: */ michael@0: boolean isDataFlavorSupported ( in string aDataFlavor ) ; michael@0: michael@0: }; michael@0: michael@0: michael@0: %{ C++ michael@0: michael@0: %}