Spelling fix.
[wine/multimedia.git] / include / ole.h
blob11ff4c79e4a65656a873ec46ed24c72b5995a02e
1 /*
2 * ole.h - Declarations for OLESVR and OLECLI
3 */
5 #ifndef __WINE_OLE_H
6 #define __WINE_OLE_H
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
12 #include "windef.h"
13 #include "wine/windef16.h"
14 #include "wine/obj_base.h"
15 #include "wine/obj_misc.h"
16 #include "wine/obj_storage.h"
17 #include "wine/obj_moniker.h"
18 #include "wine/obj_dataobject.h"
19 #include "wine/obj_dragdrop.h"
21 struct tagLOGPALETTE;
23 /* object types */
24 #define OT_LINK 1
25 #define OT_EMBEDDED 2
26 #define OT_STATIC 3
28 /* activate verbs */
29 #define OLEVERB_PRIMARY 0
31 typedef enum
33 OLE_OK,
34 OLE_WAIT_FOR_RELEASE,
35 OLE_BUSY,
36 OLE_ERROR_PROTECT_ONLY,
37 OLE_ERROR_MEMORY,
38 OLE_ERROR_STREAM,
39 OLE_ERROR_STATIC,
40 OLE_ERROR_BLANK,
41 OLE_ERROR_DRAW,
42 OLE_ERROR_METAFILE,
43 OLE_ERROR_ABORT,
44 OLE_ERROR_CLIPBOARD,
45 OLE_ERROR_FORMAT,
46 OLE_ERROR_OBJECT,
47 OLE_ERROR_OPTION,
48 OLE_ERROR_PROTOCOL,
49 OLE_ERROR_ADDRESS,
50 OLE_ERROR_NOT_EQUAL,
51 OLE_ERROR_HANDLE,
52 OLE_ERROR_GENERIC,
53 OLE_ERROR_CLASS,
54 OLE_ERROR_SYNTAX,
55 OLE_ERROR_DATATYPE,
56 OLE_ERROR_PALETTE,
57 OLE_ERROR_NOT_LINK,
58 OLE_ERROR_NOT_EMPTY,
59 OLE_ERROR_SIZE,
60 OLE_ERROR_DRIVE,
61 OLE_ERROR_NETWORK,
62 OLE_ERROR_NAME,
63 OLE_ERROR_TEMPLATE,
64 OLE_ERROR_NEW,
65 OLE_ERROR_EDIT,
66 OLE_ERROR_OPEN,
67 OLE_ERROR_NOT_OPEN,
68 OLE_ERROR_LAUNCH,
69 OLE_ERROR_COMM,
70 OLE_ERROR_TERMINATE,
71 OLE_ERROR_COMMAND,
72 OLE_ERROR_SHOW,
73 OLE_ERROR_DOVERB,
74 OLE_ERROR_ADVISE_NATIVE,
75 OLE_ERROR_ADVISE_PICT,
76 OLE_ERROR_ADVISE_RENAME,
77 OLE_ERROR_POKE_NATIVE,
78 OLE_ERROR_REQUEST_NATIVE,
79 OLE_ERROR_REQUEST_PICT,
80 OLE_ERROR_SERVER_BLOCKED,
81 OLE_ERROR_REGISTRATION,
82 OLE_ERROR_ALREADY_REGISTERED,
83 OLE_ERROR_TASK,
84 OLE_ERROR_OUTOFDATE,
85 OLE_ERROR_CANT_UPDATE_CLIENT,
86 OLE_ERROR_UPDATE,
87 OLE_ERROR_SETDATA_FORMAT,
88 OLE_ERROR_STATIC_FROM_OTHER_OS,
89 OLE_WARN_DELETE_DATA = 1000
90 } OLESTATUS;
92 typedef enum {
93 OLE_SERVER_MULTI,
94 OLE_SERVER_SINGLE
95 } OLE_SERVER_USE;
97 typedef enum {
98 OLE_CHANGED,
99 OLE_SAVED,
100 OLE_CLOSED,
101 OLE_RENAMED,
102 OLE_QUERY_PAINT,
103 OLE_RELEASE,
104 OLE_QUERY_RETRY
105 } OLE_NOTIFICATION;
107 typedef enum {
108 olerender_none,
109 olerender_draw,
110 olerender_format
111 } OLEOPT_RENDER;
113 typedef enum {
114 oleupdate_always,
115 oleupdate_onsave,
116 oleupdate_oncall,
117 oleupdate_onclose
118 } OLEOPT_UPDATE;
120 typedef LONG LHSERVER;
121 typedef LONG LHSERVERDOC;
122 typedef LONG LHCLIENTDOC;
123 typedef LONG OLECLIPFORMAT;/* dunno about this type, please change/add */
124 typedef OLEOPT_UPDATE* LPOLEOPT_UPDATE;
126 typedef enum {
127 OLE_NONE, /* none */
128 OLE_DELETE, /* delete object */
129 OLE_LNKPASTE, /* link paste */
130 OLE_EMBPASTE, /* paste(and update) */
131 OLE_SHOW,
132 OLE_RUN,
133 OLE_ACTIVATE,
134 OLE_UPDATE,
135 OLE_CLOSE,
136 OLE_RECONNECT,
137 OLE_SETUPDATEOPTIONS,
138 OLE_SERVERRUNLAUNCH, /* unlaunch (terminate?) server */
139 OLE_LOADFROMSTREAM, /* (auto reconnect) */
140 OLE_SETDATA, /* OleSetData */
141 OLE_REQUESTDATA, /* OleRequestData */
142 OLE_OTHER,
143 OLE_CREATE,
144 OLE_CREATEFROMTEMPLATE,
145 OLE_CREATELINKFROMFILE,
146 OLE_COPYFROMLNK,
147 OLE_CREATREFROMFILE,
148 OLE_CREATEINVISIBLE
149 } OLE_RELEASE_METHOD;
151 typedef struct _OLETARGETDEVICE {
152 UINT16 otdDeviceNameOffset;
153 UINT16 otdDriverNameOffset;
154 UINT16 otdPortNameOffset;
155 UINT16 otdExtDevmodeOffset;
156 UINT16 otdExtDevmodeSize;
157 UINT16 otdEnvironmentOffset;
158 UINT16 otdEnvironmentSize;
159 BYTE otdData[1];
160 /* ... */
161 } OLETARGETDEVICE;
163 typedef struct _OLESERVERDOC* LPOLESERVERDOC;
164 typedef struct _OLEOBJECT* LPOLEOBJECT;
165 typedef struct _OLECLIENT* LPOLECLIENT;
166 typedef struct _OLESERVERDOCVTBL {
167 OLESTATUS CALLBACK (*Save)(LPOLESERVERDOC);
168 OLESTATUS CALLBACK (*Close)(LPOLESERVERDOC);
169 OLESTATUS CALLBACK (*SetHostNames)(LPOLESERVERDOC,LPCOLESTR16,LPCOLESTR16);
170 OLESTATUS CALLBACK (*SetDocDimensions)(LPOLESERVERDOC,LPRECT16);
171 #ifdef __WINE__
172 /* GetObject is a WINELIB_NAME macro so it cannot be used in Wine itself */
173 OLESTATUS CALLBACK (*pGetObject)(LPOLESERVERDOC,LPCOLESTR16,LPOLEOBJECT*,LPOLECLIENT);
174 #else
175 OLESTATUS CALLBACK (*GetObject)(LPOLESERVERDOC,LPCOLESTR16,LPOLEOBJECT*,LPOLECLIENT);
176 #endif
177 OLESTATUS CALLBACK (*Release)(LPOLESERVERDOC);
178 OLESTATUS CALLBACK (*SetColorScheme)(LPOLESERVERDOC,struct tagLOGPALETTE*);
179 OLESTATUS CALLBACK (*Execute)(LPOLESERVERDOC,HGLOBAL16);
180 } OLESERVERDOCVTBL;
181 typedef OLESERVERDOCVTBL* LPOLESERVERDOCVTBL;
182 typedef struct _OLESERVERDOC {
183 LPOLESERVERDOCVTBL lpvtbl;
184 /* server provided state info */
185 } OLESERVERDOC;
187 typedef struct _OLESERVER* LPOLESERVER;
188 typedef struct _OLESERVERVTBL {
189 OLESTATUS CALLBACK (*Open)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPOLESERVERDOC *);
190 OLESTATUS CALLBACK (*Create)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC*);
191 OLESTATUS CALLBACK (*CreateFromTemplate)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *);
192 OLESTATUS CALLBACK (*Edit)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *);
193 OLESTATUS CALLBACK (*Exit)(LPOLESERVER);
194 OLESTATUS CALLBACK (*Release)(LPOLESERVER);
195 OLESTATUS CALLBACK (*Execute)(LPOLESERVER);
196 } OLESERVERVTBL;
197 typedef OLESERVERVTBL *LPOLESERVERVTBL;
198 typedef struct _OLESERVER {
199 LPOLESERVERVTBL lpvtbl;
200 /* server specific data */
201 } OLESERVER;
202 typedef struct _OLECLIENTVTBL {
203 int CALLBACK (*CallBack)(LPOLECLIENT,OLE_NOTIFICATION,LPOLEOBJECT);
204 } OLECLIENTVTBL;
205 typedef OLECLIENTVTBL *LPOLECLIENTVTBL;
207 typedef struct _OLECLIENT {
208 LPOLECLIENTVTBL lpvtbl;
209 /* client data... */
210 } OLECLIENT;
212 struct _OLESTREAM;
214 typedef struct _OLEOBJECTVTBL {
215 void CALLBACK *(*QueryProtocol)(LPOLEOBJECT,LPCOLESTR16);
216 OLESTATUS CALLBACK (*Release)(LPOLEOBJECT);
217 OLESTATUS CALLBACK (*Show)(LPOLEOBJECT,BOOL16);
218 OLESTATUS CALLBACK (*DoVerb)(LPOLEOBJECT,UINT16,BOOL16,BOOL16);
219 OLESTATUS CALLBACK (*GetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE16 *);
220 OLESTATUS CALLBACK (*SetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE16);
221 OLESTATUS CALLBACK (*SetTargetDevice)(LPOLEOBJECT,HGLOBAL16);
222 OLESTATUS CALLBACK (*SetBounds)(LPOLEOBJECT,LPRECT16);
223 OLESTATUS CALLBACK (*EnumFormats)(LPOLEOBJECT,OLECLIPFORMAT);
224 OLESTATUS CALLBACK (*SetColorScheme)(LPOLEOBJECT,struct tagLOGPALETTE*);
225 OLESTATUS CALLBACK (*Delete)(LPOLEOBJECT);
226 OLESTATUS CALLBACK (*SetHostNames)(LPOLEOBJECT,LPCOLESTR16,LPCOLESTR16);
227 OLESTATUS CALLBACK (*SaveToStream)(LPOLEOBJECT,struct _OLESTREAM*);
228 OLESTATUS CALLBACK (*Clone)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *);
229 OLESTATUS CALLBACK (*CopyFromLink)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *);
230 OLESTATUS CALLBACK (*Equal)(LPOLEOBJECT,LPOLEOBJECT);
231 OLESTATUS CALLBACK (*CopyToClipBoard)(LPOLEOBJECT);
232 OLESTATUS CALLBACK (*Draw)(LPOLEOBJECT,HDC16,LPRECT16,LPRECT16,HDC16);
233 OLESTATUS CALLBACK (*Activate)(LPOLEOBJECT,UINT16,BOOL16,BOOL16,HWND16,LPRECT16);
234 OLESTATUS CALLBACK (*Execute)(LPOLEOBJECT,HGLOBAL16,UINT16);
235 OLESTATUS CALLBACK (*Close)(LPOLEOBJECT);
236 OLESTATUS CALLBACK (*Update)(LPOLEOBJECT);
237 OLESTATUS CALLBACK (*Reconnect)(LPOLEOBJECT);
238 OLESTATUS CALLBACK (*ObjectConvert)(LPOLEOBJECT,LPCOLESTR16,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT*);
239 OLESTATUS CALLBACK (*GetLinkUpdateOptions)(LPOLEOBJECT,LPOLEOPT_UPDATE);
240 OLESTATUS CALLBACK (*SetLinkUpdateOptions)(LPOLEOBJECT,OLEOPT_UPDATE);
241 OLESTATUS CALLBACK (*Rename)(LPOLEOBJECT,LPCOLESTR16);
242 OLESTATUS CALLBACK (*QueryName)(LPOLEOBJECT,LPSTR,LPUINT16);
243 OLESTATUS CALLBACK (*QueryType)(LPOLEOBJECT,LPLONG);
244 OLESTATUS CALLBACK (*QueryBounds)(LPOLEOBJECT,LPRECT16);
245 OLESTATUS CALLBACK (*QuerySize)(LPOLEOBJECT,LPDWORD);
246 OLESTATUS CALLBACK (*QueryOpen)(LPOLEOBJECT);
247 OLESTATUS CALLBACK (*QueryOutOfDate)(LPOLEOBJECT);
248 OLESTATUS CALLBACK (*QueryReleaseStatus)(LPOLEOBJECT);
249 OLESTATUS CALLBACK (*QueryReleaseError)(LPOLEOBJECT);
250 OLE_RELEASE_METHOD CALLBACK (*QueryReleaseMethod)(LPOLEOBJECT);
251 OLESTATUS CALLBACK (*RequestData)(LPOLEOBJECT,OLECLIPFORMAT);
252 OLESTATUS CALLBACK (*ObjectLong)(LPOLEOBJECT,UINT16,LPLONG);
253 } OLEOBJECTVTBL;
254 typedef OLEOBJECTVTBL* LPOLEOBJECTVTBL;
256 typedef struct _OLEOBJECT {
257 LPOLEOBJECTVTBL lpvtbl;
258 } OLEOBJECT;
261 typedef struct IMalloc16 IMalloc16,*LPMALLOC16;
263 #define ICOM_INTERFACE IMalloc16
264 #define IMalloc16_METHODS \
265 ICOM_METHOD1 (LPVOID,Alloc, DWORD,cb) \
266 ICOM_METHOD2 (LPVOID,Realloc, LPVOID,pv, DWORD,cb) \
267 ICOM_VMETHOD1( Free, LPVOID,pv) \
268 ICOM_METHOD1(DWORD, GetSize, LPVOID,pv) \
269 ICOM_METHOD1(INT16, DidAlloc, LPVOID,pv) \
270 ICOM_METHOD (LPVOID,HeapMinimize)
271 #define IMalloc16_IMETHODS \
272 IUnknown_IMETHODS \
273 IMalloc16_METHODS
274 ICOM_DEFINE(IMalloc16,IUnknown)
275 #undef ICOM_INTERFACE
277 /*** IUnknown methods ***/
278 #define IMalloc16_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
279 #define IMalloc16_AddRef(p) ICOM_CALL (AddRef,p)
280 #define IMalloc16_Release(p) ICOM_CALL (Release,p)
281 /*** IMalloc16 methods ***/
282 #define IMalloc16_Alloc(p,a) ICOM_CALL1(Alloc,p,a)
283 #define IMalloc16_Realloc(p,a,b) ICOM_CALL2(Realloc,p,a,b)
284 #define IMalloc16_Free(p,a) ICOM_CALL1(Free,p,a)
285 #define IMalloc16_GetSize(p,a) ICOM_CALL1(GetSize,p,a)
286 #define IMalloc16_DidAlloc(p,a) ICOM_CALL1(DidAlloc,p,a)
287 #define IMalloc16_HeapMinimize(p) ICOM_CALL (HeapMinimize,p)
290 HRESULT WINAPI CoCreateStandardMalloc16(DWORD dwMemContext, LPMALLOC16* lpMalloc);
291 HRESULT WINAPI CoGetMalloc16(DWORD dwMemContext,LPMALLOC16* lpMalloc);
292 HRESULT WINAPI CoInitialize16(LPVOID lpReserved);
293 HRESULT WINAPI CoLockObjectExternal16(LPUNKNOWN,BOOL16,BOOL16);
294 HRESULT WINAPI CoRegisterClassObject16(REFCLSID,LPUNKNOWN,DWORD,DWORD,LPDWORD);
295 void WINAPI CoUninitialize16(void);
296 HRESULT WINAPI DoDragDrop16(LPDATAOBJECT,LPDROPSOURCE,DWORD,DWORD*);
297 OLESTATUS WINAPI OleRegisterServer16(LPCSTR,LPOLESERVER,LHSERVER *,HINSTANCE16,OLE_SERVER_USE);
298 OLESTATUS WINAPI OleUnblockServer16(LHSERVER,BOOL16 *);
299 OLESTATUS WINAPI OleRegisterServerDoc16(LHSERVER,LPCSTR,LPOLESERVERDOC,LHSERVERDOC *);
300 OLESTATUS WINAPI OleRegisterClientDoc16(LPCSTR,LPCSTR,LONG,LHCLIENTDOC *);
301 OLESTATUS WINAPI OleRenameClientDoc16(LHCLIENTDOC,LPCSTR);
302 OLESTATUS WINAPI OleRevokeServerDoc16(LHSERVERDOC);
303 OLESTATUS WINAPI OleRevokeClientDoc16(LHCLIENTDOC);
304 OLESTATUS WINAPI OleRevokeServer16(LHSERVER);
305 OLESTATUS WINAPI OleRevertClientDoc16(LHCLIENTDOC hServerDoc);
306 OLESTATUS WINAPI OleEnumObjects16(LHCLIENTDOC hServerDoc, SEGPTR data);
307 OLESTATUS WINAPI OleCreateLinkFromClip16(LPCSTR,SEGPTR,LHCLIENTDOC,LPCSTR,SEGPTR,UINT16,UINT16);
308 OLESTATUS WINAPI OleQueryLinkFromClip16(LPCSTR name, UINT16 render, UINT16 clipformat);
309 OLESTATUS WINAPI OleQueryCreateFromClip16(LPCSTR name, UINT16 render, UINT16 clipformat);
310 OLESTATUS WINAPI OleQueryType16(LPOLEOBJECT oleob, SEGPTR xlong);
311 OLESTATUS WINAPI OleCreateFromClip16(LPCSTR,SEGPTR,LHCLIENTDOC,LPCSTR,SEGPTR,UINT16,UINT16);
312 HRESULT WINAPI RegisterDragDrop16(HWND16,LPDROPTARGET);
313 HRESULT WINAPI RevokeDragDrop16(HWND16);
315 BSTR16 WINAPI SysAllocString16(LPCOLESTR16);
316 INT16 WINAPI SysReAllocString16(LPBSTR16,LPCOLESTR16);
317 VOID WINAPI SysFreeString16(BSTR16);
318 BSTR16 WINAPI SysAllocStringLen16(const char*, int);
319 int WINAPI SysReAllocStringLen16(BSTR16*, const char*, int);
320 int WINAPI SysStringLen16(BSTR16);
322 #ifdef __cplusplus
323 } /*extern*/
324 #endif
326 #endif /* __WINE_OLE_H */