Add a few more 32->16 Escape conversions.
[wine.git] / include / ole.h
blob45b887930b4d3443d198fbbdde2fabfc4b77cab6
1 /*
2 * ole.h - Declarations for OLESVR and OLECLI
3 */
5 #ifndef __WINE_OLE_H
6 #define __WINE_OLE_H
8 #include "wingdi.h" /* LOGPALETTE */
10 /* FIXME: we need to include wtypes.h mainly, it seems, because we need BSTR.
11 * Normally none of the APIs in ole.h depend on it. It is most likey that they should
12 * be moved to ole2.h (which includes objbase.h and thus wtypes.h) or some other
13 * OLE include
15 #include "wtypes.h"
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
21 /* object types */
22 #define OT_LINK 1
23 #define OT_EMBEDDED 2
24 #define OT_STATIC 3
26 /* activate verbs */
27 #define OLEVERB_PRIMARY 0
29 typedef enum
31 OLE_OK,
32 OLE_WAIT_FOR_RELEASE,
33 OLE_BUSY,
34 OLE_ERROR_PROTECT_ONLY,
35 OLE_ERROR_MEMORY,
36 OLE_ERROR_STREAM,
37 OLE_ERROR_STATIC,
38 OLE_ERROR_BLANK,
39 OLE_ERROR_DRAW,
40 OLE_ERROR_METAFILE,
41 OLE_ERROR_ABORT,
42 OLE_ERROR_CLIPBOARD,
43 OLE_ERROR_FORMAT,
44 OLE_ERROR_OBJECT,
45 OLE_ERROR_OPTION,
46 OLE_ERROR_PROTOCOL,
47 OLE_ERROR_ADDRESS,
48 OLE_ERROR_NOT_EQUAL,
49 OLE_ERROR_HANDLE,
50 OLE_ERROR_GENERIC,
51 OLE_ERROR_CLASS,
52 OLE_ERROR_SYNTAX,
53 OLE_ERROR_DATATYPE,
54 OLE_ERROR_PALETTE,
55 OLE_ERROR_NOT_LINK,
56 OLE_ERROR_NOT_EMPTY,
57 OLE_ERROR_SIZE,
58 OLE_ERROR_DRIVE,
59 OLE_ERROR_NETWORK,
60 OLE_ERROR_NAME,
61 OLE_ERROR_TEMPLATE,
62 OLE_ERROR_NEW,
63 OLE_ERROR_EDIT,
64 OLE_ERROR_OPEN,
65 OLE_ERROR_NOT_OPEN,
66 OLE_ERROR_LAUNCH,
67 OLE_ERROR_COMM,
68 OLE_ERROR_TERMINATE,
69 OLE_ERROR_COMMAND,
70 OLE_ERROR_SHOW,
71 OLE_ERROR_DOVERB,
72 OLE_ERROR_ADVISE_NATIVE,
73 OLE_ERROR_ADVISE_PICT,
74 OLE_ERROR_ADVISE_RENAME,
75 OLE_ERROR_POKE_NATIVE,
76 OLE_ERROR_REQUEST_NATIVE,
77 OLE_ERROR_REQUEST_PICT,
78 OLE_ERROR_SERVER_BLOCKED,
79 OLE_ERROR_REGISTRATION,
80 OLE_ERROR_ALREADY_REGISTERED,
81 OLE_ERROR_TASK,
82 OLE_ERROR_OUTOFDATE,
83 OLE_ERROR_CANT_UPDATE_CLIENT,
84 OLE_ERROR_UPDATE,
85 OLE_ERROR_SETDATA_FORMAT,
86 OLE_ERROR_STATIC_FROM_OTHER_OS,
87 OLE_WARN_DELETE_DATA = 1000
88 } OLESTATUS;
90 typedef enum {
91 OLE_SERVER_MULTI,
92 OLE_SERVER_SINGLE
93 } OLE_SERVER_USE;
95 typedef enum {
96 OLE_CHANGED,
97 OLE_SAVED,
98 OLE_CLOSED,
99 OLE_RENAMED,
100 OLE_QUERY_PAINT,
101 OLE_RELEASE,
102 OLE_QUERY_RETRY
103 } OLE_NOTIFICATION;
105 typedef enum {
106 olerender_none,
107 olerender_draw,
108 olerender_format
109 } OLEOPT_RENDER;
111 typedef enum {
112 oleupdate_always,
113 oleupdate_onsave,
114 oleupdate_oncall,
115 oleupdate_onclose
116 } OLEOPT_UPDATE;
118 typedef LONG LHSERVER;
119 typedef LONG LHSERVERDOC;
120 typedef LONG LHCLIENTDOC;
121 typedef LONG OLECLIPFORMAT;/* dunno about this type, please change/add */
122 typedef OLEOPT_UPDATE* LPOLEOPT_UPDATE;
124 typedef enum {
125 OLE_NONE, /* none */
126 OLE_DELETE, /* delete object */
127 OLE_LNKPASTE, /* link paste */
128 OLE_EMBPASTE, /* paste(and update) */
129 OLE_SHOW,
130 OLE_RUN,
131 OLE_ACTIVATE,
132 OLE_UPDATE,
133 OLE_CLOSE,
134 OLE_RECONNECT,
135 OLE_SETUPDATEOPTIONS,
136 OLE_SERVERRUNLAUNCH, /* unlaunch (terminate?) server */
137 OLE_LOADFROMSTREAM, /* (auto reconnect) */
138 OLE_SETDATA, /* OleSetData */
139 OLE_REQUESTDATA, /* OleRequestData */
140 OLE_OTHER,
141 OLE_CREATE,
142 OLE_CREATEFROMTEMPLATE,
143 OLE_CREATELINKFROMFILE,
144 OLE_COPYFROMLNK,
145 OLE_CREATREFROMFILE,
146 OLE_CREATEINVISIBLE
147 } OLE_RELEASE_METHOD;
149 typedef struct _OLETARGETDEVICE {
150 UINT16 otdDeviceNameOffset;
151 UINT16 otdDriverNameOffset;
152 UINT16 otdPortNameOffset;
153 UINT16 otdExtDevmodeOffset;
154 UINT16 otdExtDevmodeSize;
155 UINT16 otdEnvironmentOffset;
156 UINT16 otdEnvironmentSize;
157 BYTE otdData[1];
158 /* ... */
159 } OLETARGETDEVICE;
160 typedef struct _OLESTREAM* LPOLESTREAM;
161 typedef struct _OLESTREAMVTBL {
162 DWORD (CALLBACK *Get)(LPOLESTREAM,LPSTR,DWORD);
163 DWORD (CALLBACK *Put)(LPOLESTREAM,LPSTR,DWORD);
164 } OLESTREAMVTBL;
165 typedef OLESTREAMVTBL* LPOLESTREAMVTBL;
166 typedef struct _OLESTREAM {
167 LPOLESTREAMVTBL lpstbl;
168 } OLESTREAM;
169 typedef struct _OLESERVERDOC* LPOLESERVERDOC;
170 typedef struct _OLEOBJECT* LPOLEOBJECT;
171 typedef struct _OLECLIENT* LPOLECLIENT;
172 typedef struct _OLESERVERDOCVTBL {
173 OLESTATUS (CALLBACK *Save)(LPOLESERVERDOC);
174 OLESTATUS (CALLBACK *Close)(LPOLESERVERDOC);
175 OLESTATUS (CALLBACK *SetHostNames)(LPOLESERVERDOC,LPCOLESTR16,LPCOLESTR16);
176 OLESTATUS (CALLBACK *SetDocDimensions)(LPOLESERVERDOC,LPRECT16);
177 #ifdef __WINE__
178 /* GetObject is a WINELIB_NAME macro so it cannot be used in Wine itself */
179 OLESTATUS (CALLBACK *pGetObject)(LPOLESERVERDOC,LPCOLESTR16,LPOLEOBJECT*,LPOLECLIENT);
180 #else
181 OLESTATUS (CALLBACK *GetObject)(LPOLESERVERDOC,LPCOLESTR16,LPOLEOBJECT*,LPOLECLIENT);
182 #endif
183 OLESTATUS (CALLBACK *Release)(LPOLESERVERDOC);
184 OLESTATUS (CALLBACK *SetColorScheme)(LPOLESERVERDOC,LPLOGPALETTE);
185 OLESTATUS (CALLBACK *Execute)(LPOLESERVERDOC,HGLOBAL16);
186 } OLESERVERDOCVTBL;
187 typedef OLESERVERDOCVTBL* LPOLESERVERDOCVTBL;
188 typedef struct _OLESERVERDOC {
189 LPOLESERVERDOCVTBL lpvtbl;
190 /* server provided state info */
191 } OLESERVERDOC;
193 typedef struct _OLESERVER* LPOLESERVER;
194 typedef struct _OLESERVERVTBL {
195 OLESTATUS (CALLBACK *Open)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPOLESERVERDOC *);
196 OLESTATUS (CALLBACK *Create)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC*);
197 OLESTATUS (CALLBACK *CreateFromTemplate)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *);
198 OLESTATUS (CALLBACK *Edit)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *);
199 OLESTATUS (CALLBACK *Exit)(LPOLESERVER);
200 OLESTATUS (CALLBACK *Release)(LPOLESERVER);
201 OLESTATUS (CALLBACK *Execute)(LPOLESERVER);
202 } OLESERVERVTBL;
203 typedef OLESERVERVTBL *LPOLESERVERVTBL;
204 typedef struct _OLESERVER {
205 LPOLESERVERVTBL lpvtbl;
206 /* server specific data */
207 } OLESERVER;
208 typedef struct _OLECLIENTVTBL {
209 int (CALLBACK *CallBack)(LPOLECLIENT,OLE_NOTIFICATION,LPOLEOBJECT);
210 } OLECLIENTVTBL;
211 typedef OLECLIENTVTBL *LPOLECLIENTVTBL;
213 typedef struct _OLECLIENT {
214 LPOLECLIENTVTBL lpvtbl;
215 /* client data... */
216 } OLECLIENT;
218 typedef struct _OLEOBJECTVTBL {
219 void * (CALLBACK *QueryProtocol)(LPOLEOBJECT,LPCOLESTR16);
220 OLESTATUS (CALLBACK *Release)(LPOLEOBJECT);
221 OLESTATUS (CALLBACK *Show)(LPOLEOBJECT,BOOL16);
222 OLESTATUS (CALLBACK *DoVerb)(LPOLEOBJECT,UINT16,BOOL16,BOOL16);
223 OLESTATUS (CALLBACK *GetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE16 *);
224 OLESTATUS (CALLBACK *SetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE16);
225 OLESTATUS (CALLBACK *SetTargetDevice)(LPOLEOBJECT,HGLOBAL16);
226 OLESTATUS (CALLBACK *SetBounds)(LPOLEOBJECT,LPRECT16);
227 OLESTATUS (CALLBACK *EnumFormats)(LPOLEOBJECT,OLECLIPFORMAT);
228 OLESTATUS (CALLBACK *SetColorScheme)(LPOLEOBJECT,LPLOGPALETTE);
229 OLESTATUS (CALLBACK *Delete)(LPOLEOBJECT);
230 OLESTATUS (CALLBACK *SetHostNames)(LPOLEOBJECT,LPCOLESTR16,LPCOLESTR16);
231 OLESTATUS (CALLBACK *SaveToStream)(LPOLEOBJECT,LPOLESTREAM);
232 OLESTATUS (CALLBACK *Clone)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *);
233 OLESTATUS (CALLBACK *CopyFromLink)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *);
234 OLESTATUS (CALLBACK *Equal)(LPOLEOBJECT,LPOLEOBJECT);
235 OLESTATUS (CALLBACK *CopyToClipBoard)(LPOLEOBJECT);
236 OLESTATUS (CALLBACK *Draw)(LPOLEOBJECT,HDC16,LPRECT16,LPRECT16,HDC16);
237 OLESTATUS (CALLBACK *Activate)(LPOLEOBJECT,UINT16,BOOL16,BOOL16,HWND16,LPRECT16);
238 OLESTATUS (CALLBACK *Execute)(LPOLEOBJECT,HGLOBAL16,UINT16);
239 OLESTATUS (CALLBACK *Close)(LPOLEOBJECT);
240 OLESTATUS (CALLBACK *Update)(LPOLEOBJECT);
241 OLESTATUS (CALLBACK *Reconnect)(LPOLEOBJECT);
242 OLESTATUS (CALLBACK *ObjectConvert)(LPOLEOBJECT,LPCOLESTR16,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT*);
243 OLESTATUS (CALLBACK *GetLinkUpdateOptions)(LPOLEOBJECT,LPOLEOPT_UPDATE);
244 OLESTATUS (CALLBACK *SetLinkUpdateOptions)(LPOLEOBJECT,OLEOPT_UPDATE);
245 OLESTATUS (CALLBACK *Rename)(LPOLEOBJECT,LPCOLESTR16);
246 OLESTATUS (CALLBACK *QueryName)(LPOLEOBJECT,LPSTR,LPUINT16);
247 OLESTATUS (CALLBACK *QueryType)(LPOLEOBJECT,LPLONG);
248 OLESTATUS (CALLBACK *QueryBounds)(LPOLEOBJECT,LPRECT16);
249 OLESTATUS (CALLBACK *QuerySize)(LPOLEOBJECT,LPDWORD);
250 OLESTATUS (CALLBACK *QueryOpen)(LPOLEOBJECT);
251 OLESTATUS (CALLBACK *QueryOutOfDate)(LPOLEOBJECT);
252 OLESTATUS (CALLBACK *QueryReleaseStatus)(LPOLEOBJECT);
253 OLESTATUS (CALLBACK *QueryReleaseError)(LPOLEOBJECT);
254 OLE_RELEASE_METHOD (CALLBACK *QueryReleaseMethod)(LPOLEOBJECT);
255 OLESTATUS (CALLBACK *RequestData)(LPOLEOBJECT,OLECLIPFORMAT);
256 OLESTATUS (CALLBACK *ObjectLong)(LPOLEOBJECT,UINT16,LPLONG);
257 } OLEOBJECTVTBL;
258 typedef OLEOBJECTVTBL* LPOLEOBJECTVTBL;
260 typedef struct _OLEOBJECT {
261 LPOLEOBJECTVTBL lpvtbl;
262 } OLEOBJECT;
265 OLESTATUS WINAPI OleRegisterServer16(LPCSTR,LPOLESERVER,LHSERVER *,HINSTANCE16,OLE_SERVER_USE);
266 OLESTATUS WINAPI OleUnblockServer16(LHSERVER,BOOL16 *);
267 OLESTATUS WINAPI OleRegisterServerDoc16(LHSERVER,LPCSTR,LPOLESERVERDOC,LHSERVERDOC *);
268 OLESTATUS WINAPI OleRegisterClientDoc16(LPCSTR,LPCSTR,LONG,LHCLIENTDOC *);
269 OLESTATUS WINAPI OleRenameClientDoc16(LHCLIENTDOC,LPCSTR);
270 OLESTATUS WINAPI OleRevokeServerDoc16(LHSERVERDOC);
271 OLESTATUS WINAPI OleRevokeClientDoc16(LHCLIENTDOC);
272 OLESTATUS WINAPI OleRevokeServer16(LHSERVER);
273 OLESTATUS WINAPI OleRevertClientDoc16(LHCLIENTDOC hServerDoc);
274 OLESTATUS WINAPI OleEnumObjects16(LHCLIENTDOC hServerDoc, SEGPTR data);
275 OLESTATUS WINAPI OleCreateLinkFromClip16(
276 LPCSTR name, LPOLECLIENT olecli, LHCLIENTDOC hclientdoc, LPCSTR xname,
277 LPOLEOBJECT *lpoleob, UINT16 render, UINT16 clipformat);
278 OLESTATUS WINAPI OleQueryLinkFromClip16(LPCSTR name, UINT16 render, UINT16 clipformat);
279 OLESTATUS WINAPI OleQueryCreateFromClip16(LPCSTR name, UINT16 render, UINT16 clipformat);
280 OLESTATUS WINAPI OleQueryType16(LPOLEOBJECT oleob, SEGPTR xlong);
281 OLESTATUS WINAPI OleCreateFromClip16(
282 LPCSTR name, LPOLECLIENT olecli, LHCLIENTDOC hclientdoc, LPCSTR xname,
283 LPOLEOBJECT *lpoleob, UINT16 render, UINT16 clipformat);
285 /* com functions */
286 void WINAPI CoFreeUnusedLibraries(void);
287 HINSTANCE WINAPI CoLoadLibrary(LPSTR lpszLibName, BOOL bAutoFree);
288 void WINAPI CoFreeUnusedLibraries(void);
289 void WINAPI CoFreeAllLibraries(void);
291 #ifdef __cplusplus
292 } /*extern*/
293 #endif
295 #endif /* __WINE_OLE_H */