|
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 |
|
26 #ifndef WebHTMLRepresentation_H |
|
27 #define WebHTMLRepresentation_H |
|
28 |
|
29 #include "IWebHTMLRepresentation.h" |
|
30 #include "IWebDocument.h" |
|
31 |
|
32 class WebFrame; |
|
33 |
|
34 class WebHTMLRepresentation : public IWebHTMLRepresentation, IWebDocumentRepresentation |
|
35 { |
|
36 public: |
|
37 static WebHTMLRepresentation* createInstance(WebFrame* frame); |
|
38 protected: |
|
39 WebHTMLRepresentation(); |
|
40 ~WebHTMLRepresentation(); |
|
41 public: |
|
42 |
|
43 // IUnknown |
|
44 virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); |
|
45 virtual ULONG STDMETHODCALLTYPE AddRef(void); |
|
46 virtual ULONG STDMETHODCALLTYPE Release(void); |
|
47 |
|
48 // IWebHTMLRepresentation |
|
49 virtual HRESULT STDMETHODCALLTYPE supportedMIMETypes( |
|
50 /* [out][in] */ BSTR* types, |
|
51 /* [out][in] */ int* cTypes); |
|
52 |
|
53 virtual HRESULT STDMETHODCALLTYPE supportedNonImageMIMETypes( |
|
54 /* [out][in] */ BSTR* types, |
|
55 /* [out][in] */ int* cTypes); |
|
56 |
|
57 virtual HRESULT STDMETHODCALLTYPE supportedImageMIMETypes( |
|
58 /* [out][in] */ BSTR* types, |
|
59 /* [out][in] */ int* cTypes); |
|
60 |
|
61 virtual HRESULT STDMETHODCALLTYPE attributedStringFromDOMNodes( |
|
62 /* [in] */ IDOMNode* startNode, |
|
63 /* [in] */ int startOffset, |
|
64 /* [in] */ IDOMNode* endNode, |
|
65 /* [in] */ int endOffset, |
|
66 /* [retval][out] */ IDataObject** attributedString); |
|
67 |
|
68 virtual HRESULT STDMETHODCALLTYPE elementWithName( |
|
69 /* [in] */ BSTR name, |
|
70 /* [in] */ IDOMElement* form, |
|
71 /* [retval][out] */ IDOMElement** element); |
|
72 |
|
73 virtual HRESULT STDMETHODCALLTYPE elementDoesAutoComplete( |
|
74 /* [in] */ IDOMElement* element, |
|
75 /* [retval][out] */ BOOL* result); |
|
76 |
|
77 virtual HRESULT STDMETHODCALLTYPE elementIsPassword( |
|
78 /* [in] */ IDOMElement* element, |
|
79 /* [retval][out] */ BOOL* result); |
|
80 |
|
81 virtual HRESULT STDMETHODCALLTYPE formForElement( |
|
82 /* [in] */ IDOMElement* element, |
|
83 /* [retval][out] */ IDOMElement** form); |
|
84 |
|
85 virtual HRESULT STDMETHODCALLTYPE currentForm( |
|
86 /* [retval][out] */ IDOMElement** form); |
|
87 |
|
88 virtual HRESULT STDMETHODCALLTYPE controlsInForm( |
|
89 /* [in] */ IDOMElement* form, |
|
90 /* [out][in] */ IDOMElement** controls, |
|
91 /* [out][in] */ int* cControls); |
|
92 |
|
93 virtual HRESULT STDMETHODCALLTYPE searchForLabels( |
|
94 /* [size_is][in] */ BSTR *labels, |
|
95 /* [in] */ int cLabels, |
|
96 /* [in] */ IDOMElement *beforeElement, |
|
97 /* [retval][out] */ BSTR *result); |
|
98 |
|
99 virtual HRESULT STDMETHODCALLTYPE matchLabels( |
|
100 /* [size_is][in] */ BSTR *labels, |
|
101 /* [in] */ int cLabels, |
|
102 /* [in] */ IDOMElement *againstElement, |
|
103 /* [retval][out] */ BSTR *result); |
|
104 |
|
105 // IWebDocumentRepresentation |
|
106 virtual HRESULT STDMETHODCALLTYPE setDataSource( |
|
107 /* [in] */ IWebDataSource* dataSource); |
|
108 |
|
109 virtual HRESULT STDMETHODCALLTYPE receivedData( |
|
110 /* [in] */ IStream* data, |
|
111 /* [in] */ IWebDataSource* dataSource); |
|
112 |
|
113 virtual HRESULT STDMETHODCALLTYPE receivedError( |
|
114 /* [in] */ IWebError* error, |
|
115 /* [in] */ IWebDataSource* dataSource); |
|
116 |
|
117 virtual HRESULT STDMETHODCALLTYPE finishedLoadingWithDataSource( |
|
118 /* [in] */ IWebDataSource* dataSource); |
|
119 |
|
120 virtual HRESULT STDMETHODCALLTYPE canProvideDocumentSource( |
|
121 /* [retval][out] */ BOOL* result); |
|
122 |
|
123 virtual HRESULT STDMETHODCALLTYPE documentSource( |
|
124 /* [retval][out] */ BSTR* source); |
|
125 |
|
126 virtual HRESULT STDMETHODCALLTYPE title( |
|
127 /* [retval][out] */ BSTR* docTitle); |
|
128 |
|
129 protected: |
|
130 ULONG m_refCount; |
|
131 WebFrame* m_frame; |
|
132 }; |
|
133 |
|
134 #endif |