nsISupports
Last changed in Gecko 43 (Firefox 43 / Thunderbird 43 / SeaMonkey 2.40)dataTransfer
drag and drop API instead. The only exception is getCurrentSession()
, since there's currently no way to check for a drag in progress using standard DOM methods or properties.void endDragSession( in PRBool aDoneDrag ) ; |
void dragMoved(in long aX, in long aY); Native code only! |
void fireDragEventAtSource(in unsigned long aMsg); Obsolete since Gecko 43 |
void fireDragEventAtSource(in mozilla::EventMessage aEventMessage); Native code only! |
nsIDragSession getCurrentSession( ) ; |
void invokeDragSession( in nsIDOMNode aDOMNode, in nsISupportsArray aTransferables, in nsIScriptableRegion aRegion, in unsigned long aActionType ); |
void invokeDragSessionWithImage(in nsIDOMNode aDOMNode, in nsISupportsArray aTransferableArray, in nsIScriptableRegion aRegion, in unsigned long aActionType, in nsIDOMNode aImage, in long aImageX, in long aImageY, in nsIDOMDragEvent aDragEvent, in nsIDOMDataTransfer aDataTransfer); |
void invokeDragSessionWithSelection(in nsISelection aSelection, in nsISupportsArray aTransferableArray, in unsigned long aActionType, in nsIDOMDragEvent aDragEvent, in nsIDOMDataTransfer aDataTransfer); |
void startDragSession( ) ; |
void suppress(); |
void unsuppress(); |
Constant | Value | Description |
DRAGDROP_ACTION_NONE |
0 |
No action. |
DRAGDROP_ACTION_COPY |
1 |
The drag and drop operation should copy the object. |
DRAGDROP_ACTION_MOVE |
2 |
The drag and drop operation should move the object. |
DRAGDROP_ACTION_LINK |
4 |
The drag and drop operation should link the object. |
DRAGDROP_ACTION_UNINITIALIZED |
64 |
The action is not initialized. |
Programmatically changes the drag position of the drag session. This is used on Mac and Windows to update the position of a popup being used as a drag image during the drag operation. It's not used on GTK, which handles the drag popup itself.
[noscript] void dragMoved( in long aX, in long aY );
aX
aY
Tells the Drag Service to end a drag session. This is called when an external drag occurs.
void endDragSession( in PRBool aDoneDrag );
aDoneDrag
aDoneDrag
is true
, the drag has finished, otherwise the drag has just left the window. Obsolete since Gecko 43 (Firefox 43 / Thunderbird 43 / SeaMonkey 2.40)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
Fire a drag event at the source of the drag. This was changed in Gecko 43, see the following section.
void fireDragEventAtSource(
in unsigned long aMsg
); Obsolete since Gecko 43
aMsg
NS_DRAGDROP_*
contants which was defined in widget/BasicEvents.h
Fire a drag event at the fource of the drag. This is available only from native code since Gecko 43.
[noscript] void fireDragEventAtSource( in mozilla::EventMessage aEventMessage );
aEventMessage
eDragDropEventFirst
and eDragDropEventLast
defined in widget/EventMessageList.h
Returns the current nsIDragSession.
nsIDragSession getCurrentSession();
None.
The current drag session, or null if no drag is in progress.
Starts a modal drag session with an array of transferables
void invokeDragSession( in nsIDOMNode aDOMNode, in nsISupportsArray aTransferables, in nsIScriptableRegion aRegion, in unsigned long aActionType );
aDOMNode
aTransferables
aRegion
aActionType
Starts a modal drag session using an image.
A custom image may be specified using the aImage
argument. If this is supplied, the aImageX
and aImageY
arguments specify the offset within the image where the cursor would be positioned. That is, when the image is drawn, it is offset up and left the amount so that the cursor appears at that location within the image. If aImage
is null
, aImageX
and aImageY
are not used and the image is instead determined from the source node aDOMNode
, and the offset calculated so that the initial location for the image appears in the same screen position as where the element is located. The node must be within a document.
Currently, supported images are all DOM nodes. If this is an HTML <image>
or <canvas>
element, the drag image is taken from the image data. If the element is in a document, it will be rendered at its displayed size, otherwise, it will be rendered at its real size. For other types of elements, the element is rendered into an offscreen buffer in the same manner as it is currently displayed. The document selection is hidden while drawing. The aDragEvent
must be supplied as the current screen coordinates of the event are needed to calculate the image location.
void invokeDragSessionWithImage( in nsIDOMNode aDOMNode, in nsISupportsArray aTransferableArray, in nsIScriptableRegion aRegion, in unsigned long aActionType, in nsIDOMNode aImage, in long aImageX, in long aImageY, in nsIDOMDragEvent aDragEvent, in nsIDOMDataTransfer aDataTransfer );
aDOMNode
aTransferables
aRegion
aActionType
aImage
aImageX
aImageY
aDragEvent
aDataTransfer
Start a modal drag session using the selection as the drag image. The aDragEvent
must be supplied as the current screen coordinates of the event are needed to calculate the image location.
void invokeDragSessionWithSelection( in nsISelection aSelection, in nsISupportsArray aTransferableArray, in unsigned long aActionType, in nsIDOMDragEvent aDragEvent, in nsIDOMDataTransfer aDataTransfer );
aSelection
aTransferableArray
aActionType
aDragEvent
aDataTransfer
Tells the Drag Service to start a drag session. This is called when an external drag occurs
void startDragSession();
None.
Increase dragging suppress level by one. This disables dragging if it is not already disabled.
void suppress();
None.
Decrease dragging suppress level by one. If level is zero, dragging is re-enabled.
void unsuppress();
None.