Skip queue cleanups if queue has been destroyed already.
[wine] / include / ole.h
1 /*
2  *      ole.h   -       Declarations for OLESVR and OLECLI
3  */
4
5 #ifndef __WINE_OLE_H
6 #define __WINE_OLE_H
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
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"
20
21 struct tagLOGPALETTE;
22
23 /* object types */
24 #define OT_LINK         1
25 #define OT_EMBEDDED     2
26 #define OT_STATIC       3
27
28 /* activate verbs */
29 #define OLEVERB_PRIMARY 0
30
31 typedef enum
32 {
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;
91
92 typedef enum {
93         OLE_SERVER_MULTI,
94         OLE_SERVER_SINGLE
95 } OLE_SERVER_USE;
96
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;
106
107 typedef enum {
108         olerender_none,
109         olerender_draw,
110         olerender_format
111 } OLEOPT_RENDER;
112
113 typedef enum {
114         oleupdate_always,
115         oleupdate_onsave,
116         oleupdate_oncall,
117         oleupdate_onclose
118 } OLEOPT_UPDATE;
119
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;
125
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;
150
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;
162
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;
186
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;
206
207 typedef struct _OLECLIENT {
208         LPOLECLIENTVTBL lpvtbl;
209         /* client data... */
210 } OLECLIENT;
211
212 struct _OLESTREAM;
213
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;
255
256 typedef struct _OLEOBJECT {
257         LPOLEOBJECTVTBL lpvtbl;
258 } OLEOBJECT;
259
260 #ifdef __cplusplus
261 } /*extern*/
262 #endif
263
264 #endif  /* __WINE_OLE_H */