WebHTMLRepresentation.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
  14. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
  17. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  20. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  21. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef WebHTMLRepresentation_H
  26. #define WebHTMLRepresentation_H
  27. #include "WebKit.h"
  28. class WebFrame;
  29. class WebHTMLRepresentation : public IWebHTMLRepresentation, IWebDocumentRepresentation
  30. {
  31. public:
  32. static WebHTMLRepresentation* createInstance(WebFrame* frame);
  33. protected:
  34. WebHTMLRepresentation();
  35. ~WebHTMLRepresentation();
  36. public:
  37. // IUnknown
  38. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
  39. virtual ULONG STDMETHODCALLTYPE AddRef();
  40. virtual ULONG STDMETHODCALLTYPE Release();
  41. // IWebHTMLRepresentation
  42. virtual HRESULT STDMETHODCALLTYPE supportedMIMETypes(
  43. /* [out][in] */ BSTR* types,
  44. /* [out][in] */ int* cTypes);
  45. virtual HRESULT STDMETHODCALLTYPE supportedNonImageMIMETypes(
  46. /* [out][in] */ BSTR* types,
  47. /* [out][in] */ int* cTypes);
  48. virtual HRESULT STDMETHODCALLTYPE supportedImageMIMETypes(
  49. /* [out][in] */ BSTR* types,
  50. /* [out][in] */ int* cTypes);
  51. virtual HRESULT STDMETHODCALLTYPE attributedStringFromDOMNodes(
  52. /* [in] */ IDOMNode* startNode,
  53. /* [in] */ int startOffset,
  54. /* [in] */ IDOMNode* endNode,
  55. /* [in] */ int endOffset,
  56. /* [retval][out] */ IDataObject** attributedString);
  57. virtual HRESULT STDMETHODCALLTYPE elementWithName(
  58. /* [in] */ BSTR name,
  59. /* [in] */ IDOMElement* form,
  60. /* [retval][out] */ IDOMElement** element);
  61. virtual HRESULT STDMETHODCALLTYPE elementDoesAutoComplete(
  62. /* [in] */ IDOMElement* element,
  63. /* [retval][out] */ BOOL* result);
  64. virtual HRESULT STDMETHODCALLTYPE elementIsPassword(
  65. /* [in] */ IDOMElement* element,
  66. /* [retval][out] */ BOOL* result);
  67. virtual HRESULT STDMETHODCALLTYPE formForElement(
  68. /* [in] */ IDOMElement* element,
  69. /* [retval][out] */ IDOMElement** form);
  70. virtual HRESULT STDMETHODCALLTYPE currentForm(
  71. /* [retval][out] */ IDOMElement** form);
  72. virtual HRESULT STDMETHODCALLTYPE controlsInForm(
  73. /* [in] */ IDOMElement* form,
  74. /* [out][in] */ IDOMElement** controls,
  75. /* [out][in] */ int* cControls);
  76. /* Deprecated. Use the variant that includes resultDistance and resultIsInCellAbove instead. */
  77. virtual HRESULT STDMETHODCALLTYPE deprecatedSearchForLabels(
  78. /* [size_is][in] */ BSTR *labels,
  79. /* [in] */ int cLabels,
  80. /* [in] */ IDOMElement *beforeElement,
  81. /* [retval][out] */ BSTR *result);
  82. virtual HRESULT STDMETHODCALLTYPE matchLabels(
  83. /* [size_is][in] */ BSTR *labels,
  84. /* [in] */ int cLabels,
  85. /* [in] */ IDOMElement *againstElement,
  86. /* [retval][out] */ BSTR *result);
  87. virtual HRESULT STDMETHODCALLTYPE searchForLabels(BSTR* labels, unsigned cLabels, IDOMElement* beforeElement, unsigned* resultDistance, BOOL* resultIsInCellAbove, BSTR* result);
  88. // IWebDocumentRepresentation
  89. virtual HRESULT STDMETHODCALLTYPE setDataSource(
  90. /* [in] */ IWebDataSource* dataSource);
  91. virtual HRESULT STDMETHODCALLTYPE receivedData(
  92. /* [in] */ IStream* data,
  93. /* [in] */ IWebDataSource* dataSource);
  94. virtual HRESULT STDMETHODCALLTYPE receivedError(
  95. /* [in] */ IWebError* error,
  96. /* [in] */ IWebDataSource* dataSource);
  97. virtual HRESULT STDMETHODCALLTYPE finishedLoadingWithDataSource(
  98. /* [in] */ IWebDataSource* dataSource);
  99. virtual HRESULT STDMETHODCALLTYPE canProvideDocumentSource(
  100. /* [retval][out] */ BOOL* result);
  101. virtual HRESULT STDMETHODCALLTYPE documentSource(
  102. /* [retval][out] */ BSTR* source);
  103. virtual HRESULT STDMETHODCALLTYPE title(
  104. /* [retval][out] */ BSTR* docTitle);
  105. protected:
  106. ULONG m_refCount;
  107. WebFrame* m_frame;
  108. };
  109. #endif