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.

98 lines
3.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: evtsink.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _EVT_SINK_H
  11. #define _EVT_SINK_H
  12. class CAMCStatusBarText;
  13. class CHistoryList;
  14. class CAMCWebViewCtrl;
  15. class CAMCProgressCtrl;
  16. /*+-------------------------------------------------------------------------*
  17. * class CWebEventSink
  18. *
  19. *
  20. * PURPOSE: Receives notifications from a web browser. There is only one
  21. * place where a CWebEventSink object is created - within CWebCtrl
  22. * ::Create.
  23. *
  24. * The notifications received by this object can be used to activate
  25. * other events and states.
  26. *+-------------------------------------------------------------------------*/
  27. class CWebEventSink :
  28. public IDispatchImpl<IWebSink, &IID_IWebSink, &LIBID_MMCInternalWebOcx>,
  29. public CComObjectRoot
  30. {
  31. public:
  32. CWebEventSink();
  33. ~CWebEventSink();
  34. SC ScInitialize(CAMCWebViewCtrl *pWebViewControl);
  35. BEGIN_COM_MAP(CWebEventSink)
  36. COM_INTERFACE_ENTRY(IDispatch)
  37. COM_INTERFACE_ENTRY(IWebSink)
  38. END_COM_MAP()
  39. DECLARE_NOT_AGGREGATABLE(CWebEventSink)
  40. // DWebBrowserEvents methods
  41. public:
  42. STDMETHOD_(void, BeforeNavigate)(BSTR URL, long Flags,
  43. BSTR TargetFrameName, VARIANT* PostData,
  44. BSTR Headers, VARIANT_BOOL* Cancel);
  45. STDMETHOD_(void, CommandStateChange)(int Command, VARIANT_BOOL Enable);
  46. STDMETHOD_(void, DownloadBegin)();
  47. STDMETHOD_(void, DownloadComplete)();
  48. STDMETHOD_(void, FrameBeforeNavigate)(BSTR URL, long Flags,
  49. BSTR TargetFrameName, VARIANT* PostData,
  50. BSTR Headers, VARIANT_BOOL* Cancel);
  51. STDMETHOD_(void, FrameNavigateComplete)(BSTR URL);
  52. STDMETHOD_(void, FrameNewWindow)(BSTR URL, long Flags, BSTR TargetFrameName,
  53. VARIANT* PostData, BSTR Headers, VARIANT_BOOL* Processed);
  54. STDMETHOD_(void, NavigateComplete)(BSTR URL);
  55. STDMETHOD_(void, NewWindow)(BSTR URL, long Flags, BSTR TargetFrameName,
  56. VARIANT* PostData, BSTR Headers, BSTR Referrer);
  57. STDMETHOD_(void, Progress)(long Progress, long ProgressMax);
  58. STDMETHOD_(void, PropertyChange)(BSTR szProperty);
  59. STDMETHOD_(void, Quit)(VARIANT_BOOL* pCancel);
  60. STDMETHOD_(void, StatusTextChange)(BSTR bstrText);
  61. STDMETHOD_(void, TitleChange)(BSTR Text);
  62. STDMETHOD_(void, WindowActivate)();
  63. STDMETHOD_(void, WindowMove)();
  64. STDMETHOD_(void, WindowResize)();
  65. private:
  66. bool IsPageBreak(BSTR URL);
  67. // Window activation helper
  68. public:
  69. void SetActiveTo(BOOL bState);
  70. // Attributes
  71. private:
  72. CAMCWebViewCtrl * m_pWebViewControl;
  73. // Status bar members
  74. CConsoleStatusBar* m_pStatusBar;
  75. CAMCProgressCtrl* m_pwndProgressCtrl;
  76. CHistoryList* m_pHistoryList;
  77. bool m_fLastTextWasEmpty;
  78. bool m_bBrowserForwardEnabled;
  79. bool m_bBrowserBackEnabled;
  80. };
  81. #endif