1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/nsIDragSession.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,89 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 +#include "nsITransferable.idl" 1.12 + 1.13 + 1.14 +%{ C++ 1.15 +#include "nsSize.h" 1.16 +%} 1.17 + 1.18 +native nsSize (nsSize); 1.19 + 1.20 + 1.21 +interface nsIDOMDocument; 1.22 +interface nsIDOMNode; 1.23 +interface nsIDOMDataTransfer; 1.24 + 1.25 +[scriptable, uuid(fde41f6a-c710-46f8-a0a8-1ff76ca4ff57)] 1.26 +interface nsIDragSession : nsISupports 1.27 +{ 1.28 + /** 1.29 + * Set the current state of the drag, whether it can be dropped or not. 1.30 + * usually the target "frame" sets this so the native system can render the correct feedback 1.31 + */ 1.32 + attribute boolean canDrop; 1.33 + 1.34 + /** 1.35 + * Indicates if the drop event should be dispatched only to chrome. 1.36 + */ 1.37 + attribute boolean onlyChromeDrop; 1.38 + 1.39 + /** 1.40 + * Sets the action (copy, move, link, et.c) for the current drag 1.41 + */ 1.42 + attribute unsigned long dragAction; 1.43 + 1.44 + /** 1.45 + * Sets the current width and height of the drag target area. 1.46 + * It will contain the current size of the Frame that the drag is currently in 1.47 + */ 1.48 + [noscript] attribute nsSize targetSize; 1.49 + 1.50 + /** 1.51 + * Get the number of items that were dropped 1.52 + */ 1.53 + readonly attribute unsigned long numDropItems; 1.54 + 1.55 + /** 1.56 + * The document where the drag was started, which will be null if the 1.57 + * drag originated outside the application. Useful for determining if a drop 1.58 + * originated in the same document. 1.59 + */ 1.60 + readonly attribute nsIDOMDocument sourceDocument; 1.61 + 1.62 + /** 1.63 + * The dom node that was originally dragged to start the session, which will be null if the 1.64 + * drag originated outside the application. 1.65 + */ 1.66 + readonly attribute nsIDOMNode sourceNode; 1.67 + 1.68 + /** 1.69 + * The data transfer object for the current drag. 1.70 + */ 1.71 + attribute nsIDOMDataTransfer dataTransfer; 1.72 + 1.73 + /** 1.74 + * Get data from a Drag&Drop. Can be called while the drag is in process 1.75 + * or after the drop has completed. 1.76 + * 1.77 + * @param aTransferable the transferable for the data to be put into 1.78 + * @param aItemIndex which of multiple drag items, zero-based 1.79 + */ 1.80 + void getData ( in nsITransferable aTransferable, in unsigned long aItemIndex ) ; 1.81 + 1.82 + /** 1.83 + * Check to set if any of the native data on the clipboard matches this data flavor 1.84 + */ 1.85 + boolean isDataFlavorSupported ( in string aDataFlavor ) ; 1.86 + 1.87 +}; 1.88 + 1.89 + 1.90 +%{ C++ 1.91 + 1.92 +%}