home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / msmqocm.cab / mqmail.h < prev    next >
C/C++ Source or Header  |  1997-10-06  |  8KB  |  215 lines

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