home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xdragevn.h < prev    next >
Text File  |  1998-04-05  |  2KB  |  63 lines

  1. #ifndef __OOL_XDRAGEVENT_H__
  2. #define __OOL_XDRAGEVENT_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XDragEvent                            */
  8. /*                       derived from: XEvent                                */
  9. /*                        last update: 7/96                                  */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13. #include "xevent.h"
  14.  
  15. #ifdef OOL_FOR_OS2_X86
  16.    //events
  17.    #define DRG_DROPPED   1
  18.    #define DRG_DRAGOVER  2
  19.  
  20.    //target accept-mode
  21.    #define DRG_DROP      DOR_DROP
  22.    #define DRG_NODROP    DOR_NODROP
  23.    #define DRG_NODROPOP  DOR_NODROPOP
  24.    #define DRG_NEVERDROP DOR_NEVERDROP
  25.  
  26.    //target operation
  27.    #define DRG_COPY            DO_COPY
  28.    #define DRG_MOVE            DO_MOVE
  29.    #define DRG_LINK            DO_LINK
  30.    #define DRG_ENDCONVERSATION DM_ENDCONVERSATION
  31.    #define DRG_DISCARDOBJECT   DM_DISCARDOBJECT
  32.    #define DRG_PRINTOBJECT     DM_PRINTOBJECT
  33. #endif
  34.  
  35.  
  36. class XPoint;
  37. class XDragItem;
  38.  
  39.  
  40. class _export_ XDragEvent: public XEvent
  41. {
  42.       friend MRESULT HandleDefault( XWindow * w, ULONG msg, MPARAM mp1, MPARAM mp2, BOOL& handled);
  43.    private:
  44.       SHORT accept;
  45.       SHORT operation;
  46.       DRAGINFO * dragInfo;
  47.       ~XDragEvent();
  48.       PPRINTDEST printer;
  49.    public:
  50.       XDragEvent( const LONG, const void*);
  51.       BOOL GetDragItem( XDragItem * itm, const SHORT index);
  52.       SHORT GetDragItemCount( void ) const { return dragInfo ? dragInfo->cditem : -1; }
  53.       BOOL GetDropPos( XPoint * p) const;
  54.       PRINTDEST * GetPrinterInfo(void) const { return printer; }
  55.       OOL_WINDOWHANDLE GetSourceWindow( void ) const { return dragInfo ? dragInfo->hwndSource : 0; }
  56.       SHORT GetDragOperation(void) const { return dragInfo->usOperation; }
  57.       void SetAcceptMode( const SHORT mode) { accept = mode; }
  58.       void SetOperation( const SHORT op) { operation = op; }
  59. };
  60.  
  61.  
  62. #endif
  63.