Adopted by: NSObject (informal protocol)
Declared in:
- AppKit/NSDragging.h
The NSDraggingSource informal protocol declares methods that are implemented by the source object in a dragging session (see the NSDraggingDestination protocol for definitions of dragging terms). The dragging source is specified as an argument to the dragImage:at:offset:event:pasteboard:source:slideBack: message, sent to a window or view object to initiate the 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 methods are invoked automatically during a dragging session-you never send an NSDraggingSource message directly to an object.
- Specifying dragging options
- - draggingSourceOperationMaskForLocal:
- - ignoreModifierKeysWhileDragging
- Responding to dragging sessions
- - draggedImage:beganAt:
- - draggedImage:endedAt:deposited:
- (void)draggedImage:(NSImage
*)anImage
beganAt:(NSPoint)aPoint
See Also: - convertScreenToBase: (NSWindow), - convertBaseToScreen: (NSWindow), - convertPoint:fromView: (NSView), - convertPoint:toView: (NSView)
- (void)draggedImage:(NSImage
*)anImage
endedAt:(NSPoint)aPoint
deposited:(BOOL)flag
This method provides the source object with an opportunity to respond to either a successful or a failed dragging session. For example, if you are moving data from one location to another, you could use this method to make the source data disappear from its previous location, if the dragging session is successful, or reset itself to its previous state, in the event of a failure.
See Also: - convertScreenToBase: (NSWindow), - convertBaseToScreen: (NSWindow), - convertPoint:fromView: (NSView), - convertPoint:toView: (NSView)
- (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)flag
Option | Meaning |
NSDragOperationCopy | The data represented by the image can be copied. |
NSDragOperationLink | The data can be shared. |
NSDragOperationGeneric | The operation can be defined by the destination. |
NSDragOperationPrivate | The operation is negotiated privately between the source and the destination. |
NSDragOperationAll | Combines all the above. |
If the source does not permit any dragging operations, it
should return NSDragOperationNone
.
- (BOOL)ignoreModifierKeysWhileDragging