2 * Copyright 2006 Jacek Caban for CodeWeavers
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.
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.
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
31 #include "wine/debug.h"
33 #include "mshtml_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
37 #define HTMLTEXTCONT_THIS(iface) DEFINE_THIS(HTMLTextContainer, HTMLTextContainer, iface)
39 static HRESULT WINAPI
HTMLTextContainer_QueryInterface(IHTMLTextContainer
*iface
,
40 REFIID riid
, void **ppv
)
42 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
43 return IHTMLElement_QueryInterface(HTMLELEM(&This
->element
), riid
, ppv
);
46 static ULONG WINAPI
HTMLTextContainer_AddRef(IHTMLTextContainer
*iface
)
48 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
49 return IHTMLElement_AddRef(HTMLELEM(&This
->element
));
52 static ULONG WINAPI
HTMLTextContainer_Release(IHTMLTextContainer
*iface
)
54 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
55 return IHTMLElement_Release(HTMLELEM(&This
->element
));
58 static HRESULT WINAPI
HTMLTextContainer_GetTypeInfoCount(IHTMLTextContainer
*iface
, UINT
*pctinfo
)
60 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
61 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This
->element
.node
.dispex
), pctinfo
);
64 static HRESULT WINAPI
HTMLTextContainer_GetTypeInfo(IHTMLTextContainer
*iface
, UINT iTInfo
,
65 LCID lcid
, ITypeInfo
**ppTInfo
)
67 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
68 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This
->element
.node
.dispex
), iTInfo
, lcid
, ppTInfo
);
71 static HRESULT WINAPI
HTMLTextContainer_GetIDsOfNames(IHTMLTextContainer
*iface
, REFIID riid
,
72 LPOLESTR
*rgszNames
, UINT cNames
,
73 LCID lcid
, DISPID
*rgDispId
)
75 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
76 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This
->element
.node
.dispex
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
79 static HRESULT WINAPI
HTMLTextContainer_Invoke(IHTMLTextContainer
*iface
, DISPID dispIdMember
,
80 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
81 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
83 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
84 return IDispatchEx_Invoke(DISPATCHEX(&This
->element
.node
.dispex
), dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
85 pVarResult
, pExcepInfo
, puArgErr
);
88 static HRESULT WINAPI
HTMLTextContainer_createControlRange(IHTMLTextContainer
*iface
,
91 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
92 FIXME("(%p)->(%p)\n", This
, range
);
96 static HRESULT WINAPI
HTMLTextContainer_get_scrollHeight(IHTMLTextContainer
*iface
, LONG
*p
)
98 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
100 TRACE("(%p)->(%p)\n", This
, p
);
102 return IHTMLElement2_get_scrollHeight(HTMLELEM2(&This
->element
), p
);
105 static HRESULT WINAPI
HTMLTextContainer_get_scrollWidth(IHTMLTextContainer
*iface
, LONG
*p
)
107 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
109 TRACE("(%p)->(%p)\n", This
, p
);
111 return IHTMLElement2_get_scrollWidth(HTMLELEM2(&This
->element
), p
);
114 static HRESULT WINAPI
HTMLTextContainer_put_scrollTop(IHTMLTextContainer
*iface
, LONG v
)
116 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
118 TRACE("(%p)->(%d)\n", This
, v
);
120 return IHTMLElement2_put_scrollTop(HTMLELEM2(&This
->element
), v
);
123 static HRESULT WINAPI
HTMLTextContainer_get_scrollTop(IHTMLTextContainer
*iface
, LONG
*p
)
125 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
127 TRACE("(%p)->(%p)\n", This
, p
);
129 return IHTMLElement2_get_scrollTop(HTMLELEM2(&This
->element
), p
);
132 static HRESULT WINAPI
HTMLTextContainer_put_scrollLeft(IHTMLTextContainer
*iface
, LONG v
)
134 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
136 TRACE("(%p)->(%d)\n", This
, v
);
138 return IHTMLElement2_put_scrollLeft(HTMLELEM2(&This
->element
), v
);
141 static HRESULT WINAPI
HTMLTextContainer_get_scrollLeft(IHTMLTextContainer
*iface
, LONG
*p
)
143 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
145 TRACE("(%p)->(%p)\n", This
, p
);
147 return IHTMLElement2_get_scrollLeft(HTMLELEM2(&This
->element
), p
);
150 static HRESULT WINAPI
HTMLTextContainer_put_onscroll(IHTMLTextContainer
*iface
, VARIANT v
)
152 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
153 FIXME("(%p)->()\n", This
);
157 static HRESULT WINAPI
HTMLTextContainer_get_onscroll(IHTMLTextContainer
*iface
, VARIANT
*p
)
159 HTMLTextContainer
*This
= HTMLTEXTCONT_THIS(iface
);
160 FIXME("(%p)->(%p)\n", This
, p
);
164 #undef HTMLTEXTCONT_THIS
166 static const IHTMLTextContainerVtbl HTMLTextContainerVtbl
= {
167 HTMLTextContainer_QueryInterface
,
168 HTMLTextContainer_AddRef
,
169 HTMLTextContainer_Release
,
170 HTMLTextContainer_GetTypeInfoCount
,
171 HTMLTextContainer_GetTypeInfo
,
172 HTMLTextContainer_GetIDsOfNames
,
173 HTMLTextContainer_Invoke
,
174 HTMLTextContainer_createControlRange
,
175 HTMLTextContainer_get_scrollHeight
,
176 HTMLTextContainer_get_scrollWidth
,
177 HTMLTextContainer_put_scrollTop
,
178 HTMLTextContainer_get_scrollTop
,
179 HTMLTextContainer_put_scrollLeft
,
180 HTMLTextContainer_get_scrollLeft
,
181 HTMLTextContainer_put_onscroll
,
182 HTMLTextContainer_get_onscroll
185 void HTMLTextContainer_Init(HTMLTextContainer
*This
, HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
,
186 dispex_static_data_t
*dispex_data
)
188 This
->lpHTMLTextContainerVtbl
= &HTMLTextContainerVtbl
;
190 HTMLElement_Init(&This
->element
, doc
, nselem
, dispex_data
);
192 ConnectionPoint_Init(&This
->cp
, &This
->element
.cp_container
, &DIID_HTMLTextContainerEvents
, NULL
);