Source code of Windows XP (NT5)
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.

345 lines
9.3 KiB

  1. /***************************************************************************
  2. Name : faxcover.h
  3. Comment : Fax Cover Page declarations
  4. Functions : (see Prototypes just below)
  5. Created : 03/18/94
  6. Author : Bruce J Kelley
  7. Contribs : Andrew Waters 8/11/94 Added MAPI prop structures and
  8. header information
  9. ***************************************************************************/
  10. //#define COVER_PAGE_EDITOR "awcpe.exe"
  11. #define CPE_TEMP_FILE_NAME "~awcpet."
  12. #define CPE_EXTENSION "cpd"
  13. #define NEWLINE "\n"
  14. // This is the exported name of the support entry point
  15. #define CPE_SUPPORT_FUNCTION_NAME "CPESupportProc"
  16. // Typedefs for the memory mapped file
  17. //This is the list of properties in the order they are stored in the file
  18. enum
  19. {
  20. // Recipient properties
  21. cperRECIPIENT_SIZE=0,
  22. cperRECIPIENT_NAME,
  23. cperRECIPIENT_TITLE,
  24. cperRECIPIENT_DEPARTMENT,
  25. cperRECIPIENT_OFFICE_LOCATION,
  26. cperRECIPIENT_COMPANY,
  27. cperRECIPIENT_STREET_ADDRESS,
  28. cperRECIPIENT_POST_OFFICE_BOX,
  29. cperRECIPIENT_LOCALITY,
  30. cperRECIPIENT_STATE,
  31. cperRECIPIENT_POSTAL_CODE,
  32. cperRECIPIENT_COUNTRY,
  33. cperRECIPIENT_HOME_PHONE,
  34. cperRECIPIENT_WORK_PHONE,
  35. cperRECIPIENT_FAX_PHONE,
  36. cperLAST
  37. } cper;
  38. enum
  39. {
  40. // Sender properties
  41. cpesdSENDER_SIZE=0,
  42. cpesdSENDER_NAME,
  43. cpesdSENDER_FAX_PHONE,
  44. cpesdSENDER_COMPANY,
  45. cpesdSENDER_TITLE,
  46. cpesdSENDER_ADDRESS,
  47. cpesdSENDER_DEPARTMENT,
  48. cpesdSENDER_HOME_PHONE,
  49. cpesdSENDER_WORK_PHONE,
  50. cpesdSENDER_OFFICE_LOCATION,
  51. // List properties that don't change
  52. cpesdRECIPIENT_TO_LIST,
  53. cpesdRECIPIENT_CC_LIST,
  54. // Message related properties
  55. cpesdMESSAGE_SUBJECT,
  56. cpesdMESSAGE_SUBMISSION_TIME,
  57. cpesdMESSAGE_BILLING_CODE,
  58. // Configuration properties
  59. cpesdCONFIG_CPE_TEMPLATE,
  60. cpesdCONFIG_PRINT_DEVICE,
  61. // Miscellanous message properties
  62. cpesdMISC_ATTACHMENT_NAME_LIST,
  63. cpesdMISC_USER_DEFINED,
  64. // Count properties
  65. cpesdCOUNT_ATTACHMENTS,
  66. cpesdCOUNT_RECIPIENTS,
  67. cpesdCOUNT_PAGES,
  68. // Derived property so CPE can get at PR_BODY data
  69. // using the tempfile copy of PR_BODY
  70. cpesdMESSAGE_BODY_FILENAME,
  71. // Internal Data that isn't in the public interface
  72. cpesdERROR_EVENT,
  73. cpesdFINISH_EVENT,
  74. cpesdNEXT_EVENT,
  75. cpesdRECIP_ATOM,
  76. cpesdLAST
  77. } cpesd;
  78. typedef struct EntryTAG
  79. {
  80. DWORD dwOffset; //Offset of this entry in the file
  81. DWORD dwSize; //Size of entry in body. If it is a string this includes the NULL.
  82. } ENTRY;
  83. typedef struct CPESD_HeaderTAG
  84. {
  85. ENTRY rgEntries[cpesdLAST]; // This is always first in the file
  86. } CPESD_HEADER, FAR *LPCPESD_HEADER;
  87. typedef struct CPER_HeaderTAG
  88. {
  89. ENTRY rgEntries[cperLAST];
  90. } CPER_HEADER, FAR *LPCPER_HEADER;
  91. enum
  92. {
  93. // Static data not associated with a user.
  94. sdmprPR_DISPLAY_TO=0,
  95. sdmprPR_DISPLAY_CC,
  96. sdmprPR_SUBJECT,
  97. sdmprPR_CLIENT_SUBMIT_TIME,
  98. sdmprPR_FAX_BILLING_CODE,
  99. sdmprPR_FAX_CP_NAME,
  100. sdmpr_LAST
  101. } sdmpr;
  102. extern const struct _SPropTagArray_StaticDataMessage_PropTagArray;
  103. enum
  104. {
  105. // Sender Properties
  106. sdpprPR_SENDER_NAME=0,
  107. sdpprPR_SENDER_EMAIL_ADDR,
  108. sdpprPR_COMPANY_NAME,
  109. sdpprPR_TITLE,
  110. sdpprPR_POSTAL_ADDRESS,
  111. sdpprPR_DEPARTMENT_NAME,
  112. sdpprPR_HOME_TELEPHONE_NUMBER,
  113. sdpprPR_OFFICE_TELEPHONE_NUMBER,
  114. sdpprPR_OFFICE_LOCATION,
  115. sdppr_LAST
  116. } sdppr;
  117. extern const struct _SPropTagArray_StaticDataProfile_PropTagArray;
  118. // Recipient Property array. This is the array that will be upated between
  119. // each cover page that is printed
  120. enum
  121. {
  122. rprPR_DISPLAY_NAME=0,
  123. rprPR_TITLE,
  124. rprPR_DEPARTMENT_NAME,
  125. rprPR_OFFICE_LOCATION,
  126. rprPR_COMPANY_NAME,
  127. rprPR_RECIPIENT_STREET_ADDRESS,
  128. rprPR_RECIPIENT_POST_OFFICE_BOX,
  129. rprPR_RECIPIENT_LOCALITY,
  130. rprPR_RECIPIENT_STATE,
  131. rprPR_RECIPIENT_POSTAL_CODE,
  132. rprPR_RECIPIENT_COUNTRY,
  133. rprPR_HOME_TELEPHONE_NUMBER,
  134. rprPR_OFFICE_TELEPHONE_NUMBER,
  135. rprPR_EMAIL_ADDRESS, //This is considered the fax number
  136. rprPR_MAILBOX,
  137. rprPR_FAX_CP_NAME,
  138. rpr_LAST
  139. } rpr;
  140. extern const struct _SPropTagArray_Recipient_PropTagArray;
  141. /* Data that is not in the above structures is :
  142. COUNT_RECIPIENTS - This is in the faxjob.uNumRecipients
  143. COUNT_ATTACHMENTS - This is in faxjob.uNumAttachments
  144. COUNT_PAGES - This is in format.wNumPages I need to increment this once to
  145. add in the cover page.
  146. MISC_ATTACHMENT_NAME_LIST - This would require gettting an attachment table
  147. */
  148. /*
  149. Event structure used for determination of which event signaled
  150. */
  151. typedef enum _CPE_PRINT_EVENTS{
  152. CPE_ERROR_EVENT = 0,
  153. CPE_PRINT_JOB_EVENT,
  154. CPE_PRINT_ERROR_EVENT,
  155. CPE_PRINT_ID_EVENT,
  156. CPE_TIMEOUT= WAIT_TIMEOUT,
  157. CPE_FAILED = WAIT_FAILED
  158. } CPE_PRINT_EVENTS, *PCPE_PRINT_EVENTS;
  159. #define C_CPE_EVENTS 4 //This is the number of events that will be waited on
  160. // Return value from
  161. typedef enum _WAIT_CP_RETURN {
  162. WCP_DONE_OK,
  163. WCP_DONE_FAILURE,
  164. WCP_TIMEOUT
  165. } WAIT_CP_RETURN, * LPWAIT_CP_RETURN;
  166. // THESE MUST BE IDENTICAL TO THE ONES IN AWCPESUP.H!!!!!!!
  167. // This is the root level key where the CPE specific sub keys are stored
  168. #define CPE_SUPPORT_ROOT_KEY ("Software\\Microsoft\\At Work Fax\\Transport Service Provider")
  169. // This is the location where the CPE puts the command line to used when calling it to print
  170. // cover pages at send time. The format is total at the CPE's discretion. The transport will
  171. // look for the string "SESS_ID" and replace it with the current session id. The session ID is
  172. // a DWORD.
  173. #define CPE_COMMAND_LINE_KEY ("Cover Page Editor")
  174. // This key contains the DLL name that the CPE loads to get the Support Object
  175. #define CPE_SUPPORT_DLL_KEY ("CPE Support DLL")
  176. //This is the key that holds the name of the function in the Support DLL that is the actual "Service Entry"
  177. #define CPE_SUPPORT_FUNCTION_NAME_KEY ("CPE Support Function Name")
  178. // END IDENTICAL
  179. // Function prototypes
  180. // This is in cover.c. It is used to init the CPE transport interface
  181. BOOL InitCPEInterface(HINSTANCE);
  182. /*
  183. CreateCPStaticDataMapping
  184. Variable comments
  185. pszBodyFile = File containing message body text from PR_BODY.
  186. atSDFile is an atom representing the name of the file mapping
  187. hSDFile is the handle to the file mapping
  188. hCPErrEvt is set by the support object on error from the CPE
  189. hCPNxtEvt is set by the transport to cause the CPE to print the next page
  190. hCPFinEvt is set by the transport to notify the CPE that the job is done
  191. */
  192. BOOL CreateCPStaticDataMapping(NPFAXJOB ppFaxJob,
  193. WORD wNumPages,
  194. LPTSTR pszBodyFile,
  195. LPATOM atSDFile,
  196. LPHANDLE hSDFile,
  197. LPATOM atCPErrEvt,
  198. LPHANDLE hCPErrEvt,
  199. LPATOM atCPNxtEvt,
  200. LPHANDLE hCPNxtEvt,
  201. LPATOM atCPFinEvt,
  202. LPHANDLE hCPFinEvt);
  203. BOOL DestroyCPStaticDataMapping(LPATOM atSDFile,
  204. LPHANDLE hSDFile,
  205. LPATOM atCPErrEvt,
  206. LPHANDLE hCPErrEvt,
  207. LPATOM atCPNxtEvt,
  208. LPHANDLE hCPNxtEvt,
  209. LPATOM atCPFinEvt,
  210. LPHANDLE hCPFinEvt);
  211. /***************************************************************************
  212. Name : RenderRecipCoverPage
  213. Purpose : This function renders a cover page for a single recipient
  214. Parameters:
  215. pFaxJob is a pointer to the current job structure.
  216. pFormat is a pointer to the current format structure.
  217. pRecip is a pointer to the current recipient.
  218. atSDFile is the atom for the static data mapping.
  219. pfCPEExec is a bool used to trak the cover page editor.
  220. Returns : TRUE on succuss, FALSE on failure
  221. ***************************************************************************/
  222. BOOL RenderRecipCoverPage(NPFAXJOB pFaxJob,
  223. NPFORMAT pFormat,
  224. NPEFAX_RECIPIENT pRecip,
  225. ATOM atSDFile,
  226. PBOOL pfCPEExec,
  227. HANDLE hCPErrEvt,
  228. HANDLE hCPNxtEvt,
  229. LPDELFILENODE * lppDeleteFiles);
  230. /*
  231. CreateCPRecipientMapping
  232. variable comments
  233. hrpCur is a handle to the current recipient
  234. atRDFile is the atom to the memmap name
  235. hRMFile is a handle to the open memap file
  236. */
  237. BOOL CreateCPRecipientMapping(NPFAXJOB pFaxJob,
  238. NPEFAX_RECIPIENT hrpCur,
  239. LPATOM patRDFile,
  240. LPHANDLE phRMFile);
  241. BOOL DestroyCPRecipientMapping(LPATOM patRDFile,
  242. LPHANDLE phRMFile);
  243. /*
  244. SetupCPRenderRecip
  245. variable comments
  246. npft is a pointer to the format structure for the job
  247. hrpCur is the handle to the current recipient
  248. prp is a pointer to the current renderer properties
  249. phDevMem is a handle to the shared devlayer memory [out]
  250. phDevlayer is a handle to the devlayer [out]
  251. pjd is a pointer to jobdata [out]
  252. */
  253. BOOL SetupCPRenderRecip(NPFORMAT npft,
  254. NPEFAX_RECIPIENT hrpCur,
  255. LPRENDER_PRINT prp,
  256. LPHANDLE phDevMem,
  257. LPHANDLE phDevlayer,
  258. PJOBSUMMARYDATA *pjd);
  259. BOOL DestroyCPRenderRecip(NPFORMAT npft,
  260. NPEFAX_RECIPIENT hrpCur,
  261. LPRENDER_PRINT prp,
  262. LPHANDLE phDevMem,
  263. LPHANDLE phDevlayer,
  264. PJOBSUMMARYDATA *pjd);
  265. /*
  266. CreateCPECommandLine
  267. variable comments
  268. atSDFile is the atom for the static data mapping
  269. atRDFile is the atom for the recipient data mapping
  270. ppszCPECmdLn is where the command line is returned
  271. */
  272. BOOL CreateCPECommandLine(ATOM atSDFile,
  273. ATOM atRDFile,
  274. LPTSTR *ppszCPECmdLn);
  275. /*
  276. WaitCPEvents
  277. variable comments
  278. lpvYieldParm is a parameter for MapiYield
  279. prp is a handle to the current renderer properties
  280. hCPErrEvt is a handle to CPError event
  281. */
  282. WAIT_CP_RETURN WaitCPEvents(LPVOID lpvYieldParm,
  283. LPRENDER_PRINT prp,
  284. HANDLE hCPErrEvt);