Bug 1462329 [wpt PR 10991] - Server-Timing: test TAO:* for cross-origin resource...
[gecko.git] / widget / nsIDragSession.idl
blob243a73ecf5ac8654f47b9a08cd6511e52cf3a4cd
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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/. */
7 #include "nsISupports.idl"
8 #include "nsITransferable.idl"
11 %{ C++
12 #include "nsSize.h"
15 native nsSize (nsSize);
17 interface nsIDOMNode;
19 webidl DataTransfer;
20 webidl Document;
22 [scriptable, builtinclass, uuid(25bce737-73f0-43c7-bc20-c71044a73c5a)]
23 interface nsIDragSession : nsISupports
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
29 attribute boolean canDrop;
31 /**
32 * Indicates if the drop event should be dispatched only to chrome.
34 attribute boolean onlyChromeDrop;
36 /**
37 * Sets the action (copy, move, link, et.c) for the current drag
38 */
39 attribute unsigned long dragAction;
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;
47 /**
48 * Get the number of items that were dropped
50 readonly attribute unsigned long numDropItems;
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.
57 readonly attribute Document sourceDocument;
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.
63 readonly attribute nsIDOMNode sourceNode;
65 /**
66 * The URI spec of the triggering principal. This may be different than
67 * sourceNode's principal when sourceNode is xul:browser and the drag is
68 * triggered in a browsing context inside it.
70 attribute AUTF8String triggeringPrincipalURISpec;
72 /**
73 * The data transfer object for the current drag.
75 [binaryname(DataTransferXPCOM)]
76 attribute DataTransfer dataTransfer;
77 [notxpcom, nostdcall] DataTransfer getDataTransfer();
78 [notxpcom, nostdcall] void setDataTransfer(in DataTransfer aDataTransfer);
80 /**
81 * Get data from a Drag&Drop. Can be called while the drag is in process
82 * or after the drop has completed.
84 * @param aTransferable the transferable for the data to be put into
85 * @param aItemIndex which of multiple drag items, zero-based
87 void getData ( in nsITransferable aTransferable, in unsigned long aItemIndex ) ;
89 /**
90 * Check to set if any of the native data on the clipboard matches this data flavor
92 boolean isDataFlavorSupported ( in string aDataFlavor ) ;
94 void userCancelled();
96 void dragEventDispatchedToChildProcess();
98 // Called when nsIDragSession implementation should update the UI for the
99 // drag-and-drop based on the data got from the child process in response to
100 // NS_DRAGDROP_OVER sent from parent process to child process.
101 void updateDragEffect();
103 // Change the drag image, using similar arguments as
104 // nsIDragService::InvokeDragSessionWithImage.
105 void updateDragImage(in nsIDOMNode aImage, in long aImageX, in long aImageY);
109 %{ C++