From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- files/es/nsidragservice/index.html | 317 +++++++++++++++++++++++++++++++++++++ 1 file changed, 317 insertions(+) create mode 100644 files/es/nsidragservice/index.html (limited to 'files/es/nsidragservice') diff --git a/files/es/nsidragservice/index.html b/files/es/nsidragservice/index.html new file mode 100644 index 0000000000..89c629f87e --- /dev/null +++ b/files/es/nsidragservice/index.html @@ -0,0 +1,317 @@ +--- +title: nsIDragService +slug: nsIDragService +tags: + - páginas_a_traducir +translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDragService +--- +

+
widget/nsIDragService.idlScriptable
+ + +Implements the Drag Service for handling drag and drop operations. + + +
+Inherits from: nsISupports +Last changed in Gecko 43 (Firefox 43 / Thunderbird 43 / SeaMonkey 2.40)
+

+ +
Note: Using this interface directly from add-on code is deprecated. Add-ons should use the standard 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.
+ +

Method overview

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void endDragSession( in PRBool aDoneDrag ) ;
void dragMoved(in long aX, in long aY); Native code only!
void fireDragEventAtSource(in unsigned long aMsg); Obsoleto 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();
+ +

Constants

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ConstantValueDescription
DRAGDROP_ACTION_NONE0No action.
DRAGDROP_ACTION_COPY1The drag and drop operation should copy the object.
DRAGDROP_ACTION_MOVE2The drag and drop operation should move the object.
DRAGDROP_ACTION_LINK4The drag and drop operation should link the object.
DRAGDROP_ACTION_UNINITIALIZED64The action is not initialized.
+ +

Methods

+ +

Native code only!

dragMoved

+ +

+ +

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
+);
+
+ +
Parameters
+ +
+
aX
+
The X coordinate to which to move the popup being dragged.
+
aY
+
The Y coordinate to which to move the popup being dragged.
+
+ +

endDragSession()

+ +

Tells the Drag Service to end a drag session. This is called when an external drag occurs.

+ +
void endDragSession(
+  in PRBool aDoneDrag
+);
+
+ +
Parameters
+ +
+
aDoneDrag
+
If aDoneDrag is true, the drag has finished, otherwise the drag has just left the window.
+
+ +

fireDragEventAtSource()

+ +

Obsoleto Gecko 43 (Firefox 43 / Thunderbird 43 / SeaMonkey 2.40)
Esta funcionalidad es obsoleta. Aunque puede aún funcionar en algunos navegadores, se desalienta su uso ya que puede ser removida en cualquier momento. Evite usarla.

+ +

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
+); Obsoleto Gecko 43
+
+ +
Parameters
+ +
+
aMsg
+
One of the 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
+);
+
+ +
Parameters
+ +
+
aEventMessage
+
One of the event messages between eDragDropEventFirst and eDragDropEventLast defined in widget/EventMessageList.h
+
+ +

getCurrentSession()

+ +

Returns the current nsIDragSession.

+ +
nsIDragSession getCurrentSession();
+
+ +
Parameters
+ +

None.

+ +
Return value
+ +

The current drag session, or null if no drag is in progress.

+ +

invokeDragSession()

+ +

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
+);
+
+ +
Parameters
+ +
+
aDOMNode
+
The source node on which the drag gesture was started.
+
aTransferables
+
An array of transferables to be dragged.
+
aRegion
+
A region containing rectangles for cursor feedback, in window coordinates.
+
aActionType
+
Specified which of copy/move/link are allowed.
+
+ +

invokeDragSessionWithImage()

+ +

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
+);
+
+ +
Parameters
+ +
+
aDOMNode
+
The source node on which the drag gesture was started.
+
aTransferables
+
An array of transferables to be dragged.
+
aRegion
+
A region containing rectangles for cursor feedback, in window coordinates.
+
aActionType
+
Specified which of copy/move/link are allowed.
+
aImage
+
Image object.
+
aImageX
+
X position of image.
+
aImageY
+
Y position of image.
+
aDragEvent
+
The drag gesture event that initiated the drag.
+
aDataTransfer
+
A data transfer object that is available on the current drag session.
+
+ +

invokeDragSessionWithSelection()

+ +

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
+);
+
+ +
Parameters
+ +
+
aSelection
+
The selection that is to be dragged.
+
aTransferableArray
+
An array of transferables to be dragged.
+
aActionType
+
Specified which of copy/move/link are allowed
+
aDragEvent
+
The drag gesture event that initiated the drag.
+
aDataTransfer
+
A data transfer object that is available on the current drag session.
+
+ +

startDragSession()

+ +

Tells the Drag Service to start a drag session. This is called when an external drag occurs

+ +
void startDragSession();
+
+ +
Parameters
+ +

None.

+ +

suppress()

+ +

Increase dragging suppress level by one. This disables dragging if it is not already disabled.

+ +
void suppress();
+
+ +
Parameters
+ +

None.

+ +

unsuppress()

+ +

Decrease dragging suppress level by one. If level is zero, dragging is re-enabled.

+ +
void unsuppress();
+
+ +
Parameters
+ +

None.

+ +

-- cgit v1.2.3-54-g00ecf