Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef MAPI_H
      7 #define MAPI_H
      8 
      9 #ifdef __cplusplus
     10 extern "C" {
     11 #endif
     12 
     13 #ifndef EXPORT
     14 #define EXPORT
     15 #endif
     16 
     17   typedef unsigned __LONG32 *LPULONG;
     18   typedef unsigned __LONG32 FLAGS;
     19 
     20 #ifndef __LHANDLE
     21 #define __LHANDLE
     22   typedef ULONG_PTR LHANDLE,*LPLHANDLE;
     23 #endif
     24 
     25   typedef unsigned char *LPBYTE;
     26 
     27 #define lhSessionNull ((LHANDLE)0)
     28 
     29   typedef struct {
     30     ULONG ulReserved;
     31     ULONG flFlags;
     32     ULONG nPosition;
     33     LPSTR lpszPathName;
     34     LPSTR lpszFileName;
     35     LPVOID lpFileType;
     36   } MapiFileDesc,*lpMapiFileDesc;
     37 
     38 #define MAPI_OLE 0x00000001
     39 #define MAPI_OLE_STATIC 0x00000002
     40 
     41   typedef struct {
     42     ULONG ulReserved;
     43     ULONG cbTag;
     44     LPBYTE lpTag;
     45     ULONG cbEncoding;
     46     LPBYTE lpEncoding;
     47   } MapiFileTagExt,*lpMapiFileTagExt;
     48 
     49   typedef struct {
     50     ULONG ulReserved;
     51     ULONG ulRecipClass;
     52     LPSTR lpszName;
     53     LPSTR lpszAddress;
     54     ULONG ulEIDSize;
     55     LPVOID lpEntryID;
     56   } MapiRecipDesc,*lpMapiRecipDesc;
     57 
     58 #ifndef MAPI_ORIG
     59 #define MAPI_ORIG 0
     60 #define MAPI_TO 1
     61 #define MAPI_CC 2
     62 #define MAPI_BCC 3
     63 #endif
     64 
     65   typedef struct {
     66     ULONG ulReserved;
     67     LPSTR lpszSubject;
     68     LPSTR lpszNoteText;
     69     LPSTR lpszMessageType;
     70     LPSTR lpszDateReceived;
     71     LPSTR lpszConversationID;
     72     FLAGS flFlags;
     73     lpMapiRecipDesc lpOriginator;
     74     ULONG nRecipCount;
     75     lpMapiRecipDesc lpRecips;
     76     ULONG nFileCount;
     77     lpMapiFileDesc lpFiles;
     78   } MapiMessage,*lpMapiMessage;
     79 
     80 #define MAPI_UNREAD 0x00000001
     81 #define MAPI_RECEIPT_REQUESTED 0x00000002
     82 #define MAPI_SENT 0x00000004
     83 
     84 #define MAPI_LOGON_UI 0x00000001
     85 #ifndef MAPI_PASSWORD_UI
     86 #define MAPI_PASSWORD_UI 0x00020000
     87 #endif
     88 #define MAPI_NEW_SESSION 0x00000002
     89 #define MAPI_FORCE_DOWNLOAD 0x00001000
     90 #define MAPI_EXTENDED 0x00000020
     91 
     92 #ifndef MAPI_DIALOG
     93 #define MAPI_DIALOG 0x00000008
     94 #endif
     95 
     96 #define MAPI_UNREAD_ONLY 0x00000020
     97 #define MAPI_GUARANTEE_FIFO 0x00000100
     98 #define MAPI_LONG_MSGID 0x00004000
     99 
    100 #define MAPI_PEEK 0x00000080
    101 #define MAPI_SUPPRESS_ATTACH 0x00000800
    102 #define MAPI_ENVELOPE_ONLY 0x00000040
    103 #define MAPI_BODY_AS_FILE 0x00000200
    104 
    105 #define MAPI_AB_NOMODIFY 0x00000400
    106 
    107   typedef ULONG (WINAPI MAPILOGON)(ULONG_PTR ulUIParam,LPSTR lpszProfileName,LPSTR lpszPassword,FLAGS flFlags,ULONG ulReserved,LPLHANDLE lplhSession);
    108   typedef MAPILOGON *LPMAPILOGON;
    109   MAPILOGON MAPILogon;
    110 
    111   typedef ULONG (WINAPI MAPILOGOFF)(LHANDLE lhSession,ULONG_PTR ulUIParam,FLAGS flFlags,ULONG ulReserved);
    112   typedef MAPILOGOFF *LPMAPILOGOFF;
    113   MAPILOGOFF MAPILogoff;
    114 
    115   typedef ULONG (WINAPI MAPISENDMAIL)(LHANDLE lhSession,ULONG_PTR ulUIParam,lpMapiMessage lpMessage,FLAGS flFlags,ULONG ulReserved);
    116   typedef MAPISENDMAIL *LPMAPISENDMAIL;
    117   MAPISENDMAIL MAPISendMail;
    118 
    119   typedef ULONG (WINAPI MAPISENDDOCUMENTS)(ULONG_PTR ulUIParam,LPSTR lpszDelimChar,LPSTR lpszFilePaths,LPSTR lpszFileNames,ULONG ulReserved);
    120   typedef MAPISENDDOCUMENTS *LPMAPISENDDOCUMENTS;
    121   MAPISENDDOCUMENTS MAPISendDocuments;
    122 
    123   typedef ULONG (WINAPI MAPIFINDNEXT)(LHANDLE lhSession,ULONG_PTR ulUIParam,LPSTR lpszMessageType,LPSTR lpszSeedMessageID,FLAGS flFlags,ULONG ulReserved,LPSTR lpszMessageID);
    124   typedef MAPIFINDNEXT *LPMAPIFINDNEXT;
    125   MAPIFINDNEXT MAPIFindNext;
    126 
    127   typedef ULONG (WINAPI MAPIREADMAIL)(LHANDLE lhSession,ULONG_PTR ulUIParam,LPSTR lpszMessageID,FLAGS flFlags,ULONG ulReserved,lpMapiMessage *lppMessage);
    128   typedef MAPIREADMAIL *LPMAPIREADMAIL;
    129   MAPIREADMAIL MAPIReadMail;
    130 
    131   typedef ULONG (WINAPI MAPISAVEMAIL)(LHANDLE lhSession,ULONG_PTR ulUIParam,lpMapiMessage lpMessage,FLAGS flFlags,ULONG ulReserved,LPSTR lpszMessageID);
    132   typedef MAPISAVEMAIL *LPMAPISAVEMAIL;
    133   MAPISAVEMAIL MAPISaveMail;
    134 
    135   typedef ULONG (WINAPI MAPIDELETEMAIL)(LHANDLE lhSession,ULONG_PTR ulUIParam,LPSTR lpszMessageID,FLAGS flFlags,ULONG ulReserved);
    136   typedef MAPIDELETEMAIL *LPMAPIDELETEMAIL;
    137   MAPIDELETEMAIL MAPIDeleteMail;
    138 
    139   typedef ULONG (EXPORT WINAPI *LPMAPIFREEBUFFER)(LPVOID pv);
    140 
    141   ULONG WINAPI MAPIFreeBuffer(LPVOID pv);
    142 
    143   typedef ULONG (WINAPI MAPIADDRESS)(LHANDLE lhSession,ULONG_PTR ulUIParam,LPSTR lpszCaption,ULONG nEditFields,LPSTR lpszLabels,ULONG nRecips,lpMapiRecipDesc lpRecips,FLAGS flFlags,ULONG ulReserved,LPULONG lpnNewRecips,lpMapiRecipDesc *lppNewRecips);
    144   typedef MAPIADDRESS *LPMAPIADDRESS;
    145   MAPIADDRESS MAPIAddress;
    146 
    147   typedef ULONG (WINAPI MAPIDETAILS)(LHANDLE lhSession,ULONG_PTR ulUIParam,lpMapiRecipDesc lpRecip,FLAGS flFlags,ULONG ulReserved);
    148   typedef MAPIDETAILS *LPMAPIDETAILS;
    149   MAPIDETAILS MAPIDetails;
    150 
    151   typedef ULONG (WINAPI MAPIRESOLVENAME)(LHANDLE lhSession,ULONG_PTR ulUIParam,LPSTR lpszName,FLAGS flFlags,ULONG ulReserved,lpMapiRecipDesc *lppRecip);
    152   typedef MAPIRESOLVENAME *LPMAPIRESOLVENAME;
    153   MAPIRESOLVENAME MAPIResolveName;
    154 
    155 #ifndef SUCCESS_SUCCESS
    156 #define SUCCESS_SUCCESS 0
    157 #endif
    158 #define MAPI_USER_ABORT 1
    159 #define MAPI_E_USER_ABORT MAPI_USER_ABORT
    160 #define MAPI_E_FAILURE 2
    161 #define MAPI_E_LOGON_FAILURE 3
    162 #define MAPI_E_LOGIN_FAILURE MAPI_E_LOGON_FAILURE
    163 #define MAPI_E_DISK_FULL 4
    164 #define MAPI_E_INSUFFICIENT_MEMORY 5
    165 #define MAPI_E_ACCESS_DENIED 6
    166 #define MAPI_E_TOO_MANY_SESSIONS 8
    167 #define MAPI_E_TOO_MANY_FILES 9
    168 #define MAPI_E_TOO_MANY_RECIPIENTS 10
    169 #define MAPI_E_ATTACHMENT_NOT_FOUND 11
    170 #define MAPI_E_ATTACHMENT_OPEN_FAILURE 12
    171 #define MAPI_E_ATTACHMENT_WRITE_FAILURE 13
    172 #define MAPI_E_UNKNOWN_RECIPIENT 14
    173 #define MAPI_E_BAD_RECIPTYPE 15
    174 #define MAPI_E_NO_MESSAGES 16
    175 #define MAPI_E_INVALID_MESSAGE 17
    176 #define MAPI_E_TEXT_TOO_LARGE 18
    177 #define MAPI_E_INVALID_SESSION 19
    178 #define MAPI_E_TYPE_NOT_SUPPORTED 20
    179 #define MAPI_E_AMBIGUOUS_RECIPIENT 21
    180 #define MAPI_E_AMBIG_RECIP MAPI_E_AMBIGUOUS_RECIPIENT
    181 #define MAPI_E_MESSAGE_IN_USE 22
    182 #define MAPI_E_NETWORK_FAILURE 23
    183 #define MAPI_E_INVALID_EDITFIELDS 24
    184 #define MAPI_E_INVALID_RECIPS 25
    185 #define MAPI_E_NOT_SUPPORTED 26
    186 
    187 #ifdef MAPIX_H
    188   STDMETHODIMP_(SCODE) ScMAPIXFromSMAPI(LHANDLE lhSimpleSession,ULONG ulFlags,LPCIID lpInterface,LPMAPISESSION*lppMAPISession);
    189 #endif
    190 
    191 #ifdef __cplusplus
    192 }
    193 #endif
    194 #endif
    195