New code to install forms so that appropriate icons are shown in the Viewer.
[gpgol.git] / src / mymapi.h
1 /* mymapi.h - MAPI definitions required for GpgOL and Mingw32
2  * Copyright (C) 1998 Justin Bradford
3  * Copyright (C) 2000 Fran├žois Gouget
4  * Copyright (C) 2005, 2007 g10 Code GmbH
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, see <http://www.gnu.org/licenses/>.
18  */
19
20 /* This header has been put together from the mingw32 and Wine
21    headers.  The first were missing the MAPI definitions and the
22    latter one is not compatible to the first one.  We only declare
23    stuff we really need for this project.
24
25    Revisions:
26    2005-07-26  Initial version (wk at g10code).
27    2005-08-14  Tweaked for use with myexchext.h.
28    2007-07-19  Add IConverterSession.  Info taken from
29                  http://blogs.msdn.com/stephen_griffin/archive/2007/06/22/
30                  iconvertersession-do-you-converter-session.aspx
31    2007-07-23  More IConverterSession features.
32    2007-07-23  Add IMAPISession; taken from WINE.
33    2007-07-24  Add IMsgStore, IMAPIContainer and IMAPIFolder taken from specs.
34                Reorganized code.
35    2008-08-01  Add IMAPIFormContainer taken from specs.
36 */
37
38 #ifndef MAPI_H
39 #define MAPI_H
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 /* Some types */
46
47 #ifndef __LHANDLE
48 #define __LHANDLE
49 typedef unsigned long           LHANDLE, *LPLHANDLE;
50 #endif
51 #define lhSessionNull           ((LHANDLE)0)
52
53 typedef unsigned long           FLAGS;
54
55
56 typedef struct _MAPIUID
57 {
58     BYTE ab[sizeof(GUID)];
59 } MAPIUID, *LPMAPIUID;
60
61
62 struct MapiFileDesc_s
63 {
64   ULONG ulReserved;
65   ULONG flFlags;
66   ULONG nPosition;
67   LPSTR lpszPathName;
68   LPSTR lpszFileName;
69   LPVOID lpFileType;
70 };
71 typedef struct MapiFileDesc_s MapiFileDesc;
72 typedef struct MapiFileDesc_s *lpMapiFileDesc;
73
74 struct MapiRecipDesc_s
75 {
76   ULONG ulReserved;
77   ULONG ulRecipClass;
78   LPSTR lpszName;
79   LPSTR lpszAddress;
80   ULONG ulEIDSize;
81   LPVOID lpEntryID;
82 };
83 typedef struct MapiRecipDesc_s MapiRecipDesc;
84 typedef struct MapiRecipDesc_s *lpMapiRecipDesc;
85
86 struct MapiMessage_s
87 {
88   ULONG ulReserved;
89   LPSTR lpszSubject;
90   LPSTR lpszNoteText;
91   LPSTR lpszMessageType;
92   LPSTR lpszDateReceived;
93   LPSTR lpszConversationID;
94   FLAGS flFlags;
95   lpMapiRecipDesc lpOriginator;
96   ULONG nRecipCount;
97   lpMapiRecipDesc lpRecips;
98   ULONG nFileCount;
99   lpMapiFileDesc lpFiles;
100 };
101 typedef struct MapiMessage_s MapiMessage;
102 typedef struct MapiMessage_s *lpMapiMessage;
103
104
105 /* Error codes */
106 #define MAPI_E_NO_ACCESS                   E_ACCESSDENIED
107 #define MAPI_E_NOT_FOUND                   ((SCODE)0x8004010F)
108
109
110 /* Object types.  */
111 #define MAPI_STORE      0x00000001u
112 #define MAPI_ADDRBOOK   0x00000002u
113 #define MAPI_FOLDER     0x00000003u
114 #define MAPI_ABCONT     0x00000004u
115 #define MAPI_MESSAGE    0x00000005u
116 #define MAPI_MAILUSER   0x00000006u
117 #define MAPI_ATTACH     0x00000007u
118 #define MAPI_DISTLIST   0x00000008u
119 #define MAPI_PROFSECT   0x00000009u
120 #define MAPI_STATUS     0x0000000Au
121 #define MAPI_SESSION    0x0000000Bu
122 #define MAPI_FORMINFO   0x0000000Cu
123
124
125 /* MAPILogon */
126 #define MAPI_LOGON_UI           0x00000001
127 #define MAPI_PASSWORD_UI        0x00020000
128 #define MAPI_NEW_SESSION        0x00000002
129 #define MAPI_FORCE_DOWNLOAD     0x00001000
130 #define MAPI_EXTENDED           0x00000020
131
132
133 /* MAPISendMail */
134 #define MAPI_DIALOG             0x00000008
135
136
137 /* Flags for various calls */
138 #define MAPI_MODIFY                   0x00000001U /* Object can be modified. */
139 #define MAPI_CREATE                   0x00000002U
140 #define MAPI_ACCESS_MODIFY            MAPI_MODIFY /* Want write access. */
141 #define MAPI_ACCESS_READ              0x00000002U /* Want read access. */
142 #define MAPI_ACCESS_DELETE            0x00000004U /* Want delete access. */
143 #define MAPI_ACCESS_CREATE_HIERARCHY  0x00000008U
144 #define MAPI_ACCESS_CREATE_CONTENTS   0x00000010U
145 #define MAPI_ACCESS_CREATE_ASSOCIATED 0x00000020U
146 #define MAPI_UNICODE                  0x80000000U /* Strings in this
147                                                      call are Unicode. */
148
149 #define MAPI_DEFERRED_ERRORS          0x00000008ul
150 #define MAPI_BEST_ACCESS              0x00000010ul
151
152
153 #define MDB_NO_DIALOG                 0x00000001ul
154 #define MDB_WRITE                     0x00000004ul
155 #define MDB_TEMPORARY                 0x00000020ul
156 #define MDB_NO_MAIL                   0x00000080ul
157
158
159 #define ATTACH_BY_VALUE       1
160 #define ATTACH_BY_REFERENCE   2
161 #define ATTACH_BY_REF_RESOLVE 3
162 #define ATTACH_BY_REF_ONLY    4
163 #define ATTACH_EMBEDDED_MSG   5
164 #define ATTACH_OLE            6
165
166
167 #define KEEP_OPEN_READONLY            0x00000001
168 #define KEEP_OPEN_READWRITE           0x00000002
169 #define FORCE_SAVE                    0x00000004
170
171 #define SOF_UNIQUEFILENAME            0x80000000
172
173 #define RTF_SYNC_RTF_CHANGED          1
174 #define RTF_SYNC_BODY_CHANGED         2
175
176
177 #define FORCE_SUBMIT                  0x00000001ul
178
179 #define MSGFLAG_READ                  0x00000001ul
180 #define MSGFLAG_UNMODIFIED            0x00000002ul
181 #define MSGFLAG_SUBMIT                0x00000004ul
182 #define MSGFLAG_UNSENT                0x00000008ul
183 #define MSGFLAG_HASATTACH             0x00000010ul
184 #define MSGFLAG_FROMME                0x00000020ul
185 #define MSGFLAG_ASSOCIATED            0x00000040ul
186 #define MSGFLAG_RESEND                0x00000080ul
187 #define MSGFLAG_RN_PENDING            0x00000100ul
188 #define MSGFLAG_NRN_PENDING           0x00000200ul
189
190 #define SUBMITFLAG_LOCKED             0x00000001ul
191 #define SUBMITFLAG_PREPROCESS         0x00000002ul
192
193 #define HOOK_DELETE                   0x00000001ul
194 #define HOOK_CANCEL                   0x00000002ul
195
196 #define HOOK_INBOUND                  0x00000200ul
197 #define HOOK_OUTBOUND                 0x00000400ul
198
199
200 #ifndef MAPI_DIM
201 # define MAPI_DIM 1 /* Default to one dimension for variable length arrays */
202 #endif
203
204 DEFINE_OLEGUID(IID_IABContainer,0x2030D,0,0);
205 DEFINE_OLEGUID(IID_IABLogon,0x20314,0,0);
206 DEFINE_OLEGUID(IID_IABProvider,0x20311,0,0);
207 DEFINE_OLEGUID(IID_IAddrBook,0x20309,0,0);
208 DEFINE_OLEGUID(IID_IAttachment,0x20308,0,0);
209 DEFINE_OLEGUID(IID_IDistList,0x2030E,0,0);
210 DEFINE_OLEGUID(IID_IEnumMAPIFormProp,0x20323,0,0);
211 DEFINE_OLEGUID(IID_IMailUser,0x2030A,0,0);
212 DEFINE_OLEGUID(IID_IMAPIAdviseSink,0x20302,0,0);
213 DEFINE_OLEGUID(IID_IMAPIContainer,0x2030B,0,0);
214 DEFINE_OLEGUID(IID_IMAPIControl,0x2031B,0,0);
215 DEFINE_OLEGUID(IID_IMAPIFolder,0x2030C,0,0);
216 DEFINE_OLEGUID(IID_IMAPIForm,0x20327,0,0);
217 DEFINE_OLEGUID(IID_IMAPIFormAdviseSink,0x2032F,0,0);
218 DEFINE_OLEGUID(IID_IMAPIFormContainer,0x2032E,0,0);
219 DEFINE_OLEGUID(IID_IMAPIFormFactory,0x20350,0,0);
220 DEFINE_OLEGUID(IID_IMAPIFormInfo,0x20324,0,0);
221 DEFINE_OLEGUID(IID_IMAPIFormMgr,0x20322,0,0);
222 DEFINE_OLEGUID(IID_IMAPIFormProp,0x2032D,0,0);
223 DEFINE_OLEGUID(IID_IMAPIMessageSite,0x20370,0,0);
224 DEFINE_OLEGUID(IID_IMAPIProgress,0x2031F,0,0);
225 DEFINE_OLEGUID(IID_IMAPIProp,0x20303,0,0);
226 DEFINE_OLEGUID(IID_IMAPIPropData,0x2031A,0,0);
227 DEFINE_OLEGUID(IID_IMAPISession,0x20300,0,0);
228 DEFINE_OLEGUID(IID_IMAPISpoolerInit,0x20317,0,0);
229 DEFINE_OLEGUID(IID_IMAPISpoolerService,0x2031E,0,0);
230 DEFINE_OLEGUID(IID_IMAPISpoolerSession,0x20318,0,0);
231 DEFINE_OLEGUID(IID_IMAPIStatus,0x20305,0,0);
232 DEFINE_OLEGUID(IID_IMAPISup,0x2030F,0,0);
233 DEFINE_OLEGUID(IID_IMAPITable,0x20301,0,0);
234 DEFINE_OLEGUID(IID_IMAPITableData,0x20316,0,0);
235 DEFINE_OLEGUID(IID_IMAPIViewAdviseSink,0x2032B,0,0);
236 DEFINE_OLEGUID(IID_IMAPIViewContext,0x20321,0,0);
237 DEFINE_OLEGUID(IID_IMessage,0x20307,0,0);
238 DEFINE_OLEGUID(IID_IMsgServiceAdmin,0x2031D,0,0);
239 DEFINE_OLEGUID(IID_IMsgStore,0x20306,0,0);
240 DEFINE_OLEGUID(IID_IMSLogon,0x20313,0,0);
241 DEFINE_OLEGUID(IID_IMSProvider,0x20310,0,0);
242 DEFINE_OLEGUID(IID_IPersistMessage,0x2032A,0,0);
243 DEFINE_OLEGUID(IID_IProfAdmin,0x2031C,0,0);
244 DEFINE_OLEGUID(IID_IProfSect,0x20304,0,0);
245 DEFINE_OLEGUID(IID_IProviderAdmin,0x20325,0,0);
246 DEFINE_OLEGUID(IID_ISpoolerHook,0x20320,0,0);
247 DEFINE_OLEGUID(IID_IStream, 0x0000c, 0, 0);
248 DEFINE_OLEGUID(IID_IStreamDocfile,0x2032C,0,0);
249 DEFINE_OLEGUID(IID_IStreamTnef,0x20330,0,0);
250 DEFINE_OLEGUID(IID_ITNEF,0x20319,0,0);
251 DEFINE_OLEGUID(IID_IXPLogon,0x20315,0,0);
252 DEFINE_OLEGUID(IID_IXPProvider,0x20312,0,0);
253 DEFINE_OLEGUID(MUID_PROFILE_INSTANCE,0x20385,0,0);
254 DEFINE_OLEGUID(PS_MAPI,0x20328,0,0);
255 DEFINE_OLEGUID(PS_PUBLIC_STRINGS,0x20329,0,0);
256 DEFINE_OLEGUID(PS_ROUTING_ADDRTYPE,0x20381,0,0);
257 DEFINE_OLEGUID(PS_ROUTING_DISPLAY_NAME,0x20382,0,0);
258 DEFINE_OLEGUID(PS_ROUTING_EMAIL_ADDRESSES,0x20380,0,0);
259 DEFINE_OLEGUID(PS_ROUTING_ENTRYID,0x20383,0,0);
260 DEFINE_OLEGUID(PS_ROUTING_SEARCH_KEY,0x20384,0,0);
261
262 DEFINE_GUID(CLSID_IConverterSession, 0x4e3a7680, 0xb77a,
263             0x11d0, 0x9d, 0xa5, 0x0, 0xc0, 0x4f, 0xd6, 0x56, 0x85);
264 DEFINE_GUID(IID_IConverterSession, 0x4b401570, 0xb77b,
265             0x11d0, 0x9d, 0xa5, 0x0, 0xc0, 0x4f, 0xd6, 0x56, 0x85);
266
267
268
269 struct _ENTRYID
270 {
271     BYTE abFlags[4];
272     BYTE ab[MAPI_DIM];
273 };
274 typedef struct _ENTRYID ENTRYID;
275 typedef struct _ENTRYID *LPENTRYID;
276
277
278 /* The property tag structure. This describes a list of columns */
279 typedef struct _SPropTagArray
280 {
281     ULONG cValues;              /* Number of elements in aulPropTag */
282     ULONG aulPropTag[MAPI_DIM]; /* Property tags */
283 } SPropTagArray, *LPSPropTagArray;
284
285 #define CbNewSPropTagArray(c) \
286                (offsetof(SPropTagArray,aulPropTag)+(c)*sizeof(ULONG))
287 #define CbSPropTagArray(p)    CbNewSPropTagArray((p)->cValues)
288 #define SizedSPropTagArray(n,id) \
289     struct _SPropTagArray_##id { ULONG cValues; ULONG aulPropTag[n]; } id
290
291
292 /* Multi-valued PT_APPTIME property value */
293 typedef struct _SAppTimeArray
294 {
295     ULONG   cValues; /* Number of doubles in lpat */
296     double *lpat;    /* Pointer to double array of length cValues */
297 } SAppTimeArray;
298
299 /* PT_BINARY property value */
300 typedef struct _SBinary
301 {
302     ULONG  cb;  /* Number of bytes in lpb */
303     LPBYTE lpb; /* Pointer to byte array of length cb */
304 } SBinary, *LPSBinary;
305
306 /* Multi-valued PT_BINARY property value */
307 typedef struct _SBinaryArray
308 {
309     ULONG    cValues; /* Number of SBinarys in lpbin */
310     SBinary *lpbin;   /* Pointer to SBinary array of length cValues */
311 } SBinaryArray;
312
313 typedef SBinaryArray ENTRYLIST, *LPENTRYLIST;
314
315 /* Multi-valued PT_CY property value */
316 typedef struct _SCurrencyArray
317 {
318     ULONG  cValues; /* Number of CYs in lpcu */
319     CY    *lpcur;   /* Pointer to CY array of length cValues */
320 } SCurrencyArray;
321
322 /* Multi-valued PT_SYSTIME property value */
323 typedef struct _SDateTimeArray
324 {
325     ULONG     cValues; /* Number of FILETIMEs in lpft */
326     FILETIME *lpft;    /* Pointer to FILETIME array of length cValues */
327 } SDateTimeArray;
328
329 /* Multi-valued PT_DOUBLE property value */
330 typedef struct _SDoubleArray
331 {
332     ULONG   cValues; /* Number of doubles in lpdbl */
333     double *lpdbl;   /* Pointer to double array of length cValues */
334 } SDoubleArray;
335
336 /* Multi-valued PT_CLSID property value */
337 typedef struct _SGuidArray
338 {
339     ULONG cValues; /* Number of GUIDs in lpguid */
340     GUID *lpguid;  /* Pointer to GUID array of length cValues */
341 } SGuidArray;
342
343 /* Multi-valued PT_LONGLONG property value */
344 typedef struct _SLargeIntegerArray
345 {
346     ULONG          cValues; /* Number of long64s in lpli */
347     LARGE_INTEGER *lpli;    /* Pointer to long64 array of length cValues */
348 } SLargeIntegerArray;
349
350 /* Multi-valued PT_LONG property value */
351 typedef struct _SLongArray
352 {
353     ULONG  cValues; /* Number of longs in lpl */
354     LONG  *lpl;     /* Pointer to long array of length cValues */
355 } SLongArray;
356
357 /* Multi-valued PT_STRING8 property value */
358 typedef struct _SLPSTRArray
359 {
360     ULONG  cValues; /* Number of Ascii strings in lppszA */
361     LPSTR *lppszA;  /* Pointer to Ascii string array of length cValues */
362 } SLPSTRArray;
363
364 /* Multi-valued PT_FLOAT property value */
365 typedef struct _SRealArray
366 {
367     ULONG cValues; /* Number of floats in lpflt */
368     float *lpflt;  /* Pointer to float array of length cValues */
369 } SRealArray;
370
371 /* Multi-valued PT_SHORT property value */
372 typedef struct _SShortArray
373 {
374     ULONG      cValues; /* Number of shorts in lpb */
375     short int *lpi;     /* Pointer to short array of length cValues */
376 } SShortArray;
377
378 /* Multi-valued PT_UNICODE property value */
379 typedef struct _SWStringArray
380 {
381     ULONG   cValues; /* Number of Unicode strings in lppszW */
382     LPWSTR *lppszW;  /* Pointer to Unicode string array of length cValues */
383 } SWStringArray;
384
385
386 /* A property value */
387 union PV_u
388 {
389     short int          i;
390     LONG               l;
391     ULONG              ul;
392     float              flt;
393     double             dbl;
394     unsigned short     b;
395     CY                 cur;
396     double             at;
397     FILETIME           ft;
398     LPSTR              lpszA;
399     SBinary            bin;
400     LPWSTR             lpszW;
401     LPGUID             lpguid;
402     LARGE_INTEGER      li;
403     SShortArray        MVi;
404     SLongArray         MVl;
405     SRealArray         MVflt;
406     SDoubleArray       MVdbl;
407     SCurrencyArray     MVcur;
408     SAppTimeArray      MVat;
409     SDateTimeArray     MVft;
410     SBinaryArray       MVbin;
411     SLPSTRArray        MVszA;
412     SWStringArray      MVszW;
413     SGuidArray         MVguid;
414     SLargeIntegerArray MVli;
415     SCODE              err;
416     LONG               x;
417 };
418 typedef union PV_u uPV;
419
420 /* Property value structure. This is essentially a mini-Variant. */
421 struct SPropValue_s
422 {
423   ULONG     ulPropTag;  /* The property type. */
424   ULONG     dwAlignPad; /* Alignment, treat as reserved. */
425   uPV       Value;      /* The property value. */
426 };
427 typedef struct SPropValue_s SPropValue;
428 typedef struct SPropValue_s *LPSPropValue;
429
430 /* Structure describing a table row (a collection of property values). */
431 struct SRow_s
432 {
433   ULONG        ulAdrEntryPad; /* Padding, treat as reserved. */
434   ULONG        cValues;       /* Count of property values in lpProbs. */
435   LPSPropValue lpProps;       /* Pointer to an array of property
436                                  values of length cValues. */
437 };
438 typedef struct SRow_s SRow;
439 typedef struct SRow_s *LPSRow;
440
441
442 /* Structure describing a set of table rows. */
443 struct SRowSet_s
444 {
445   ULONG cRows;          /* Count of rows in aRow. */
446   SRow  aRow[MAPI_DIM]; /* Array of rows of length cRows. */
447 };
448 typedef struct SRowSet_s *LPSRowSet;
449
450
451 /* Structure describing a problem with a property */
452 typedef struct _SPropProblem
453 {
454     ULONG ulIndex;   /* Index of the property */
455     ULONG ulPropTag; /* Proprty tag of the property */
456     SCODE scode;     /* Error code of the problem */
457 } SPropProblem, *LPSPropProblem;
458
459 /* A collection of property problems */
460 typedef struct _SPropProblemArray
461 {
462     ULONG        cProblem;           /* Number of problems in aProblem */
463     SPropProblem aProblem[MAPI_DIM]; /* Array of problems of length cProblem */
464 } SPropProblemArray, *LPSPropProblemArray;
465
466
467 /* Table bookmarks */
468 typedef ULONG BOOKMARK;
469
470 #define BOOKMARK_BEGINNING ((BOOKMARK)0) /* The first row */
471 #define BOOKMARK_CURRENT   ((BOOKMARK)1) /* The curent table row */
472 #define BOOKMARK_END       ((BOOKMARK)2) /* The last row */
473
474
475 /* Row restrictions */
476 typedef struct _SRestriction* LPSRestriction;
477
478
479 /* Errors. */
480 typedef struct _MAPIERROR
481 {
482     ULONG  ulVersion;       /* Mapi version */
483 #if defined (UNICODE) || defined (__WINESRC__)
484     LPWSTR lpszError;       /* Error and component strings. These are Ascii */
485     LPWSTR lpszComponent;   /* unless the MAPI_UNICODE flag is passed in */
486 #else
487     LPSTR  lpszError;
488     LPSTR  lpszComponent;
489 #endif
490     ULONG  ulLowLevelError;
491     ULONG  ulContext;
492 } MAPIERROR, *LPMAPIERROR;
493
494
495 /* Sorting */
496 #define TABLE_SORT_ASCEND  0U
497 #define TABLE_SORT_DESCEND 1U
498 #define TABLE_SORT_COMBINE 2U
499
500 typedef struct _SSortOrder
501 {
502     ULONG ulPropTag;
503     ULONG ulOrder;
504 } SSortOrder, *LPSSortOrder;
505
506 typedef struct _SSortOrderSet
507 {
508     ULONG      cSorts;
509     ULONG      cCategories;
510     ULONG      cExpanded;
511     SSortOrder aSort[MAPI_DIM];
512 } SSortOrderSet, * LPSSortOrderSet;
513
514
515
516 typedef struct _MAPINAMEID
517 {
518     LPGUID lpguid;
519     ULONG ulKind;
520     union
521     {
522         LONG lID;
523         LPWSTR lpwstrName;
524     } Kind;
525 } MAPINAMEID, *LPMAPINAMEID;
526
527 #define MNID_ID     0
528 #define MNID_STRING 1
529
530
531 typedef struct _ADRENTRY
532 {
533     ULONG        ulReserved1;
534     ULONG        cValues;
535     LPSPropValue rgPropVals;
536 } ADRENTRY, *LPADRENTRY;
537
538 typedef struct _ADRLIST
539 {
540     ULONG    cEntries;
541     ADRENTRY aEntries[MAPI_DIM];
542 } ADRLIST, *LPADRLIST;
543
544
545 struct IAddrBook;
546 typedef struct IAddrBook *LPADRBOOK;
547
548
549 /* FIXME: Need to move the HCHARSET definition to some other place.  */
550 typedef void *HCHARSET;
551
552
553 typedef enum tagCHARSETTYPE
554   {
555     CHARSET_BODY = 0,
556     CHARSET_HEADER = 1,
557     CHARSET_WEB = 2
558   }
559 CHARSETTYPE;
560
561 typedef enum tagCSETAPPLYTYPE
562   {
563     CSET_APPLY_UNTAGGED = 0,
564     CSET_APPLY_ALL = 1,
565     CSET_APPLY_TAG_ALL = 2
566   }
567 CSETAPPLYTYPE;
568
569
570 /* Note that this is just a minimal definition.  */
571 typedef struct
572 {
573   ULONG ulEventType;  /* Notification type.  */
574   ULONG ulAlignPad;   /* Force alignment on a 8 byte.  */
575   union {
576     struct {
577       ULONG           n_entryid;
578       LPENTRYID       entryid;
579       ULONG           obj_type;
580       ULONG           n_parentid;
581       LPENTRYID       parentid;
582       ULONG           n_oldid;
583       LPENTRYID       oldid;
584       ULONG           n_oldparentid;
585       LPENTRYID       oldparentid;
586       LPSPropTagArray prop_tag_array;
587     } obj;
588   } info;
589 } NOTIFICATION, FAR *LPNOTIFICATION;
590
591
592 /* Definitions required for IConverterSession. */
593 typedef enum tagMIMESAVETYPE
594   {
595     SAVE_RFC822 = 0,    /* Use uuencode for attachments.  */
596     SAVE_RFC1521 = 1    /* Regular MIME.  */
597   }
598 MIMESAVETYPE;
599
600 typedef enum tagENCODINGTYPE
601   {
602     IET_BINARY   = 0,
603     IET_BASE64   = 1,
604     IET_UUENCODE = 2,
605     IET_QP       = 3,
606     IET_7BIT     = 4,
607     IET_8BIT     = 5,
608     IET_INETCSET = 6,
609     IET_UNICODE  = 7,
610     IET_RFC1522  = 8,
611     IET_ENCODED  = 9,
612     IET_CURRENT  = 10,
613     IET_UNKNOWN  = 11,
614     IET_BINHEX40 = 12,
615     IET_LAST     = 13
616   }
617 ENCODINGTYPE;
618
619 #define CCSF_SMTP            0x0002 /* The input is an SMTP message.  */
620 #define CCSF_NOHEADERS       0x0004 /* Ignore headers outside the message.  */
621 #define CCSF_USE_TNEF        0x0010 /* Embed TNEF in MIME.  */
622 #define CCSF_INCLUDE_BCC     0x0020 /* Include BCC recipients.  */
623 #define CCSF_8BITHEADERS     0x0040 /* Allow 8-bit headers. (mapi->mime) */
624 #define CCSF_USE_RTF         0x0080 /* Convert HTML to RTF.  */
625 #define CCSF_PLAIN_TEXT_ONLY 0x1000 /* Create only plain text (mapi->mime) */
626 #define CCSF_NO_MSGID        0x4000 /* Do not include Message-Id.  */
627
628
629 \f
630 /**** Class definitions ****/
631 typedef const IID *LPCIID;
632
633
634 struct IAttach;
635 typedef struct IAttach *LPATTACH;
636
637 struct IMAPIAdviseSink;
638 typedef struct IMAPIAdviseSink *LPMAPIADVISESINK;
639
640 struct IMAPIProgress;
641 typedef struct IMAPIProgress *LPMAPIPROGRESS;
642
643 struct IMAPITable;
644 typedef struct IMAPITable *LPMAPITABLE;
645
646 struct IMAPIProp;
647 typedef struct IMAPIProp *LPMAPIPROP;
648
649 struct IMessage;
650 typedef struct IMessage *LPMESSAGE;
651
652 struct IMAPIContainer;
653 typedef struct IMAPIContainer *LPMAPICONTAINER;
654
655 struct IMAPIFolder;
656 typedef struct IMAPIFolder *LPMAPIFOLDER;
657
658 struct IMsgStore;
659 typedef struct IMsgStore *LPMDB;
660
661 struct IMAPISession;
662 typedef struct IMAPISession *LPMAPISESSION;
663
664 struct IMsgServiceAdmin;
665 typedef struct IMsgServiceAdmin *LPSERVICEADMIN;
666
667 struct IConverterSession;
668 typedef struct IConverterSession *LPCONVERTERSESSION;
669
670 struct IProfSect;
671 typedef struct IProfSect *LPPROFSECT;
672
673 struct ISpoolerHook;
674 typedef struct ISpoolerHook *LPSPOOLERHOOK;
675
676 struct IMAPIFormContainer;
677 typedef struct IMAPIFormContainer *LPMAPIFORMCONTAINER;
678
679
680 /*** IUnknown methods ***/
681 #define MY_IUNKNOWN_METHODS \
682   STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE; \
683   STDMETHOD_(ULONG,AddRef)(THIS) PURE;                  \
684   STDMETHOD_(ULONG,Release)(THIS) PURE
685
686 /*** IMAPIProp methods ***/
687 #define MY_IMAPIPROP_METHODS \
688   STDMETHOD(GetLastError)(THIS_ HRESULT, ULONG, LPMAPIERROR FAR*);         \
689   STDMETHOD(SaveChanges)(THIS_ ULONG);                                     \
690   STDMETHOD(GetProps)(THIS_ LPSPropTagArray, ULONG, ULONG FAR*,            \
691                       LPSPropValue FAR*);                                  \
692   STDMETHOD(GetPropList)(THIS_ ULONG, LPSPropTagArray FAR *);              \
693   STDMETHOD(OpenProperty)(THIS_ ULONG, LPCIID lpiid, ULONG,                \
694                           ULONG, LPUNKNOWN FAR*);                          \
695   STDMETHOD(SetProps)(THIS_ LONG, LPSPropValue, LPSPropProblemArray FAR*); \
696   STDMETHOD(DeleteProps)(THIS_ LPSPropTagArray, LPSPropProblemArray FAR *);\
697   STDMETHOD(CopyTo)(THIS_ ULONG, LPCIID, LPSPropTagArray, ULONG,           \
698                     LPMAPIPROGRESS, LPCIID lpInterface, LPVOID,            \
699                     ULONG, LPSPropProblemArray FAR*);                      \
700   STDMETHOD(CopyProps)(THIS_ LPSPropTagArray, ULONG, LPMAPIPROGRESS,       \
701                        LPCIID, LPVOID, ULONG, LPSPropProblemArray FAR*);   \
702   STDMETHOD(GetNamesFromIDs)(THIS_ LPSPropTagArray FAR*, LPGUID,           \
703                              ULONG, ULONG FAR*, LPMAPINAMEID FAR* FAR*);   \
704   STDMETHOD(GetIDsFromNames)(THIS_ ULONG, LPMAPINAMEID FAR*, ULONG,        \
705                              LPSPropTagArray FAR*)
706
707 /*** IMsgstore methods ***/
708 #define MY_IMSGSTORE_METHODS \
709   STDMETHOD(Advise)(THIS_ ULONG n_entryid, LPENTRYID entryid,                \
710                     ULONG ulEventMask, LPMAPIADVISESINK lpAdviseSink,        \
711                     ULONG FAR *connection) PURE;                             \
712   STDMETHOD(Unadvise)(THIS_ ULONG connection) PURE;                          \
713   STDMETHOD(CompareEntryIDs)(THIS_  ULONG n_entryid1, LPENTRYID entryid1,    \
714                              ULONG n_entryid2, LPENTRYID entryid2,           \
715                              ULONG flags, ULONG FAR *lpulResult) PURE;       \
716   STDMETHOD(OpenEntry)(THIS_ ULONG n_entryid, LPENTRYID entryid,             \
717                        LPCIID lpInterface, ULONG flags,                      \
718                        ULONG FAR *obj_type, LPUNKNOWN FAR *lppUnk) PURE;     \
719   STDMETHOD(SetReceiveFolder)(THIS_ LPTSTR message_class, ULONG flags,       \
720                               ULONG n_entryid, LPENTRYID entryid) PURE;      \
721   STDMETHOD(GetReceiveFolder)(THIS_ LPTSTR message_class, ULONG flags,       \
722                               ULONG FAR *r_nentryid,LPENTRYID FAR *r_entryid,\
723                               LPTSTR FAR *lppszExplicitClass) PURE;          \
724   STDMETHOD(GetReceiveFolderTable)(THIS_ ULONG flags,                        \
725                                    LPMAPITABLE FAR *lppTable) PURE;          \
726   STDMETHOD(StoreLogoff)(THIS_ ULONG FAR *r_flags) PURE;                     \
727   STDMETHOD(AbortSubmit)(THIS_ ULONG nentryid, LPENTRYID entryid,            \
728                          ULONG flags) PURE;                                  \
729   STDMETHOD(GetOutgoingQueue)(THIS_ ULONG flags,LPMAPITABLE FAR *table) PURE;\
730   STDMETHOD(SetLockState)(THIS_ LPMESSAGE message, ULONG lock_state) PURE;   \
731   STDMETHOD(FinishedMsg)(THIS_ ULONG ulFlags,                                \
732                          ULONG nentryid, LPENTRYID entryid) PURE;            \
733   STDMETHOD(NotifyNewMail)(THIS_ LPNOTIFICATION notification) PURE
734
735
736 /*** IMessage methods ***/
737 #define MY_IMESSAGE_METHODS \
738   STDMETHOD(GetAttachmentTable)(THIS_ ULONG, LPMAPITABLE FAR*) PURE;         \
739   STDMETHOD(OpenAttach)(THIS_ ULONG, LPCIID, ULONG, LPATTACH FAR*) PURE;     \
740   STDMETHOD(CreateAttach)(THIS_ LPCIID, ULONG, ULONG FAR*,                   \
741                           LPATTACH FAR*) PURE;                               \
742   STDMETHOD(DeleteAttach)(THIS_ ULONG, ULONG, LPMAPIPROGRESS, ULONG) PURE;   \
743   STDMETHOD(GetRecipientTable)(THIS_ ULONG, LPMAPITABLE FAR*) PURE;          \
744   STDMETHOD(ModifyRecipients)(THIS_ ULONG, LPADRLIST) PURE;                  \
745   STDMETHOD(SubmitMessage)(THIS_ ULONG) PURE;                                \
746   STDMETHOD(SetReadFlag)(THIS_ ULONG) PURE
747
748 /*** IMAPIContainer ***/
749 #define MY_IMAPICONTAINER_METHODS \
750   STDMETHOD(GetContentsTable)(THIS_ ULONG flags,                             \
751                               LPMAPITABLE FAR *table) PURE;                  \
752   STDMETHOD(GetHierarchyTable)(THIS_ ULONG flags,                            \
753                                LPMAPITABLE FAR *table) PURE;                 \
754   STDMETHOD(OpenEntry)(THIS_ ULONG n_entryid, LPENTRYID entryid,             \
755                        LPCIID iface, ULONG flags,                            \
756                        ULONG FAR *obj_type, LPUNKNOWN FAR *lppUnk) PURE;     \
757   STDMETHOD(SetSearchCriteria)(THIS_ LPSRestriction restriction,             \
758                                LPENTRYLIST container_list,                   \
759                                ULONG  search_flags) PURE;                    \
760   STDMETHOD(GetSearchCriteria)(THIS_ ULONG flags,                            \
761                                LPSRestriction FAR *restriction,              \
762                                LPENTRYLIST FAR *container_list,              \
763                                ULONG FAR *search_state) PURE
764
765
766 /*** IMAPIFolder methods ***/
767 #define MY_IMAPIFOLDER_METHODS \
768   STDMETHOD(CreateMessage)(THIS_ LPCIID iface, ULONG flags,                  \
769                            LPMESSAGE FAR *message) PURE;                     \
770   STDMETHOD(CopyMessages)(THIS_ LPENTRYLIST msg_list, LPCIID iface,          \
771                           LPVOID dest_folder, ULONG ui_param,                \
772                           LPMAPIPROGRESS progress, ULONG flags) PURE;        \
773   STDMETHOD(DeleteMessages)(THIS_ LPENTRYLIST msg_list, ULONG uiparam,       \
774                             LPMAPIPROGRESS progress, ULONG flags) PURE;      \
775   STDMETHOD(CreateFolder)(THIS_ ULONG folder_type, LPTSTR folder_name,       \
776                           LPTSTR folder_comment, LPCIID iface,               \
777                           ULONG flags, LPMAPIFOLDER FAR *folder) PURE;       \
778   STDMETHOD(CopyFolder)(THIS_ ULONG n_entryid, LPENTRYID entryid,            \
779                         LPCIID iface, LPVOID dest_folder,                    \
780                         LPTSTR new_folder_name, ULONG uiparam,               \
781                         LPMAPIPROGRESS progress, ULONG flags) PURE;          \
782   STDMETHOD(DeleteFolder)(THIS_ ULONG n_entryid, LPENTRYID entryid,          \
783                           ULONG uiparam,                                     \
784                           LPMAPIPROGRESS progress, ULONG flags) PURE;        \
785   STDMETHOD(SetReadFlags)(THIS_ LPENTRYLIST msg_list, ULONG uiparam,         \
786                           LPMAPIPROGRESS progress, ULONG flags) PURE;        \
787   STDMETHOD(GetMessageStatus)(THIS_ ULONG n_entryid, LPENTRYID entryid,      \
788                               ULONG flags, ULONG FAR *message_status) PURE;  \
789   STDMETHOD(SetMessageStatus)(THIS_ ULONG n_entryid, LPENTRYID entryid,      \
790                               ULONG new_status, ULONG new_status_mask,       \
791                               ULONG FAR *r_old_status) PURE;                 \
792   STDMETHOD(SaveContentsSort)(THIS_ LPSSortOrderSet sort_criteria,           \
793                               ULONG flags) PURE;                             \
794   STDMETHOD(EmptyFolder)(THIS_ ULONG uiparam,                                \
795                          LPMAPIPROGRESS progress, ULONG flags) PURE
796
797
798 /*** IMAPITable methods ***/
799 #define MY_IMAPITABLE_METHODS \
800   STDMETHOD(GetLastError)(THIS_ HRESULT, ULONG, LPMAPIERROR*) PURE;          \
801   STDMETHOD(Advise)(THIS_ ULONG, LPMAPIADVISESINK, ULONG*) PURE;             \
802   STDMETHOD(Unadvise)(THIS_ ULONG ulCxn) PURE;                               \
803   STDMETHOD(GetStatus)(THIS_ ULONG*, ULONG*) PURE;                           \
804   STDMETHOD(SetColumns)(THIS_ LPSPropTagArray, ULONG) PURE;                  \
805   STDMETHOD(QueryColumns)(THIS_ ULONG, LPSPropTagArray*) PURE;               \
806   STDMETHOD(GetRowCount)(THIS_ ULONG, ULONG *) PURE;                         \
807   STDMETHOD(SeekRow)(THIS_ BOOKMARK, LONG, LONG*) PURE;                      \
808   STDMETHOD(SeekRowApprox)(THIS_ ULONG, ULONG) PURE;                         \
809   STDMETHOD(QueryPosition)(THIS_ ULONG*, ULONG*, ULONG*) PURE;               \
810   STDMETHOD(FindRow)(THIS_ LPSRestriction, BOOKMARK, ULONG) PURE;            \
811   STDMETHOD(Restrict)(THIS_ LPSRestriction, ULONG) PURE;                     \
812   STDMETHOD(CreateBookmark)(THIS_ BOOKMARK*) PURE;                           \
813   STDMETHOD(FreeBookmark)(THIS_ BOOKMARK) PURE;                              \
814   STDMETHOD(SortTable)(THIS_ LPSSortOrderSet, ULONG) PURE;                   \
815   STDMETHOD(QuerySortOrder)(THIS_ LPSSortOrderSet*) PURE;                    \
816   STDMETHOD(QueryRows)(THIS_ LONG, ULONG, LPSRowSet*) PURE;                  \
817   STDMETHOD(Abort)(THIS) PURE;                                               \
818   STDMETHOD(ExpandRow)(THIS_ ULONG, LPBYTE, ULONG, ULONG,                    \
819                        LPSRowSet*, ULONG*) PURE;                             \
820   STDMETHOD(CollapseRow)(THIS_ ULONG, LPBYTE, ULONG, ULONG*) PURE;           \
821   STDMETHOD(WaitForCompletion)(THIS_ ULONG, ULONG, ULONG*) PURE;             \
822   STDMETHOD(GetCollapseState)(THIS_ ULONG, ULONG,LPBYTE,ULONG*,LPBYTE*) PURE;\
823   STDMETHOD(SetCollapseState)(THIS_ ULONG, ULONG, LPBYTE, BOOKMARK*) PURE
824
825
826
827 /*** IMAPISession methods ***/
828 #define MY_IMAPISESSION_METHODS \
829   STDMETHOD(GetLastError)(THIS_ HRESULT hResult, ULONG ulFlags,               \
830                           LPMAPIERROR *lppMAPIError) PURE;                    \
831   STDMETHOD(GetMsgStoresTable)(THIS_ ULONG ulFlags,                           \
832                                LPMAPITABLE *lppTable) PURE;                   \
833   STDMETHOD(OpenMsgStore)(THIS_ ULONG_PTR ulUIParam, ULONG cbId,              \
834                           LPENTRYID lpId, LPCIID lpIFace,                     \
835                           ULONG ulFlags, LPMDB *lppMDB) PURE;                 \
836   STDMETHOD(OpenAddressBook)(THIS_ ULONG_PTR ulUIParam, LPCIID iid,           \
837                              ULONG ulFlags, LPADRBOOK *lppAdrBook) PURE;      \
838   STDMETHOD(OpenProfileSection)(THIS_ LPMAPIUID lpUID, LPCIID iid,            \
839                                 ULONG ulFlags, LPPROFSECT *lppProf) PURE;     \
840   STDMETHOD(GetStatusTable)(THIS_ ULONG ulFlags, LPMAPITABLE *lppTable) PURE; \
841   STDMETHOD(OpenEntry)(THIS_ ULONG cbId, LPENTRYID lpId, LPCIID iid,          \
842                        ULONG ulFlags, ULONG *lpType, LPUNKNOWN *lppUnk) PURE; \
843   STDMETHOD(CompareEntryIDs)(THIS_ ULONG cbLID, LPENTRYID lpLID, ULONG cbRID, \
844                              LPENTRYID lpRID, ULONG ulFlags,                  \
845                              ULONG *lpRes) PURE;                              \
846   STDMETHOD(Advise)(THIS_ ULONG cbId, LPENTRYID lpId, ULONG ulMask,           \
847                     LPMAPIADVISESINK lpSink, ULONG *lpCxn) PURE;              \
848   STDMETHOD(Unadvise)(THIS_ ULONG ulConnection) PURE;                         \
849   STDMETHOD(MessageOptions)(THIS_ ULONG_PTR ulUIParam, ULONG ulFlags,         \
850                             LPSTR lpszAddr, LPMESSAGE lpMsg) PURE;            \
851   STDMETHOD(QueryDefaultMessageOpt)(THIS_ LPSTR lpszAddr, ULONG ulFlags,      \
852                                     ULONG *lpcVals,                           \
853                                     LPSPropValue *lppOpts) PURE;              \
854   STDMETHOD(EnumAdrTypes)(THIS_ ULONG ulFlags, ULONG *lpcTypes,               \
855                           LPSTR **lpppszTypes) PURE;                          \
856   STDMETHOD(QueryIdentity)(THIS_ ULONG *lpcbId, LPENTRYID *lppEntryID) PURE;  \
857   STDMETHOD(Logoff)(THIS_ ULONG_PTR ulUIParam, ULONG ulFlags,                 \
858                     ULONG ulReserved) PURE;                                   \
859   STDMETHOD(SetDefaultStore)(THIS_ ULONG ulFlags, ULONG cbId,                 \
860                              LPENTRYID lpId) PURE;                            \
861   STDMETHOD(AdminServices)(THIS_ ULONG ulFlags, LPSERVICEADMIN *lppAdmin)PURE;\
862   STDMETHOD(ShowForm)(THIS_ ULONG_PTR ulUIParam, LPMDB lpStore,               \
863                       LPMAPIFOLDER lpParent, LPCIID iid, ULONG ulToken,       \
864                       LPMESSAGE lpSent, ULONG ulFlags, ULONG ulStatus,        \
865                       ULONG ulMsgFlags, ULONG ulAccess, LPSTR lpszClass)PURE; \
866   STDMETHOD(PrepareForm)(THIS_ LPCIID lpIFace, LPMESSAGE lpMsg,               \
867                          ULONG *lpToken) PURE;
868
869
870 /*** ISpoolerHook methods ***/
871 #define MY_ISPOOLERHOOK_METHODS \
872   STDMETHOD(InboundMsgHook)(THIS_ LPMESSAGE message, LPMAPIFOLDER folder,     \
873                             LPMDB mdb, ULONG FAR *r_flags,                    \
874                             ULONG FAR *n_entryid, LPBYTE FAR *entryid) PURE;  \
875   STDMETHOD(OutboundMsgHook)(THIS_ LPMESSAGE message, LPMAPIFOLDER folder,    \
876                              LPMDB mdb, ULONG FAR *r_flags,                   \
877                              ULONG FAR *n_entryid, LPBYTE FAR *entryid) PURE
878
879
880
881 \f
882 EXTERN_C const IID IID_IMAPIProp;
883 #undef INTERFACE
884 #define INTERFACE IMAPIProp
885 DECLARE_INTERFACE_(IMAPIProp,IUnknown)
886 {
887   MY_IUNKNOWN_METHODS;
888   MY_IMAPIPROP_METHODS;
889 };
890
891
892
893 EXTERN_C const IID IID_IMsgStore;
894 #undef INTERFACE
895 #define INTERFACE IMsgStore
896 DECLARE_INTERFACE_(IMsgStore,IMAPIProp)
897 {
898   MY_IUNKNOWN_METHODS;
899   MY_IMAPIPROP_METHODS;
900   MY_IMSGSTORE_METHODS;
901 };
902
903
904 EXTERN_C const IID IID_IMessage;
905 #undef INTERFACE
906 #define INTERFACE IMessage
907 DECLARE_INTERFACE_(IMessage,IMAPIProp)
908 {
909   MY_IUNKNOWN_METHODS;
910   MY_IMAPIPROP_METHODS;
911   MY_IMESSAGE_METHODS;
912 };
913
914
915 EXTERN_C const IID IID_IMAPIContainer;
916 #undef INTERFACE
917 #define INTERFACE IMAPIContainer
918 DECLARE_INTERFACE_(IMAPIContainer,IMAPIProp)
919 {
920   MY_IUNKNOWN_METHODS;
921   MY_IMAPIPROP_METHODS;
922   MY_IMAPICONTAINER_METHODS;
923 };
924
925
926 EXTERN_C const IID IID_IMAPIFolder;
927 #undef INTERFACE
928 #define INTERFACE IMAPIFolder
929 DECLARE_INTERFACE_(IMAPIFolder,IMAPIContainer)
930 {
931   MY_IUNKNOWN_METHODS;
932   MY_IMAPIPROP_METHODS;
933   MY_IMAPICONTAINER_METHODS;
934   MY_IMAPIFOLDER_METHODS;
935 };
936
937
938 EXTERN_C const IID IID_IAttachment;
939 #undef INTERFACE
940 #define INTERFACE IAttach
941 DECLARE_INTERFACE_(IAttach, IMAPIProp)
942 {
943   MY_IUNKNOWN_METHODS;
944   MY_IMAPIPROP_METHODS;
945   /*** IAttach methods ***/
946   /* No methods */
947 };
948
949
950 EXTERN_C const IID IID_IMAPITableData;
951 #undef INTERFACE
952 #define INTERFACE IMAPITable
953 DECLARE_INTERFACE_(IMAPITable,IUnknown)
954 {
955   MY_IUNKNOWN_METHODS;
956   MY_IMAPITABLE_METHODS;
957 };
958
959
960 EXTERN_C const IID IID_IMAPISession;
961 #undef INTERFACE
962 #define INTERFACE IMAPISession
963 DECLARE_INTERFACE_(IMAPISession, IUnknown)
964 {
965   MY_IUNKNOWN_METHODS;
966   MY_IMAPISESSION_METHODS;
967 };
968
969
970
971
972 EXTERN_C const IID IID_IConverterSession;
973 #undef INTERFACE
974 #define INTERFACE IConverterSession
975 DECLARE_INTERFACE_(IConverterSession, IUnknown)
976 {
977   MY_IUNKNOWN_METHODS;
978
979   /*** IConverterSession ***/
980
981   /* Pass a MAPI address book to be used for name resultion to the
982      converter.  */
983   STDMETHOD(SetAdrBook)(THIS_ LPADRBOOK pab);
984   /* For an encoding for the outermost MIME container.  */
985   STDMETHOD(SetEncoding)(THIS_ ENCODINGTYPE);
986   STDMETHOD(PlaceHolder3)(THIS);
987   /* Convert a MIME stream to a MAPI message.  SRC_SRV needs to be
988      NULL. */
989   STDMETHOD(MIMEToMAPI)(THIS_ LPSTREAM pstm, LPMESSAGE pmsg,
990                         LPCSTR src_srv, ULONG flags);
991   /* Convert a MAPI message to a MIME stream. */
992   STDMETHOD(MAPIToMIMEStm)(THIS_ LPMESSAGE pmsg, LPSTREAM pstm, ULONG flags);
993   STDMETHOD(PlaceHolder6)(THIS);
994   STDMETHOD(PlaceHolder7)(THIS);
995   STDMETHOD(PlaceHolder8)(THIS);
996   /* Enable text wrapping and the maximum line length.  */
997   STDMETHOD(SetTextWrapping)(THIS_ BOOL, ULONG);
998   /* Set the MIME save format.  The default is SAVE_RFC1521 (MIME) but
999      my be changed using this function to SAVE_RFC822 (uuencode).  */
1000   STDMETHOD(SetSaveFormat)(THIS_ MIMESAVETYPE);
1001   STDMETHOD(PlaceHolder11)(THIS);
1002   /* Tell which character set to use.  HCHARSET is either NULL or a
1003      handle retrieved by (e.g.) MimeOleGetCodePageCharset.  If FAPPLY
1004      is false, HCHARSET is not used.  */
1005   STDMETHOD(SetCharset)(THIS_ BOOL fApply, HCHARSET hcharset,
1006                         CSETAPPLYTYPE csetapplytype);
1007 };
1008
1009
1010 EXTERN_C const IID IID_ISpoolerHook;
1011 #undef INTERFACE
1012 #define INTERFACE ISpoolerHook
1013 DECLARE_INTERFACE_(ISpoolerHook, IUnknown)
1014 {
1015   MY_IUNKNOWN_METHODS;
1016   MY_ISPOOLERHOOK_METHODS;
1017 };
1018
1019
1020
1021 /* IMAPIFormContainer */
1022
1023 #define MAPIFORM_INSTALL_OVERWRITEONCONFLICT  0x10
1024
1025 typedef struct _SMAPIFormPropEnumVal
1026 {
1027   LPTSTR pszDisplayName;
1028   ULONG nVal;
1029 } SMAPIFormPropEnumVal, *LPMAPIFORMPROPENUMVAL;
1030
1031
1032 typedef struct _SMAPIFormProp
1033 {
1034   ULONG      ulFlags;
1035   ULONG      nPropType;
1036   MAPINAMEID nmid;
1037   LPTSTR     pszDisplayName;
1038   ULONG      nSpecialType;
1039   union {
1040     struct {
1041       MAPINAMEID nmidIdx;
1042       ULONG cfpevAvailable;
1043       LPMAPIFORMPROPENUMVAL pfpevAvailable;
1044     } s1;
1045   } u;
1046 } SMAPIFormProp, *LPMAPIFORMPROP;
1047
1048 typedef struct _SMAPIFormPropArray
1049 {
1050   ULONG cProps;
1051   ULONG ulPad;
1052   SMAPIFormProp aFormProp[MAPI_DIM];
1053 } SMAPIFormPropArray, *LPMAPIFORMPROPARRAY;
1054
1055 typedef struct _SMessageClassArray
1056 {
1057   ULONG  cValues;
1058   LPCSTR aMessageClass[MAPI_DIM];
1059 } SMessageClassArray, *LPSMESSAGECLASSARRAY;
1060
1061
1062 /* Fixme: The void ptr in ResolveMessageClass and SMAPIFormInfoArray
1063    should be a LPMAPIFORMINFO, but we have not yet defined the
1064    corresponding class. */
1065 typedef struct _SMAPIFormInfoArray
1066 {
1067   ULONG cForms;
1068   void * aFormInfo[MAPI_DIM];
1069 } SMAPIFormInfoArray, *LPSMAPIFORMINFOARRAY;
1070
1071 #define MY_IMAPIFORMCONTAINER_METHODS                                         \
1072   STDMETHOD(GetLastError)(THIS_ HRESULT, ULONG, LPMAPIERROR FAR*) PURE;       \
1073   STDMETHOD(InstallForm)(THIS_ ULONG ulUIParam, ULONG ulFlags,                \
1074                          LPCTSTR szCfgPathName) PURE;                         \
1075   STDMETHOD(RemoveForm)(THIS_ LPCSTR szMessageClass) PURE;                    \
1076   STDMETHOD(ResolveMessageClass) (THIS_ LPCSTR szMessageClass, ULONG ulFlags, \
1077                                   void * FAR *pforminfo) PURE;                \
1078   STDMETHOD(ResolveMultipleMessageClasses)                                    \
1079     (THIS_ LPSMESSAGECLASSARRAY pMsgClassArray, ULONG ulFlags,                \
1080      LPSMAPIFORMINFOARRAY FAR *ppfrminfoarray) PURE;                          \
1081   STDMETHOD(CalcFormPropSet)(THIS_  ULONG ulFlags,                            \
1082                              LPMAPIFORMPROPARRAY FAR *ppResults) PURE;        \
1083   STDMETHOD(GetDisplay)(THIS_ ULONG ulFlags,                                  \
1084                         LPTSTR FAR *pszDisplayName) PURE;
1085
1086
1087 EXTERN_C const IID IID_IMAPIFormContainer;
1088 #undef INTERFACE
1089 #define INTERFACE IMAPIFormContainer
1090 DECLARE_INTERFACE_(IMAPIFormContainer, IUnknown)
1091 {
1092   MY_IUNKNOWN_METHODS;
1093   MY_IMAPIFORMCONTAINER_METHODS;
1094 };
1095
1096
1097 \f
1098 #undef MY_IUNKNOWN_METHODS
1099 #undef MY_IMAPIPROP_METHODS
1100 #undef MY_IMSGSTORE_METHODS
1101 #undef MY_IMESSAGE_METHODS
1102 #undef MY_IMAPICONTAINER_METHODS
1103 #undef MY_IMAPIFOLDER_METHODS
1104 #undef MY_IMAPITABLE_METHODS
1105 #undef MY_IMAPISESSION_METHODS
1106 #undef MY_ISPOOLERHOOK_METHODS
1107 #undef MY_IMAPIFORMCONTAINER_METHODS
1108
1109
1110 \f
1111 /**** C Wrapper ****/
1112 #ifdef COBJMACROS
1113
1114 #define IMessage_CreateAttach(This,a,b,c,d) \
1115                 (This)->lpVtbl->CreateAttach ((This),(a),(b),(c),(d))
1116 #define IMessage_DeleteAttach(This,a,b,c,d) \
1117                 (This)->lpVtbl->DeleteAttach ((This),(a),(b),(c),(d))
1118 #define IMessage_SetProps(This,a,b,c) \
1119                 (This)->lpVtbl->SetProps ((This),(a),(b),(c))
1120 #define IMessage_DeleteProps(This,a,b) \
1121                 (This)->lpVtbl->DeleteProps ((This),(a),(b))
1122 #define IMessage_SaveChanges(This,a) (This)->lpVtbl->SaveChanges ((This),(a))
1123
1124 #define IAttach_Release(This)  (This)->lpVtbl->Release ((This))
1125 #define IAttach_SaveChanges(This,a) (This)->lpVtbl->SaveChanges ((This),(a))
1126 #define IAttach_OpenProperty(This,a,b,c,d,e) \
1127                 (This)->lpVtbl->OpenProperty ((This),(a),(b),(c),(d),(e))
1128
1129
1130
1131
1132 #endif /*COBJMACROS*/
1133
1134 \f
1135 /****  Function prototypes. *****/
1136
1137 ULONG   WINAPI UlAddRef(void*);
1138 ULONG   WINAPI UlRelease(void*);
1139 HRESULT WINAPI HrGetOneProp(LPMAPIPROP,ULONG,LPSPropValue*);
1140 HRESULT WINAPI HrSetOneProp(LPMAPIPROP,LPSPropValue);
1141 BOOL    WINAPI FPropExists(LPMAPIPROP,ULONG);
1142 void    WINAPI FreePadrlist(LPADRLIST);
1143 void    WINAPI FreeProws(LPSRowSet);
1144 HRESULT WINAPI HrQueryAllRows(LPMAPITABLE,LPSPropTagArray,LPSRestriction,
1145                               LPSSortOrderSet,LONG,LPSRowSet*);
1146 LPSPropValue WINAPI PpropFindProp(LPSPropValue,ULONG,ULONG);
1147
1148 HRESULT WINAPI RTFSync (LPMESSAGE, ULONG, BOOL FAR*);
1149
1150
1151 /* Memory allocation routines */
1152 typedef SCODE (WINAPI ALLOCATEBUFFER)(ULONG,LPVOID*);
1153 typedef SCODE (WINAPI ALLOCATEMORE)(ULONG,LPVOID,LPVOID*);
1154 typedef ULONG (WINAPI FREEBUFFER)(LPVOID);
1155 typedef ALLOCATEBUFFER *LPALLOCATEBUFFER;
1156 typedef ALLOCATEMORE *LPALLOCATEMORE;
1157 typedef FREEBUFFER *LPFREEBUFFER;
1158
1159 SCODE WINAPI MAPIAllocateBuffer (ULONG, LPVOID FAR *);
1160 ULONG WINAPI MAPIFreeBuffer (LPVOID);
1161
1162 void    MAPIUninitialize (void);
1163 HRESULT MAPIInitialize (LPVOID lpMapiInit);
1164
1165 #if defined (UNICODE)
1166 HRESULT WINAPI OpenStreamOnFile(LPALLOCATEBUFFER,LPFREEBUFFER,
1167                                 ULONG,LPWSTR,LPWSTR,LPSTREAM*);
1168 #else
1169 HRESULT WINAPI OpenStreamOnFile(LPALLOCATEBUFFER,LPFREEBUFFER,
1170                                 ULONG,LPSTR,LPSTR,LPSTREAM*);
1171 #endif
1172
1173
1174 STDAPI MAPIOpenLocalFormContainer (LPMAPIFORMCONTAINER FAR *ppfcnt);
1175
1176
1177 #ifdef __cplusplus
1178 }
1179 #endif
1180 #endif /* MAPI_H */