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.

101 lines
3.1 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__DragDrop_h__INCLUDED)
  16. #define CORE__DragDrop_h__INCLUDED
  17. #pragma once
  18. #if ENABLE_MSGTABLE_API
  19. #include "Extension.h"
  20. class TargetLock;
  21. #if 1
  22. class DuDropTarget :
  23. public DropTargetImpl<DuDropTarget, DuExtension>,
  24. public IDropTarget
  25. {
  26. protected:
  27. inline DuDropTarget();
  28. ~DuDropTarget();
  29. public:
  30. static HRESULT InitClass();
  31. // IDropTarget
  32. public:
  33. STDMETHOD(DragEnter)(IDataObject * pdoSrc, DWORD grfKeyState, POINTL ptDesktopPxl, DWORD * pdwEffect);
  34. STDMETHOD(DragOver)(DWORD grfKeyState, POINTL ptDesktopPxl, DWORD * pdwEffect);
  35. STDMETHOD(DragLeave)();
  36. STDMETHOD(Drop)(IDataObject * pdoSrc, DWORD grfKeyState, POINTL ptDesktopPxl, DWORD * pdwEffect);
  37. // Public API
  38. public:
  39. dapi HRESULT ApiOnDestroySubject(DropTarget::OnDestroySubjectMsg * pmsg);
  40. static HRESULT CALLBACK
  41. PromoteDropTarget(DUser::ConstructProc pfnCS, HCLASS hclCur, DUser::Gadget * pgad, DUser::Gadget::ConstructInfo * pmicData);
  42. static HCLASS CALLBACK
  43. DemoteDropTarget(HCLASS hclCur, DUser::Gadget * pgad, void * pvData);
  44. // Implementation
  45. protected:
  46. inline BOOL HasSource() const;
  47. inline BOOL HasTarget() const;
  48. HRESULT xwDragScan(POINTL ptDesktopPxl, DWORD * pdwEffect, POINT * pptClientPxl);
  49. HRESULT xwUpdateTarget(POINT ptContainerPxl, DWORD * pdwEffect, POINT * pptClientPxl);
  50. HRESULT xwUpdateTarget(Visual * pgvFound, DWORD * pdwEffect, POINT * pptClientPxl);
  51. HRESULT xwDragEnter(POINT * pptClientPxl, DWORD * pdwEffect);
  52. void xwDragLeave();
  53. // Data
  54. protected:
  55. static const IID * s_rgpIID[];
  56. IDropTarget *
  57. m_pdtCur; // Current Gadget DuDropTarget
  58. IDataObject *
  59. m_pdoSrc; // Source's data object
  60. HWND m_hwnd; // Containing HWND
  61. DWORD m_grfLastKeyState; // Last key state
  62. POINT m_ptLastContainerPxl; // Last container pixel
  63. Visual * m_pgvDrop; // Current DuDropTarget
  64. static PRID s_pridListen; // PRID for DuDropTarget
  65. friend class TargetLock;
  66. };
  67. class TargetLock
  68. {
  69. public:
  70. inline TargetLock();
  71. inline ~TargetLock();
  72. BOOL Lock(DuDropTarget * p, DWORD * pdwEffect, BOOL fAddRef = TRUE);
  73. protected:
  74. IUnknown * m_punk;
  75. BOOL m_fAddRef;
  76. };
  77. #endif // ENABLE_MSGTABLE_API
  78. #endif
  79. #include "DragDrop.inl"
  80. #endif // CORE__DragDrop_h__INCLUDED