home *** CD-ROM | disk | FTP | other *** search
/ Altsys Virtuoso 2.0K / virtuoso_20k.iso / DemoApps / Utilities / Other / JumpBack / Source.compressed / Source.compressed / Source / DragView.h < prev    next >
Encoding:
Text File  |  1993-03-19  |  3.1 KB  |  96 lines

  1.  
  2. //======================================================================
  3. //
  4. //    Portions written by FreemanSoft Inc.
  5. //
  6. //    FreemanSoft disclaims any warranty of any kind, expressed or implied,
  7. //    as to this source code's fitness for any particular use.
  8. //
  9. //    For more information, use the following electronic mail addresses:
  10. //     
  11. //        info@FreemanSoft.com    general questions
  12. //        support@FreemanSoft.com    technical questions
  13. //
  14. //======================================================================
  15.  
  16.  
  17. /* 
  18.  * DragView
  19.  *    Written by
  20.  *    Joe Freeman    jfreeman@next.com    
  21.  *
  22.  *    This code has no warranty.  
  23.  *    It is provided so that the consumer may maintain and modify it
  24.  *    at their own risk.  Use this code at your own risk.
  25.  */
  26.  
  27.  
  28. #import <appkit/View.h>
  29.  
  30. @interface DragView:View
  31. {
  32.     id delegate;
  33.  
  34.     NXImage *proposedImage;    /* holds the proposed icon */
  35.     NXImage *currentImage;    /* holds the current icon */
  36.  
  37.                 /* just for fun, record number of times */
  38.     int    exit_count;        /* the user dragged stuff in and out. */
  39. }
  40.  
  41. - setDelegate:anObject;
  42.  
  43. /*========================================================================
  44.  * notifies workspace to slide browser to that points
  45.  *========================================================================*/
  46. - mouseDown:(NXEvent *)theEvent;
  47.  
  48. /*========================================================================
  49.  *
  50.  *========================================================================*/
  51. - (NXDragOperation) draggingEntered:sender;
  52. - draggingExited:(id <NXDraggingInfo>)sender;
  53. - (BOOL)prepareForDragOperation:(id <NXDraggingInfo>)sender;
  54.  
  55. /*========================================================================
  56.  * so someone can programaticly tell to grab an icon for a specific file
  57.  *========================================================================*/
  58. - useIconForFile:(char *)aFullFilePath;
  59.  
  60. /*========================================================================
  61.  *
  62.  * we suppor the notion of a current image and a proposed
  63.  * that way we can flash a new icon but still get back to the
  64.  * old when if the operation fails (user drags out or wrong type file)
  65.  *
  66.  *========================================================================*/
  67.  
  68.                 /* does not free previous proposed */
  69. - proposedImage:theImage;    /* make passed in icon, the proposed icon */
  70.                 
  71.                 /* frees old current NXImage */
  72. - currentImage:theImage ;    /* make passed in icon, the current icon */
  73. - (NXImage *)currentImage;
  74.  
  75. - abortProposedImage:sender;    /* proposed icon not accepted use current */
  76. - acceptProposedImage:sender;    /* make the proposed icon the currentImage */
  77. - clearCurrentImage:sender;    /* we don't want an icon any more */
  78.  
  79.  
  80. @end
  81.  
  82. @interface DragViewDelegate:Object
  83. {
  84. }
  85.  
  86. - iconEntered:where;        /* so window title is cute */
  87. - iconBogus:where;        /* was determined to be invalid */
  88. - iconLeft:where;        /* so window title is cute */
  89. - iconDropped:where;        /* so window title is cute */
  90. - (BOOL) isFilePBValid:(Pasteboard *)aPB forView:sender;
  91. - (BOOL) acceptedFilePB:(Pasteboard *)pboard forView:sender;
  92.  
  93. - userClicked:(int)numTimes at:(NXPoint *)clickPoint inDragView:sender;
  94.  
  95.  
  96. @end