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.

114 lines
5.9 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999-2000 Microsoft Corporation
  3. Module Name:
  4. MPC_html.h
  5. Abstract:
  6. This file contains the declaration of various functions and classes
  7. designed to help the handling of HTML elements.
  8. Revision History:
  9. Davide Massarenti (Dmassare) 07/11/2000
  10. created
  11. ******************************************************************************/
  12. #if !defined(__INCLUDED___MPC___HTML_H___)
  13. #define __INCLUDED___MPC___HTML_H___
  14. #include <MPC_main.h>
  15. #include <exdisp.h>
  16. #include <exdispid.h>
  17. #include <shobjidl.h>
  18. #include <mshtmlc.h>
  19. #include <mshtmdid.h>
  20. #include <dispex.h>
  21. #include <ocmm.h>
  22. /////////////////////////////////////////////////////////////////////////
  23. namespace MPC
  24. {
  25. namespace HTML
  26. {
  27. typedef std::list< IHTMLElement* > IHTMLElementList;
  28. typedef IHTMLElementList::iterator IHTMLElementIter;
  29. typedef IHTMLElementList::const_iterator IHTMLElementIterConst;
  30. ////////////////////////////////////////////////////////////////////////////////
  31. void QuoteEscape( /*[out]*/ MPC::wstring& strAppendTo, /*[in]*/ LPCWSTR szToEscape, /*[in]*/ WCHAR chQuote );
  32. void UrlUnescape( /*[out]*/ MPC::wstring& strAppendTo, /*[in]*/ LPCWSTR szToEscape, /*[in]*/ bool fAsQueryString = false );
  33. void UrlEscape ( /*[out]*/ MPC::wstring& strAppendTo, /*[in]*/ LPCWSTR szToEscape, /*[in]*/ bool fAsQueryString = false );
  34. void HTMLEscape ( /*[out]*/ MPC::wstring& strAppendTo, /*[in]*/ LPCWSTR szToEscape );
  35. ////////////////////////////////////////////////////////////////////////////////
  36. HRESULT ConstructFullTag( /*[out]*/ MPC::wstring& strHTML ,
  37. /*[in] */ LPCWSTR szTag ,
  38. /*[in] */ bool fCloseTag ,
  39. /*[in] */ const MPC::WStringLookup* pmapAttributes ,
  40. /*[in] */ LPCWSTR szExtraAttributes ,
  41. /*[in] */ LPCWSTR szBody ,
  42. /*[in] */ bool fEscapeBody );
  43. void ParseHREF( /*[in ]*/ LPCWSTR szURL, /*[out]*/ MPC::wstring& strBaseURL, /*[out]*/ MPC::WStringLookup& mapQuery );
  44. void BuildHREF( /*[out]*/ MPC::wstring& strURL, /*[in ]*/ LPCWSTR szBaseURL, /*[in ]*/ const MPC::WStringLookup& mapQuery );
  45. void vBuildHREF( /*[out]*/ MPC::wstring& strURL, /*[in ]*/ LPCWSTR szBaseURL, /*[in ]*/ ... );
  46. ////////////////////////////////////////////////////////////////////////////////
  47. HRESULT IDispatch_To_IHTMLDocument2( /*[out]*/ CComPtr<IHTMLDocument2>& doc, /*[in]*/ IDispatch* pDisp );
  48. ////////////////////////////////////////////////////////////////////////////////
  49. HRESULT GetFramePath( /*[out]*/ CComBSTR& bstrFrame, /*[in]*/ IDispatch* pDisp );
  50. HRESULT AreAllTheFramesInTheCompleteState( /*[out]*/ bool& fDone, /*[in]*/ IDispatch* pDisp );
  51. HRESULT LocateFrame( /*[out]*/ CComPtr<IHTMLWindow2>& win, /*[in]*/ IHTMLElement* pObj, /*[in]*/ LPCWSTR szName );
  52. ////////////////////////////////////////////////////////////////////////////////
  53. HRESULT GetEventObject( /*[out]*/ CComPtr<IHTMLEventObj>& ev, /*[in]*/ IHTMLElement* pObj );
  54. HRESULT GetUniqueID( /*[out]*/ CComBSTR& bstrID, /*[in]*/ IHTMLElement* pObj );
  55. HRESULT FindFirstParentWithThisTag( /*[out]*/ CComPtr<IHTMLElement>& elem, /*[in]*/ IHTMLElement* pObj, /*[in]*/ LPCWSTR szTag );
  56. HRESULT FindFirstParentWithThisID ( /*[out]*/ CComPtr<IHTMLElement>& elem, /*[in]*/ IHTMLElement* pObj, /*[in]*/ LPCWSTR szID = NULL );
  57. HRESULT FindElementInCollection( /*[out]*/ CComPtr<IHTMLElement>& elem ,
  58. /*[in] */ IHTMLElementCollection* coll ,
  59. /*[in] */ LPCWSTR szID ,
  60. /*[in] */ int iPos = 0 );
  61. HRESULT FindElement( /*[out]*/ CComPtr<IHTMLElement>& elem, /*[in]*/ IHTMLElement* pObj, /*[in]*/ LPCWSTR szID , /*[in]*/ int iPos = 0 );
  62. HRESULT FindChild ( /*[out]*/ CComPtr<IHTMLElement>& elem, /*[in]*/ IHTMLElement* pObj, /*[in]*/ LPCWSTR szID , /*[in]*/ int iPos = 0 );
  63. HRESULT EnumerateCollection( /*[out]*/ IHTMLElementList& lst, /*[in]*/ IHTMLElementCollection* pColl, /*[in]*/ LPCWSTR szFilterID = NULL );
  64. HRESULT EnumerateElements ( /*[out]*/ IHTMLElementList& lst, /*[in]*/ IHTMLElement* pObj , /*[in]*/ LPCWSTR szFilterID = NULL );
  65. HRESULT EnumerateChildren ( /*[out]*/ IHTMLElementList& lst, /*[in]*/ IHTMLElement* pObj , /*[in]*/ LPCWSTR szFilterID = NULL );
  66. HRESULT FindStyle( /*[out]*/ CComPtr<IHTMLRuleStyle>& style, /*[in]*/ IHTMLElement* pObj, /*[in]*/ LPCWSTR szName );
  67. ////////////////////////////////////////////////////////////////////////////////
  68. HRESULT GetAttribute( /*[out]*/ CComPtr<IHTMLDOMAttribute>& attr , /*[in]*/ IHTMLElement* pObj, /*[in]*/ LPCWSTR szName );
  69. HRESULT GetAttribute( /*[out]*/ CComBSTR& value, /*[in]*/ IHTMLElement* pObj, /*[in]*/ LPCWSTR szName );
  70. ////////////////////////////////////////////////////////////////////////////////
  71. bool ConvertColor( /*[in]*/ VARIANT& v, /*[out]*/ COLORREF& color, /*[out]*/ bool& fSystem );
  72. }; // namespace HTML
  73. }; // namespace MPC
  74. /////////////////////////////////////////////////////////////////////////
  75. #endif // !defined(__INCLUDED___MPC___HTML_H___)