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