push 5dd2d658b972a733854ca32020d79186875eac82
[wine/hacks.git] / dlls / mshtml / omnavigator.c
blobd1bcdca7310e4a5ab6b748ca8ce6ca34ae552fd4
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 const IOmNavigatorVtbl *lpIOmNavigatorVtbl;
37 LONG ref;
38 } OmNavigator;
40 #define OMNAVIGATOR(x) ((IOmNavigator*) &(x)->lpIOmNavigatorVtbl)
42 #define OMNAVIGATOR_THIS(iface) DEFINE_THIS(OmNavigator, IOmNavigator, iface)
44 static HRESULT WINAPI OmNavigator_QueryInterface(IOmNavigator *iface, REFIID riid, void **ppv)
46 OmNavigator *This = OMNAVIGATOR_THIS(iface);
48 *ppv = NULL;
50 if(IsEqualGUID(&IID_IUnknown, riid)) {
51 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
52 *ppv = OMNAVIGATOR(This);
53 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
54 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
55 *ppv = OMNAVIGATOR(This);
56 }else if(IsEqualGUID(&IID_IOmNavigator, riid)) {
57 TRACE("(%p)->(IID_IOmNavigator %p)\n", This, ppv);
58 *ppv = OMNAVIGATOR(This);
61 if(*ppv) {
62 IUnknown_AddRef((IUnknown*)*ppv);
63 return S_OK;
66 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
67 return E_NOINTERFACE;
70 static ULONG WINAPI OmNavigator_AddRef(IOmNavigator *iface)
72 OmNavigator *This = OMNAVIGATOR_THIS(iface);
73 LONG ref = InterlockedIncrement(&This->ref);
75 TRACE("(%p) ref=%d\n", This, ref);
77 return ref;
80 static ULONG WINAPI OmNavigator_Release(IOmNavigator *iface)
82 OmNavigator *This = OMNAVIGATOR_THIS(iface);
83 LONG ref = InterlockedDecrement(&This->ref);
85 TRACE("(%p) ref=%d\n", This, ref);
87 if(!ref)
88 heap_free(This);
90 return ref;
93 static HRESULT WINAPI OmNavigator_GetTypeInfoCount(IOmNavigator *iface, UINT *pctinfo)
95 OmNavigator *This = OMNAVIGATOR_THIS(iface);
96 FIXME("(%p)->(%p)\n", This, pctinfo);
97 return E_NOTIMPL;
100 static HRESULT WINAPI OmNavigator_GetTypeInfo(IOmNavigator *iface, UINT iTInfo,
101 LCID lcid, ITypeInfo **ppTInfo)
103 OmNavigator *This = OMNAVIGATOR_THIS(iface);
104 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
105 return E_NOTIMPL;
108 static HRESULT WINAPI OmNavigator_GetIDsOfNames(IOmNavigator *iface, REFIID riid,
109 LPOLESTR *rgszNames, UINT cNames,
110 LCID lcid, DISPID *rgDispId)
112 OmNavigator *This = OMNAVIGATOR_THIS(iface);
113 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
114 lcid, rgDispId);
115 return E_NOTIMPL;
118 static HRESULT WINAPI OmNavigator_Invoke(IOmNavigator *iface, DISPID dispIdMember,
119 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
120 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
122 OmNavigator *This = OMNAVIGATOR_THIS(iface);
123 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
124 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
125 return E_NOTIMPL;
128 static HRESULT WINAPI OmNavigator_get_appCodeName(IOmNavigator *iface, BSTR *p)
130 OmNavigator *This = OMNAVIGATOR_THIS(iface);
131 FIXME("(%p)->(%p)\n", This, p);
132 return E_NOTIMPL;
135 static HRESULT WINAPI OmNavigator_get_appName(IOmNavigator *iface, BSTR *p)
137 OmNavigator *This = OMNAVIGATOR_THIS(iface);
138 FIXME("(%p)->(%p)\n", This, p);
139 return E_NOTIMPL;
142 static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
144 OmNavigator *This = OMNAVIGATOR_THIS(iface);
145 FIXME("(%p)->(%p)\n", This, p);
146 return E_NOTIMPL;
149 static HRESULT WINAPI OmNavigator_get_userAgent(IOmNavigator *iface, BSTR *p)
151 OmNavigator *This = OMNAVIGATOR_THIS(iface);
152 FIXME("(%p)->(%p)\n", This, p);
153 return E_NOTIMPL;
156 static HRESULT WINAPI OmNavigator_javaEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
158 OmNavigator *This = OMNAVIGATOR_THIS(iface);
159 FIXME("(%p)->(%p)\n", This, enabled);
160 return E_NOTIMPL;
163 static HRESULT WINAPI OmNavigator_taintEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
165 OmNavigator *This = OMNAVIGATOR_THIS(iface);
166 FIXME("(%p)->(%p)\n", This, enabled);
167 return E_NOTIMPL;
170 static HRESULT WINAPI OmNavigator_get_mimeTypes(IOmNavigator *iface, IHTMLMimeTypesCollection **p)
172 OmNavigator *This = OMNAVIGATOR_THIS(iface);
173 FIXME("(%p)->(%p)\n", This, p);
174 return E_NOTIMPL;
177 static HRESULT WINAPI OmNavigator_get_plugins(IOmNavigator *iface, IHTMLPluginsCollection **p)
179 OmNavigator *This = OMNAVIGATOR_THIS(iface);
180 FIXME("(%p)->(%p)\n", This, p);
181 return E_NOTIMPL;
184 static HRESULT WINAPI OmNavigator_get_cookieEnabled(IOmNavigator *iface, VARIANT_BOOL *p)
186 OmNavigator *This = OMNAVIGATOR_THIS(iface);
187 FIXME("(%p)->(%p)\n", This, p);
188 return E_NOTIMPL;
191 static HRESULT WINAPI OmNavigator_get_opsProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
193 OmNavigator *This = OMNAVIGATOR_THIS(iface);
194 FIXME("(%p)->(%p)\n", This, p);
195 return E_NOTIMPL;
198 static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String)
200 OmNavigator *This = OMNAVIGATOR_THIS(iface);
201 FIXME("(%p)->(%p)\n", This, String);
202 return E_NOTIMPL;
205 static HRESULT WINAPI OmNavigator_get_cpuClass(IOmNavigator *iface, BSTR *p)
207 OmNavigator *This = OMNAVIGATOR_THIS(iface);
208 FIXME("(%p)->(%p)\n", This, p);
209 return E_NOTIMPL;
212 static HRESULT WINAPI OmNavigator_get_systemLanguage(IOmNavigator *iface, BSTR *p)
214 OmNavigator *This = OMNAVIGATOR_THIS(iface);
215 FIXME("(%p)->(%p)\n", This, p);
216 return E_NOTIMPL;
219 static HRESULT WINAPI OmNavigator_get_browserLanguage(IOmNavigator *iface, BSTR *p)
221 OmNavigator *This = OMNAVIGATOR_THIS(iface);
222 FIXME("(%p)->(%p)\n", This, p);
223 return E_NOTIMPL;
226 static HRESULT WINAPI OmNavigator_get_userLanguage(IOmNavigator *iface, BSTR *p)
228 OmNavigator *This = OMNAVIGATOR_THIS(iface);
229 FIXME("(%p)->(%p)\n", This, p);
230 return E_NOTIMPL;
233 static HRESULT WINAPI OmNavigator_get_platform(IOmNavigator *iface, BSTR *p)
235 OmNavigator *This = OMNAVIGATOR_THIS(iface);
236 FIXME("(%p)->(%p)\n", This, p);
237 return E_NOTIMPL;
240 static HRESULT WINAPI OmNavigator_get_appMinorVersion(IOmNavigator *iface, BSTR *p)
242 OmNavigator *This = OMNAVIGATOR_THIS(iface);
243 FIXME("(%p)->(%p)\n", This, p);
244 return E_NOTIMPL;
247 static HRESULT WINAPI OmNavigator_get_connectionSpeed(IOmNavigator *iface, long *p)
249 OmNavigator *This = OMNAVIGATOR_THIS(iface);
250 FIXME("(%p)->(%p)\n", This, p);
251 return E_NOTIMPL;
254 static HRESULT WINAPI OmNavigator_get_onLine(IOmNavigator *iface, VARIANT_BOOL *p)
256 OmNavigator *This = OMNAVIGATOR_THIS(iface);
257 FIXME("(%p)->(%p)\n", This, p);
258 return E_NOTIMPL;
261 static HRESULT WINAPI OmNavigator_get_userProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
263 OmNavigator *This = OMNAVIGATOR_THIS(iface);
264 FIXME("(%p)->(%p)\n", This, p);
265 return E_NOTIMPL;
268 #undef OMNAVIGATOR_THIS
270 static const IOmNavigatorVtbl OmNavigatorVtbl = {
271 OmNavigator_QueryInterface,
272 OmNavigator_AddRef,
273 OmNavigator_Release,
274 OmNavigator_GetTypeInfoCount,
275 OmNavigator_GetTypeInfo,
276 OmNavigator_GetIDsOfNames,
277 OmNavigator_Invoke,
278 OmNavigator_get_appCodeName,
279 OmNavigator_get_appName,
280 OmNavigator_get_appVersion,
281 OmNavigator_get_userAgent,
282 OmNavigator_javaEnabled,
283 OmNavigator_taintEnabled,
284 OmNavigator_get_mimeTypes,
285 OmNavigator_get_plugins,
286 OmNavigator_get_cookieEnabled,
287 OmNavigator_get_opsProfile,
288 OmNavigator_toString,
289 OmNavigator_get_cpuClass,
290 OmNavigator_get_systemLanguage,
291 OmNavigator_get_browserLanguage,
292 OmNavigator_get_userLanguage,
293 OmNavigator_get_platform,
294 OmNavigator_get_appMinorVersion,
295 OmNavigator_get_connectionSpeed,
296 OmNavigator_get_onLine,
297 OmNavigator_get_userProfile
300 IOmNavigator *OmNavigator_Create(void)
302 OmNavigator *ret;
304 ret = heap_alloc(sizeof(*ret));
305 ret->lpIOmNavigatorVtbl = &OmNavigatorVtbl;
306 ret->ref = 1;
308 return OMNAVIGATOR(ret);