Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.

NXDraggingSource
(informal protocol)


Category Of: Object
Declared In: appkit/drag.h



Category Description

The NXDraggingSource category declares methods that can (or must) be implemented by the source object in a dragging session (see the NXDraggingDestination protocol for definitions of dragging terms).  This dragging source is specified as an argument to the dragImage:... message, sent to a Window or View, that instigated the dragging session.

Warning: See the documentation of the dragImage:... method in either Window or View for a warning regarding the mouse-down event that initiates a dragging session.
Of the methods declared below, only draggingSourceOperationMaskForLocal: must be implemented.  The other methods are invoked only if the dragging source implements them.  All four methods are invoked automatically during a dragging session--you never send an NXDraggingSource message directly to an object.



Method Types

Querying the source draggingSourceOperationMaskForLocal:
Informing the source draggedImage:beganAt:
draggedImage:endedAt:deposited:



Instance Methods

draggedImage:beganAt:
draggedImage:(NXImage *)image beganAt:(NXPoint *)screenPoint

Invoked when the dragged image, given by image, is displayed but before it starts following the cursor.  The origin of the image is given by screenPoint, reckoned in screen coordinates.  This method isn't invoked if the dragging source doesn't provide an implementation for it.  The return value is ignored.



draggedImage:endedAt:deposited:
draggedImage:(NXImage *)image
endedAt:(NXPoint *)screenPoint
deposited:(BOOL)didDeposit

Invoked after the dragged image has been released and the dragging destination has been given a chance to operate on the data it represents.  The image is given by image, the location of the image's origin when it was released reckoned in screen coordinates, is given by screenPoint.  This method isn't invoked if the dragging source doesn't provide an implementation for it. The final argument, didDeposit, indicates whether the destination accepted the image.  The return value is ignored.



draggingSourceOperationMaskForLocal:
(NXDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal

This is the only NXDraggingSource method that must be implemented by the source object.  It should return an NXDragOperation mask, built by OR'ing the applicable constants listed below, that represents the operations that can be performed on the dragged image's data.  The isLocal flag indicates whether the candidate destination object (the Window or View over which the dragged image is currently poised) is in the same application as the source.

NXDragOperation Meaning
NX_DragOperationNone No operation is possible.
NX_DragOperationCopy The data represented by the image can be copied.
NX_DragOperationLink The data can be shared.
NX_DragOperationGeneric The operation can be defined by the destination.
NX_DragOperationPrivate Private source/destination negotiation.
NX_DragOperationAll Combines all the above.



ignoreModifierKeysWhileDragging
(BOOL)ignoreModifierKeysWhileDragging

Returns whether the standard meanings of the modifier keys should be ignored during a dragging session.