wsock32: Assign to struct instead of using memcpy.
[wine/hacks.git] / dlls / mshtml / htmldoc5.c
blob33025380a1aef3d86c601fc9e6b2314dcb9de5e9
1 /*
2 * Copyright 2007 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
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
24 #define COBJMACROS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "ole2.h"
31 #include "wine/debug.h"
33 #include "mshtml_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 #define HTMLDOC5_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument5, iface)
39 static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface,
40 REFIID riid, void **ppv)
42 HTMLDocument *This = HTMLDOC5_THIS(iface);
43 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
46 static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface)
48 HTMLDocument *This = HTMLDOC5_THIS(iface);
49 return IHTMLDocument2_AddRef(HTMLDOC(This));
52 static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface)
54 HTMLDocument *This = HTMLDOC5_THIS(iface);
55 return IHTMLDocument2_Release(HTMLDOC(This));
58 static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo)
60 HTMLDocument *This = HTMLDOC5_THIS(iface);
61 FIXME("(%p)->(%p)\n", This, pctinfo);
62 return E_NOTIMPL;
65 static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo,
66 LCID lcid, ITypeInfo **ppTInfo)
68 HTMLDocument *This = HTMLDOC5_THIS(iface);
69 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
70 return E_NOTIMPL;
73 static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid,
74 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
76 HTMLDocument *This = HTMLDOC5_THIS(iface);
77 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
78 lcid, rgDispId);
79 return E_NOTIMPL;
82 static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember,
83 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
84 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
86 HTMLDocument *This = HTMLDOC5_THIS(iface);
87 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
88 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
89 return E_NOTIMPL;
92 static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v)
94 HTMLDocument *This = HTMLDOC5_THIS(iface);
95 FIXME("(%p)->(v)\n", This);
96 return E_NOTIMPL;
99 static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p)
101 HTMLDocument *This = HTMLDOC5_THIS(iface);
102 FIXME("(%p)->(%p)\n", This, p);
103 return E_NOTIMPL;
106 static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p)
108 HTMLDocument *This = HTMLDOC5_THIS(iface);
109 FIXME("(%p)->(%p)\n", This, p);
110 return E_NOTIMPL;
113 static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p)
115 HTMLDocument *This = HTMLDOC5_THIS(iface);
116 FIXME("(%p)->(%p)\n", This, p);
117 return E_NOTIMPL;
120 static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName,
121 IHTMLDOMAttribute **ppattribute)
123 HTMLDocument *This = HTMLDOC5_THIS(iface);
124 FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
125 return E_NOTIMPL;
128 static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata,
129 IHTMLDOMNode **ppRetNode)
131 HTMLDocument *This = HTMLDOC5_THIS(iface);
132 FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
133 return E_NOTIMPL;
136 static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v)
138 HTMLDocument *This = HTMLDOC5_THIS(iface);
139 FIXME("(%p)->(v)\n", This);
140 return E_NOTIMPL;
143 static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p)
145 HTMLDocument *This = HTMLDOC5_THIS(iface);
146 FIXME("(%p)->(%p)\n", This, p);
147 return E_NOTIMPL;
150 static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v)
152 HTMLDocument *This = HTMLDOC5_THIS(iface);
153 FIXME("(%p)->(v)\n", This);
154 return E_NOTIMPL;
157 static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p)
159 HTMLDocument *This = HTMLDOC5_THIS(iface);
160 FIXME("(%p)->(%p)\n", This, p);
161 return E_NOTIMPL;
164 static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v)
166 HTMLDocument *This = HTMLDOC5_THIS(iface);
167 FIXME("(%p)->(v)\n", This);
168 return E_NOTIMPL;
171 static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p)
173 HTMLDocument *This = HTMLDOC5_THIS(iface);
174 FIXME("(%p)->(%p)\n", This, p);
175 return E_NOTIMPL;
178 static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v)
180 HTMLDocument *This = HTMLDOC5_THIS(iface);
181 FIXME("(%p)->(v)\n", This);
182 return E_NOTIMPL;
185 static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p)
187 HTMLDocument *This = HTMLDOC5_THIS(iface);
188 FIXME("(%p)->(%p)\n", This, p);
189 return E_NOTIMPL;
192 static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v)
194 HTMLDocument *This = HTMLDOC5_THIS(iface);
195 FIXME("(%p)->(v)\n", This);
196 return E_NOTIMPL;
199 static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p)
201 HTMLDocument *This = HTMLDOC5_THIS(iface);
202 FIXME("(%p)->(%p)\n", This, p);
203 return E_NOTIMPL;
206 static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v)
208 HTMLDocument *This = HTMLDOC5_THIS(iface);
209 FIXME("(%p)->(v)\n", This);
210 return E_NOTIMPL;
213 static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p)
215 HTMLDocument *This = HTMLDOC5_THIS(iface);
216 FIXME("(%p)->(%p)\n", This, p);
217 return E_NOTIMPL;
220 static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
222 HTMLDocument *This = HTMLDOC5_THIS(iface);
223 nsIDOMDocument *nsdoc;
224 nsIDOMNSHTMLDocument *nshtmldoc;
225 nsAString mode_str;
226 const PRUnichar *mode;
227 nsresult nsres;
229 TRACE("(%p)->(%p)\n", This, p);
231 nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
232 if(NS_FAILED(nsres))
233 ERR("GetDocument failed: %08x\n", nsres);
235 nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc);
236 nsIDOMDocument_Release(nsdoc);
237 if(NS_FAILED(nsres)) {
238 ERR("Could not get nsIDOMNSHTMLDocument: %08x\n", nsres);
239 return S_OK;
242 nsAString_Init(&mode_str, NULL);
243 nsIDOMNSHTMLDocument_GetCompatMode(nshtmldoc, &mode_str);
244 nsIDOMNSHTMLDocument_Release(nshtmldoc);
246 nsAString_GetData(&mode_str, &mode);
247 *p = SysAllocString(mode);
248 nsAString_Finish(&mode_str);
250 return S_OK;
253 #undef HTMLDOC5_THIS
255 static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
256 HTMLDocument5_QueryInterface,
257 HTMLDocument5_AddRef,
258 HTMLDocument5_Release,
259 HTMLDocument5_GetTypeInfoCount,
260 HTMLDocument5_GetTypeInfo,
261 HTMLDocument5_GetIDsOfNames,
262 HTMLDocument5_Invoke,
263 HTMLDocument5_put_onmousewheel,
264 HTMLDocument5_get_onmousewheel,
265 HTMLDocument5_get_doctype,
266 HTMLDocument5_get_implementation,
267 HTMLDocument5_createAttribute,
268 HTMLDocument5_createComment,
269 HTMLDocument5_put_onfocusin,
270 HTMLDocument5_get_onfocusin,
271 HTMLDocument5_put_onfocusout,
272 HTMLDocument5_get_onfocusout,
273 HTMLDocument5_put_onactivate,
274 HTMLDocument5_get_onactivate,
275 HTMLDocument5_put_ondeactivate,
276 HTMLDocument5_get_ondeactivate,
277 HTMLDocument5_put_onbeforeactivate,
278 HTMLDocument5_get_onbeforeactivate,
279 HTMLDocument5_put_onbeforedeactivate,
280 HTMLDocument5_get_onbeforedeactivate,
281 HTMLDocument5_get_compatMode
284 void HTMLDocument_HTMLDocument5_Init(HTMLDocument *This)
286 This->lpHTMLDocument5Vtbl = &HTMLDocument5Vtbl;