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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
36 const IOmNavigatorVtbl
*lpIOmNavigatorVtbl
;
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
);
51 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
52 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
53 *ppv
= OMNAVIGATOR(This
);
54 }else if(IsEqualGUID(&IID_IOmNavigator
, riid
)) {
55 TRACE("(%p)->(IID_IOmNavigator %p)\n", This
, ppv
);
56 *ppv
= OMNAVIGATOR(This
);
57 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
58 return *ppv
? S_OK
: E_NOINTERFACE
;
62 IUnknown_AddRef((IUnknown
*)*ppv
);
66 WARN("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
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
);
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
);
88 release_dispex(&This
->dispex
);
95 static HRESULT WINAPI
OmNavigator_GetTypeInfoCount(IOmNavigator
*iface
, UINT
*pctinfo
)
97 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
98 FIXME("(%p)->(%p)\n", This
, pctinfo
);
102 static HRESULT WINAPI
OmNavigator_GetTypeInfo(IOmNavigator
*iface
, UINT iTInfo
,
103 LCID lcid
, ITypeInfo
**ppTInfo
)
105 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
107 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This
->dispex
), iTInfo
, lcid
, ppTInfo
);
110 static HRESULT WINAPI
OmNavigator_GetIDsOfNames(IOmNavigator
*iface
, REFIID riid
,
111 LPOLESTR
*rgszNames
, UINT cNames
,
112 LCID lcid
, DISPID
*rgDispId
)
114 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
116 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This
->dispex
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
119 static HRESULT WINAPI
OmNavigator_Invoke(IOmNavigator
*iface
, DISPID dispIdMember
,
120 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
121 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
123 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
125 return IDispatchEx_Invoke(DISPATCHEX(&This
->dispex
), dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
126 pVarResult
, pExcepInfo
, puArgErr
);
129 static HRESULT WINAPI
OmNavigator_get_appCodeName(IOmNavigator
*iface
, BSTR
*p
)
131 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
133 static const WCHAR mozillaW
[] = {'M','o','z','i','l','l','a',0};
135 TRACE("(%p)->(%p)\n", This
, p
);
137 *p
= SysAllocString(mozillaW
);
141 static HRESULT WINAPI
OmNavigator_get_appName(IOmNavigator
*iface
, BSTR
*p
)
143 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
145 static const WCHAR app_nameW
[] =
146 {'M','i','c','r','o','s','o','f','t',' ',
147 'I','n','t','e','r','n','e','t',' ',
148 'E','x','p','l','o','r','e','r',0};
150 TRACE("(%p)->(%p)\n", This
, p
);
152 *p
= SysAllocString(app_nameW
);
154 return E_OUTOFMEMORY
;
159 static HRESULT WINAPI
OmNavigator_get_appVersion(IOmNavigator
*iface
, BSTR
*p
)
161 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
163 /* FIXME: Should we return something smarter? */
164 static const WCHAR app_verW
[] =
165 {'4','.','0',' ','(','c','o','m','p','a','t','i','b','l','e',';',
166 ' ','M','S','I','E',' ','7','.','0',';',
167 ' ','W','i','n','d','o','w','s',' ','N','T',' ','5','.','1',';',
168 ' ','M','o','z','i','l','l','a','/','4','.','0',')',0};
170 TRACE("(%p)->(%p)\n", This
, p
);
172 *p
= SysAllocString(app_verW
);
174 return E_OUTOFMEMORY
;
179 static HRESULT WINAPI
OmNavigator_get_userAgent(IOmNavigator
*iface
, BSTR
*p
)
181 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
182 FIXME("(%p)->(%p)\n", This
, p
);
186 static HRESULT WINAPI
OmNavigator_javaEnabled(IOmNavigator
*iface
, VARIANT_BOOL
*enabled
)
188 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
189 FIXME("(%p)->(%p)\n", This
, enabled
);
193 static HRESULT WINAPI
OmNavigator_taintEnabled(IOmNavigator
*iface
, VARIANT_BOOL
*enabled
)
195 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
196 FIXME("(%p)->(%p)\n", This
, enabled
);
200 static HRESULT WINAPI
OmNavigator_get_mimeTypes(IOmNavigator
*iface
, IHTMLMimeTypesCollection
**p
)
202 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
203 FIXME("(%p)->(%p)\n", This
, p
);
207 static HRESULT WINAPI
OmNavigator_get_plugins(IOmNavigator
*iface
, IHTMLPluginsCollection
**p
)
209 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
210 FIXME("(%p)->(%p)\n", This
, p
);
214 static HRESULT WINAPI
OmNavigator_get_cookieEnabled(IOmNavigator
*iface
, VARIANT_BOOL
*p
)
216 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
217 FIXME("(%p)->(%p)\n", This
, p
);
221 static HRESULT WINAPI
OmNavigator_get_opsProfile(IOmNavigator
*iface
, IHTMLOpsProfile
**p
)
223 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
224 FIXME("(%p)->(%p)\n", This
, p
);
228 static HRESULT WINAPI
OmNavigator_toString(IOmNavigator
*iface
, BSTR
*String
)
230 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
232 static const WCHAR objectW
[] = {'[','o','b','j','e','c','t',']',0};
234 TRACE("(%p)->(%p)\n", This
, String
);
239 *String
= SysAllocString(objectW
);
240 return *String
? S_OK
: E_OUTOFMEMORY
;
243 static HRESULT WINAPI
OmNavigator_get_cpuClass(IOmNavigator
*iface
, BSTR
*p
)
245 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
246 FIXME("(%p)->(%p)\n", This
, p
);
250 static HRESULT WINAPI
OmNavigator_get_systemLanguage(IOmNavigator
*iface
, BSTR
*p
)
252 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
253 FIXME("(%p)->(%p)\n", This
, p
);
257 static HRESULT WINAPI
OmNavigator_get_browserLanguage(IOmNavigator
*iface
, BSTR
*p
)
259 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
260 FIXME("(%p)->(%p)\n", This
, p
);
264 static HRESULT WINAPI
OmNavigator_get_userLanguage(IOmNavigator
*iface
, BSTR
*p
)
266 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
267 FIXME("(%p)->(%p)\n", This
, p
);
271 static HRESULT WINAPI
OmNavigator_get_platform(IOmNavigator
*iface
, BSTR
*p
)
273 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
276 static const WCHAR platformW
[] = {'W','i','n','6','4',0};
278 static const WCHAR platformW
[] = {'W','i','n','3','2',0};
281 TRACE("(%p)->(%p)\n", This
, p
);
283 *p
= SysAllocString(platformW
);
287 static HRESULT WINAPI
OmNavigator_get_appMinorVersion(IOmNavigator
*iface
, BSTR
*p
)
289 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
290 FIXME("(%p)->(%p)\n", This
, p
);
294 static HRESULT WINAPI
OmNavigator_get_connectionSpeed(IOmNavigator
*iface
, LONG
*p
)
296 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
297 FIXME("(%p)->(%p)\n", This
, p
);
301 static HRESULT WINAPI
OmNavigator_get_onLine(IOmNavigator
*iface
, VARIANT_BOOL
*p
)
303 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
304 FIXME("(%p)->(%p)\n", This
, p
);
308 static HRESULT WINAPI
OmNavigator_get_userProfile(IOmNavigator
*iface
, IHTMLOpsProfile
**p
)
310 OmNavigator
*This
= OMNAVIGATOR_THIS(iface
);
311 FIXME("(%p)->(%p)\n", This
, p
);
315 #undef OMNAVIGATOR_THIS
317 static const IOmNavigatorVtbl OmNavigatorVtbl
= {
318 OmNavigator_QueryInterface
,
321 OmNavigator_GetTypeInfoCount
,
322 OmNavigator_GetTypeInfo
,
323 OmNavigator_GetIDsOfNames
,
325 OmNavigator_get_appCodeName
,
326 OmNavigator_get_appName
,
327 OmNavigator_get_appVersion
,
328 OmNavigator_get_userAgent
,
329 OmNavigator_javaEnabled
,
330 OmNavigator_taintEnabled
,
331 OmNavigator_get_mimeTypes
,
332 OmNavigator_get_plugins
,
333 OmNavigator_get_cookieEnabled
,
334 OmNavigator_get_opsProfile
,
335 OmNavigator_toString
,
336 OmNavigator_get_cpuClass
,
337 OmNavigator_get_systemLanguage
,
338 OmNavigator_get_browserLanguage
,
339 OmNavigator_get_userLanguage
,
340 OmNavigator_get_platform
,
341 OmNavigator_get_appMinorVersion
,
342 OmNavigator_get_connectionSpeed
,
343 OmNavigator_get_onLine
,
344 OmNavigator_get_userProfile
347 static const tid_t OmNavigator_iface_tids
[] = {
351 static dispex_static_data_t OmNavigator_dispex
= {
353 DispHTMLNavigator_tid
,
355 OmNavigator_iface_tids
358 IOmNavigator
*OmNavigator_Create(void)
362 ret
= heap_alloc_zero(sizeof(*ret
));
363 ret
->lpIOmNavigatorVtbl
= &OmNavigatorVtbl
;
366 init_dispex(&ret
->dispex
, (IUnknown
*)OMNAVIGATOR(ret
), &OmNavigator_dispex
);
368 return OMNAVIGATOR(ret
);