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