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 TNEF_H 7 #define TNEF_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 #ifndef BEGIN_INTERFACE 14 #define BEGIN_INTERFACE 15 #endif 16 17 typedef struct _STnefProblem { 18 ULONG ulComponent; 19 ULONG ulAttribute; 20 ULONG ulPropTag; 21 SCODE scode; 22 } STnefProblem; 23 24 typedef struct _STnefProblemArray { 25 ULONG cProblem; 26 STnefProblem aProblem[MAPI_DIM]; 27 } STnefProblemArray,*LPSTnefProblemArray; 28 29 #define CbNewSTnefProblemArray(_cprob) (offsetof(STnefProblemArray,aProblem) + (_cprob)*sizeof(STnefProblem)) 30 #define CbSTnefProblemArray(_lparray) (offsetof(STnefProblemArray,aProblem) + (UINT) ((_lparray)->cProblem*sizeof(STnefProblem))) 31 32 DECLARE_MAPI_INTERFACE_PTR(ITnef,LPITNEF); 33 34 #define TNEF_DECODE ((ULONG) 0) 35 #define TNEF_ENCODE ((ULONG) 2) 36 37 #define TNEF_PURE ((ULONG) 0x00010000) 38 #define TNEF_COMPATIBILITY ((ULONG) 0x00020000) 39 #define TNEF_BEST_DATA ((ULONG) 0x00040000) 40 #define TNEF_COMPONENT_ENCODING ((ULONG) 0x80000000) 41 42 #define TNEF_PROP_INCLUDE ((ULONG) 0x00000001) 43 #define TNEF_PROP_EXCLUDE ((ULONG) 0x00000002) 44 #define TNEF_PROP_CONTAINED ((ULONG) 0x00000004) 45 #define TNEF_PROP_MESSAGE_ONLY ((ULONG) 0x00000008) 46 #define TNEF_PROP_ATTACHMENTS_ONLY ((ULONG) 0x00000010) 47 #define TNEF_PROP_CONTAINED_TNEF ((ULONG) 0x00000040) 48 49 #define TNEF_COMPONENT_MESSAGE ((ULONG) 0x00001000) 50 #define TNEF_COMPONENT_ATTACHMENT ((ULONG) 0x00002000) 51 52 #define MAPI_ITNEF_METHODS(IPURE) MAPIMETHOD(AddProps) (THIS_ ULONG ulFlags,ULONG ulElemID,LPVOID lpvData,LPSPropTagArray lpPropList) IPURE; MAPIMETHOD(ExtractProps) (THIS_ ULONG ulFlags,LPSPropTagArray lpPropList,LPSTnefProblemArray *lpProblems) IPURE; MAPIMETHOD(Finish) (THIS_ ULONG ulFlags,WORD *lpKey,LPSTnefProblemArray *lpProblems) IPURE; MAPIMETHOD(OpenTaggedBody) (THIS_ LPMESSAGE lpMessage,ULONG ulFlags,LPSTREAM *lppStream) IPURE; MAPIMETHOD(SetProps) (THIS_ ULONG ulFlags,ULONG ulElemID,ULONG cValues,LPSPropValue lpProps) IPURE; MAPIMETHOD(EncodeRecips) (THIS_ ULONG ulFlags,LPMAPITABLE lpRecipientTable) IPURE; MAPIMETHOD(FinishComponent) (THIS_ ULONG ulFlags,ULONG ulComponentID,LPSPropTagArray lpCustomPropList,LPSPropValue lpCustomProps,LPSPropTagArray lpPropList,LPSTnefProblemArray *lpProblems) IPURE; 53 #undef INTERFACE 54 #define INTERFACE ITnef 55 DECLARE_MAPI_INTERFACE_(ITnef,IUnknown) { 56 BEGIN_INTERFACE 57 MAPI_IUNKNOWN_METHODS(PURE) 58 MAPI_ITNEF_METHODS(PURE) 59 }; 60 61 STDMETHODIMP OpenTnefStream(LPVOID lpvSupport,LPSTREAM lpStream,LPTSTR lpszStreamName,ULONG ulFlags,LPMESSAGE lpMessage,WORD wKeyVal,LPITNEF *lppTNEF); 62 typedef HRESULT (WINAPI *LPOPENTNEFSTREAM) (LPVOID lpvSupport,LPSTREAM lpStream,LPTSTR lpszStreamName,ULONG ulFlags,LPMESSAGE lpMessage,WORD wKeyVal,LPITNEF *lppTNEF); 63 STDMETHODIMP OpenTnefStreamEx(LPVOID lpvSupport,LPSTREAM lpStream,LPTSTR lpszStreamName,ULONG ulFlags,LPMESSAGE lpMessage,WORD wKeyVal,LPADRBOOK lpAdressBook,LPITNEF *lppTNEF); 64 typedef HRESULT (WINAPI *LPOPENTNEFSTREAMEX) (LPVOID lpvSupport,LPSTREAM lpStream,LPTSTR lpszStreamName,ULONG ulFlags,LPMESSAGE lpMessage,WORD wKeyVal,LPADRBOOK lpAdressBook,LPITNEF *lppTNEF); 65 STDMETHODIMP GetTnefStreamCodepage (LPSTREAM lpStream,ULONG *lpulCodepage,ULONG *lpulSubCodepage); 66 typedef HRESULT (WINAPI *LPGETTNEFSTREAMCODEPAGE) (LPSTREAM lpStream,ULONG *lpulCodepage,ULONG *lpulSubCodepage); 67 68 #define OPENTNEFSTREAM "OpenTnefStream" 69 #define OPENTNEFSTREAMEX "OpenTnefStreamEx" 70 #define GETTNEFSTREAMCODEPAGE "GetTnefStreamCodePage" 71 72 #define MAKE_TNEF_VERSION(_mj,_mn) (((ULONG)(0x0000FFFF & _mj) << 16) | (ULONG)(0x0000FFFF & _mn)) 73 #define TNEF_SIGNATURE ((ULONG) 0x223E9F78) 74 #define TNEF_VERSION ((ULONG) MAKE_TNEF_VERSION(1,0)) 75 76 typedef WORD ATYP; 77 enum { atypNull,atypFile,atypOle,atypPicture,atypMax }; 78 79 #define MAC_BINARY ((DWORD) 0x00000001) 80 81 #include <pshpack1.h> 82 typedef struct _renddata { 83 ATYP atyp; 84 ULONG ulPosition; 85 WORD dxWidth; 86 WORD dyHeight; 87 DWORD dwFlags; 88 } RENDDATA,*PRENDDATA; 89 #include <poppack.h> 90 91 #include <pshpack1.h> 92 typedef struct _dtr { 93 WORD wYear; 94 WORD wMonth; 95 WORD wDay; 96 WORD wHour; 97 WORD wMinute; 98 WORD wSecond; 99 WORD wDayOfWeek; 100 } DTR; 101 #include <poppack.h> 102 103 #define fmsNull ((BYTE) 0x00) 104 #define fmsModified ((BYTE) 0x01) 105 #define fmsLocal ((BYTE) 0x02) 106 #define fmsSubmitted ((BYTE) 0x04) 107 #define fmsRead ((BYTE) 0x20) 108 #define fmsHasAttach ((BYTE) 0x80) 109 110 #define trpidNull ((WORD) 0x0000) 111 #define trpidUnresolved ((WORD) 0x0001) 112 #define trpidResolvedNSID ((WORD) 0x0002) 113 #define trpidResolvedAddress ((WORD) 0x0003) 114 #define trpidOneOff ((WORD) 0x0004) 115 #define trpidGroupNSID ((WORD) 0x0005) 116 #define trpidOffline ((WORD) 0x0006) 117 #define trpidIgnore ((WORD) 0x0007) 118 #define trpidClassEntry ((WORD) 0x0008) 119 #define trpidResolvedGroupAddress ((WORD) 0x0009) 120 typedef struct _trp { 121 WORD trpid; 122 WORD cbgrtrp; 123 WORD cch; 124 WORD cbRgb; 125 } TRP,*PTRP,*PGRTRP,*LPTRP; 126 #define CbOfTrp(_p) (sizeof(TRP) + (_p)->cch + (_p)->cbRgb) 127 #define LpszOfTrp(_p) ((LPSTR)(((LPTRP) (_p)) + 1)) 128 #define LpbOfTrp(_p) (((LPBYTE)(((LPTRP)(_p)) + 1)) + (_p)->cch) 129 #define LptrpNext(_p) ((LPTRP)((LPBYTE)(_p) + CbOfTrp(_p))) 130 131 typedef DWORD XTYPE; 132 #define xtypeUnknown ((XTYPE) 0) 133 #define xtypeInternet ((XTYPE) 6) 134 135 #define cbDisplayName 41 136 #define cbEmailName 11 137 #define cbSeverName 12 138 typedef struct _ADDR_ALIAS { 139 char rgchName[cbDisplayName]; 140 char rgchEName[cbEmailName]; 141 char rgchSrvr[cbSeverName]; 142 ULONG dibDetail; 143 WORD type; 144 } ADDRALIAS,*LPADDRALIAS; 145 #define cbALIAS sizeof(ALIAS) 146 147 #define cbTYPE 16 148 #define cbMaxIdData 200 149 typedef struct _NSID { 150 DWORD dwSize; 151 unsigned char uchType[cbTYPE]; 152 XTYPE xtype; 153 LONG lTime; 154 union { 155 ADDRALIAS alias; 156 char rgchInterNet[1]; 157 } address; 158 } NSID,*LPNSID; 159 #define cbNSID sizeof(NSID) 160 161 #define prioLow 3 162 #define prioNorm 2 163 #define prioHigh 1 164 165 #define atpTriples ((WORD) 0x0000) 166 #define atpString ((WORD) 0x0001) 167 #define atpText ((WORD) 0x0002) 168 #define atpDate ((WORD) 0x0003) 169 #define atpShort ((WORD) 0x0004) 170 #define atpLong ((WORD) 0x0005) 171 #define atpByte ((WORD) 0x0006) 172 #define atpWord ((WORD) 0x0007) 173 #define atpDword ((WORD) 0x0008) 174 #define atpMax ((WORD) 0x0009) 175 176 #define LVL_MESSAGE ((BYTE) 0x01) 177 #define LVL_ATTACHMENT ((BYTE) 0x02) 178 179 #define ATT_ID(_att) ((WORD) ((_att) & 0x0000FFFF)) 180 #define ATT_TYPE(_att) ((WORD) (((_att) >> 16) & 0x0000FFFF)) 181 #define ATT(_atp,_id) ((((DWORD) (_atp)) << 16) | ((WORD) (_id))) 182 183 #define attNull ATT(0,0x0000) 184 #define attFrom ATT(atpTriples,0x8000) 185 #define attSubject ATT(atpString,0x8004) 186 #define attDateSent ATT(atpDate,0x8005) 187 #define attDateRecd ATT(atpDate,0x8006) 188 #define attMessageStatus ATT(atpByte,0x8007) 189 #define attMessageClass ATT(atpWord,0x8008) 190 #define attMessageID ATT(atpString,0x8009) 191 #define attParentID ATT(atpString,0x800A) 192 #define attConversationID ATT(atpString,0x800B) 193 #define attBody ATT(atpText,0x800C) 194 #define attPriority ATT(atpShort,0x800D) 195 #define attAttachData ATT(atpByte,0x800F) 196 #define attAttachTitle ATT(atpString,0x8010) 197 #define attAttachMetaFile ATT(atpByte,0x8011) 198 #define attAttachCreateDate ATT(atpDate,0x8012) 199 #define attAttachModifyDate ATT(atpDate,0x8013) 200 #define attDateModified ATT(atpDate,0x8020) 201 #define attAttachTransportFilename ATT(atpByte,0x9001) 202 #define attAttachRenddata ATT(atpByte,0x9002) 203 #define attMAPIProps ATT(atpByte,0x9003) 204 #define attRecipTable ATT(atpByte,0x9004) 205 #define attAttachment ATT(atpByte,0x9005) 206 #define attTnefVersion ATT(atpDword,0x9006) 207 #define attOemCodepage ATT(atpByte,0x9007) 208 #define attOriginalMessageClass ATT(atpWord,0x0006) 209 210 #define attOwner ATT(atpByte,0x0000) 211 #define attSentFor ATT(atpByte,0x0001) 212 #define attDelegate ATT(atpByte,0x0002) 213 #define attDateStart ATT(atpDate,0x0006) 214 #define attDateEnd ATT(atpDate,0x0007) 215 #define attAidOwner ATT(atpLong,0x0008) 216 #define attRequestRes ATT(atpShort,0x0009) 217 218 #ifdef __cplusplus 219 } 220 #endif 221 #endif 222