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.

136 lines
6.6 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1999 **
  4. //*********************************************************************
  5. //
  6. // MAINPANE.H - Header for the implementation of CObShellMainPane
  7. //
  8. // HISTORY:
  9. //
  10. // 1/27/99 a-jaswed Created.
  11. //
  12. // Class which will create a window, attach and instance of ObWebBrowser,
  13. // and then provide several specialized interfaces to alter the content of the doc
  14. #ifndef _MAINPANE_H_
  15. #define _MAINPANE_H_
  16. #include <tchar.h>
  17. #include <comdef.h> // for COM interface definitions
  18. #include <exdisp.h>
  19. #include <mshtml.h>
  20. #include <exdispid.h>
  21. #include "cunknown.h"
  22. #include "obshel.h"
  23. #include "obweb.h"
  24. #include "statuspn.h"
  25. class CObShellMainPane : public CUnknown,
  26. public IObShellMainPane,
  27. public DWebBrowserEvents2
  28. {
  29. // Declare the delegating IUnknown.
  30. DECLARE_IUNKNOWN
  31. public:
  32. static HRESULT CreateInstance (IUnknown* pOuterUnknown,
  33. CUnknown** ppNewComponent);
  34. // IObShellMainPane Members
  35. virtual HRESULT __stdcall CreateMainPane (HANDLE_PTR hInstance, HWND hwndParent, RECT* prectWindowSize, BSTR bstrStartPage);
  36. virtual HRESULT __stdcall PreTranslateMessage (LPMSG lpMsg);
  37. virtual HRESULT __stdcall Navigate (WCHAR* pszUrl);
  38. virtual HRESULT __stdcall ListenToMainPaneEvents (IUnknown* pUnk);
  39. virtual HRESULT __stdcall SetExternalInterface (IUnknown* pUnk);
  40. virtual HRESULT __stdcall ExecScriptFn (BSTR bstrScriptFn, VARIANT* pvarRet);
  41. virtual HRESULT __stdcall SetAppMode (DWORD dwAppMode);
  42. virtual HRESULT __stdcall AddStatusItem (BSTR bstrText,int iIndex);
  43. virtual HRESULT __stdcall RemoveStatusItem (int iIndex);
  44. virtual HRESULT __stdcall SelectStatusItem (int iIndex);
  45. virtual HRESULT __stdcall SetStatusLogo (BSTR bstrPath);
  46. virtual HRESULT __stdcall GetNumberOfStatusItems (int* piTotal);
  47. virtual HRESULT __stdcall Walk (BOOL* pbRet);
  48. virtual HRESULT __stdcall ExtractUnHiddenText (BSTR* pbstrText);
  49. virtual HRESULT __stdcall get_PageType (LPDWORD pdwPageType);
  50. virtual HRESULT __stdcall get_IsQuickFinish (BOOL* pbIsQuickFinish);
  51. virtual HRESULT __stdcall get_PageFlag (LPDWORD pdwPageFlag);
  52. virtual HRESULT __stdcall get_PageID (BSTR* pbstrPageID);
  53. virtual HRESULT __stdcall get_URL (BOOL bForward,
  54. BSTR *pbstrReturnURL);
  55. virtual HRESULT __stdcall OnDialingError (UINT uiType, UINT uiErrorCode);
  56. virtual HRESULT __stdcall OnServerError (UINT uiType, UINT uiErrorCode);
  57. virtual HRESULT __stdcall OnDialing (UINT uiType);
  58. virtual HRESULT __stdcall OnConnecting (UINT uiType);
  59. virtual HRESULT __stdcall OnDownloading (UINT uiType);
  60. virtual HRESULT __stdcall OnConnected (UINT uiType);
  61. virtual HRESULT __stdcall OnDisconnect (UINT uiType);
  62. virtual HRESULT __stdcall OnDeviceArrival (UINT uiDeviceType);
  63. virtual HRESULT __stdcall OnHelp ();
  64. virtual HRESULT __stdcall OnIcsConnectionStatus (UINT uiType);
  65. // Migration functons
  66. virtual HRESULT __stdcall OnRefDownloadProgress (UINT uiType, UINT uiPercentDone);
  67. virtual HRESULT __stdcall OnISPDownloadComplete (UINT uiType, BSTR bstrURL);
  68. virtual HRESULT __stdcall OnRefDownloadComplete (UINT uiType, UINT uiErrorCode);
  69. virtual HRESULT __stdcall MainPaneShowWindow ();
  70. virtual HRESULT __stdcall DestroyMainPane ();
  71. virtual HRESULT __stdcall SaveISPFile (BSTR bstrSrcFileName,
  72. BSTR bstrDestFileName);
  73. STDMETHOD (PlayBackgroundMusic)() { return m_pObWebBrowser ? m_pObWebBrowser->PlayBackgroundMusic() : S_OK; }
  74. STDMETHOD (StopBackgroundMusic)() { return m_pObWebBrowser ? m_pObWebBrowser->StopBackgroundMusic() : S_OK; }
  75. STDMETHOD (UnhookScriptErrorHandler)() { return m_pObWebBrowser->UnhookScriptErrorHandler(); }
  76. // DWebBrowserEvents2
  77. STDMETHOD (GetTypeInfoCount) (UINT* pcInfo);
  78. STDMETHOD (GetTypeInfo) (UINT, LCID, ITypeInfo** );
  79. STDMETHOD (GetIDsOfNames) (REFIID, OLECHAR**, UINT,
  80. LCID, DISPID* );
  81. STDMETHOD (Invoke) (DISPID dispidMember,
  82. REFIID riid,
  83. LCID lcid,
  84. WORD wFlags,
  85. DISPPARAMS* pdispparams,
  86. VARIANT* pvarResult,
  87. EXCEPINFO* pexcepinfo,
  88. UINT* puArgErr);
  89. IHTMLFormElement* get_pNextForm() { return m_pNextForm; }
  90. IHTMLFormElement* get_pBackForm() { return m_pBackForm; }
  91. private:
  92. HWND m_hMainWnd;
  93. HWND m_hwndParent;
  94. IDispatch* m_pDispEvent;
  95. IObWebBrowser* m_pObWebBrowser;
  96. BSTR m_bstrBaseUrl;
  97. int m_cStatusItems;
  98. DWORD m_dwAppMode;
  99. HINSTANCE m_hInstance;
  100. CIFrmStatusPane* m_pIFrmStatPn;
  101. IHTMLFormElement* m_pPageIDForm;
  102. IHTMLFormElement* m_pBackForm;
  103. IHTMLFormElement* m_pPageTypeForm;
  104. IHTMLFormElement* m_pNextForm;
  105. IHTMLFormElement* m_pPageFlagForm;
  106. // IUnknown
  107. virtual HRESULT __stdcall NondelegatingQueryInterface(const IID& iid, void** ppv);
  108. void ProcessServerError (WCHAR* pszError);
  109. HRESULT FireObShellDocumentComplete ();
  110. CObShellMainPane (IUnknown* pOuterUnknown);
  111. virtual ~CObShellMainPane ();
  112. virtual void FinalRelease (); // Notify derived classes that we are releasing
  113. HRESULT getQueryString (IHTMLFormElement *pForm,
  114. LPWSTR lpszQuery);
  115. };
  116. LRESULT WINAPI MainPaneWndProc (HWND hwnd, UINT msg,
  117. WPARAM wParam, LPARAM lParam);
  118. #endif