home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / AppKit.framework / Versions / B / Headers / NSDragging.h < prev    next >
Text File  |  1996-10-17  |  2KB  |  65 lines

  1. /*
  2.     NSDragging.h
  3.     Application Kit
  4.     Copyright (c) 1994-1996, NeXT Software, Inc.
  5.     All rights reserved.
  6. */
  7.  
  8. #import <Foundation/NSGeometry.h>
  9.  
  10. @class NSImage;
  11. @class NSPasteboard;
  12. @class NSWindow;
  13.  
  14. enum {
  15.     NSDragOperationNone            = 0, /* no operation == rejection */
  16.     NSDragOperationCopy            = 1,
  17.     NSDragOperationLink            = 2,
  18.     NSDragOperationGeneric        = 4,
  19.     NSDragOperationPrivate        = 8, /* system leaves the cursor alone until exit */
  20.     NSDragOperationAll            = 15
  21. };
  22.  
  23.  
  24. /* protocol for the sender of messages to a drag destination.  The view or
  25.    window that registered dragging types sends these messages as dragging is
  26.    happening to find out details about that session of dragging.
  27.  */
  28. @protocol NSDraggingInfo
  29. - (NSWindow *)draggingDestinationWindow;
  30. - (unsigned int)draggingSourceOperationMask;
  31. - (NSPoint)draggingLocation;
  32. - (NSPoint)draggedImageLocation;
  33. - (NSImage *)draggedImage;
  34. - (NSPasteboard *)draggingPasteboard;
  35. - (id)draggingSource;
  36. - (int)draggingSequenceNumber;
  37. - (void)slideDraggedImageTo:(NSPoint)screenPoint;
  38. @end
  39.  
  40.  
  41. /* Methods implemented by an object that receives dragged images.  The
  42.    destination view or window is sent these messages during dragging if it
  43.    responds to them.
  44.  */
  45. @interface NSObject(NSDraggingDestination)
  46. - (unsigned int)draggingEntered:(id <NSDraggingInfo>)sender;
  47. - (unsigned int)draggingUpdated:(id <NSDraggingInfo>)sender;
  48. - (void)draggingExited:(id <NSDraggingInfo>)sender;
  49. - (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
  50. - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
  51. - (void)concludeDragOperation:(id <NSDraggingInfo>)sender;
  52. @end
  53.  
  54.  
  55. /* Methods implemented by an object that initiates a drag session.  The
  56.    source app is sent these messages during dragging.  The first must be
  57.    implemented, the others are sent if the source responds to them.
  58.  */
  59. @interface NSObject(NSDraggingSource)
  60. - (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)flag;
  61. - (void)draggedImage:(NSImage *)image beganAt:(NSPoint)screenPoint;
  62. - (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint deposited:(BOOL)flag;
  63. - (BOOL)ignoreModifierKeysWhileDragging;
  64. @end
  65.