457d060858e51589bfacac3bee68e329228e6699
[gpgol.git] / src / myexchext.h
1 /* myexchext.h - Simple replacement for exchext.h
2
3  * This file defines the interface used by Exchange extensions.  It
4  * has been compiled by g10 Code GmbH from several sources describing
5  * the interface.
6  *
7  * Revisions:
8  * 2005-08-12  Initial version.
9  * 2005-09-18  Add IExchExtAttachedFileEvents.
10  * 2007-07-18  Add IExchExtUserEvents and IExchExtSessionEvents.
11  * 2007-07-20  Add IOutlookExtItemEvents.
12  */
13
14 #ifndef EXCHEXT_H
15 #define EXCHEXT_H
16
17 #ifdef __cplusplus
18 extern "C" {
19 #if 0
20 }
21 #endif
22 #endif
23
24 #include <commctrl.h>
25 #include <unknwn.h>
26 #include "mymapi.h"
27
28
29 /* Constants used by Install. */
30 #define EECONTEXT_SESSION               0x00000001
31 #define EECONTEXT_VIEWER                0x00000002
32 #define EECONTEXT_REMOTEVIEWER          0x00000003
33 #define EECONTEXT_SEARCHVIEWER          0x00000004
34 #define EECONTEXT_ADDRBOOK              0x00000005
35 #define EECONTEXT_SENDNOTEMESSAGE       0x00000006
36 #define EECONTEXT_READNOTEMESSAGE       0x00000007
37 #define EECONTEXT_SENDPOSTMESSAGE       0x00000008
38 #define EECONTEXT_READPOSTMESSAGE       0x00000009
39 #define EECONTEXT_READREPORTMESSAGE     0x0000000A
40 #define EECONTEXT_SENDRESENDMESSAGE     0x0000000B
41 #define EECONTEXT_PROPERTYSHEETS        0x0000000C
42 #define EECONTEXT_ADVANCEDCRITERIA      0x0000000D
43 #define EECONTEXT_TASK                  0x0000000E
44
45 /* Constants for GetVersion. */
46 #define EECBGV_GETBUILDVERSION          0x00000001
47 #define EECBGV_GETACTUALVERSION         0x00000002
48 #define EECBGV_GETVIRTUALVERSION        0x00000004
49 #define EECBGV_BUILDVERSION_MAJOR       0x000d0000
50 #define EECBGV_BUILDVERSION_MAJOR_MASK  0xffff0000
51 #define EECBGV_BUILDVERSION_MINOR_MASK  0x0000ffff
52
53 /* Some toolbar IDs. */
54 #define EETBID_STANDARD                 0x00000001
55
56 /* Constants use for QueryHelpText. */
57 #define EECQHT_STATUS                   0x00000001
58 #define EECQHT_TOOLTIP                  0x00000002
59
60 /* Flags use by the methods of IExchExtPropertySheets.  */
61 #define EEPS_MESSAGE                    0x00000001
62 #define EEPS_FOLDER                     0x00000002
63 #define EEPS_STORE                      0x00000003
64 #define EEPS_TOOLSOPTIONS               0x00000004
65
66 /* Flags used by OnFooComplete. */
67 #define EEME_FAILED                     0x00000001
68 #define EEME_COMPLETE_FAILED            0x00000002
69
70
71 /* Command IDs. */
72 #define EECMDID_ToolsCustomizeToolbar          134
73 #define EECMDID_ToolsOptions                   136
74
75
76 /* Flag values for IExchExtAttachedFileEvents::OpenSzFile. */
77 #define EEAFE_OPEN         (0x00000001)
78 #define EEAFE_PRINT        (0x00000002)
79 #define EEAFE_QUICKVIEW    (0x00000003)
80
81
82
83 /* GUIDs */
84 DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
85
86 DEFINE_OLEGUID(IID_IUnknown,                  0x00000000, 0, 0);
87 DEFINE_OLEGUID(IID_IDispatch,                 0x00020400, 0, 0);
88
89 DEFINE_OLEGUID(IID_IExchExtCallback,          0x00020d10, 0, 0);
90 DEFINE_OLEGUID(IID_IExchExt,                  0x00020d11, 0, 0);
91 DEFINE_OLEGUID(IID_IExchExtCommands,          0x00020d12, 0, 0);
92 DEFINE_OLEGUID(IID_IExchExtUserEvents,        0x00020d13, 0, 0);
93 DEFINE_OLEGUID(IID_IExchExtSessionEvents,     0x00020d14, 0, 0);
94 DEFINE_OLEGUID(IID_IExchExtMessageEvents,     0x00020d15, 0, 0);
95 DEFINE_OLEGUID(IID_IExchExtAttachedFileEvents,0x00020d16, 0, 0);
96 DEFINE_OLEGUID(IID_IExchExtPropertySheets,    0x00020d17, 0, 0);
97 DEFINE_OLEGUID(IID_IExchExtAdvancedCriteria,  0x00020d18, 0, 0);
98 DEFINE_OLEGUID(IID_IExchExtModeless,          0x00020d19, 0, 0);
99 DEFINE_OLEGUID(IID_IExchExtModelessCallback,  0x00020d1a, 0, 0);
100 DEFINE_OLEGUID(IID_IOutlookExtCallback,       0x0006720d, 0, 0);
101 DEFINE_OLEGUID(IID_IOutlookExtItemEvents,     0x0006723A, 0, 0);
102
103
104 /* Type definitions. */
105
106 /* Parameters for the toolbar entries for
107    IExchExtCommands::InstallCommands. */
108 struct TBENTRY
109 {
110   HWND hwnd;
111   ULONG tbid;
112   ULONG ulFlags;
113   UINT itbbBase;
114 };
115 typedef struct TBENTRY TBENTRY;
116 typedef struct TBENTRY *LPTBENTRY;
117
118
119
120
121
122 \f
123 /**** Class declarations.  ***/
124 typedef struct IExchExt IExchExt;
125 typedef IExchExt *LPEXCHEXT;
126
127 typedef struct IExchExtUserEvents IExchExtUserEvents;
128 typedef IExchExtUserEvents *LPEXCHEXTUSEREVENTS;
129
130 typedef struct IExchExtSessionEvents IExchExtSessionEvents;
131 typedef IExchExtSessionEvents *LPEXCHEXTSESSIONEVENTS;
132
133 typedef struct IExchExtMessageEvents IExchExtMessageEvents;
134 typedef IExchExtMessageEvents *LPEXCHEXTMESSAGEEVENTS;
135
136 typedef struct IExchExtCommands IExchExtCommands;
137 typedef IExchExtCommands *LPEXCHEXTCOMMANDS;
138
139 typedef struct IExchExtPropertySheets IExchExtPropertySheets;
140 typedef IExchExtPropertySheets *LPEXCHEXTPROPERTYSHEETS;
141
142 typedef struct IExchExtCallback IExchExtCallback;
143 typedef IExchExtCallback *LPEXCHEXTCALLBACK;
144
145 typedef struct IExchExtAttachedFileEvents IExchExtAttachedFileEvents;
146 typedef IExchExtAttachedFileEvents *LPEXCHEXTATTACHEDFILEEVENTS;
147
148 typedef struct IOutlookExtCallback IOutlookExtCallback;
149 typedef IOutlookExtCallback *LPOUTLOOKEXTCALLBACK;
150
151 typedef struct IOutlookExtItemEvents IOutlookExtItemEvents;
152 typedef IOutlookExtItemEvents *LPOUTLOOKEXTITEMEVENTS;
153
154
155 /* The next classes are not yet defined. but if so they should go here. */
156 typedef struct IExchExtModeless IExchExtModeless; 
157 typedef IExchExtModeless *LPEXCHEXTMODELESS;
158 typedef struct IExchExtModelessCallback IExchExtModelessCallback;
159 typedef IExchExtModelessCallback *LPEXCHEXTMODELESSCALLBACK;
160
161
162
163
164 /*** Class declarations of classes defined elsewhere. ***/
165 struct IMAPISession;
166 typedef struct IMAPISession *LPMAPISESSION;
167
168 struct IAddrBook;
169 typedef struct IAddrBook *LPADRBOOK;
170
171 struct IMAPIFolder;
172 typedef struct IMAPIFolder *LPMAPIFOLDER;
173
174 struct IMAPIProp;
175 typedef struct IMAPIProp *LPMAPIPROP;
176
177 struct IPersistMessage;
178 typedef struct IPersistMessage *LPPERSISTMESSAGE;
179
180 struct IMAPIMessageSite;
181 typedef struct IMAPIMessageSite *LPMAPIMESSAGESITE;
182
183 struct IMAPIViewContext;
184 typedef struct IMAPIViewContext *LPMAPIVIEWCONTEXT;
185
186
187
188 /*** Types derived from the above class definitions. ***/
189
190 /* Callback used to load an extension. */
191 typedef LPEXCHEXT (CALLBACK *LPFNEXCHEXTENTRY)(void);
192
193 /* Parameters for the IExchExtCallback::ChooseFolder. */
194 typedef UINT (STDAPICALLTYPE *LPEECFHOOKPROC)(HWND, UINT, WPARAM, LPARAM);
195
196 struct EXCHEXTCHOOSEFOLDER
197 {
198   UINT cbLength;
199   HWND hwnd;
200   LPTSTR szCaption;
201   LPTSTR szLabel;
202   LPTSTR szHelpFile;
203   ULONG ulHelpID;
204   HINSTANCE hinst;
205   UINT uiDlgID;
206   LPEECFHOOKPROC lpeecfhp;
207   DWORD dwHookData;
208   ULONG ulFlags;
209   LPMDB pmdb;
210   LPMAPIFOLDER pfld;
211   LPTSTR szName;
212   DWORD dwReserved1;
213   DWORD dwReserved2;
214   DWORD dwReserved3;
215 };
216 typedef struct EXCHEXTCHOOSEFOLDER EXCHEXTCHOOSEFOLDER;
217 typedef struct EXCHEXTCHOOSEFOLDER *LPEXCHEXTCHOOSEFOLDER;
218
219
220
221
222 /**** Class definitions.  ***/
223
224 EXTERN_C const IID IID_IExchExt;
225 #undef INTERFACE
226 #define INTERFACE IExchExt
227 DECLARE_INTERFACE_(IExchExt, IUnknown)
228 {
229   /*** IUnknown methods. ***/
230   STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
231   STDMETHOD_(ULONG, AddRef)(THIS) PURE;
232   STDMETHOD_(ULONG, Release)(THIS) PURE;
233
234   /*** IExchExt methods. ***/
235   STDMETHOD(Install)(THIS_ LPEXCHEXTCALLBACK, ULONG, ULONG) PURE;
236 };
237
238
239
240 EXTERN_C const IID IID_IExchExtUserEvents;
241 #undef INTERFACE
242 #define INTERFACE IExchExtUserEvents
243 DECLARE_INTERFACE_(IExchExtUserEvents, IUnknown)
244 {
245   /*** IUnknown methods. ***/
246   STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
247   STDMETHOD_(ULONG, AddRef)(THIS) PURE;
248   STDMETHOD_(ULONG, Release)(THIS) PURE;
249
250   /*** IExchExtUserEvents methods. ***/
251   STDMETHOD_(void, OnSelectionChange)(THIS_ LPEXCHEXTCALLBACK) PURE;
252   STDMETHOD_(void, OnObjectChange)(THIS_ LPEXCHEXTCALLBACK) PURE;
253 };
254
255
256
257 EXTERN_C const IID IID_IExchExtSessionEvents;
258 #undef INTERFACE
259 #define INTERFACE IExchExtSessionEvents
260 DECLARE_INTERFACE_(IExchExtSessionEvents, IUnknown)
261 {
262   /*** IUnknown methods. ***/
263   STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
264   STDMETHOD_(ULONG, AddRef)(THIS) PURE;
265   STDMETHOD_(ULONG, Release)(THIS) PURE;
266
267   /*** IExchExtSessionEvents methods. ***/
268   STDMETHOD(OnDelivery)(THIS_ LPEXCHEXTCALLBACK) PURE;
269 };
270
271
272
273 EXTERN_C const IID IID_IExchExtMessageEvents;
274 #undef INTERFACE
275 #define INTERFACE IExchExtMessageEvents
276 DECLARE_INTERFACE_(IExchExtMessageEvents, IUnknown)
277 {
278   /*** IUnknown methods. ***/
279   STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
280   STDMETHOD_(ULONG, AddRef)(THIS) PURE;
281   STDMETHOD_(ULONG, Release)(THIS) PURE;
282
283   /*** IExchExtMessageEvents methods. ***/
284   STDMETHOD(OnRead)(THIS_ LPEXCHEXTCALLBACK) PURE;
285   STDMETHOD(OnReadComplete)(THIS_ LPEXCHEXTCALLBACK, ULONG) PURE;
286   STDMETHOD(OnWrite)(THIS_ LPEXCHEXTCALLBACK) PURE;
287   STDMETHOD(OnWriteComplete)(THIS_ LPEXCHEXTCALLBACK, ULONG) PURE;
288   STDMETHOD(OnCheckNames)(THIS_ LPEXCHEXTCALLBACK) PURE;
289   STDMETHOD(OnCheckNamesComplete)(THIS_ LPEXCHEXTCALLBACK, ULONG) PURE;
290   STDMETHOD(OnSubmit)(THIS_ LPEXCHEXTCALLBACK) PURE;
291   STDMETHOD_(void, OnSubmitComplete)(THIS_ LPEXCHEXTCALLBACK, ULONG) PURE;
292 };
293
294
295
296 EXTERN_C const IID IID_IExchExtCommands;
297 #undef INTERFACE
298 #define INTERFACE IExchExtCommands
299 DECLARE_INTERFACE_(IExchExtCommands, IUnknown)
300 {
301   /*** IUnknown methods. ***/
302   STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
303   STDMETHOD_(ULONG, AddRef)(THIS) PURE;
304   STDMETHOD_(ULONG, Release)(THIS) PURE;
305
306   /*** IExchExtCommands methods. ***/
307   STDMETHOD(InstallCommands)(THIS_ LPEXCHEXTCALLBACK, HWND, HMENU,
308                              UINT*, LPTBENTRY, UINT, ULONG) PURE;
309   STDMETHOD_(void, InitMenu)(THIS_ LPEXCHEXTCALLBACK) PURE;
310   STDMETHOD(DoCommand)(THIS_ LPEXCHEXTCALLBACK, UINT) PURE;
311   STDMETHOD(Help)(THIS_ LPEXCHEXTCALLBACK, UINT) PURE;
312   STDMETHOD(QueryHelpText)(THIS_ UINT, ULONG, LPTSTR, UINT) PURE;
313   STDMETHOD(QueryButtonInfo)(THIS_ ULONG, UINT, LPTBBUTTON,
314                              LPTSTR, UINT, ULONG) PURE;
315   STDMETHOD(ResetToolbar)(THIS_ ULONG, ULONG) PURE;
316 };
317
318
319
320 EXTERN_C const IID IID_IExchExtPropertySheets;
321 #undef INTERFACE
322 #define INTERFACE IExchExtPropertySheets
323 DECLARE_INTERFACE_(IExchExtPropertySheets, IUnknown)
324 {
325   /*** IUnknown methods. ***/
326   STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
327   STDMETHOD_(ULONG, AddRef)(THIS) PURE;
328   STDMETHOD_(ULONG, Release)(THIS) PURE;
329
330   /*** IExchExtPropertySheet methods. ***/
331   STDMETHOD_(ULONG, GetMaxPageCount)(THIS_ ULONG) PURE;
332   STDMETHOD(GetPages)(THIS_ LPEXCHEXTCALLBACK, ULONG,
333                       LPPROPSHEETPAGE, ULONG*) PURE;
334   STDMETHOD_(void, FreePages)(THIS_ LPPROPSHEETPAGE, ULONG, ULONG) PURE;
335 };
336
337
338
339 EXTERN_C const IID IID_IExchExtCallback;
340 #undef INTERFACE
341 #define INTERFACE IExchExtCallback
342 DECLARE_INTERFACE_(IExchExtCallback, IUnknown)
343 {
344   /*** IUnknown methods. ***/
345   STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
346   STDMETHOD_(ULONG, AddRef)(THIS) PURE;
347   STDMETHOD_(ULONG, Release)(THIS) PURE;
348
349   /*** IExchExtCallback methods. ***/
350   STDMETHOD(GetVersion)(THIS_ ULONG*, ULONG) PURE;
351   STDMETHOD(GetWindow)(THIS_ HWND*) PURE;
352   STDMETHOD(GetMenu)(THIS_ HMENU*) PURE;
353   STDMETHOD(GetToolbar)(THIS_ ULONG, HWND*) PURE;
354   STDMETHOD(GetSession)(THIS_ LPMAPISESSION*, LPADRBOOK*) PURE;
355   STDMETHOD(GetObject)(THIS_ LPMDB*, LPMAPIPROP*) PURE;
356   STDMETHOD(GetSelectionCount)(THIS_ ULONG*) PURE;
357   STDMETHOD(GetSelectionItem)(THIS_ ULONG, ULONG*, LPENTRYID*, ULONG*,
358                               LPTSTR, ULONG, ULONG*, ULONG) PURE;
359   STDMETHOD(GetMenuPos)(THIS_ ULONG, HMENU*, ULONG*, ULONG*, ULONG) PURE;
360   STDMETHOD(GetSharedExtsDir)(THIS_ LPTSTR, ULONG, ULONG) PURE;
361   STDMETHOD(GetRecipients)(THIS_ LPADRLIST*) PURE;
362   STDMETHOD(SetRecipients)(THIS_ LPADRLIST) PURE;
363   STDMETHOD(GetNewMessageSite)(THIS_ ULONG, LPMAPIFOLDER, LPPERSISTMESSAGE,
364                                LPMESSAGE*, LPMAPIMESSAGESITE*,
365                                LPMAPIVIEWCONTEXT*, ULONG) PURE;
366   STDMETHOD(RegisterModeless)(THIS_ LPEXCHEXTMODELESS,
367                               LPEXCHEXTMODELESSCALLBACK*) PURE;
368   STDMETHOD(ChooseFolder)(THIS_ LPEXCHEXTCHOOSEFOLDER) PURE;
369 };
370
371
372
373 EXTERN_C const IID IID_IExchExtAttachedFileEvents;
374 #undef INTERFACE
375 #define INTERFACE  IExchExtAttachedFileEvents
376 DECLARE_INTERFACE_(IExchExtAttachedFileEvents, IUnknown)
377 {
378   /*** IUnknown methods ***/
379   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * lppvObj) PURE;
380   STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
381   STDMETHOD_(ULONG,Release) (THIS) PURE;
382   
383   /*** IExchExtAttachedFileEvents methods ***/
384   STDMETHOD(OnReadPattFromSzFile)(THIS_ LPATTACH lpatt, LPTSTR lpszFile,
385                                   ULONG ulFlags) PURE;
386   STDMETHOD(OnWritePattToSzFile)(THIS_ LPATTACH lpatt, LPTSTR lpszFile,
387                                  ULONG ulFlags) PURE;
388   STDMETHOD(QueryDisallowOpenPatt)(THIS_ LPATTACH lpatt) PURE;
389   STDMETHOD(OnOpenPatt)(THIS_ LPATTACH lpatt) PURE;
390   STDMETHOD(OnOpenSzFile)(THIS_ LPTSTR lpszFile, ULONG ulFlags) PURE;
391 };
392
393
394
395 EXTERN_C const IID IID_IOutlookExtCallback;
396 #undef INTERFACE
397 #define INTERFACE IOutlookExtCallback
398 DECLARE_INTERFACE_(IOutlookExtCallback, IUnknown)
399 {
400   /*** IUnknown methods. ***/
401   STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
402   STDMETHOD_(ULONG, AddRef)(THIS) PURE;
403   STDMETHOD_(ULONG, Release)(THIS) PURE;
404
405   /*** IOutlookExtCallback.  **/
406   STDMETHOD(GetObject)(LPUNKNOWN *ppunk);
407   STDMETHOD(GetOfficeCharacter)(void **ppmsotfc);
408 };
409
410
411
412 EXTERN_C const IID IID_IOutlookExtItemEvents;
413 #undef INTERFACE
414 #define INTERFACE  IOutlookExtItemEvents
415 DECLARE_INTERFACE_(IOutlookExtItemEvents, IUnknown)
416 {
417   /*** IUnknown methods ***/
418   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * lppvObj) PURE;
419   STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
420   STDMETHOD_(ULONG,Release) (THIS) PURE;
421
422   /*** IOutlookExtItemEvents ***/
423   STDMETHOD(OnOpen)(THIS_ LPEXCHEXTCALLBACK) PURE;
424   STDMETHOD(OnOpenComplete)(THIS_ LPEXCHEXTCALLBACK, ULONG) PURE;
425   STDMETHOD(OnClose)(THIS_ LPEXCHEXTCALLBACK, ULONG) PURE;
426   STDMETHOD(OnCloseComplete)(THIS_ LPEXCHEXTCALLBACK, ULONG) PURE;
427 };
428
429
430 #ifdef __cplusplus
431 }
432 #endif
433
434 #endif /*EXCHEXT.h*/