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.

367 lines
12 KiB

  1. /*****************************************************************************\
  2. * *
  3. * dvobj.h - Data/view value types, interface and APIs *
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * Copyright (c) 1993-1994, Microsoft Corp. All rights reserved. *
  8. * *
  9. \*****************************************************************************/
  10. #if !defined( _DVOBJ_H_ )
  11. #define _DVOBJ_H_
  12. /****** DV value types ******************************************************/
  13. // forward type declarations
  14. #if defined(__cplusplus)
  15. interface IStorage;
  16. interface IStream;
  17. interface IAdviseSink;
  18. interface IMoniker;
  19. #else
  20. typedef interface IStorage IStorage;
  21. typedef interface IStream IStream;
  22. typedef interface IAdviseSink IAdviseSink;
  23. typedef interface IMoniker IMoniker;
  24. #endif
  25. typedef IStorage FAR* LPSTORAGE;
  26. typedef IStream FAR* LPSTREAM;
  27. typedef IAdviseSink FAR* LPADVISESINK;
  28. typedef IMoniker FAR* LPMONIKER;
  29. #if !defined(_MAC)
  30. typedef WORD CLIPFORMAT;
  31. #else
  32. typedef unsigned long CLIPFORMAT; // ResType
  33. #endif
  34. typedef CLIPFORMAT FAR* LPCLIPFORMAT;
  35. // Data/View aspect; specifies the desired aspect of the object when
  36. // drawing or getting data.
  37. typedef enum tagDVASPECT
  38. {
  39. DVASPECT_CONTENT = 1,
  40. DVASPECT_THUMBNAIL = 2,
  41. DVASPECT_ICON = 4,
  42. DVASPECT_DOCPRINT = 8
  43. } DVASPECT;
  44. // Data/View target device; determines the device for drawing or gettting data
  45. typedef struct FARSTRUCT tagDVTARGETDEVICE
  46. {
  47. DWORD tdSize;
  48. WORD tdDriverNameOffset;
  49. WORD tdDeviceNameOffset;
  50. WORD tdPortNameOffset;
  51. WORD tdExtDevmodeOffset;
  52. BYTE tdData[1];
  53. } DVTARGETDEVICE;
  54. // Format, etc.; completely specifices the kind of data desired, including tymed
  55. typedef struct FARSTRUCT tagFORMATETC
  56. {
  57. CLIPFORMAT cfFormat;
  58. DVTARGETDEVICE FAR* ptd;
  59. DWORD dwAspect;
  60. LONG lindex;
  61. DWORD tymed;
  62. } FORMATETC, FAR* LPFORMATETC;
  63. // TYpes of storage MEDiums; determines how data is stored or passed around
  64. typedef enum tagTYMED
  65. {
  66. TYMED_HGLOBAL = 1,
  67. TYMED_FILE = 2,
  68. TYMED_ISTREAM = 4,
  69. TYMED_ISTORAGE = 8,
  70. TYMED_GDI = 16,
  71. TYMED_MFPICT = 32,
  72. TYMED_NULL = 0
  73. } TYMED;
  74. // DATA format DIRection
  75. typedef enum tagDATADIR
  76. {
  77. DATADIR_GET = 1,
  78. DATADIR_SET = 2,
  79. } DATADIR;
  80. // SToraGe MEDIUM; a block of data on a particular medium
  81. typedef struct FARSTRUCT tagSTGMEDIUM
  82. {
  83. DWORD tymed;
  84. union
  85. {
  86. HANDLE hGlobal;
  87. LPSTR lpszFileName;
  88. IStream FAR* pstm;
  89. IStorage FAR* pstg;
  90. }
  91. #ifdef NONAMELESSUNION
  92. u // add a tag when name less unions not supported
  93. #endif
  94. ;
  95. IUnknown FAR* pUnkForRelease;
  96. } STGMEDIUM, FAR* LPSTGMEDIUM;
  97. // Advise Flags
  98. typedef enum tagADVF
  99. {
  100. ADVF_NODATA = 1,
  101. ADVF_PRIMEFIRST = 2,
  102. ADVF_ONLYONCE = 4,
  103. ADVF_DATAONSTOP = 64,
  104. ADVFCACHE_NOHANDLER = 8,
  105. ADVFCACHE_FORCEBUILTIN = 16,
  106. ADVFCACHE_ONSAVE = 32
  107. } ADVF;
  108. // Stats for data; used by several enumerations and by at least one
  109. // implementation of IDataAdviseHolder; if a field is not used, it
  110. // will be NULL.
  111. typedef struct FARSTRUCT tagSTATDATA
  112. { // field used by:
  113. FORMATETC formatetc; // EnumAdvise, EnumData (cache), EnumFormats
  114. DWORD advf; // EnumAdvise, EnumData (cache)
  115. IAdviseSink FAR* pAdvSink; // EnumAdvise
  116. DWORD dwConnection; // EnumAdvise
  117. } STATDATA;
  118. typedef STATDATA FAR* LPSTATDATA;
  119. /****** DV Interfaces ***************************************************/
  120. #undef INTERFACE
  121. #define INTERFACE IEnumFORMATETC
  122. DECLARE_INTERFACE_(IEnumFORMATETC, IUnknown)
  123. {
  124. // *** IUnknown methods ***
  125. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppv) PURE;
  126. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  127. STDMETHOD_(ULONG,Release) (THIS) PURE;
  128. // *** IEnumFORMATETC methods ***
  129. STDMETHOD(Next) (THIS_ ULONG celt, FORMATETC FAR * rgelt, ULONG FAR* pceltFetched) PURE;
  130. STDMETHOD(Skip) (THIS_ ULONG celt) PURE;
  131. STDMETHOD(Reset) (THIS) PURE;
  132. STDMETHOD(Clone) (THIS_ IEnumFORMATETC FAR* FAR* ppenum) PURE;
  133. };
  134. typedef IEnumFORMATETC FAR* LPENUMFORMATETC;
  135. #undef INTERFACE
  136. #define INTERFACE IEnumSTATDATA
  137. DECLARE_INTERFACE_(IEnumSTATDATA, IUnknown)
  138. {
  139. // *** IUnknown methods ***
  140. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppv) PURE;
  141. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  142. STDMETHOD_(ULONG, Release) (THIS) PURE;
  143. // *** IEnumSTATDATA methods ***
  144. STDMETHOD(Next) (THIS_ ULONG celt, STATDATA FAR * rgelt, ULONG FAR* pceltFetched) PURE;
  145. STDMETHOD(Skip) (THIS_ ULONG celt) PURE;
  146. STDMETHOD(Reset) (THIS) PURE;
  147. STDMETHOD(Clone) (THIS_ IEnumSTATDATA FAR* FAR* ppenum) PURE;
  148. };
  149. typedef IEnumSTATDATA FAR* LPENUMSTATDATA;
  150. #undef INTERFACE
  151. #define INTERFACE IDataObject
  152. #define DATA_E_FORMATETC DV_E_FORMATETC
  153. #define DATA_S_SAMEFORMATETC (DATA_S_FIRST + 0)
  154. DECLARE_INTERFACE_(IDataObject, IUnknown)
  155. {
  156. // *** IUnknown methods ***
  157. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  158. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  159. STDMETHOD_(ULONG, Release) (THIS) PURE;
  160. // *** IDataObject methods ***
  161. STDMETHOD(GetData) (THIS_ LPFORMATETC pformatetcIn,
  162. LPSTGMEDIUM pmedium ) PURE;
  163. STDMETHOD(GetDataHere) (THIS_ LPFORMATETC pformatetc,
  164. LPSTGMEDIUM pmedium ) PURE;
  165. STDMETHOD(QueryGetData) (THIS_ LPFORMATETC pformatetc ) PURE;
  166. STDMETHOD(GetCanonicalFormatEtc) (THIS_ LPFORMATETC pformatetc,
  167. LPFORMATETC pformatetcOut) PURE;
  168. STDMETHOD(SetData) (THIS_ LPFORMATETC pformatetc, STGMEDIUM FAR * pmedium,
  169. BOOL fRelease) PURE;
  170. STDMETHOD(EnumFormatEtc) (THIS_ DWORD dwDirection,
  171. LPENUMFORMATETC FAR* ppenumFormatEtc) PURE;
  172. STDMETHOD(DAdvise) (THIS_ FORMATETC FAR* pFormatetc, DWORD advf,
  173. LPADVISESINK pAdvSink, DWORD FAR* pdwConnection) PURE;
  174. STDMETHOD(DUnadvise) (THIS_ DWORD dwConnection) PURE;
  175. STDMETHOD(EnumDAdvise) (THIS_ LPENUMSTATDATA FAR* ppenumAdvise) PURE;
  176. };
  177. typedef IDataObject FAR* LPDATAOBJECT;
  178. #undef INTERFACE
  179. #define INTERFACE IViewObject
  180. #define VIEW_E_DRAW (VIEW_E_FIRST)
  181. #define E_DRAW VIEW_E_DRAW
  182. #define VIEW_S_ALREADY_FROZEN (VIEW_S_FIRST)
  183. DECLARE_INTERFACE_(IViewObject, IUnknown)
  184. {
  185. // *** IUnknown methods ***
  186. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  187. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  188. STDMETHOD_(ULONG,Release) (THIS) PURE;
  189. // *** IViewObject methods ***
  190. STDMETHOD(Draw) (THIS_ DWORD dwDrawAspect, LONG lindex,
  191. void FAR* pvAspect, DVTARGETDEVICE FAR * ptd,
  192. HDC hicTargetDev,
  193. HDC hdcDraw,
  194. const LPRECTL lprcBounds,
  195. const LPRECTL lprcWBounds,
  196. BOOL (CALLBACK * pfnContinue) (DWORD),
  197. DWORD dwContinue) PURE;
  198. STDMETHOD(GetColorSet) (THIS_ DWORD dwDrawAspect, LONG lindex,
  199. void FAR* pvAspect, DVTARGETDEVICE FAR * ptd,
  200. HDC hicTargetDev,
  201. LPLOGPALETTE FAR* ppColorSet) PURE;
  202. STDMETHOD(Freeze)(THIS_ DWORD dwDrawAspect, LONG lindex,
  203. void FAR* pvAspect,
  204. DWORD FAR* pdwFreeze) PURE;
  205. STDMETHOD(Unfreeze) (THIS_ DWORD dwFreeze) PURE;
  206. STDMETHOD(SetAdvise) (THIS_ DWORD aspects, DWORD advf,
  207. LPADVISESINK pAdvSink) PURE;
  208. STDMETHOD(GetAdvise) (THIS_ DWORD FAR* pAspects, DWORD FAR* pAdvf,
  209. LPADVISESINK FAR* ppAdvSink) PURE;
  210. };
  211. typedef IViewObject FAR* LPVIEWOBJECT;
  212. #undef INTERFACE
  213. #define INTERFACE IAdviseSink
  214. DECLARE_INTERFACE_(IAdviseSink, IUnknown)
  215. {
  216. // *** IUnknown methods ***
  217. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppv) PURE;
  218. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  219. STDMETHOD_(ULONG,Release) (THIS) PURE;
  220. // *** IAdviseSink methods ***
  221. STDMETHOD_(void,OnDataChange)(THIS_ FORMATETC FAR* pFormatetc,
  222. STGMEDIUM FAR* pStgmed) PURE;
  223. STDMETHOD_(void,OnViewChange)(THIS_ DWORD dwAspect, LONG lindex) PURE;
  224. STDMETHOD_(void,OnRename)(THIS_ LPMONIKER pmk) PURE;
  225. STDMETHOD_(void,OnSave)(THIS) PURE;
  226. STDMETHOD_(void,OnClose)(THIS) PURE;
  227. };
  228. typedef IAdviseSink FAR* LPADVISESINK;
  229. #undef INTERFACE
  230. #define INTERFACE IAdviseSink2
  231. DECLARE_INTERFACE_(IAdviseSink2, IAdviseSink)
  232. {
  233. // *** IUnknown methods ***
  234. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppv) PURE;
  235. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  236. STDMETHOD_(ULONG,Release) (THIS) PURE;
  237. // *** IAdviseSink methods ***
  238. STDMETHOD_(void,OnDataChange)(THIS_ FORMATETC FAR* pFormatetc,
  239. STGMEDIUM FAR* pStgmed) PURE;
  240. STDMETHOD_(void,OnViewChange)(THIS_ DWORD dwAspect, LONG lindex) PURE;
  241. STDMETHOD_(void,OnRename)(THIS_ LPMONIKER pmk) PURE;
  242. STDMETHOD_(void,OnSave)(THIS) PURE;
  243. STDMETHOD_(void,OnClose)(THIS) PURE;
  244. // *** IAdviseSink2 methods ***
  245. STDMETHOD_(void,OnLinkSrcChange)(THIS_ LPMONIKER pmk) PURE;
  246. };
  247. typedef IAdviseSink2 FAR* LPADVISESINK2;
  248. #undef INTERFACE
  249. #define INTERFACE IDataAdviseHolder
  250. DECLARE_INTERFACE_(IDataAdviseHolder, IUnknown)
  251. {
  252. // *** IUnknown methods ***
  253. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppv) PURE;
  254. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  255. STDMETHOD_(ULONG,Release) (THIS) PURE;
  256. // *** IDataAdviseHolder methods ***
  257. STDMETHOD(Advise)(THIS_ LPDATAOBJECT pDataObject, FORMATETC FAR* pFetc,
  258. DWORD advf, LPADVISESINK pAdvise, DWORD FAR* pdwConnection) PURE;
  259. STDMETHOD(Unadvise)(THIS_ DWORD dwConnection) PURE;
  260. STDMETHOD(EnumAdvise)(THIS_ LPENUMSTATDATA FAR* ppenumAdvise) PURE;
  261. STDMETHOD(SendOnDataChange)(THIS_ LPDATAOBJECT pDataObject, DWORD dwReserved, DWORD advf) PURE;
  262. };
  263. typedef IDataAdviseHolder FAR* LPDATAADVISEHOLDER;
  264. #undef INTERFACE
  265. #define INTERFACE IOleCache
  266. #define CACHE_E_NOCACHE_UPDATED (CACHE_E_FIRST)
  267. #define CACHE_S_FORMATETC_NOTSUPPORTED (CACHE_S_FIRST)
  268. #define CACHE_S_SAMECACHE (CACHE_S_FIRST+1)
  269. #define CACHE_S_SOMECACHES_NOTUPDATED (CACHE_S_FIRST+2)
  270. DECLARE_INTERFACE_(IOleCache, IUnknown)
  271. {
  272. // *** IUnknown methods ***
  273. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  274. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  275. STDMETHOD_(ULONG,Release) (THIS) PURE;
  276. // *** IOleCache methods ***
  277. STDMETHOD(Cache) (THIS_ LPFORMATETC lpFormatetc, DWORD advf, LPDWORD lpdwConnection) PURE;
  278. STDMETHOD(Uncache) (THIS_ DWORD dwConnection) PURE;
  279. STDMETHOD(EnumCache) (THIS_ LPENUMSTATDATA FAR* ppenumStatData) PURE;
  280. STDMETHOD(InitCache) (THIS_ LPDATAOBJECT pDataObject) PURE;
  281. STDMETHOD(SetData) (THIS_ LPFORMATETC pformatetc, STGMEDIUM FAR * pmedium,
  282. BOOL fRelease) PURE;
  283. };
  284. typedef IOleCache FAR* LPOLECACHE;
  285. /****** DV APIs ***********************************************************/
  286. STDAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER FAR* ppDAHolder);
  287. #endif // _DVOBJ_H_