Bug 1376625 - Updating meta data for newly added tests r=ato
[gecko.git] / widget / nsIDragService.idl
blob8cc268e05313b891f34ab200aa9ada4b5f78f0c0
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 "nsIArray.idl"
8 #include "nsISupports.idl"
9 #include "nsIDragSession.idl"
10 #include "nsIScriptableRegion.idl"
11 #include "nsIContentPolicy.idl"
13 interface nsIDOMNode;
14 interface nsIDOMDragEvent;
15 interface nsIDOMDataTransfer;
16 interface nsISelection;
18 %{C++
19 #include "mozilla/EventForwards.h"
21 namespace mozilla {
22 namespace dom {
23 class ContentParent;
24 } // namespace dom
25 } // namespace mozilla
28 [ptr] native ContentParentPtr(mozilla::dom::ContentParent);
29 native EventMessage(mozilla::EventMessage);
31 [scriptable, uuid(ebd6b3a2-af16-43af-a698-3091a087dd62), builtinclass]
32 interface nsIDragService : nsISupports
34 const long DRAGDROP_ACTION_NONE = 0;
35 const long DRAGDROP_ACTION_COPY = 1;
36 const long DRAGDROP_ACTION_MOVE = 2;
37 const long DRAGDROP_ACTION_LINK = 4;
38 const long DRAGDROP_ACTION_UNINITIALIZED = 64;
40 /**
41 * Starts a modal drag session with an array of transaferables.
43 * Note: This method is deprecated for non-native code.
45 * @param aTransferables - an array of transferables to be dragged
46 * @param aRegion - a region containing rectangles for cursor feedback,
47 * in window coordinates.
48 * @param aActionType - specified which of copy/move/link are allowed
49 * @param aContentPolicyType - the contentPolicyType that will be
50 * passed to the loadInfo when creating a new channel
51 * (defaults to TYPE_OTHER)
53 void invokeDragSession (in nsIDOMNode aDOMNode,
54 in nsIArray aTransferables,
55 in nsIScriptableRegion aRegion,
56 in unsigned long aActionType,
57 [optional] in nsContentPolicyType aContentPolicyType);
59 /**
60 * Starts a modal drag session using an image. The first four arguments are
61 * the same as invokeDragSession.
63 * Note: This method is deprecated for non-native code.
65 * A custom image may be specified using the aImage argument. If this is
66 * supplied, the aImageX and aImageY arguments specify the offset within
67 * the image where the cursor would be positioned. That is, when the image
68 * is drawn, it is offset up and left the amount so that the cursor appears
69 * at that location within the image.
71 * If aImage is null, aImageX and aImageY are not used and the image is instead
72 * determined from the source node aDOMNode, and the offset calculated so that
73 * the initial location for the image appears in the same screen position as
74 * where the element is located. The node must be within a document.
76 * Currently, supported images are all DOM nodes. If this is an HTML <image> or
77 * <canvas>, the drag image is taken from the image data. If the element is in
78 * a document, it will be rendered at its displayed size, othewise, it will be
79 * rendered at its real size. For other types of elements, the element is
80 * rendered into an offscreen buffer in the same manner as it is currently
81 * displayed. The document selection is hidden while drawing.
83 * The aDragEvent must be supplied as the current screen coordinates of the
84 * event are needed to calculate the image location.
86 void invokeDragSessionWithImage(in nsIDOMNode aDOMNode,
87 in nsIArray aTransferableArray,
88 in nsIScriptableRegion aRegion,
89 in unsigned long aActionType,
90 in nsIDOMNode aImage,
91 in long aImageX,
92 in long aImageY,
93 in nsIDOMDragEvent aDragEvent,
94 in nsIDOMDataTransfer aDataTransfer);
96 /**
97 * Start a modal drag session using the selection as the drag image.
98 * The aDragEvent must be supplied as the current screen coordinates of the
99 * event are needed to calculate the image location.
101 * Note: This method is deprecated for non-native code.
103 void invokeDragSessionWithSelection(in nsISelection aSelection,
104 in nsIArray aTransferableArray,
105 in unsigned long aActionType,
106 in nsIDOMDragEvent aDragEvent,
107 in nsIDOMDataTransfer aDataTransfer);
110 * Returns the current Drag Session
112 nsIDragSession getCurrentSession ( ) ;
115 * Tells the Drag Service to start a drag session. This is called when
116 * an external drag occurs
118 void startDragSession ( ) ;
121 * Tells the Drag Service to end a drag session. This is called when
122 * an external drag occurs
124 * If aDoneDrag is true, the drag has finished, otherwise the drag has
125 * just left the window.
127 void endDragSession(in boolean aDoneDrag,
128 [optional] in unsigned long aKeyModifiers);
131 * Fire a drag event at the source of the drag
133 [noscript] void fireDragEventAtSource(in EventMessage aEventMessage,
134 in unsigned long aKeyModifiers);
137 * Increase/decrease dragging suppress level by one.
138 * If level is greater than one, dragging is disabled.
140 void suppress();
141 void unsuppress();
144 * aX and aY are in LayoutDevice pixels.
146 [noscript] void dragMoved(in long aX, in long aY);
148 [notxpcom, nostdcall] boolean maybeAddChildProcess(in ContentParentPtr aChild);
152 %{ C++