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.

150 lines
5.2 KiB

  1. //**********************************************************************
  2. // File name: WALKER.H
  3. //
  4. // Definition of COleSite
  5. //
  6. // Copyright (c) 1992 - 1996 Microsoft Corporation. All rights reserved.
  7. //**********************************************************************
  8. #if !defined( _WALKER_H_ )
  9. #define _WALKER_H_
  10. #include <mshtml.h>
  11. class CWalker : public IPropertyNotifySink, IOleClientSite, IDispatch
  12. {
  13. private:
  14. ULONG m_cRef; //Reference count
  15. public:
  16. CWalker()
  17. {
  18. m_cRef = 1;
  19. m_hrConnected = CONNECT_E_CANNOTCONNECT;
  20. m_dwCookie = 0;
  21. m_pCP = NULL;
  22. m_pMSHTML = NULL;
  23. m_pPageIDForm = NULL;
  24. m_pBackForm = NULL;
  25. m_pPageTypeForm = NULL;
  26. m_pNextForm = NULL;
  27. m_pPageFlagForm = NULL;
  28. m_hEventTridentDone = 0;
  29. }
  30. ~CWalker()
  31. {
  32. if (m_pMSHTML)
  33. m_pMSHTML->Release();
  34. if (m_pPageIDForm)
  35. m_pPageIDForm->Release();
  36. if (m_pBackForm)
  37. m_pBackForm->Release();
  38. if (m_pPageTypeForm)
  39. m_pPageTypeForm->Release();
  40. if (m_pNextForm)
  41. m_pNextForm->Release();
  42. if (m_pPageFlagForm)
  43. m_pPageFlagForm->Release();
  44. }
  45. // IUnknown methods
  46. STDMETHOD(QueryInterface)(REFIID riid, LPVOID* ppv);
  47. STDMETHOD_(ULONG, AddRef)();
  48. STDMETHOD_(ULONG, Release)();
  49. // IPropertyNotifySink methods
  50. STDMETHOD(OnChanged)(DISPID dispID);
  51. STDMETHOD(OnRequestEdit)(DISPID dispID)
  52. { return NOERROR; }
  53. // IOleClientSite methods
  54. STDMETHOD(SaveObject)(void) { return E_NOTIMPL; }
  55. STDMETHOD(GetMoniker)(DWORD dwAssign,
  56. DWORD dwWhichMoniker,
  57. IMoniker** ppmk)
  58. { return E_NOTIMPL; }
  59. STDMETHOD(GetContainer)(IOleContainer** ppContainer)
  60. { return E_NOTIMPL; }
  61. STDMETHOD(ShowObject)(void)
  62. { return E_NOTIMPL; }
  63. STDMETHOD(OnShowWindow)(BOOL fShow)
  64. { return E_NOTIMPL; }
  65. STDMETHOD(RequestNewObjectLayout)(void)
  66. { return E_NOTIMPL; }
  67. // IDispatch method
  68. STDMETHOD(GetTypeInfoCount)(UINT* pctinfo)
  69. { return E_NOTIMPL; }
  70. STDMETHOD(GetTypeInfo)(UINT iTInfo,
  71. LCID lcid,
  72. ITypeInfo** ppTInfo)
  73. { return E_NOTIMPL; }
  74. STDMETHOD(GetIDsOfNames)(REFIID riid,
  75. LPOLESTR* rgszNames,
  76. UINT cNames,
  77. LCID lcid,
  78. DISPID* rgDispId)
  79. { return E_NOTIMPL; }
  80. STDMETHOD(Invoke)(DISPID dispIdMember,
  81. REFIID riid,
  82. LCID lcid,
  83. WORD wFlags,
  84. DISPPARAMS __RPC_FAR *pDispParams,
  85. VARIANT __RPC_FAR *pVarResult,
  86. EXCEPINFO __RPC_FAR *pExcepInfo,
  87. UINT __RPC_FAR *puArgErr);
  88. // Additional class methods
  89. HRESULT Walk ();
  90. HRESULT AttachToDocument (IWebBrowser2* lpWebBrowser);
  91. HRESULT AttachToMSHTML (BSTR bstrURL);
  92. HRESULT ExtractUnHiddenText (BSTR* pbstrText);
  93. HRESULT Detach ();
  94. HRESULT InitForMSHTML ();
  95. HRESULT TermForMSHTML ();
  96. HRESULT LoadURLFromFile (BSTR bstrURL);
  97. HRESULT ProcessOLSFile (IWebBrowser2* lpWebBrowser);
  98. HRESULT get_PageType (LPDWORD pdwPageType);
  99. HRESULT get_IsQuickFinish (BOOL* pbIsQuickFinish);
  100. HRESULT get_PageFlag (LPDWORD pdwPageFlag);
  101. HRESULT get_PageID (BSTR* pbstrPageID);
  102. HRESULT get_URL (LPTSTR lpszURL, BOOL bForward);
  103. HRESULT get_IeakIspFile (LPTSTR lpszIspFile);
  104. HRESULT get_FirstFormQueryString (LPTSTR lpszQuery);
  105. DWORD m_dwCookie;
  106. LPCONNECTIONPOINT m_pCP;
  107. HRESULT m_hrConnected;
  108. IHTMLFormElement* get_pNextForm() { return m_pNextForm; }
  109. IHTMLFormElement* get_pBackForm() { return m_pBackForm; }
  110. private:
  111. HRESULT getQueryString(IHTMLFormElement *pForm,
  112. LPTSTR lpszQuery);
  113. void GetInputValue(LPTSTR lpszName, BSTR *pVal, UINT index, IHTMLFormElement *pForm);
  114. protected:
  115. IHTMLDocument2* m_pTrident; // An instance of MSHTML that we CoCreated
  116. IHTMLDocument2* m_pMSHTML; // A ref of m_pTrident, OR a QI for the WebBrowser's Document
  117. // These elements will contain the navigation information we need
  118. IHTMLFormElement* m_pPageIDForm;
  119. IHTMLFormElement* m_pBackForm;
  120. IHTMLFormElement* m_pPageTypeForm;
  121. IHTMLFormElement* m_pNextForm;
  122. IHTMLFormElement* m_pPageFlagForm;
  123. HANDLE m_hEventTridentDone;
  124. };
  125. #endif