Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.8 KiB

  1. /***************************************************************************\
  2. *
  3. * File: DragDrop.h
  4. *
  5. * Description:
  6. * DragDrop.h defines drag and drop operations
  7. *
  8. *
  9. * History:
  10. * 7/31/2000: JStall: Created
  11. *
  12. * Copyright (C) 2000 by Microsoft Corporation. All rights reserved.
  13. *
  14. \***************************************************************************/
  15. #if !defined(CORE__OldDragDrop_h__INCLUDED)
  16. #define CORE__OldDragDrop_h__INCLUDED
  17. #pragma once
  18. #include "OldExtension.h"
  19. class OldTargetLock;
  20. class OldDropTarget :
  21. public OldExtension,
  22. public IDropTarget
  23. {
  24. protected:
  25. inline OldDropTarget();
  26. ~OldDropTarget();
  27. public:
  28. static HRESULT Build(HGADGET hgadRoot, HWND hwnd, OldDropTarget ** ppdt);
  29. // IDropTarget
  30. public:
  31. STDMETHOD(DragEnter)(IDataObject * pdoSrc, DWORD grfKeyState, POINTL ptDesktopPxl, DWORD * pdwEffect);
  32. STDMETHOD(DragOver)(DWORD grfKeyState, POINTL ptDesktopPxl, DWORD * pdwEffect);
  33. STDMETHOD(DragLeave)();
  34. STDMETHOD(Drop)(IDataObject * pdoSrc, DWORD grfKeyState, POINTL ptDesktopPxl, DWORD * pdwEffect);
  35. // Operations
  36. public:
  37. // Implementation
  38. protected:
  39. inline BOOL HasSource() const;
  40. inline BOOL HasTarget() const;
  41. HRESULT xwDragScan(POINTL ptDesktopPxl, DWORD * pdwEffect, POINT * pptClientPxl);
  42. HRESULT xwUpdateTarget(POINT ptContainerPxl, DWORD * pdwEffect, POINT * pptClientPxl);
  43. HRESULT xwUpdateTarget(HGADGET hgadFound, DWORD * pdwEffect, POINT * pptClientPxl);
  44. HRESULT xwDragEnter(POINT * pptClientPxl, DWORD * pdwEffect);
  45. void xwDragLeave();
  46. virtual void OnDestroyListener();
  47. virtual void OnDestroySubject();
  48. // Data
  49. protected:
  50. static const IID * s_rgpIID[];
  51. IDropTarget *
  52. m_pdtCur; // Current Gadget OldDropTarget
  53. IDataObject *
  54. m_pdoSrc; // Source's data object
  55. HWND m_hwnd; // Containing HWND
  56. DWORD m_grfLastKeyState; // Last key state
  57. POINT m_ptLastContainerPxl; // Last container pixel
  58. HGADGET m_hgadDrop; // Current OldDropTarget
  59. static PRID s_pridListen; // PRID for OldDropTarget
  60. friend class OldTargetLock;
  61. };
  62. class OldTargetLock
  63. {
  64. public:
  65. inline OldTargetLock();
  66. inline ~OldTargetLock();
  67. BOOL Lock(OldDropTarget * p, DWORD * pdwEffect, BOOL fAddRef = TRUE);
  68. protected:
  69. IUnknown * m_punk;
  70. BOOL m_fAddRef;
  71. };
  72. #include "OldDragDrop.inl"
  73. #endif // CORE__OldDragDrop_h__INCLUDED