Convert WND.text field to Unicode.
[wine.git] / include / wine / obj_dataobject.h
blob67fc0b674534dfcefb6ac07d3738333e6d5b8d7d
1 /*
2 * Defines the COM interfaces and APIs related to IDataObject.
4 */
6 #ifndef __WINE_WINE_OBJ_DATAOBJECT_H
7 #define __WINE_WINE_OBJ_DATAOBJECT_H
9 #include "wine/obj_base.h"
10 #include "wine/obj_moniker.h"
11 #include "wine/obj_storage.h"
13 #ifdef __cplusplus
14 extern "C" {
15 #endif /* defined(__cplusplus) */
17 /*****************************************************************************
18 * Predeclare the structures
20 typedef enum tagDATADIR
22 DATADIR_GET = 1,
23 DATADIR_SET = 2
24 } DATADIR;
26 typedef struct DVTARGETDEVICE16 DVTARGETDEVICE16, *LPDVTARGETDEVICE16;
27 typedef struct DVTARGETDEVICE DVTARGETDEVICE, *LPDVTARGETDEVICE;
29 typedef struct FORMATETC16 FORMATETC16, *LPFORMATETC16;
30 typedef struct FORMATETC FORMATETC, *LPFORMATETC;
32 typedef struct STGMEDIUM STGMEDIUM, *LPSTGMEDIUM;
35 /*****************************************************************************
36 * Predeclare the interfaces
38 DEFINE_OLEGUID(IID_IAdviseSink, 0x0000010fL, 0, 0);
39 typedef struct IAdviseSink IAdviseSink,*LPADVISESINK;
41 DEFINE_OLEGUID(IID_IAdviseSink2, 0x00000125L, 0, 0);
42 typedef struct IAdviseSink2 IAdviseSink2,*LPADVISESINK2;
44 DEFINE_OLEGUID(IID_IDataAdviseHolder, 0x00000110L, 0, 0);
45 typedef struct IDataAdviseHolder IDataAdviseHolder,*LPDATAADVISEHOLDER;
47 DEFINE_OLEGUID(IID_IDataObject, 0x0000010EL, 0, 0);
48 typedef struct IDataObject IDataObject,*LPDATAOBJECT;
50 DEFINE_OLEGUID(IID_IEnumFORMATETC, 0x00000103L, 0, 0);
51 typedef struct IEnumFORMATETC IEnumFORMATETC,*LPENUMFORMATETC;
53 DEFINE_OLEGUID(IID_IEnumSTATDATA, 0x00000105L, 0, 0);
54 typedef struct IEnumSTATDATA IEnumSTATDATA,*LPENUMSTATDATA;
57 /*****************************************************************************
58 * DVTARGETDEVICE structure
60 struct DVTARGETDEVICE
62 DWORD tdSize;
63 WORD tdDriverNameOffset;
64 WORD tdDeviceNameOffset;
65 WORD tdPortNameOffset;
66 WORD tdExtDevmodeOffset;
67 BYTE tdData[1];
71 /*****************************************************************************
72 * FORMATETC structure
74 /* wished data format */
75 struct FORMATETC
77 CLIPFORMAT cfFormat;
78 DVTARGETDEVICE* ptd;
79 DWORD dwAspect;
80 LONG lindex;
81 DWORD tymed;
85 /*****************************************************************************
86 * STGMEDIUM structure
88 typedef enum tagTYMED
90 TYMED_HGLOBAL = 1,
91 TYMED_FILE = 2,
92 TYMED_ISTREAM = 4,
93 TYMED_ISTORAGE = 8,
94 TYMED_GDI = 16,
95 TYMED_MFPICT = 32,
96 TYMED_ENHMF = 64,
97 TYMED_NULL = 0
98 } TYMED;
100 typedef struct tagRemSTGMEDIUM
102 DWORD tymed;
103 DWORD dwHandleType;
104 unsigned long pData;
105 unsigned long pUnkForRelease;
106 unsigned long cbData;
107 byte data[1];
108 } RemSTGMEDIUM;
110 /* dataobject as answer to a request */
111 struct STGMEDIUM
113 DWORD tymed;
114 union {
115 HBITMAP hBitmap;
116 HMETAFILEPICT hMetaFilePict;
117 HENHMETAFILE hEnhMetaFile;
118 HGLOBAL hGlobal;
119 LPOLESTR lpszFileName;
120 IStream *pstm;
121 IStorage *pstg;
122 } DUMMYUNIONNAME;
123 IUnknown *pUnkForRelease;
126 typedef enum tagADVF
128 ADVF_NODATA = 1,
129 ADVF_PRIMEFIRST = 2,
130 ADVF_ONLYONCE = 4,
131 ADVF_DATAONSTOP = 64,
132 ADVFCACHE_NOHANDLER = 8,
133 ADVFCACHE_FORCEBUILTIN = 16,
134 ADVFCACHE_ONSAVE = 32
135 } ADVF;
137 typedef struct tagSTATDATA
139 FORMATETC formatetc;
140 DWORD advf;
141 IAdviseSink *pAdvSink;
142 DWORD dwConnection;
143 } STATDATA, *LPSTATDATA;
145 /*****************************************************************************
146 * IAdviseSink interface
148 #define ICOM_INTERFACE IAdviseSink
149 #define IAdviseSink_METHODS \
150 ICOM_VMETHOD2(OnDataChange, FORMATETC*,pFormatetc, STGMEDIUM*,pStgmed) \
151 ICOM_VMETHOD2(OnViewChange, DWORD,dwAspect, LONG,lindex) \
152 ICOM_VMETHOD1(OnRename, IMoniker*,pmk) \
153 ICOM_VMETHOD (OnSave) \
154 ICOM_VMETHOD (OnClose)
155 #define IAdviseSink_IMETHODS \
156 IUnknown_IMETHODS \
157 IAdviseSink_METHODS
158 ICOM_DEFINE(IAdviseSink,IUnknown)
159 #undef ICOM_INTERFACE
161 /*** IUnknown methods ***/
162 #define IAdviseSink_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
163 #define IAdviseSink_AddRef(p) ICOM_CALL (AddRef,p)
164 #define IAdviseSink_Release(p) ICOM_CALL (Release,p)
165 /*** IAdviseSink methods ***/
166 #define IAdviseSink_OnDataChange(p,a,b) ICOM_CALL2(OnDataChange,p,a,b)
167 #define IAdviseSink_OnViewChange(p,a,b) ICOM_CALL2(OnViewChange,p,a,b)
168 #define IAdviseSink_OnRename(p,a) ICOM_CALL1(OnRename,p,a)
169 #define IAdviseSink_OnSave(p) ICOM_CALL (OnSave,p)
170 #define IAdviseSink_OnClose(p) ICOM_CALL (OnClose,p)
173 /*****************************************************************************
174 * IAdviseSink2 interface
176 #define ICOM_INTERFACE IAdviseSink2
177 #define IAdviseSink2_METHODS \
178 ICOM_VMETHOD1(OnLinkSrcChange, IMoniker*,pmk)
179 #define IAdviseSink2_IMETHODS \
180 IAdviseSink_IMETHODS \
181 IAdviseSink2_METHODS
182 ICOM_DEFINE(IAdviseSink2,IAdviseSink)
183 #undef ICOM_INTERFACE
185 /*** IUnknown methods ***/
186 #define IAdviseSink2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
187 #define IAdviseSink2_AddRef(p) ICOM_CALL (AddRef,p)
188 #define IAdviseSink2_Release(p) ICOM_CALL (Release,p)
189 /*** IAdviseSink methods ***/
190 #define IAdviseSink2_OnDataChange(p,a,b) ICOM_CALL2(IAdviseSink,OnDataChange,p,a,b)
191 #define IAdviseSink2_OnViewChange(p,a,b) ICOM_CALL2(IAdviseSink,OnViewChange,p,a,b)
192 #define IAdviseSink2_OnRename(p,a) ICOM_CALL1(IAdviseSink,OnRename,p,a)
193 #define IAdviseSink2_OnSave(p) ICOM_CALL (IAdviseSink,OnSave,p)
194 #define IAdviseSink2_OnClose(p) ICOM_CALL (IAdviseSink,OnClose,p)
195 /*** IAdviseSink2 methods ***/
196 #define IAdviseSink2_OnLinkSrcChange(p,a) ICOM_CALL(OnLinkSrcChange,p,a)
199 /*****************************************************************************
200 * IDataAdviseHolder interface
202 #define ICOM_INTERFACE IDataAdviseHolder
203 #define IDataAdviseHolder_METHODS \
204 ICOM_METHOD5(HRESULT,Advise, IDataObject*,pDataObject, FORMATETC*,pFetc, DWORD,advf, IAdviseSink*,pAdvise, DWORD*,pdwConnection) \
205 ICOM_METHOD1(HRESULT,Unadvise, DWORD,dwConnection) \
206 ICOM_METHOD1(HRESULT,EnumAdvise, IEnumSTATDATA**,ppenumAdvise) \
207 ICOM_METHOD3(HRESULT,SendOnDataChange, IDataObject*,pDataObject, DWORD,dwReserved, DWORD,advf)
208 #define IDataAdviseHolder_IMETHODS \
209 IUnknown_IMETHODS \
210 IDataAdviseHolder_METHODS
211 ICOM_DEFINE(IDataAdviseHolder,IUnknown)
212 #undef ICOM_INTERFACE
214 /*** IUnknown methods ***/
215 #define IDataAdviseHolder_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
216 #define IDataAdviseHolder_AddRef(p) ICOM_CALL (AddRef,p)
217 #define IDataAdviseHolder_Release(p) ICOM_CALL (Release,p)
218 /*** IDataAdviseHolder methods ***/
219 #define IDataAdviseHolder_Advise(p,a,b,c,d,e) ICOM_CALL5(Advise,p,a,b,c,d,e)
220 #define IDataAdviseHolder_Unadvise(p,a) ICOM_CALL1(Unadvise,p,a)
221 #define IDataAdviseHolder_EnumAdvise(p,a) ICOM_CALL1(EnumAdvise,p,a)
222 #define IDataAdviseHolder_SendOnDataChange(p,a,b,c) ICOM_CALL3(SendOnDataChange,p,a,b,c)
224 /* FIXME: not implemented */
225 HRESULT WINAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER* ppDAHolder);
228 /*****************************************************************************
229 * IDataObject interface
231 #define ICOM_INTERFACE IDataObject
232 #define IDataObject_METHODS \
233 ICOM_METHOD2(HRESULT,GetData, LPFORMATETC,pformatetcIn, STGMEDIUM*,pmedium) \
234 ICOM_METHOD2(HRESULT,GetDataHere, LPFORMATETC,pformatetc, STGMEDIUM*,pmedium) \
235 ICOM_METHOD1(HRESULT,QueryGetData, LPFORMATETC,pformatetc) \
236 ICOM_METHOD2(HRESULT,GetCanonicalFormatEtc, LPFORMATETC,pformatectIn, LPFORMATETC,pformatetcOut) \
237 ICOM_METHOD3(HRESULT,SetData, LPFORMATETC,pformatetc, STGMEDIUM*,pmedium, BOOL,fRelease) \
238 ICOM_METHOD2(HRESULT,EnumFormatEtc, DWORD,dwDirection, IEnumFORMATETC**,ppenumFormatEtc) \
239 ICOM_METHOD4(HRESULT,DAdvise, FORMATETC*,pformatetc, DWORD,advf, IAdviseSink*,pAdvSink, DWORD*,pdwConnection) \
240 ICOM_METHOD1(HRESULT,DUnadvise, DWORD,dwConnection) \
241 ICOM_METHOD1(HRESULT,EnumDAdvise, IEnumSTATDATA**,ppenumAdvise)
242 #define IDataObject_IMETHODS \
243 IUnknown_IMETHODS \
244 IDataObject_METHODS
245 ICOM_DEFINE(IDataObject,IUnknown)
246 #undef ICOM_INTERFACE
248 /*** IUnknown methods ***/
249 #define IDataObject_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
250 #define IDataObject_AddRef(p) ICOM_CALL (AddRef,p)
251 #define IDataObject_Release(p) ICOM_CALL (Release,p)
252 /*** IDataObject methods ***/
253 #define IDataObject_GetData(p,a,b) ICOM_CALL2(GetData,p,a,b)
254 #define IDataObject_GetDataHere(p,a,b) ICOM_CALL2(GetDataHere,p,a,b)
255 #define IDataObject_QueryGetData(p,a) ICOM_CALL1(QueryGetData,p,a)
256 #define IDataObject_GetCanonicalFormatEtc(p,a,b) ICOM_CALL2(GetCanonicalFormatEtc,p,a,b)
257 #define IDataObject_SetData(p,a,b,c) ICOM_CALL3(SetData,p,a,b,c)
258 #define IDataObject_EnumFormatEtc(p,a,b) ICOM_CALL2(EnumFormatEtc,p,a,b)
259 #define IDataObject_DAdvise(p,a,b,c,d) ICOM_CALL4(DAdvise,p,a,b,c,d)
260 #define IDataObject_DUnadvise(p,a) ICOM_CALL1(DUnadvise,p,a)
261 #define IDataObject_EnumDAdvise(p,a) ICOM_CALL1(EnumDAdvise,p,a)
264 /*****************************************************************************
265 * IEnumFORMATETC interface
267 #define ICOM_INTERFACE IEnumFORMATETC
268 #define IEnumFORMATETC_METHODS \
269 ICOM_METHOD3(HRESULT,Next, ULONG,celt, FORMATETC*,rgelt, ULONG*,pceltFethed) \
270 ICOM_METHOD1(HRESULT,Skip, ULONG,celt) \
271 ICOM_METHOD (HRESULT,Reset) \
272 ICOM_METHOD1(HRESULT,Clone, IEnumFORMATETC**,ppenum)
273 #define IEnumFORMATETC_IMETHODS \
274 IUnknown_IMETHODS \
275 IEnumFORMATETC_METHODS
276 ICOM_DEFINE(IEnumFORMATETC,IUnknown)
277 #undef ICOM_INTERFACE
279 /*** IUnknown methods ***/
280 #define IEnumFORMATETC_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
281 #define IEnumFORMATETC_AddRef(p) ICOM_CALL (AddRef,p)
282 #define IEnumFORMATETC_Release(p) ICOM_CALL (Release,p)
283 /*** IEnumFORMATETC methods ***/
284 #define IEnumFORMATETC_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
285 #define IEnumFORMATETC_Skip(p,a) ICOM_CALL1(Skip,p,a)
286 #define IEnumFORMATETC_Reset(p) ICOM_CALL (Reset,p)
287 #define IEnumFORMATETC_Clone(p,a) ICOM_CALL1(Clone,p,a)
290 /*****************************************************************************
291 * IEnumSTATDATA interface
293 #define ICOM_INTERFACE IEnumSTATDATA
294 #define IEnumSTATDATA_METHODS \
295 ICOM_METHOD3(HRESULT,Next, ULONG,celt, STATDATA*,rgelt, ULONG*,pceltFethed) \
296 ICOM_METHOD1(HRESULT,Skip, ULONG,celt) \
297 ICOM_METHOD (HRESULT,Reset) \
298 ICOM_METHOD1(HRESULT,Clone, IEnumSTATDATA**,ppenum)
299 #define IEnumSTATDATA_IMETHODS \
300 IUnknown_IMETHODS \
301 IEnumSTATDATA_METHODS
302 ICOM_DEFINE(IEnumSTATDATA,IUnknown)
303 #undef ICOM_INTERFACE
305 /*** IUnknown methods ***/
306 #define IEnumSTATDATA_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
307 #define IEnumSTATDATA_AddRef(p) ICOM_CALL (AddRef,p)
308 #define IEnumSTATDATA_Release(p) ICOM_CALL (Release,p)
309 /*** IEnumSTATDATA methods ***/
310 #define IEnumSTATDATA_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
311 #define IEnumSTATDATA_Skip(p,a) ICOM_CALL1(Skip,p,a)
312 #define IEnumSTATDATA_Reset(p) ICOM_CALL (Reset,p)
313 #define IEnumSTATDATA_Clone(p,a) ICOM_CALL1(Clone,p,a)
316 /*****************************************************************************
317 * Additional API
320 /* FIXME: not implemented */
321 HRESULT WINAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid, REFIID iid, LPVOID* ppv);
323 #ifdef __cplusplus
324 } /* extern "C" */
325 #endif /* defined(__cplusplus) */
327 #endif /* __WINE_WINE_OBJ_DATAOBJECT_H */