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.

405 lines
12 KiB

  1. /****
  2. *
  3. *
  4. *
  5. * idrgdrp.h - drag 'n' drop for vcard files and other formats
  6. *
  7. *
  8. * Copyright (C) Microsoft Corp. 1995, 1996, 1997.
  9. ****/
  10. #ifndef _IDRGDRP_H
  11. #define _IDRGDRP_H
  12. struct _IWAB_DRAGDROP;
  13. typedef struct _IWAB_DRAGDROP * LPIWABDRAGDROP;
  14. /* IWAB_DROPTARGET ------------------------------------------------------ */
  15. #define CBIWAB_DROPTARGET sizeof(IWAB_DROPTARGET)
  16. #define IWAB_DROPTARGET_METHODS(IPURE) \
  17. MAPIMETHOD(DragEnter) \
  18. (THIS_ IDataObject * pDataObject, \
  19. DWORD grfKeyState, \
  20. POINTL pt, \
  21. DWORD * pdwEffect) IPURE; \
  22. MAPIMETHOD(DragOver) \
  23. (THIS_ DWORD grfKeyState, \
  24. POINTL pt, \
  25. DWORD * pdwEffect) IPURE; \
  26. MAPIMETHOD(DragLeave) \
  27. (THIS) IPURE; \
  28. MAPIMETHOD(Drop) \
  29. (THIS_ IDataObject * pDataObject, \
  30. DWORD grfKeyState, \
  31. POINTL pt, \
  32. DWORD * pdwEffect) IPURE;
  33. /****/
  34. #undef INTERFACE
  35. #define INTERFACE IWAB_DropTarget
  36. DECLARE_MAPI_INTERFACE_(IWAB_DropTarget, IUnknown)
  37. {
  38. BEGIN_INTERFACE
  39. MAPI_IUNKNOWN_METHODS(PURE)
  40. IWAB_DROPTARGET_METHODS(PURE)
  41. };
  42. #undef INTERFACE
  43. #define INTERFACE struct _IWAB_DROPTARGET
  44. #undef METHOD_PREFIX
  45. #define METHOD_PREFIX IWAB_DROPTARGET_
  46. #undef LPVTBL_ELEM
  47. #define LPVTBL_ELEM lpvtbl
  48. #undef MAPIMETHOD_
  49. #define MAPIMETHOD_(type, method) MAPIMETHOD_DECLARE(type, method, IWAB_DROPTARGET_)
  50. MAPI_IUNKNOWN_METHODS(IMPL)
  51. IWAB_DROPTARGET_METHODS(IMPL)
  52. #undef MAPIMETHOD_
  53. #define MAPIMETHOD_(type, method) MAPIMETHOD_TYPEDEF(type, method, IWAB_DROPTARGET_)
  54. MAPI_IUNKNOWN_METHODS(IMPL)
  55. IWAB_DROPTARGET_METHODS(IMPL)
  56. #undef MAPIMETHOD_
  57. #define MAPIMETHOD_(type, method) STDMETHOD_(type, method)
  58. DECLARE_MAPI_INTERFACE(IWAB_DROPTARGET_)
  59. {
  60. BEGIN_INTERFACE
  61. MAPI_IUNKNOWN_METHODS(IMPL)
  62. IWAB_DROPTARGET_METHODS(IMPL)
  63. };
  64. typedef struct _IWAB_DROPTARGET
  65. {
  66. MAPIX_BASE_MEMBERS(IWAB_DROPTARGET)
  67. LPIWABDRAGDROP lpIWDD;
  68. } IWABDROPTARGET, * LPIWABDROPTARGET;
  69. /* ----------------------------------------------------------------------------------------------*/
  70. /* IWAB_DROPSOURCE ------------------------------------------------------ */
  71. #define CBIWAB_DROPSOURCE sizeof(IWAB_DROPSOURCE)
  72. #define IWAB_DROPSOURCE_METHODS(IPURE) \
  73. MAPIMETHOD(QueryContinueDrag) \
  74. (THIS_ BOOL fEscapePressed, \
  75. DWORD grfKeyState) IPURE; \
  76. MAPIMETHOD(GiveFeedback) \
  77. (THIS_ DWORD dwEffect) IPURE;
  78. /****/
  79. #undef INTERFACE
  80. #define INTERFACE IWAB_DropSource
  81. DECLARE_MAPI_INTERFACE_(IWAB_DropSource, IUnknown)
  82. {
  83. BEGIN_INTERFACE
  84. MAPI_IUNKNOWN_METHODS(PURE)
  85. IWAB_DROPSOURCE_METHODS(PURE)
  86. };
  87. #undef INTERFACE
  88. #define INTERFACE struct _IWAB_DROPSOURCE
  89. #undef METHOD_PREFIX
  90. #define METHOD_PREFIX IWAB_DROPSOURCE_
  91. #undef LPVTBL_ELEM
  92. #define LPVTBL_ELEM lpvtbl
  93. #undef MAPIMETHOD_
  94. #define MAPIMETHOD_(type, method) MAPIMETHOD_DECLARE(type, method, IWAB_DROPSOURCE_)
  95. MAPI_IUNKNOWN_METHODS(IMPL)
  96. IWAB_DROPSOURCE_METHODS(IMPL)
  97. #undef MAPIMETHOD_
  98. #define MAPIMETHOD_(type, method) MAPIMETHOD_TYPEDEF(type, method, IWAB_DROPSOURCE_)
  99. MAPI_IUNKNOWN_METHODS(IMPL)
  100. IWAB_DROPSOURCE_METHODS(IMPL)
  101. #undef MAPIMETHOD_
  102. #define MAPIMETHOD_(type, method) STDMETHOD_(type, method)
  103. DECLARE_MAPI_INTERFACE(IWAB_DROPSOURCE_)
  104. {
  105. BEGIN_INTERFACE
  106. MAPI_IUNKNOWN_METHODS(IMPL)
  107. IWAB_DROPSOURCE_METHODS(IMPL)
  108. };
  109. typedef struct _IWAB_DROPSOURCE
  110. {
  111. MAPIX_BASE_MEMBERS(IWAB_DROPSOURCE)
  112. LPIWABDRAGDROP lpIWDD;
  113. } IWABDROPSOURCE, * LPIWABDROPSOURCE;
  114. /* ----------------------------------------------------------------------------------------------*/
  115. /* IWAB_DRAGDROP ------------------------------------------------------ */
  116. #define CBIWAB_DRAGDROP sizeof(IWAB_DRAGDROP)
  117. #undef INTERFACE
  118. #define INTERFACE IWAB_DragDrop
  119. DECLARE_MAPI_INTERFACE_(IWAB_DragDrop, IUnknown)
  120. {
  121. BEGIN_INTERFACE
  122. MAPI_IUNKNOWN_METHODS(PURE)
  123. };
  124. #undef INTERFACE
  125. #define INTERFACE struct _IWAB_DRAGDROP
  126. #undef METHOD_PREFIX
  127. #define METHOD_PREFIX IWAB_DRAGDROP_
  128. #undef LPVTBL_ELEM
  129. #define LPVTBL_ELEM lpvtbl
  130. #undef MAPIMETHOD_
  131. #define MAPIMETHOD_(type, method) MAPIMETHOD_DECLARE(type, method, IWAB_DRAGDROP_)
  132. MAPI_IUNKNOWN_METHODS(IMPL)
  133. #undef MAPIMETHOD_
  134. #define MAPIMETHOD_(type, method) MAPIMETHOD_TYPEDEF(type, method, IWAB_DRAGDROP_)
  135. MAPI_IUNKNOWN_METHODS(IMPL)
  136. #undef MAPIMETHOD_
  137. #define MAPIMETHOD_(type, method) STDMETHOD_(type, method)
  138. DECLARE_MAPI_INTERFACE(IWAB_DRAGDROP_)
  139. {
  140. BEGIN_INTERFACE
  141. MAPI_IUNKNOWN_METHODS(IMPL)
  142. };
  143. typedef struct _IWAB_DRAGDROP
  144. {
  145. MAPIX_BASE_MEMBERS(IWAB_DRAGDROP)
  146. LPIWABDRAGDROP lpIWDD;
  147. LPIWABDROPTARGET lpIWABDropTarget;
  148. LPIWABDROPSOURCE lpIWABDropSource;
  149. LPDATAOBJECT m_pIDataObject;
  150. DWORD m_dwEffect;
  151. CLIPFORMAT m_cfAccept;
  152. BOOL m_bIsCopyOperation; // if CTRL key is pressed
  153. DWORD m_grfInitialKeyState;
  154. BOOL m_bSource;
  155. BOOL m_bOverTV;
  156. LPVOID m_lpv; // data of parent window
  157. } IWABDRAGDROP, * LPIWABDRAGDROP;
  158. /* ----------------------------------------------------------------------------------------------*/
  159. // Create the IDragDrop Data Object
  160. HRESULT HrCreateIWABDragDrop(LPIWABDRAGDROP * lppIWABDragDrop);
  161. /* ----------------------------------------------------------------------------------------------*/
  162. /* IWAB_DATAOBJECT ------------------------------------------------------ */
  163. #define CBIWAB_DATAOBJECT sizeof(IWAB_DATAOBJECT)
  164. #define IWAB_DATAOBJECT_METHODS(IPURE) \
  165. MAPIMETHOD(GetData) \
  166. (THIS_ FORMATETC * pFormatetc, \
  167. STGMEDIUM * pmedium) IPURE; \
  168. MAPIMETHOD(GetDataHere) \
  169. (THIS_ FORMATETC * pFormatetc, \
  170. STGMEDIUM * pmedium) IPURE; \
  171. MAPIMETHOD(QueryGetData) \
  172. (THIS_ FORMATETC * pFormatetc) IPURE; \
  173. MAPIMETHOD(GetCanonicalFormatEtc) \
  174. (THIS_ FORMATETC * pFormatetcIn, \
  175. FORMATETC * pFormatetcOut) IPURE; \
  176. MAPIMETHOD(SetData) \
  177. (THIS_ FORMATETC * pFormatetc, \
  178. STGMEDIUM * pmedium, \
  179. BOOL fRelease) IPURE; \
  180. MAPIMETHOD(EnumFormatEtc) \
  181. (THIS_ DWORD dwDirection, \
  182. IEnumFORMATETC ** ppenumFormatetc) IPURE; \
  183. MAPIMETHOD(DAdvise) \
  184. (THIS_ FORMATETC * pFormatetc, \
  185. DWORD advf, \
  186. IAdviseSink * pAdvSink, \
  187. DWORD * pdwConnection) IPURE; \
  188. MAPIMETHOD(DUnadvise) \
  189. (THIS_ DWORD dwConnection) IPURE; \
  190. MAPIMETHOD(EnumDAdvise) \
  191. (THIS_ IEnumSTATDATA ** ppenumAdvise) IPURE; \
  192. /****/
  193. #undef INTERFACE
  194. #define INTERFACE IWAB_DataObject
  195. DECLARE_MAPI_INTERFACE_(IWAB_DataObject, IUnknown)
  196. {
  197. BEGIN_INTERFACE
  198. MAPI_IUNKNOWN_METHODS(PURE)
  199. IWAB_DATAOBJECT_METHODS(PURE)
  200. };
  201. #undef INTERFACE
  202. #define INTERFACE struct _IWAB_DATAOBJECT
  203. #undef METHOD_PREFIX
  204. #define METHOD_PREFIX IWAB_DATAOBJECT_
  205. #undef LPVTBL_ELEM
  206. #define LPVTBL_ELEM lpvtbl
  207. #undef MAPIMETHOD_
  208. #define MAPIMETHOD_(type, method) MAPIMETHOD_DECLARE(type, method, IWAB_DATAOBJECT_)
  209. MAPI_IUNKNOWN_METHODS(IMPL)
  210. IWAB_DATAOBJECT_METHODS(IMPL)
  211. #undef MAPIMETHOD_
  212. #define MAPIMETHOD_(type, method) MAPIMETHOD_TYPEDEF(type, method, IWAB_DATAOBJECT_)
  213. MAPI_IUNKNOWN_METHODS(IMPL)
  214. IWAB_DATAOBJECT_METHODS(IMPL)
  215. #undef MAPIMETHOD_
  216. #define MAPIMETHOD_(type, method) STDMETHOD_(type, method)
  217. DECLARE_MAPI_INTERFACE(IWAB_DATAOBJECT_)
  218. {
  219. BEGIN_INTERFACE
  220. MAPI_IUNKNOWN_METHODS(IMPL)
  221. IWAB_DATAOBJECT_METHODS(IMPL)
  222. };
  223. typedef struct _IWAB_DATAOBJECT
  224. {
  225. MAPIX_BASE_MEMBERS(IWAB_DATAOBJECT)
  226. LPADRBOOK m_lpAdrBook;
  227. HWND m_hWndLV;
  228. BOOL m_bObjectIsGroup; // TRUE when dragging a single object which is a group
  229. ULONG cbDatahDrop;
  230. const void *pDatahDrop;
  231. ULONG cbDataTextA;
  232. const void *pDataTextA;
  233. ULONG cbDataTextW;
  234. const void *pDataTextW;
  235. ULONG cbDataBuffer;
  236. const void *pDataBuffer;
  237. ULONG cbDataEID;
  238. const void *pDataEID;
  239. LPVOID m_lpv;
  240. } IWABDATAOBJECT, * LPIWABDATAOBJECT;
  241. /* ----------------------------------------------------------------------------------------------*/
  242. // Creates the IDataObject that holds info about the dragged and dropped object
  243. HRESULT HrCreateIWABDataObject(LPVOID lpv, LPADRBOOK lpAdrBook, HWND hWndLV, LPIWABDATAOBJECT * lppIWABDataObject, BOOL bGetDataNow, BOOL bIsGroup);
  244. /* ----------------------------------------------------------------------------------------------*/
  245. /* IWAB_ENUMFORMATETC ------------------------------------------------------ */
  246. #define CBIWAB_ENUMFORMATETC sizeof(IWAB_ENUMFORMATETC)
  247. #define IWAB_ENUMFORMATETC_METHODS(IPURE) \
  248. MAPIMETHOD(Next) \
  249. (THIS_ ULONG celt, \
  250. FORMATETC *rgelt, \
  251. ULONG *pceltFethed) IPURE; \
  252. MAPIMETHOD(Skip) \
  253. (THIS_ ULONG celt) IPURE; \
  254. MAPIMETHOD(Reset) \
  255. (THIS) IPURE; \
  256. MAPIMETHOD(Clone) \
  257. (THIS_ IEnumFORMATETC ** ppenum) IPURE; \
  258. /****/
  259. #undef INTERFACE
  260. #define INTERFACE IWAB_EnumFORMATETC
  261. DECLARE_MAPI_INTERFACE_(IWAB_EnumFORMATETC, IUnknown)
  262. {
  263. BEGIN_INTERFACE
  264. MAPI_IUNKNOWN_METHODS(PURE)
  265. IWAB_ENUMFORMATETC_METHODS(PURE)
  266. };
  267. #undef INTERFACE
  268. #define INTERFACE struct _IWAB_ENUMFORMATETC
  269. #undef METHOD_PREFIX
  270. #define METHOD_PREFIX IWAB_ENUMFORMATETC_
  271. #undef LPVTBL_ELEM
  272. #define LPVTBL_ELEM lpvtbl
  273. #undef MAPIMETHOD_
  274. #define MAPIMETHOD_(type, method) MAPIMETHOD_DECLARE(type, method, IWAB_ENUMFORMATETC_)
  275. MAPI_IUNKNOWN_METHODS(IMPL)
  276. IWAB_ENUMFORMATETC_METHODS(IMPL)
  277. #undef MAPIMETHOD_
  278. #define MAPIMETHOD_(type, method) MAPIMETHOD_TYPEDEF(type, method, IWAB_ENUMFORMATETC_)
  279. MAPI_IUNKNOWN_METHODS(IMPL)
  280. IWAB_ENUMFORMATETC_METHODS(IMPL)
  281. #undef MAPIMETHOD_
  282. #define MAPIMETHOD_(type, method) STDMETHOD_(type, method)
  283. DECLARE_MAPI_INTERFACE(IWAB_ENUMFORMATETC_)
  284. {
  285. BEGIN_INTERFACE
  286. MAPI_IUNKNOWN_METHODS(IMPL)
  287. IWAB_ENUMFORMATETC_METHODS(IMPL)
  288. };
  289. typedef struct _IWAB_ENUMFORMATETC
  290. {
  291. MAPIX_BASE_MEMBERS(IWAB_ENUMFORMATETC)
  292. UINT ifmt;
  293. UINT cfmt;
  294. FORMATETC afmt[1];
  295. } IWABENUMFORMATETC, * LPIWABENUMFORMATETC;
  296. /* ----------------------------------------------------------------------------------------------*/
  297. HRESULT HrCreateIWABEnumFORMATETC(UINT cfmt,
  298. const FORMATETC afmt[],
  299. LPIWABENUMFORMATETC *ppenumFormatEtc);
  300. #endif