setupapi: Added Slovenian translation.
[wine] / dlls / mshtml / htmldoc5.c
1 /*
2  * Copyright 2007 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 "config.h"
20
21 #include <stdarg.h>
22 #include <stdio.h>
23
24 #define COBJMACROS
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "ole2.h"
30
31 #include "wine/debug.h"
32
33 #include "mshtml_private.h"
34
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36
37 #define HTMLDOC5_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument5, iface)
38
39 static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface,
40         REFIID riid, void **ppv)
41 {
42     HTMLDocument *This = HTMLDOC5_THIS(iface);
43     return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
44 }
45
46 static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface)
47 {
48     HTMLDocument *This = HTMLDOC5_THIS(iface);
49     return IHTMLDocument2_AddRef(HTMLDOC(This));
50 }
51
52 static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface)
53 {
54     HTMLDocument *This = HTMLDOC5_THIS(iface);
55     return IHTMLDocument2_Release(HTMLDOC(This));
56 }
57
58 static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo)
59 {
60     HTMLDocument *This = HTMLDOC5_THIS(iface);
61     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
62 }
63
64 static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo,
65         LCID lcid, ITypeInfo **ppTInfo)
66 {
67     HTMLDocument *This = HTMLDOC5_THIS(iface);
68     return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
69 }
70
71 static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid,
72         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
73 {
74     HTMLDocument *This = HTMLDOC5_THIS(iface);
75     return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
76 }
77
78 static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember,
79                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
80                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
81 {
82     HTMLDocument *This = HTMLDOC5_THIS(iface);
83     return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
84             pVarResult, pExcepInfo, puArgErr);
85 }
86
87 static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v)
88 {
89     HTMLDocument *This = HTMLDOC5_THIS(iface);
90     FIXME("(%p)->(v)\n", This);
91     return E_NOTIMPL;
92 }
93
94 static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p)
95 {
96     HTMLDocument *This = HTMLDOC5_THIS(iface);
97     FIXME("(%p)->(%p)\n", This, p);
98     return E_NOTIMPL;
99 }
100
101 static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p)
102 {
103     HTMLDocument *This = HTMLDOC5_THIS(iface);
104     FIXME("(%p)->(%p)\n", This, p);
105     return E_NOTIMPL;
106 }
107
108 static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p)
109 {
110     HTMLDocument *This = HTMLDOC5_THIS(iface);
111     FIXME("(%p)->(%p)\n", This, p);
112     return E_NOTIMPL;
113 }
114
115 static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName,
116         IHTMLDOMAttribute **ppattribute)
117 {
118     HTMLDocument *This = HTMLDOC5_THIS(iface);
119     FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
120     return E_NOTIMPL;
121 }
122
123 static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata,
124         IHTMLDOMNode **ppRetNode)
125 {
126     HTMLDocument *This = HTMLDOC5_THIS(iface);
127     FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
128     return E_NOTIMPL;
129 }
130
131 static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v)
132 {
133     HTMLDocument *This = HTMLDOC5_THIS(iface);
134     FIXME("(%p)->(v)\n", This);
135     return E_NOTIMPL;
136 }
137
138 static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p)
139 {
140     HTMLDocument *This = HTMLDOC5_THIS(iface);
141     FIXME("(%p)->(%p)\n", This, p);
142     return E_NOTIMPL;
143 }
144
145 static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v)
146 {
147     HTMLDocument *This = HTMLDOC5_THIS(iface);
148     FIXME("(%p)->(v)\n", This);
149     return E_NOTIMPL;
150 }
151
152 static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p)
153 {
154     HTMLDocument *This = HTMLDOC5_THIS(iface);
155     FIXME("(%p)->(%p)\n", This, p);
156     return E_NOTIMPL;
157 }
158
159 static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v)
160 {
161     HTMLDocument *This = HTMLDOC5_THIS(iface);
162     FIXME("(%p)->(v)\n", This);
163     return E_NOTIMPL;
164 }
165
166 static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p)
167 {
168     HTMLDocument *This = HTMLDOC5_THIS(iface);
169     FIXME("(%p)->(%p)\n", This, p);
170     return E_NOTIMPL;
171 }
172
173 static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v)
174 {
175     HTMLDocument *This = HTMLDOC5_THIS(iface);
176     FIXME("(%p)->(v)\n", This);
177     return E_NOTIMPL;
178 }
179
180 static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p)
181 {
182     HTMLDocument *This = HTMLDOC5_THIS(iface);
183     FIXME("(%p)->(%p)\n", This, p);
184     return E_NOTIMPL;
185 }
186
187 static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v)
188 {
189     HTMLDocument *This = HTMLDOC5_THIS(iface);
190     FIXME("(%p)->(v)\n", This);
191     return E_NOTIMPL;
192 }
193
194 static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p)
195 {
196     HTMLDocument *This = HTMLDOC5_THIS(iface);
197     FIXME("(%p)->(%p)\n", This, p);
198     return E_NOTIMPL;
199 }
200
201 static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v)
202 {
203     HTMLDocument *This = HTMLDOC5_THIS(iface);
204     FIXME("(%p)->(v)\n", This);
205     return E_NOTIMPL;
206 }
207
208 static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p)
209 {
210     HTMLDocument *This = HTMLDOC5_THIS(iface);
211     FIXME("(%p)->(%p)\n", This, p);
212     return E_NOTIMPL;
213 }
214
215 static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
216 {
217     HTMLDocument *This = HTMLDOC5_THIS(iface);
218     nsIDOMNSHTMLDocument *nshtmldoc;
219     nsAString mode_str;
220     const PRUnichar *mode;
221     nsresult nsres;
222
223     TRACE("(%p)->(%p)\n", This, p);
224
225     if(!This->nsdoc) {
226         WARN("NULL nsdoc\n");
227         return E_UNEXPECTED;
228     }
229
230     nsres = nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc);
231     if(NS_FAILED(nsres)) {
232         ERR("Could not get nsIDOMNSHTMLDocument: %08x\n", nsres);
233         return S_OK;
234     }
235
236     nsAString_Init(&mode_str, NULL);
237     nsIDOMNSHTMLDocument_GetCompatMode(nshtmldoc, &mode_str);
238     nsIDOMNSHTMLDocument_Release(nshtmldoc);
239
240     nsAString_GetData(&mode_str, &mode);
241     *p = SysAllocString(mode);
242     nsAString_Finish(&mode_str);
243
244     return S_OK;
245 }
246
247 #undef HTMLDOC5_THIS
248
249 static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
250     HTMLDocument5_QueryInterface,
251     HTMLDocument5_AddRef,
252     HTMLDocument5_Release,
253     HTMLDocument5_GetTypeInfoCount,
254     HTMLDocument5_GetTypeInfo,
255     HTMLDocument5_GetIDsOfNames,
256     HTMLDocument5_Invoke,
257     HTMLDocument5_put_onmousewheel,
258     HTMLDocument5_get_onmousewheel,
259     HTMLDocument5_get_doctype,
260     HTMLDocument5_get_implementation,
261     HTMLDocument5_createAttribute,
262     HTMLDocument5_createComment,
263     HTMLDocument5_put_onfocusin,
264     HTMLDocument5_get_onfocusin,
265     HTMLDocument5_put_onfocusout,
266     HTMLDocument5_get_onfocusout,
267     HTMLDocument5_put_onactivate,
268     HTMLDocument5_get_onactivate,
269     HTMLDocument5_put_ondeactivate,
270     HTMLDocument5_get_ondeactivate,
271     HTMLDocument5_put_onbeforeactivate,
272     HTMLDocument5_get_onbeforeactivate,
273     HTMLDocument5_put_onbeforedeactivate,
274     HTMLDocument5_get_onbeforedeactivate,
275     HTMLDocument5_get_compatMode
276 };
277
278 void HTMLDocument_HTMLDocument5_Init(HTMLDocument *This)
279 {
280     This->lpHTMLDocument5Vtbl = &HTMLDocument5Vtbl;
281 }