push 6fe5edf8439c19d3885814583531c2f2b1495177
[wine/hacks.git] / dlls / mshtml / omnavigator.c
blob1a1e7e8bea457812b766216c6cedfa9a22599b4d
1 /*
2 * Copyright 2008 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 <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34 typedef struct {
35 DispatchEx dispex;
36 const IOmNavigatorVtbl *lpIOmNavigatorVtbl;
38 LONG ref;
39 } OmNavigator;
41 #define OMNAVIGATOR(x) ((IOmNavigator*) &(x)->lpIOmNavigatorVtbl)
43 #define OMNAVIGATOR_THIS(iface) DEFINE_THIS(OmNavigator, IOmNavigator, iface)
45 static HRESULT WINAPI OmNavigator_QueryInterface(IOmNavigator *iface, REFIID riid, void **ppv)
47 OmNavigator *This = OMNAVIGATOR_THIS(iface);
49 *ppv = NULL;
51 if(IsEqualGUID(&IID_IUnknown, riid)) {
52 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
53 *ppv = OMNAVIGATOR(This);
54 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
55 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
56 *ppv = OMNAVIGATOR(This);
57 }else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
58 TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
59 *ppv = DISPATCHEX(&This->dispex);
60 }else if(IsEqualGUID(&IID_IOmNavigator, riid)) {
61 TRACE("(%p)->(IID_IOmNavigator %p)\n", This, ppv);
62 *ppv = OMNAVIGATOR(This);
65 if(*ppv) {
66 IUnknown_AddRef((IUnknown*)*ppv);
67 return S_OK;
70 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
71 return E_NOINTERFACE;
74 static ULONG WINAPI OmNavigator_AddRef(IOmNavigator *iface)
76 OmNavigator *This = OMNAVIGATOR_THIS(iface);
77 LONG ref = InterlockedIncrement(&This->ref);
79 TRACE("(%p) ref=%d\n", This, ref);
81 return ref;
84 static ULONG WINAPI OmNavigator_Release(IOmNavigator *iface)
86 OmNavigator *This = OMNAVIGATOR_THIS(iface);
87 LONG ref = InterlockedDecrement(&This->ref);
89 TRACE("(%p) ref=%d\n", This, ref);
91 if(!ref)
92 heap_free(This);
94 return ref;
97 static HRESULT WINAPI OmNavigator_GetTypeInfoCount(IOmNavigator *iface, UINT *pctinfo)
99 OmNavigator *This = OMNAVIGATOR_THIS(iface);
100 FIXME("(%p)->(%p)\n", This, pctinfo);
101 return E_NOTIMPL;
104 static HRESULT WINAPI OmNavigator_GetTypeInfo(IOmNavigator *iface, UINT iTInfo,
105 LCID lcid, ITypeInfo **ppTInfo)
107 OmNavigator *This = OMNAVIGATOR_THIS(iface);
108 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
109 return E_NOTIMPL;
112 static HRESULT WINAPI OmNavigator_GetIDsOfNames(IOmNavigator *iface, REFIID riid,
113 LPOLESTR *rgszNames, UINT cNames,
114 LCID lcid, DISPID *rgDispId)
116 OmNavigator *This = OMNAVIGATOR_THIS(iface);
117 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
118 lcid, rgDispId);
119 return E_NOTIMPL;
122 static HRESULT WINAPI OmNavigator_Invoke(IOmNavigator *iface, DISPID dispIdMember,
123 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
124 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
126 OmNavigator *This = OMNAVIGATOR_THIS(iface);
127 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
128 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
129 return E_NOTIMPL;
132 static HRESULT WINAPI OmNavigator_get_appCodeName(IOmNavigator *iface, BSTR *p)
134 OmNavigator *This = OMNAVIGATOR_THIS(iface);
135 FIXME("(%p)->(%p)\n", This, p);
136 return E_NOTIMPL;
139 static HRESULT WINAPI OmNavigator_get_appName(IOmNavigator *iface, BSTR *p)
141 OmNavigator *This = OMNAVIGATOR_THIS(iface);
142 FIXME("(%p)->(%p)\n", This, p);
143 return E_NOTIMPL;
146 static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
148 OmNavigator *This = OMNAVIGATOR_THIS(iface);
149 FIXME("(%p)->(%p)\n", This, p);
150 return E_NOTIMPL;
153 static HRESULT WINAPI OmNavigator_get_userAgent(IOmNavigator *iface, BSTR *p)
155 OmNavigator *This = OMNAVIGATOR_THIS(iface);
156 FIXME("(%p)->(%p)\n", This, p);
157 return E_NOTIMPL;
160 static HRESULT WINAPI OmNavigator_javaEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
162 OmNavigator *This = OMNAVIGATOR_THIS(iface);
163 FIXME("(%p)->(%p)\n", This, enabled);
164 return E_NOTIMPL;
167 static HRESULT WINAPI OmNavigator_taintEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
169 OmNavigator *This = OMNAVIGATOR_THIS(iface);
170 FIXME("(%p)->(%p)\n", This, enabled);
171 return E_NOTIMPL;
174 static HRESULT WINAPI OmNavigator_get_mimeTypes(IOmNavigator *iface, IHTMLMimeTypesCollection **p)
176 OmNavigator *This = OMNAVIGATOR_THIS(iface);
177 FIXME("(%p)->(%p)\n", This, p);
178 return E_NOTIMPL;
181 static HRESULT WINAPI OmNavigator_get_plugins(IOmNavigator *iface, IHTMLPluginsCollection **p)
183 OmNavigator *This = OMNAVIGATOR_THIS(iface);
184 FIXME("(%p)->(%p)\n", This, p);
185 return E_NOTIMPL;
188 static HRESULT WINAPI OmNavigator_get_cookieEnabled(IOmNavigator *iface, VARIANT_BOOL *p)
190 OmNavigator *This = OMNAVIGATOR_THIS(iface);
191 FIXME("(%p)->(%p)\n", This, p);
192 return E_NOTIMPL;
195 static HRESULT WINAPI OmNavigator_get_opsProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
197 OmNavigator *This = OMNAVIGATOR_THIS(iface);
198 FIXME("(%p)->(%p)\n", This, p);
199 return E_NOTIMPL;
202 static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String)
204 OmNavigator *This = OMNAVIGATOR_THIS(iface);
205 FIXME("(%p)->(%p)\n", This, String);
206 return E_NOTIMPL;
209 static HRESULT WINAPI OmNavigator_get_cpuClass(IOmNavigator *iface, BSTR *p)
211 OmNavigator *This = OMNAVIGATOR_THIS(iface);
212 FIXME("(%p)->(%p)\n", This, p);
213 return E_NOTIMPL;
216 static HRESULT WINAPI OmNavigator_get_systemLanguage(IOmNavigator *iface, BSTR *p)
218 OmNavigator *This = OMNAVIGATOR_THIS(iface);
219 FIXME("(%p)->(%p)\n", This, p);
220 return E_NOTIMPL;
223 static HRESULT WINAPI OmNavigator_get_browserLanguage(IOmNavigator *iface, BSTR *p)
225 OmNavigator *This = OMNAVIGATOR_THIS(iface);
226 FIXME("(%p)->(%p)\n", This, p);
227 return E_NOTIMPL;
230 static HRESULT WINAPI OmNavigator_get_userLanguage(IOmNavigator *iface, BSTR *p)
232 OmNavigator *This = OMNAVIGATOR_THIS(iface);
233 FIXME("(%p)->(%p)\n", This, p);
234 return E_NOTIMPL;
237 static HRESULT WINAPI OmNavigator_get_platform(IOmNavigator *iface, BSTR *p)
239 OmNavigator *This = OMNAVIGATOR_THIS(iface);
240 FIXME("(%p)->(%p)\n", This, p);
241 return E_NOTIMPL;
244 static HRESULT WINAPI OmNavigator_get_appMinorVersion(IOmNavigator *iface, BSTR *p)
246 OmNavigator *This = OMNAVIGATOR_THIS(iface);
247 FIXME("(%p)->(%p)\n", This, p);
248 return E_NOTIMPL;
251 static HRESULT WINAPI OmNavigator_get_connectionSpeed(IOmNavigator *iface, long *p)
253 OmNavigator *This = OMNAVIGATOR_THIS(iface);
254 FIXME("(%p)->(%p)\n", This, p);
255 return E_NOTIMPL;
258 static HRESULT WINAPI OmNavigator_get_onLine(IOmNavigator *iface, VARIANT_BOOL *p)
260 OmNavigator *This = OMNAVIGATOR_THIS(iface);
261 FIXME("(%p)->(%p)\n", This, p);
262 return E_NOTIMPL;
265 static HRESULT WINAPI OmNavigator_get_userProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
267 OmNavigator *This = OMNAVIGATOR_THIS(iface);
268 FIXME("(%p)->(%p)\n", This, p);
269 return E_NOTIMPL;
272 #undef OMNAVIGATOR_THIS
274 static const IOmNavigatorVtbl OmNavigatorVtbl = {
275 OmNavigator_QueryInterface,
276 OmNavigator_AddRef,
277 OmNavigator_Release,
278 OmNavigator_GetTypeInfoCount,
279 OmNavigator_GetTypeInfo,
280 OmNavigator_GetIDsOfNames,
281 OmNavigator_Invoke,
282 OmNavigator_get_appCodeName,
283 OmNavigator_get_appName,
284 OmNavigator_get_appVersion,
285 OmNavigator_get_userAgent,
286 OmNavigator_javaEnabled,
287 OmNavigator_taintEnabled,
288 OmNavigator_get_mimeTypes,
289 OmNavigator_get_plugins,
290 OmNavigator_get_cookieEnabled,
291 OmNavigator_get_opsProfile,
292 OmNavigator_toString,
293 OmNavigator_get_cpuClass,
294 OmNavigator_get_systemLanguage,
295 OmNavigator_get_browserLanguage,
296 OmNavigator_get_userLanguage,
297 OmNavigator_get_platform,
298 OmNavigator_get_appMinorVersion,
299 OmNavigator_get_connectionSpeed,
300 OmNavigator_get_onLine,
301 OmNavigator_get_userProfile
304 IOmNavigator *OmNavigator_Create(void)
306 OmNavigator *ret;
308 ret = heap_alloc(sizeof(*ret));
309 ret->lpIOmNavigatorVtbl = &OmNavigatorVtbl;
310 ret->ref = 1;
312 init_dispex(&ret->dispex, (IUnknown*)OMNAVIGATOR(ret));
314 return OMNAVIGATOR(ret);