Release 20020904.
[wine/gsoc-2012-control.git] / include / wine / obj_dataobject.h
bloba46778fdb89647eb0ca408f75db3403d7b4a0cf7
1 /*
2 * Defines the COM interfaces and APIs related to IDataObject.
4 * Copyright (C) the Wine project
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_WINE_OBJ_DATAOBJECT_H
22 #define __WINE_WINE_OBJ_DATAOBJECT_H
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* defined(__cplusplus) */
28 /*****************************************************************************
29 * Predeclare the structures
31 typedef enum tagDATADIR
33 DATADIR_GET = 1,
34 DATADIR_SET = 2
35 } DATADIR;
37 typedef struct DVTARGETDEVICE16 DVTARGETDEVICE16, *LPDVTARGETDEVICE16;
38 typedef struct DVTARGETDEVICE DVTARGETDEVICE, *LPDVTARGETDEVICE;
40 typedef struct FORMATETC16 FORMATETC16, *LPFORMATETC16;
41 typedef struct FORMATETC FORMATETC, *LPFORMATETC;
43 typedef struct STGMEDIUM STGMEDIUM, *LPSTGMEDIUM;
46 /*****************************************************************************
47 * Predeclare the interfaces
49 DEFINE_OLEGUID(IID_IAdviseSink, 0x0000010fL, 0, 0);
50 typedef struct IAdviseSink IAdviseSink,*LPADVISESINK;
52 DEFINE_OLEGUID(IID_IAdviseSink2, 0x00000125L, 0, 0);
53 typedef struct IAdviseSink2 IAdviseSink2,*LPADVISESINK2;
55 DEFINE_OLEGUID(IID_IDataAdviseHolder, 0x00000110L, 0, 0);
56 typedef struct IDataAdviseHolder IDataAdviseHolder,*LPDATAADVISEHOLDER;
58 DEFINE_OLEGUID(IID_IDataObject, 0x0000010EL, 0, 0);
59 typedef struct IDataObject IDataObject,*LPDATAOBJECT;
61 DEFINE_OLEGUID(IID_IEnumFORMATETC, 0x00000103L, 0, 0);
62 typedef struct IEnumFORMATETC IEnumFORMATETC,*LPENUMFORMATETC;
64 DEFINE_OLEGUID(IID_IEnumSTATDATA, 0x00000105L, 0, 0);
65 typedef struct IEnumSTATDATA IEnumSTATDATA,*LPENUMSTATDATA;
68 /*****************************************************************************
69 * DVTARGETDEVICE structure
71 struct DVTARGETDEVICE
73 DWORD tdSize;
74 WORD tdDriverNameOffset;
75 WORD tdDeviceNameOffset;
76 WORD tdPortNameOffset;
77 WORD tdExtDevmodeOffset;
78 BYTE tdData[1];
82 /*****************************************************************************
83 * FORMATETC structure
85 /* wished data format */
86 struct FORMATETC
88 CLIPFORMAT cfFormat;
89 DVTARGETDEVICE* ptd;
90 DWORD dwAspect;
91 LONG lindex;
92 DWORD tymed;
96 /*****************************************************************************
97 * STGMEDIUM structure
99 typedef enum tagTYMED
101 TYMED_HGLOBAL = 1,
102 TYMED_FILE = 2,
103 TYMED_ISTREAM = 4,
104 TYMED_ISTORAGE = 8,
105 TYMED_GDI = 16,
106 TYMED_MFPICT = 32,
107 TYMED_ENHMF = 64,
108 TYMED_NULL = 0
109 } TYMED;
111 typedef struct tagRemSTGMEDIUM
113 DWORD tymed;
114 DWORD dwHandleType;
115 unsigned long pData;
116 unsigned long pUnkForRelease;
117 unsigned long cbData;
118 byte data[1];
119 } RemSTGMEDIUM;
121 /* dataobject as answer to a request */
122 struct STGMEDIUM
124 DWORD tymed;
125 union {
126 HBITMAP hBitmap;
127 HMETAFILEPICT hMetaFilePict;
128 HENHMETAFILE hEnhMetaFile;
129 HGLOBAL hGlobal;
130 LPOLESTR lpszFileName;
131 IStream *pstm;
132 IStorage *pstg;
133 } DUMMYUNIONNAME;
134 IUnknown *pUnkForRelease;
137 typedef enum tagADVF
139 ADVF_NODATA = 1,
140 ADVF_PRIMEFIRST = 2,
141 ADVF_ONLYONCE = 4,
142 ADVF_DATAONSTOP = 64,
143 ADVFCACHE_NOHANDLER = 8,
144 ADVFCACHE_FORCEBUILTIN = 16,
145 ADVFCACHE_ONSAVE = 32
146 } ADVF;
148 typedef struct tagSTATDATA
150 FORMATETC formatetc;
151 DWORD advf;
152 IAdviseSink *pAdvSink;
153 DWORD dwConnection;
154 } STATDATA, *LPSTATDATA;
156 /*****************************************************************************
157 * IAdviseSink interface
159 #define ICOM_INTERFACE IAdviseSink
160 #define IAdviseSink_METHODS \
161 ICOM_VMETHOD2(OnDataChange, FORMATETC*,pFormatetc, STGMEDIUM*,pStgmed) \
162 ICOM_VMETHOD2(OnViewChange, DWORD,dwAspect, LONG,lindex) \
163 ICOM_VMETHOD1(OnRename, IMoniker*,pmk) \
164 ICOM_VMETHOD (OnSave) \
165 ICOM_VMETHOD (OnClose)
166 #define IAdviseSink_IMETHODS \
167 IUnknown_IMETHODS \
168 IAdviseSink_METHODS
169 ICOM_DEFINE(IAdviseSink,IUnknown)
170 #undef ICOM_INTERFACE
172 /*** IUnknown methods ***/
173 #define IAdviseSink_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
174 #define IAdviseSink_AddRef(p) ICOM_CALL (AddRef,p)
175 #define IAdviseSink_Release(p) ICOM_CALL (Release,p)
176 /*** IAdviseSink methods ***/
177 #define IAdviseSink_OnDataChange(p,a,b) ICOM_CALL2(OnDataChange,p,a,b)
178 #define IAdviseSink_OnViewChange(p,a,b) ICOM_CALL2(OnViewChange,p,a,b)
179 #define IAdviseSink_OnRename(p,a) ICOM_CALL1(OnRename,p,a)
180 #define IAdviseSink_OnSave(p) ICOM_CALL (OnSave,p)
181 #define IAdviseSink_OnClose(p) ICOM_CALL (OnClose,p)
184 /*****************************************************************************
185 * IAdviseSink2 interface
187 #define ICOM_INTERFACE IAdviseSink2
188 #define IAdviseSink2_METHODS \
189 ICOM_VMETHOD1(OnLinkSrcChange, IMoniker*,pmk)
190 #define IAdviseSink2_IMETHODS \
191 IAdviseSink_IMETHODS \
192 IAdviseSink2_METHODS
193 ICOM_DEFINE(IAdviseSink2,IAdviseSink)
194 #undef ICOM_INTERFACE
196 /*** IUnknown methods ***/
197 #define IAdviseSink2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
198 #define IAdviseSink2_AddRef(p) ICOM_CALL (AddRef,p)
199 #define IAdviseSink2_Release(p) ICOM_CALL (Release,p)
200 /*** IAdviseSink methods ***/
201 #define IAdviseSink2_OnDataChange(p,a,b) ICOM_CALL2(IAdviseSink,OnDataChange,p,a,b)
202 #define IAdviseSink2_OnViewChange(p,a,b) ICOM_CALL2(IAdviseSink,OnViewChange,p,a,b)
203 #define IAdviseSink2_OnRename(p,a) ICOM_CALL1(IAdviseSink,OnRename,p,a)
204 #define IAdviseSink2_OnSave(p) ICOM_CALL (IAdviseSink,OnSave,p)
205 #define IAdviseSink2_OnClose(p) ICOM_CALL (IAdviseSink,OnClose,p)
206 /*** IAdviseSink2 methods ***/
207 #define IAdviseSink2_OnLinkSrcChange(p,a) ICOM_CALL(OnLinkSrcChange,p,a)
210 /*****************************************************************************
211 * IDataAdviseHolder interface
213 #define ICOM_INTERFACE IDataAdviseHolder
214 #define IDataAdviseHolder_METHODS \
215 ICOM_METHOD5(HRESULT,Advise, IDataObject*,pDataObject, FORMATETC*,pFetc, DWORD,advf, IAdviseSink*,pAdvise, DWORD*,pdwConnection) \
216 ICOM_METHOD1(HRESULT,Unadvise, DWORD,dwConnection) \
217 ICOM_METHOD1(HRESULT,EnumAdvise, IEnumSTATDATA**,ppenumAdvise) \
218 ICOM_METHOD3(HRESULT,SendOnDataChange, IDataObject*,pDataObject, DWORD,dwReserved, DWORD,advf)
219 #define IDataAdviseHolder_IMETHODS \
220 IUnknown_IMETHODS \
221 IDataAdviseHolder_METHODS
222 ICOM_DEFINE(IDataAdviseHolder,IUnknown)
223 #undef ICOM_INTERFACE
225 /*** IUnknown methods ***/
226 #define IDataAdviseHolder_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
227 #define IDataAdviseHolder_AddRef(p) ICOM_CALL (AddRef,p)
228 #define IDataAdviseHolder_Release(p) ICOM_CALL (Release,p)
229 /*** IDataAdviseHolder methods ***/
230 #define IDataAdviseHolder_Advise(p,a,b,c,d,e) ICOM_CALL5(Advise,p,a,b,c,d,e)
231 #define IDataAdviseHolder_Unadvise(p,a) ICOM_CALL1(Unadvise,p,a)
232 #define IDataAdviseHolder_EnumAdvise(p,a) ICOM_CALL1(EnumAdvise,p,a)
233 #define IDataAdviseHolder_SendOnDataChange(p,a,b,c) ICOM_CALL3(SendOnDataChange,p,a,b,c)
235 /* FIXME: not implemented */
236 HRESULT WINAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER* ppDAHolder);
239 /*****************************************************************************
240 * IDataObject interface
242 #define ICOM_INTERFACE IDataObject
243 #define IDataObject_METHODS \
244 ICOM_METHOD2(HRESULT,GetData, LPFORMATETC,pformatetcIn, STGMEDIUM*,pmedium) \
245 ICOM_METHOD2(HRESULT,GetDataHere, LPFORMATETC,pformatetc, STGMEDIUM*,pmedium) \
246 ICOM_METHOD1(HRESULT,QueryGetData, LPFORMATETC,pformatetc) \
247 ICOM_METHOD2(HRESULT,GetCanonicalFormatEtc, LPFORMATETC,pformatectIn, LPFORMATETC,pformatetcOut) \
248 ICOM_METHOD3(HRESULT,SetData, LPFORMATETC,pformatetc, STGMEDIUM*,pmedium, BOOL,fRelease) \
249 ICOM_METHOD2(HRESULT,EnumFormatEtc, DWORD,dwDirection, IEnumFORMATETC**,ppenumFormatEtc) \
250 ICOM_METHOD4(HRESULT,DAdvise, FORMATETC*,pformatetc, DWORD,advf, IAdviseSink*,pAdvSink, DWORD*,pdwConnection) \
251 ICOM_METHOD1(HRESULT,DUnadvise, DWORD,dwConnection) \
252 ICOM_METHOD1(HRESULT,EnumDAdvise, IEnumSTATDATA**,ppenumAdvise)
253 #define IDataObject_IMETHODS \
254 IUnknown_IMETHODS \
255 IDataObject_METHODS
256 ICOM_DEFINE(IDataObject,IUnknown)
257 #undef ICOM_INTERFACE
259 /*** IUnknown methods ***/
260 #define IDataObject_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
261 #define IDataObject_AddRef(p) ICOM_CALL (AddRef,p)
262 #define IDataObject_Release(p) ICOM_CALL (Release,p)
263 /*** IDataObject methods ***/
264 #define IDataObject_GetData(p,a,b) ICOM_CALL2(GetData,p,a,b)
265 #define IDataObject_GetDataHere(p,a,b) ICOM_CALL2(GetDataHere,p,a,b)
266 #define IDataObject_QueryGetData(p,a) ICOM_CALL1(QueryGetData,p,a)
267 #define IDataObject_GetCanonicalFormatEtc(p,a,b) ICOM_CALL2(GetCanonicalFormatEtc,p,a,b)
268 #define IDataObject_SetData(p,a,b,c) ICOM_CALL3(SetData,p,a,b,c)
269 #define IDataObject_EnumFormatEtc(p,a,b) ICOM_CALL2(EnumFormatEtc,p,a,b)
270 #define IDataObject_DAdvise(p,a,b,c,d) ICOM_CALL4(DAdvise,p,a,b,c,d)
271 #define IDataObject_DUnadvise(p,a) ICOM_CALL1(DUnadvise,p,a)
272 #define IDataObject_EnumDAdvise(p,a) ICOM_CALL1(EnumDAdvise,p,a)
275 /*****************************************************************************
276 * IEnumFORMATETC interface
278 #define ICOM_INTERFACE IEnumFORMATETC
279 #define IEnumFORMATETC_METHODS \
280 ICOM_METHOD3(HRESULT,Next, ULONG,celt, FORMATETC*,rgelt, ULONG*,pceltFethed) \
281 ICOM_METHOD1(HRESULT,Skip, ULONG,celt) \
282 ICOM_METHOD (HRESULT,Reset) \
283 ICOM_METHOD1(HRESULT,Clone, IEnumFORMATETC**,ppenum)
284 #define IEnumFORMATETC_IMETHODS \
285 IUnknown_IMETHODS \
286 IEnumFORMATETC_METHODS
287 ICOM_DEFINE(IEnumFORMATETC,IUnknown)
288 #undef ICOM_INTERFACE
290 /*** IUnknown methods ***/
291 #define IEnumFORMATETC_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
292 #define IEnumFORMATETC_AddRef(p) ICOM_CALL (AddRef,p)
293 #define IEnumFORMATETC_Release(p) ICOM_CALL (Release,p)
294 /*** IEnumFORMATETC methods ***/
295 #define IEnumFORMATETC_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
296 #define IEnumFORMATETC_Skip(p,a) ICOM_CALL1(Skip,p,a)
297 #define IEnumFORMATETC_Reset(p) ICOM_CALL (Reset,p)
298 #define IEnumFORMATETC_Clone(p,a) ICOM_CALL1(Clone,p,a)
301 /*****************************************************************************
302 * IEnumSTATDATA interface
304 #define ICOM_INTERFACE IEnumSTATDATA
305 #define IEnumSTATDATA_METHODS \
306 ICOM_METHOD3(HRESULT,Next, ULONG,celt, STATDATA*,rgelt, ULONG*,pceltFethed) \
307 ICOM_METHOD1(HRESULT,Skip, ULONG,celt) \
308 ICOM_METHOD (HRESULT,Reset) \
309 ICOM_METHOD1(HRESULT,Clone, IEnumSTATDATA**,ppenum)
310 #define IEnumSTATDATA_IMETHODS \
311 IUnknown_IMETHODS \
312 IEnumSTATDATA_METHODS
313 ICOM_DEFINE(IEnumSTATDATA,IUnknown)
314 #undef ICOM_INTERFACE
316 /*** IUnknown methods ***/
317 #define IEnumSTATDATA_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
318 #define IEnumSTATDATA_AddRef(p) ICOM_CALL (AddRef,p)
319 #define IEnumSTATDATA_Release(p) ICOM_CALL (Release,p)
320 /*** IEnumSTATDATA methods ***/
321 #define IEnumSTATDATA_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
322 #define IEnumSTATDATA_Skip(p,a) ICOM_CALL1(Skip,p,a)
323 #define IEnumSTATDATA_Reset(p) ICOM_CALL (Reset,p)
324 #define IEnumSTATDATA_Clone(p,a) ICOM_CALL1(Clone,p,a)
327 /*****************************************************************************
328 * Additional API
331 /* FIXME: not implemented */
332 HRESULT WINAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid, REFIID iid, LPVOID* ppv);
334 #ifdef __cplusplus
335 } /* extern "C" */
336 #endif /* defined(__cplusplus) */
338 #endif /* __WINE_WINE_OBJ_DATAOBJECT_H */