3028d8d9b33e66589e6b1724d904122993d0c9d8
[reactos.git] / reactos / dll / win32 / mshtml / htmltextcont.c
1 /*
2 * Copyright 2006 Jacek Caban for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #define WIN32_NO_STATUS
20 #define _INC_WINDOWS
21
22 #include <config.h>
23
24 #include <stdarg.h>
25 //#include <stdio.h>
26
27 #define COBJMACROS
28
29 #include <windef.h>
30 #include <winbase.h>
31 //#include "winuser.h"
32 #include <ole2.h>
33
34 #include <wine/debug.h>
35
36 #include "mshtml_private.h"
37
38 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
39
40 static inline HTMLTextContainer *impl_from_IHTMLTextContainer(IHTMLTextContainer *iface)
41 {
42 return CONTAINING_RECORD(iface, HTMLTextContainer, IHTMLTextContainer_iface);
43 }
44
45 static HRESULT WINAPI HTMLTextContainer_QueryInterface(IHTMLTextContainer *iface,
46 REFIID riid, void **ppv)
47 {
48 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
49 return IHTMLElement_QueryInterface(&This->element.IHTMLElement_iface, riid, ppv);
50 }
51
52 static ULONG WINAPI HTMLTextContainer_AddRef(IHTMLTextContainer *iface)
53 {
54 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
55 return IHTMLElement_AddRef(&This->element.IHTMLElement_iface);
56 }
57
58 static ULONG WINAPI HTMLTextContainer_Release(IHTMLTextContainer *iface)
59 {
60 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
61 return IHTMLElement_Release(&This->element.IHTMLElement_iface);
62 }
63
64 static HRESULT WINAPI HTMLTextContainer_GetTypeInfoCount(IHTMLTextContainer *iface, UINT *pctinfo)
65 {
66 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
67 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
68 }
69
70 static HRESULT WINAPI HTMLTextContainer_GetTypeInfo(IHTMLTextContainer *iface, UINT iTInfo,
71 LCID lcid, ITypeInfo **ppTInfo)
72 {
73 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
74 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
75 ppTInfo);
76 }
77
78 static HRESULT WINAPI HTMLTextContainer_GetIDsOfNames(IHTMLTextContainer *iface, REFIID riid,
79 LPOLESTR *rgszNames, UINT cNames,
80 LCID lcid, DISPID *rgDispId)
81 {
82 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
83 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
84 cNames, lcid, rgDispId);
85 }
86
87 static HRESULT WINAPI HTMLTextContainer_Invoke(IHTMLTextContainer *iface, DISPID dispIdMember,
88 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
89 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
90 {
91 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
92 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
93 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
94 }
95
96 static HRESULT WINAPI HTMLTextContainer_createControlRange(IHTMLTextContainer *iface,
97 IDispatch **range)
98 {
99 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
100 FIXME("(%p)->(%p)\n", This, range);
101 return E_NOTIMPL;
102 }
103
104 static HRESULT WINAPI HTMLTextContainer_get_scrollHeight(IHTMLTextContainer *iface, LONG *p)
105 {
106 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
107
108 TRACE("(%p)->(%p)\n", This, p);
109
110 return IHTMLElement2_get_scrollHeight(&This->element.IHTMLElement2_iface, p);
111 }
112
113 static HRESULT WINAPI HTMLTextContainer_get_scrollWidth(IHTMLTextContainer *iface, LONG *p)
114 {
115 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
116
117 TRACE("(%p)->(%p)\n", This, p);
118
119 return IHTMLElement2_get_scrollWidth(&This->element.IHTMLElement2_iface, p);
120 }
121
122 static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface, LONG v)
123 {
124 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
125
126 TRACE("(%p)->(%d)\n", This, v);
127
128 return IHTMLElement2_put_scrollTop(&This->element.IHTMLElement2_iface, v);
129 }
130
131 static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface, LONG *p)
132 {
133 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
134
135 TRACE("(%p)->(%p)\n", This, p);
136
137 return IHTMLElement2_get_scrollTop(&This->element.IHTMLElement2_iface, p);
138 }
139
140 static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface, LONG v)
141 {
142 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
143
144 TRACE("(%p)->(%d)\n", This, v);
145
146 return IHTMLElement2_put_scrollLeft(&This->element.IHTMLElement2_iface, v);
147 }
148
149 static HRESULT WINAPI HTMLTextContainer_get_scrollLeft(IHTMLTextContainer *iface, LONG *p)
150 {
151 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
152
153 TRACE("(%p)->(%p)\n", This, p);
154
155 return IHTMLElement2_get_scrollLeft(&This->element.IHTMLElement2_iface, p);
156 }
157
158 static HRESULT WINAPI HTMLTextContainer_put_onscroll(IHTMLTextContainer *iface, VARIANT v)
159 {
160 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
161 FIXME("(%p)->()\n", This);
162 return E_NOTIMPL;
163 }
164
165 static HRESULT WINAPI HTMLTextContainer_get_onscroll(IHTMLTextContainer *iface, VARIANT *p)
166 {
167 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
168 FIXME("(%p)->(%p)\n", This, p);
169 return E_NOTIMPL;
170 }
171
172 static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = {
173 HTMLTextContainer_QueryInterface,
174 HTMLTextContainer_AddRef,
175 HTMLTextContainer_Release,
176 HTMLTextContainer_GetTypeInfoCount,
177 HTMLTextContainer_GetTypeInfo,
178 HTMLTextContainer_GetIDsOfNames,
179 HTMLTextContainer_Invoke,
180 HTMLTextContainer_createControlRange,
181 HTMLTextContainer_get_scrollHeight,
182 HTMLTextContainer_get_scrollWidth,
183 HTMLTextContainer_put_scrollTop,
184 HTMLTextContainer_get_scrollTop,
185 HTMLTextContainer_put_scrollLeft,
186 HTMLTextContainer_get_scrollLeft,
187 HTMLTextContainer_put_onscroll,
188 HTMLTextContainer_get_onscroll
189 };
190
191 void HTMLTextContainer_Init(HTMLTextContainer *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem,
192 dispex_static_data_t *dispex_data)
193 {
194 This->IHTMLTextContainer_iface.lpVtbl = &HTMLTextContainerVtbl;
195
196 HTMLElement_Init(&This->element, doc, nselem, dispex_data);
197 }