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.

84 lines
2.4 KiB

  1. // Copyright (C) Microsoft Corporation 1996-1997, All Rights reserved.
  2. #if _MSC_VER > 1000
  3. #pragma once
  4. #endif
  5. #ifndef __PRTHOOK_H__
  6. #define __PRTHOOK_H__
  7. class CContainer; // forward reference
  8. class CSiteMap; // forward reference
  9. class IWebBrowserAppImpl; // forward reference
  10. class CHHWinType; // forward reference
  11. class CPrintHook : public IDispatch
  12. {
  13. public:
  14. CPrintHook(PCSTR pszFirstUrl, CToc* pToc, HWND hWndHelp = NULL);
  15. ~CPrintHook();
  16. void BeginPrinting(int action);
  17. inline BOOL IsPrinting() {return m_fIsPrinting;}
  18. inline void IsPrinting(BOOL bNewValue) {m_fIsPrinting = bNewValue;}
  19. STDMETHOD(QueryInterface)(
  20. /* [in] */ REFIID riid,
  21. /* [iid_is][out] */ void **ppvObject);
  22. STDMETHOD_(ULONG, AddRef)(void);
  23. STDMETHOD_(ULONG, Release)(void);
  24. // IDispatch methods.
  25. STDMETHOD(GetTypeInfoCount)(
  26. /* [out] */ UINT *pctinfo);
  27. STDMETHOD(GetTypeInfo)(
  28. /* [in] */ UINT iTInfo,
  29. /* [in] */ LCID lcid,
  30. /* [out] */ ITypeInfo **ppTInfo);
  31. STDMETHOD(GetIDsOfNames)(
  32. /* [in] */ REFIID riid,
  33. /* [size_is][in] */ LPOLESTR *rgszNames,
  34. /* [in] */ UINT cNames,
  35. /* [in] */ LCID lcid,
  36. /* [size_is][out] */ DISPID *rgDispId);
  37. STDMETHOD(Invoke)(
  38. /* [in] */ DISPID dispIdMember,
  39. /* [in] */ REFIID riid,
  40. /* [in] */ LCID lcid,
  41. /* [in] */ WORD wFlags,
  42. /* [out][in] */ DISPPARAMS *pDispParams,
  43. /* [out] */ VARIANT *pVarResult,
  44. /* [out] */ EXCEPINFO *pExcepInfo,
  45. /* [out] */ UINT *puArgErr);
  46. protected:
  47. BOOL CreatePrintWindow(CStr* pcszUrl = NULL);
  48. void DestroyPrintWindow();
  49. BOOL PumpMessages();
  50. BOOL BuildPrintTable();
  51. HRESULT Print();
  52. BOOL ConstructFile(PCSTR pszCurrentUrl, CTable* pFileTable, CStr* pcszPrintFile);
  53. BOOL TranslateUrl(PSTR pszFullUrl, PSTR pszRelUrl);
  54. void OnProgressChange(LONG lProgress, LONG lProgressMax);
  55. CToc* m_pToc;
  56. CStr m_cszFirstUrl, m_cszPath, m_cszRoot, m_cszPrintFile;
  57. CHHWinType* m_phh;
  58. LPCONNECTIONPOINT m_pcp;
  59. DWORD m_dwCookie;
  60. ULONG m_ref;
  61. HWND m_hWndHelp;
  62. int m_pos, m_action;
  63. BOOL m_fIsPrinting, m_fFirstHeading, m_fDestroyHelpWindow, m_fIsIE3;
  64. BYTE m_level;
  65. TCHAR m_szPrintFile[_MAX_PATH];
  66. HWND m_hwndParent;
  67. };
  68. #endif // __PRTHOOK_H__