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.

90 lines
2.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Forms
  4. // Copyright (C) Microsoft Corporation, 1996.
  5. //
  6. // File: packager.hxx
  7. //
  8. // Contents: Save as Office9 'Thicket' format implementation classes.
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef _PACKAGER_HXX_
  12. #define _PACKAGER_HXX_
  13. #define MAX_SAVING_STATUS_TEXT 128
  14. #define MAX_BUFFER_LEN 512
  15. #define REGPATH_MSIE_MAIN TEXT("Software\\Microsoft\\Internet Explorer\\Main")
  16. #define REGVALUE_DOWNLOAD_IMAGES "Display Inline Images"
  17. #define URL_ABOUT_BLANK TEXT("about:blank")
  18. class CWebArchive;
  19. class CThicketProgress
  20. {
  21. public:
  22. CThicketProgress( HWND hDlg );
  23. ~CThicketProgress(void);
  24. void SetPercent( ULONG ulPct );
  25. void SetSaving( LPCTSTR szFile, LPCTSTR szDst );
  26. void SetSaveText(LPCTSTR szText);
  27. protected:
  28. HWND m_hDlg;
  29. HWND m_hwndProg;
  30. TCHAR* m_pszSavingFmt;
  31. int m_cchSavingFmt;
  32. TCHAR* m_pszPctFmt;
  33. ULONG m_ulPct;
  34. };
  35. /*
  36. * CDocumentPackager - master packager class.
  37. */
  38. // Packaging styles.
  39. // NOTE: These need to match the order in the format filter string.
  40. enum {
  41. PACKAGE_THICKET = 1,
  42. PACKAGE_MHTML,
  43. PACKAGE_HTML,
  44. PACKAGE_TEXT
  45. };
  46. class CDocumentPackager
  47. {
  48. public:
  49. CDocumentPackager(UINT iPackageStyle) { m_iPackageStyle = iPackageStyle;
  50. m_ptp = NULL; }
  51. ~CDocumentPackager(void) {}
  52. HRESULT PackageDocument(IHTMLDocument2 *pDoc, LPCTSTR lpstrDoc,
  53. BOOL *pfCancel, CThicketProgress *ptprog,
  54. ULONG progLow, ULONG progHigh,
  55. UINT cpDst,
  56. CWebArchive *pwa = NULL );
  57. CWebArchive *GetFrameDocArchive( CWebArchive *pwaSrc );
  58. protected:
  59. friend class CFramesPackager;
  60. UINT m_iPackageStyle;
  61. HRESULT _PackageDocument(IHTMLDocument2 *pDoc, LPCTSTR lpstrDoc,
  62. BOOL *pfCancel, CThicketProgress *ptprog,
  63. ULONG progLow, ULONG progHigh,
  64. UINT cpDst,
  65. CWebArchive *pwa,
  66. CDocumentPackager *pdpFrames,
  67. BOOL fFrameDoc);
  68. HRESULT _GetDesignDoc( IHTMLDocument2 *pDocSrc, IHTMLDocument2 **ppDocDesign,
  69. BOOL *pfCancel, CThicketProgress *ptp, UINT cp );
  70. private:
  71. CThicketProgress *m_ptp;
  72. };
  73. #endif // _PACKAGER_HXX_