home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / mqmail.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  8.1 KB  |  222 lines

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