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.

243 lines
9.9 KiB

  1. // FaxDoc.h : Declaration of the CFaxDoc
  2. #ifndef __FAXDOC_H_
  3. #define __FAXDOC_H_
  4. #include "resource.h" // main symbols
  5. #include "faxsvr.h"
  6. #include <winfax.h>
  7. /////////////////////////////////////////////////////////////////////////////
  8. // CFaxDoc
  9. class ATL_NO_VTABLE CFaxDoc :
  10. public CComObjectRootEx<CComSingleThreadModel>,
  11. public CComCoClass<CFaxDoc, &CLSID_FaxDoc>,
  12. public ISupportErrorInfo,
  13. public IDispatchImpl<IFaxDoc, &IID_IFaxDoc, &LIBID_FAXCOMLib>
  14. {
  15. public:
  16. CFaxDoc()
  17. {
  18. m_DiscountSend = FALSE;
  19. m_SendCoverpage = FALSE;
  20. m_FaxCoverpageInfo = NULL;
  21. m_FaxJobParams = NULL;
  22. m_FileName = NULL;
  23. m_JobId = 0;
  24. m_TapiConnectionObject = NULL;
  25. CFaxServer* m_pFaxServer = NULL;
  26. m_FaxNumber = NULL;
  27. m_Tsid = NULL;
  28. m_BillingCode = NULL;
  29. m_EmailAddress = NULL;;
  30. m_DocumentName = NULL;;
  31. m_Note = NULL;
  32. m_Subject = NULL;
  33. m_CoverpageName = NULL;
  34. m_RecipientName = NULL;
  35. m_RecipientNumber = NULL;
  36. m_RecipientCompany = NULL;
  37. m_RecipientAddress = NULL;
  38. m_RecipientCity = NULL;
  39. m_RecipientState = NULL;
  40. m_RecipientZip = NULL;
  41. m_RecipientCountry = NULL;
  42. m_RecipientTitle = NULL;
  43. m_RecipientDepartment = NULL;
  44. m_RecipientOffice = NULL;
  45. m_RecipientHomePhone = NULL;
  46. m_RecipientOfficePhone = NULL;
  47. m_SenderName = NULL;
  48. m_SenderCompany = NULL;
  49. m_SenderAddress = NULL;
  50. m_SenderTitle = NULL;
  51. m_SenderDepartment = NULL;
  52. m_SenderOfficeLocation = NULL;
  53. m_SenderHomePhone = NULL;
  54. m_SenderOfficePhone = NULL;
  55. m_SenderFax = NULL;
  56. //
  57. // prefill in the params...
  58. //
  59. FaxCompleteJobParams(&m_FaxJobParams,&m_FaxCoverpageInfo);
  60. if (m_FaxJobParams && m_FaxCoverpageInfo) {
  61. m_CoverpageName =SysAllocString(m_FaxCoverpageInfo->CoverPageName);
  62. m_RecipientName =SysAllocString(m_FaxCoverpageInfo->RecName);
  63. m_RecipientNumber =SysAllocString(m_FaxCoverpageInfo->RecFaxNumber);
  64. m_RecipientCompany =SysAllocString(m_FaxCoverpageInfo->RecCompany);
  65. m_RecipientAddress =SysAllocString(m_FaxCoverpageInfo->RecStreetAddress);
  66. m_RecipientCity =SysAllocString(m_FaxCoverpageInfo->RecCity);
  67. m_RecipientState =SysAllocString(m_FaxCoverpageInfo->RecState);
  68. m_RecipientZip =SysAllocString(m_FaxCoverpageInfo->RecZip);
  69. m_RecipientCountry =SysAllocString(m_FaxCoverpageInfo->RecCountry);
  70. m_RecipientTitle =SysAllocString(m_FaxCoverpageInfo->RecTitle);
  71. m_RecipientDepartment =SysAllocString(m_FaxCoverpageInfo->RecDepartment);
  72. m_RecipientOffice =SysAllocString(m_FaxCoverpageInfo->RecOfficeLocation);
  73. m_RecipientHomePhone =SysAllocString(m_FaxCoverpageInfo->RecHomePhone);
  74. m_RecipientOfficePhone =SysAllocString(m_FaxCoverpageInfo->RecOfficePhone);
  75. m_SenderName =SysAllocString(m_FaxCoverpageInfo->SdrName);
  76. m_SenderFax =SysAllocString(m_FaxCoverpageInfo->SdrFaxNumber);
  77. m_SenderCompany =SysAllocString(m_FaxCoverpageInfo->SdrCompany);
  78. m_SenderAddress =SysAllocString(m_FaxCoverpageInfo->SdrAddress);
  79. m_SenderTitle =SysAllocString(m_FaxCoverpageInfo->SdrTitle);
  80. m_SenderDepartment =SysAllocString(m_FaxCoverpageInfo->SdrDepartment);
  81. m_SenderOfficeLocation =SysAllocString(m_FaxCoverpageInfo->SdrOfficeLocation);
  82. m_SenderHomePhone =SysAllocString(m_FaxCoverpageInfo->SdrHomePhone);
  83. m_SenderOfficePhone =SysAllocString(m_FaxCoverpageInfo->SdrOfficePhone);
  84. m_Note =SysAllocString(m_FaxCoverpageInfo->Note);
  85. m_Subject =SysAllocString(m_FaxCoverpageInfo->Subject);
  86. m_Tsid =SysAllocString(m_FaxJobParams->Tsid);
  87. m_BillingCode =SysAllocString(m_FaxJobParams->BillingCode);
  88. m_EmailAddress =SysAllocString(m_FaxJobParams->DeliveryReportAddress);
  89. m_DocumentName =SysAllocString(m_FaxJobParams->DocumentName);
  90. }
  91. }
  92. DECLARE_REGISTRY_RESOURCEID(IDR_FAXDOC)
  93. BEGIN_COM_MAP(CFaxDoc)
  94. COM_INTERFACE_ENTRY(IFaxDoc)
  95. COM_INTERFACE_ENTRY(IDispatch)
  96. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  97. END_COM_MAP()
  98. // ISupportsErrorInfo
  99. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  100. // IFaxDoc
  101. public:
  102. ~CFaxDoc();
  103. BOOL Init(BSTR FileName,CFaxServer *pFaxServer);
  104. BOOL SetJob();
  105. STDMETHOD(get_FaxNumber)(/*[out, retval]*/ BSTR *pVal);
  106. STDMETHOD(put_FaxNumber)(/*[in]*/ BSTR newVal);
  107. STDMETHOD(Send)(/*[out, retval]*/long *pVal);
  108. STDMETHOD(get_DisplayName)(/*[out, retval]*/ BSTR *pVal);
  109. STDMETHOD(put_DisplayName)(/*[in]*/ BSTR newVal);
  110. STDMETHOD(get_EmailAddress)(/*[out, retval]*/ BSTR *pVal);
  111. STDMETHOD(put_EmailAddress)(/*[in]*/ BSTR newVal);
  112. STDMETHOD(get_BillingCode)(/*[out, retval]*/ BSTR *pVal);
  113. STDMETHOD(put_BillingCode)(/*[in]*/ BSTR newVal);
  114. STDMETHOD(get_Tsid)(/*[out, retval]*/ BSTR *pVal);
  115. STDMETHOD(put_Tsid)(/*[in]*/ BSTR newVal);
  116. STDMETHOD(get_CoverpageSubject)(/*[out, retval]*/ BSTR *pVal);
  117. STDMETHOD(put_CoverpageSubject)(/*[in]*/ BSTR newVal);
  118. STDMETHOD(get_CoverpageNote)(/*[out, retval]*/ BSTR *pVal);
  119. STDMETHOD(put_CoverpageNote)(/*[in]*/ BSTR newVal);
  120. STDMETHOD(get_SenderFax)(/*[out, retval]*/ BSTR *pVal);
  121. STDMETHOD(put_SenderFax)(/*[in]*/ BSTR newVal);
  122. STDMETHOD(get_SenderOfficePhone)(/*[out, retval]*/ BSTR *pVal);
  123. STDMETHOD(put_SenderOfficePhone)(/*[in]*/ BSTR newVal);
  124. STDMETHOD(get_SenderHomePhone)(/*[out, retval]*/ BSTR *pVal);
  125. STDMETHOD(put_SenderHomePhone)(/*[in]*/ BSTR newVal);
  126. STDMETHOD(get_SenderOffice)(/*[out, retval]*/ BSTR *pVal);
  127. STDMETHOD(put_SenderOffice)(/*[in]*/ BSTR newVal);
  128. STDMETHOD(get_SenderDepartment)(/*[out, retval]*/ BSTR *pVal);
  129. STDMETHOD(put_SenderDepartment)(/*[in]*/ BSTR newVal);
  130. STDMETHOD(get_SenderTitle)(/*[out, retval]*/ BSTR *pVal);
  131. STDMETHOD(put_SenderTitle)(/*[in]*/ BSTR newVal);
  132. STDMETHOD(get_SenderAddress)(/*[out, retval]*/ BSTR *pVal);
  133. STDMETHOD(put_SenderAddress)(/*[in]*/ BSTR newVal);
  134. STDMETHOD(get_SenderCompany)(/*[out, retval]*/ BSTR *pVal);
  135. STDMETHOD(put_SenderCompany)(/*[in]*/ BSTR newVal);
  136. STDMETHOD(get_SenderName)(/*[out, retval]*/ BSTR *pVal);
  137. STDMETHOD(put_SenderName)(/*[in]*/ BSTR newVal);
  138. STDMETHOD(get_RecipientOfficePhone)(/*[out, retval]*/ BSTR *pVal);
  139. STDMETHOD(put_RecipientOfficePhone)(/*[in]*/ BSTR newVal);
  140. STDMETHOD(get_RecipientHomePhone)(/*[out, retval]*/ BSTR *pVal);
  141. STDMETHOD(put_RecipientHomePhone)(/*[in]*/ BSTR newVal);
  142. STDMETHOD(get_RecipientOffice)(/*[out, retval]*/ BSTR *pVal);
  143. STDMETHOD(put_RecipientOffice)(/*[in]*/ BSTR newVal);
  144. STDMETHOD(get_RecipientDepartment)(/*[out, retval]*/ BSTR *pVal);
  145. STDMETHOD(put_RecipientDepartment)(/*[in]*/ BSTR newVal);
  146. STDMETHOD(get_RecipientTitle)(/*[out, retval]*/ BSTR *pVal);
  147. STDMETHOD(put_RecipientTitle)(/*[in]*/ BSTR newVal);
  148. STDMETHOD(get_RecipientCountry)(/*[out, retval]*/ BSTR *pVal);
  149. STDMETHOD(put_RecipientCountry)(/*[in]*/ BSTR newVal);
  150. STDMETHOD(get_RecipientZip)(/*[out, retval]*/ BSTR *pVal);
  151. STDMETHOD(put_RecipientZip)(/*[in]*/ BSTR newVal);
  152. STDMETHOD(get_RecipientState)(/*[out, retval]*/ BSTR *pVal);
  153. STDMETHOD(put_RecipientState)(/*[in]*/ BSTR newVal);
  154. STDMETHOD(get_RecipientCity)(/*[out, retval]*/ BSTR *pVal);
  155. STDMETHOD(put_RecipientCity)(/*[in]*/ BSTR newVal);
  156. STDMETHOD(get_RecipientAddress)(/*[out, retval]*/ BSTR *pVal);
  157. STDMETHOD(put_RecipientAddress)(/*[in]*/ BSTR newVal);
  158. STDMETHOD(get_RecipientCompany)(/*[out, retval]*/ BSTR *pVal);
  159. STDMETHOD(put_RecipientCompany)(/*[in]*/ BSTR newVal);
  160. STDMETHOD(get_RecipientName)(/*[out, retval]*/ BSTR *pVal);
  161. STDMETHOD(put_RecipientName)(/*[in]*/ BSTR newVal);
  162. STDMETHOD(get_DiscountSend)(/*[out, retval]*/ BOOL *pVal);
  163. STDMETHOD(put_DiscountSend)(/*[in]*/ BOOL newVal);
  164. STDMETHOD(get_ServerCoverpage)(/*[out, retval]*/ BOOL *pVal);
  165. STDMETHOD(put_ServerCoverpage)(/*[in]*/ BOOL newVal);
  166. STDMETHOD(get_SendCoverpage)(/*[out, retval]*/ BOOL *pVal);
  167. STDMETHOD(put_SendCoverpage)(/*[in]*/ BOOL newVal);
  168. STDMETHOD(get_CoverpageName)(/*[out, retval]*/ BSTR *pVal);
  169. STDMETHOD(put_CoverpageName)(/*[in]*/ BSTR newVal);
  170. STDMETHOD(get_FileName)(/*[out, retval]*/ BSTR *pVal);
  171. STDMETHOD(put_FileName)(/*[in]*/ BSTR newVal);
  172. STDMETHOD(putref_ConnectionObject)(/*[in]*/ IDispatch* newVal);
  173. STDMETHOD(get_CallHandle)(/*[out, retval]*/ long *pVal);
  174. STDMETHOD(put_CallHandle)(/*[in]*/ long newVal);
  175. private:
  176. CFaxServer* m_pFaxServer;
  177. BOOL m_DiscountSend;
  178. BOOL m_SendCoverpage;
  179. DWORD m_JobId;
  180. PFAX_COVERPAGE_INFO m_FaxCoverpageInfo;
  181. PFAX_JOB_PARAM m_FaxJobParams;
  182. BSTR m_FileName;
  183. IDispatch* m_TapiConnectionObject;
  184. VARIANT* m_pVariant;
  185. //
  186. // job info
  187. //
  188. BSTR m_FaxNumber;
  189. BSTR m_Tsid;
  190. BSTR m_BillingCode;
  191. BSTR m_EmailAddress;
  192. BSTR m_DocumentName;
  193. //
  194. // coverpage info
  195. //
  196. BSTR m_Note;
  197. BSTR m_Subject;
  198. BSTR m_CoverpageName;
  199. BSTR m_RecipientName;
  200. BSTR m_RecipientNumber;
  201. BSTR m_RecipientCompany;
  202. BSTR m_RecipientAddress;
  203. BSTR m_RecipientCity;
  204. BSTR m_RecipientState;
  205. BSTR m_RecipientZip;
  206. BSTR m_RecipientCountry;
  207. BSTR m_RecipientTitle;
  208. BSTR m_RecipientDepartment;
  209. BSTR m_RecipientOffice;
  210. BSTR m_RecipientHomePhone;
  211. BSTR m_RecipientOfficePhone;
  212. BSTR m_SenderName;
  213. BSTR m_SenderCompany;
  214. BSTR m_SenderAddress;
  215. BSTR m_SenderTitle;
  216. BSTR m_SenderDepartment;
  217. BSTR m_SenderOfficeLocation;
  218. BSTR m_SenderHomePhone;
  219. BSTR m_SenderOfficePhone;
  220. BSTR m_SenderFax;
  221. };
  222. #endif //__FAXDOC_H_