tnef.h 7.8 KB

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