[SHELL32] CDrivesFolder: Implement the eject and disconnect menu items. CORE-13841
[reactos.git] / 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 #include "mshtml_private.h"
20
21 static inline HTMLTextContainer *impl_from_IHTMLTextContainer(IHTMLTextContainer *iface)
22 {
23 return CONTAINING_RECORD(iface, HTMLTextContainer, IHTMLTextContainer_iface);
24 }
25
26 static HRESULT WINAPI HTMLTextContainer_QueryInterface(IHTMLTextContainer *iface,
27 REFIID riid, void **ppv)
28 {
29 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
30 return IHTMLElement_QueryInterface(&This->element.IHTMLElement_iface, riid, ppv);
31 }
32
33 static ULONG WINAPI HTMLTextContainer_AddRef(IHTMLTextContainer *iface)
34 {
35 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
36 return IHTMLElement_AddRef(&This->element.IHTMLElement_iface);
37 }
38
39 static ULONG WINAPI HTMLTextContainer_Release(IHTMLTextContainer *iface)
40 {
41 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
42 return IHTMLElement_Release(&This->element.IHTMLElement_iface);
43 }
44
45 static HRESULT WINAPI HTMLTextContainer_GetTypeInfoCount(IHTMLTextContainer *iface, UINT *pctinfo)
46 {
47 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
48 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
49 }
50
51 static HRESULT WINAPI HTMLTextContainer_GetTypeInfo(IHTMLTextContainer *iface, UINT iTInfo,
52 LCID lcid, ITypeInfo **ppTInfo)
53 {
54 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
55 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
56 ppTInfo);
57 }
58
59 static HRESULT WINAPI HTMLTextContainer_GetIDsOfNames(IHTMLTextContainer *iface, REFIID riid,
60 LPOLESTR *rgszNames, UINT cNames,
61 LCID lcid, DISPID *rgDispId)
62 {
63 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
64 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
65 cNames, lcid, rgDispId);
66 }
67
68 static HRESULT WINAPI HTMLTextContainer_Invoke(IHTMLTextContainer *iface, DISPID dispIdMember,
69 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
70 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
71 {
72 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
73 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
74 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
75 }
76
77 static HRESULT WINAPI HTMLTextContainer_createControlRange(IHTMLTextContainer *iface,
78 IDispatch **range)
79 {
80 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
81 FIXME("(%p)->(%p)\n", This, range);
82 return E_NOTIMPL;
83 }
84
85 static HRESULT WINAPI HTMLTextContainer_get_scrollHeight(IHTMLTextContainer *iface, LONG *p)
86 {
87 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
88
89 TRACE("(%p)->(%p)\n", This, p);
90
91 return IHTMLElement2_get_scrollHeight(&This->element.IHTMLElement2_iface, p);
92 }
93
94 static HRESULT WINAPI HTMLTextContainer_get_scrollWidth(IHTMLTextContainer *iface, LONG *p)
95 {
96 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
97
98 TRACE("(%p)->(%p)\n", This, p);
99
100 return IHTMLElement2_get_scrollWidth(&This->element.IHTMLElement2_iface, p);
101 }
102
103 static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface, LONG v)
104 {
105 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
106
107 TRACE("(%p)->(%d)\n", This, v);
108
109 return IHTMLElement2_put_scrollTop(&This->element.IHTMLElement2_iface, v);
110 }
111
112 static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface, LONG *p)
113 {
114 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
115
116 TRACE("(%p)->(%p)\n", This, p);
117
118 return IHTMLElement2_get_scrollTop(&This->element.IHTMLElement2_iface, p);
119 }
120
121 static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface, LONG v)
122 {
123 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
124
125 TRACE("(%p)->(%d)\n", This, v);
126
127 return IHTMLElement2_put_scrollLeft(&This->element.IHTMLElement2_iface, v);
128 }
129
130 static HRESULT WINAPI HTMLTextContainer_get_scrollLeft(IHTMLTextContainer *iface, LONG *p)
131 {
132 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
133
134 TRACE("(%p)->(%p)\n", This, p);
135
136 return IHTMLElement2_get_scrollLeft(&This->element.IHTMLElement2_iface, p);
137 }
138
139 static HRESULT WINAPI HTMLTextContainer_put_onscroll(IHTMLTextContainer *iface, VARIANT v)
140 {
141 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
142 FIXME("(%p)->()\n", This);
143 return E_NOTIMPL;
144 }
145
146 static HRESULT WINAPI HTMLTextContainer_get_onscroll(IHTMLTextContainer *iface, VARIANT *p)
147 {
148 HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
149 FIXME("(%p)->(%p)\n", This, p);
150 return E_NOTIMPL;
151 }
152
153 static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = {
154 HTMLTextContainer_QueryInterface,
155 HTMLTextContainer_AddRef,
156 HTMLTextContainer_Release,
157 HTMLTextContainer_GetTypeInfoCount,
158 HTMLTextContainer_GetTypeInfo,
159 HTMLTextContainer_GetIDsOfNames,
160 HTMLTextContainer_Invoke,
161 HTMLTextContainer_createControlRange,
162 HTMLTextContainer_get_scrollHeight,
163 HTMLTextContainer_get_scrollWidth,
164 HTMLTextContainer_put_scrollTop,
165 HTMLTextContainer_get_scrollTop,
166 HTMLTextContainer_put_scrollLeft,
167 HTMLTextContainer_get_scrollLeft,
168 HTMLTextContainer_put_onscroll,
169 HTMLTextContainer_get_onscroll
170 };
171
172 void HTMLTextContainer_Init(HTMLTextContainer *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem,
173 dispex_static_data_t *dispex_data)
174 {
175 This->IHTMLTextContainer_iface.lpVtbl = &HTMLTextContainerVtbl;
176
177 HTMLElement_Init(&This->element, doc, nselem, dispex_data);
178 }