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.

69 lines
2.6 KiB

  1. #ifndef _HTMPARSE_H_
  2. #define _HTMPARSE_H_
  3. #include <windows.h>
  4. #include <assert.h>
  5. #include <oleauto.h>
  6. #include <mshtml.h>
  7. #include <exdisp.h>
  8. //#include <exdispid.h>
  9. #include "appdefs.h"
  10. class CHTMLParser : public IPropertyNotifySink, IOleClientSite, IDispatch
  11. {
  12. private:
  13. ULONG m_cRef;
  14. DWORD m_dwCookie;
  15. LPCONNECTIONPOINT m_pCP;
  16. HRESULT m_hrConnected;
  17. IHTMLDocument2* m_pTrident;
  18. IHTMLDocument2* m_pMSHTML;
  19. HANDLE m_hEventTridentDone;
  20. HRESULT CreateQueryString (IHTMLFormElement* pForm, LPWSTR lpszQuery);
  21. void URLEncode (WCHAR* pszUrl, size_t cchMax);
  22. HRESULT ConcatURLValue (BSTR bstrValue, BSTR bstrName, WCHAR* lpszQuery);
  23. public:
  24. CHTMLParser ();
  25. ~CHTMLParser ();
  26. // IUnknown methods
  27. STDMETHODIMP QueryInterface (REFIID riid, LPVOID* ppv);
  28. STDMETHODIMP_(ULONG) AddRef ();
  29. STDMETHODIMP_(ULONG) Release ();
  30. // IPropertyNotifySink methods
  31. STDMETHOD (OnChanged) (DISPID dispID);
  32. STDMETHOD (OnRequestEdit) (DISPID dispID);
  33. // IOleClientSite methods
  34. STDMETHOD (SaveObject) ();
  35. STDMETHOD (GetMoniker) (DWORD dwAssign, DWORD dwWhichMoniker, IMoniker** ppmk);
  36. STDMETHOD (GetContainer) (IOleContainer** ppContainer);
  37. STDMETHOD (ShowObject) ();
  38. STDMETHOD (OnShowWindow) (BOOL fShow);
  39. STDMETHOD (RequestNewObjectLayout) ();
  40. // IDispatch methods
  41. STDMETHOD (GetTypeInfoCount) (UINT* pctinfo);
  42. STDMETHOD (GetTypeInfo) (UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo);
  43. STDMETHOD (GetIDsOfNames) (REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId);
  44. STDMETHOD (Invoke) (DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr);
  45. HRESULT LoadURLFromFile (BSTR bstrURL);
  46. HRESULT InitForMSHTML ();
  47. HRESULT TermForMSHTML ();
  48. HRESULT AttachToMSHTML (BSTR bstrURL);
  49. HRESULT AttachToDocument (IWebBrowser2* lpWebBrowser);
  50. HRESULT Detach ();
  51. HRESULT get_QueryStringForForm (IDispatch* pDisp, WCHAR* szUrl);
  52. };
  53. #endif