Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
8.1 KiB

  1. /*++
  2. Copyright (c) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. mqmail.h
  5. Abstract:
  6. Master include file for Message Queue Exchange Connector
  7. or MAPI applications
  8. --*/
  9. #ifndef _MQMAIL_H
  10. #define _MQMAIL_H
  11. #if _MSC_VER > 1000
  12. #pragma once
  13. #endif
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif // __cplusplus
  17. //----------------------------------------------------------------
  18. //mail type-id for queues
  19. //----------------------------------------------------------------
  20. #include <windows.h>
  21. #include <windowsx.h>
  22. #include <ole2.h>
  23. /* 5eadc0d0-7182-11cf-a8ff-0020afb8fb50 */
  24. DEFINE_GUID(CLSID_MQMailQueueType,
  25. 0x5eadc0d0,
  26. 0x7182, 0x11cf,
  27. 0xa8, 0xff, 0x00, 0x20, 0xaf, 0xb8, 0xfb, 0x50);
  28. //----------------------------------------------------------------
  29. //recipient type (to, cc, bcc)
  30. //----------------------------------------------------------------
  31. typedef enum MQMailRecipType_enum
  32. {
  33. MQMailRecip_TO,
  34. MQMailRecip_CC,
  35. MQMailRecip_BCC,
  36. } MQMailRecipType;
  37. //----------------------------------------------------------------
  38. //recipient data
  39. //----------------------------------------------------------------
  40. typedef struct MQMailRecip_tag
  41. {
  42. LPSTR szName; //display name of recipient
  43. LPSTR szQueueLabel; //queue label of recipient
  44. LPSTR szAddress; //address, queue-label or user@queue-label
  45. MQMailRecipType iType; //recipient type (to, cc, bcc)
  46. LPFILETIME pftDeliveryTime; //delivery time (incase in a delivery report recipient list)
  47. LPSTR szNonDeliveryReason;//non-delivery reason (incase in a non-delivery report recipient list)
  48. } MQMailRecip, FAR * LPMQMailRecip;
  49. //----------------------------------------------------------------
  50. //recipient list
  51. //----------------------------------------------------------------
  52. typedef struct MQMailRecipList_tag
  53. {
  54. ULONG cRecips; //number of recips
  55. LPMQMailRecip FAR * apRecip; //pointer to a block of recip pointers
  56. } MQMailRecipList, FAR * LPMQMailRecipList;
  57. //----------------------------------------------------------------
  58. //types of value a form field can have
  59. //----------------------------------------------------------------
  60. typedef enum MQMailFormFieldType_enum
  61. {
  62. MQMailFormField_BOOL, //boolean data
  63. MQMailFormField_STRING, //string data
  64. MQMailFormField_LONG, //long data
  65. MQMailFormField_CURRENCY, //currency data
  66. MQMailFormField_DOUBLE, //double data
  67. } MQMailFormFieldType;
  68. //----------------------------------------------------------------
  69. //union of available types of values
  70. //----------------------------------------------------------------
  71. typedef union MQMailFormFieldData_tag
  72. {
  73. BOOL b; //use when type is MQMailFormField_BOOL
  74. LPSTR lpsz; //use when type is MQMailFormField_STRING
  75. LONG l; //use when type is MQMailFormField_LONG
  76. CY cy; //use when type is MQMailFormField_CURRENCY
  77. double dbl; //use when type is MQMailFormField_DOUBLE
  78. } MQMailFormFieldData, FAR * LPMQMailFormFieldData;
  79. //----------------------------------------------------------------
  80. //form field
  81. //----------------------------------------------------------------
  82. typedef struct MQMailFormField_tag
  83. {
  84. LPSTR szName; //name of field
  85. MQMailFormFieldType iType; //type of value (boolean, string)
  86. MQMailFormFieldData Value; //value (union of available types)
  87. } MQMailFormField, FAR * LPMQMailFormField;
  88. //----------------------------------------------------------------
  89. //list of form fields
  90. //----------------------------------------------------------------
  91. typedef struct MQMailFormFieldList_tag
  92. {
  93. ULONG cFields; //number of fields
  94. LPMQMailFormField FAR * apField; //pointer to a block of field pointers
  95. } MQMailFormFieldList, FAR * LPMQMailFormFieldList;
  96. //----------------------------------------------------------------
  97. //types of EMail
  98. //----------------------------------------------------------------
  99. typedef enum MQMailEMailType_enum
  100. {
  101. MQMailEMail_MESSAGE, //text message
  102. MQMailEMail_FORM, //form with fields
  103. MQMailEMail_TNEF, //tnef data
  104. MQMailEMail_DELIVERY_REPORT, //delivery report
  105. MQMailEMail_NON_DELIVERY_REPORT,//non-delivery report
  106. } MQMailEMailType;
  107. //----------------------------------------------------------------
  108. //message specific data
  109. //----------------------------------------------------------------
  110. typedef struct MQMailMessageData_tag
  111. {
  112. LPSTR szText; //message text
  113. } MQMailMessageData, FAR * LPMQMailMessageData;
  114. //----------------------------------------------------------------
  115. //form specific data
  116. //----------------------------------------------------------------
  117. typedef struct MQMailFormData_tag
  118. {
  119. LPSTR szName; //name of form
  120. LPMQMailFormFieldList pFields; //list of fields
  121. } MQMailFormData, FAR * LPMQMailFormData;
  122. //----------------------------------------------------------------
  123. //tnef specific data
  124. //----------------------------------------------------------------
  125. typedef struct MQMailTnefData_tag
  126. {
  127. ULONG cbData; //size of tnef data
  128. LPBYTE lpbData; //tnef data buffer
  129. } MQMailTnefData, FAR * LPMQMailTnefData;
  130. //----------------------------------------------------------------
  131. //delivery report specific data
  132. //----------------------------------------------------------------
  133. typedef struct MQMailDeliveryReportData_tag
  134. {
  135. LPMQMailRecipList pDeliveredRecips; //delivered recipients
  136. LPSTR szOriginalSubject; //original mail subject
  137. LPFILETIME pftOriginalDate; //original mail sending time
  138. } MQMailDeliveryReportData, FAR * LPMQMailDeliveryReportData;
  139. //----------------------------------------------------------------
  140. //non-delivery report specific data
  141. //----------------------------------------------------------------
  142. typedef struct MQMailEMail_tag MQMailEMail, FAR * LPMQMailEMail;
  143. typedef struct MQMailNonDeliveryReportData_tag
  144. {
  145. LPMQMailRecipList pNonDeliveredRecips;//non-delivered recipients
  146. LPMQMailEMail pOriginalEMail; //original mail
  147. } MQMailNonDeliveryReportData, FAR * LPMQMailNonDeliveryReportData;
  148. //----------------------------------------------------------------
  149. //EMail basic data and specific form/message data
  150. //----------------------------------------------------------------
  151. typedef struct MQMailEMail_tag
  152. {
  153. LPMQMailRecip pFrom; //sender
  154. LPSTR szSubject; //subject
  155. BOOL fRequestDeliveryReport; //request delivery report
  156. BOOL fRequestNonDeliveryReport; //request non-delivery report
  157. LPFILETIME pftDate; //sending time
  158. LPMQMailRecipList pRecips; //recipients
  159. MQMailEMailType iType; //type of EMail (message, form, etc...)
  160. union //union of available EMail types
  161. {
  162. MQMailFormData form; //use when type is MQMailEMail_FORM
  163. MQMailMessageData message; //use when type is MQMailEMail_MESSAGE
  164. MQMailTnefData tnef; //use when type is MQMailEMail_TNEF
  165. MQMailDeliveryReportData DeliveryReport; //use when type is MQMailEMail_DELIVERY_REPORT
  166. MQMailNonDeliveryReportData NonDeliveryReport; //use when type is MQMailEMail_NON_DELIVERY_REPORT
  167. };
  168. LPVOID pReserved; //should be set to NULL
  169. } MQMailEMail, FAR * LPMQMailEMail;
  170. //----------------------------------------------------------------
  171. //creates a falcon message body out of an EMail structure
  172. //----------------------------------------------------------------
  173. STDAPI MQMailComposeBody(LPMQMailEMail pEMail,
  174. ULONG FAR * pcbBuffer,
  175. LPBYTE FAR * ppbBuffer);
  176. //----------------------------------------------------------------
  177. //creates an EMail structure out of a falcon message body
  178. //----------------------------------------------------------------
  179. STDAPI MQMailParseBody(ULONG cbBuffer,
  180. LPBYTE pbBuffer,
  181. LPMQMailEMail FAR * ppEMail);
  182. //----------------------------------------------------------------
  183. //frees memory that was allocated by MQMail like *ppEmail in MQMailParseBody
  184. // or *ppBuffer in MQMailComposeBody.
  185. //----------------------------------------------------------------
  186. STDAPI_(void) MQMailFreeMemory(LPVOID lpBuffer);
  187. #ifdef __cplusplus
  188. }
  189. #endif
  190. #endif //_MQMAIL_H