mstask: Implement ITask::DeleteTrigger().
[wine.git] / dlls / mshtml / omnavigator.c
blob406e7f564bf136d5943f77b1535171984552350d
1 /*
2 * Copyright 2008,2009 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 HTMLPluginsCollection HTMLPluginsCollection;
35 typedef struct HTMLMimeTypesCollection HTMLMimeTypesCollection;
37 typedef struct {
38 DispatchEx dispex;
39 IOmNavigator IOmNavigator_iface;
41 LONG ref;
43 HTMLPluginsCollection *plugins;
44 HTMLMimeTypesCollection *mime_types;
45 } OmNavigator;
47 typedef struct {
48 DispatchEx dispex;
49 IHTMLDOMImplementation IHTMLDOMImplementation_iface;
51 LONG ref;
52 } HTMLDOMImplementation;
54 static inline HTMLDOMImplementation *impl_from_IHTMLDOMImplementation(IHTMLDOMImplementation *iface)
56 return CONTAINING_RECORD(iface, HTMLDOMImplementation, IHTMLDOMImplementation_iface);
59 static HRESULT WINAPI HTMLDOMImplementation_QueryInterface(IHTMLDOMImplementation *iface, REFIID riid, void **ppv)
61 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
63 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
65 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IHTMLDOMImplementation, riid)) {
66 *ppv = &This->IHTMLDOMImplementation_iface;
67 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
68 return *ppv ? S_OK : E_NOINTERFACE;
69 }else {
70 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
71 *ppv = NULL;
72 return E_NOINTERFACE;
75 IUnknown_AddRef((IUnknown*)*ppv);
76 return S_OK;
79 static ULONG WINAPI HTMLDOMImplementation_AddRef(IHTMLDOMImplementation *iface)
81 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
82 LONG ref = InterlockedIncrement(&This->ref);
84 TRACE("(%p) ref=%d\n", This, ref);
86 return ref;
89 static ULONG WINAPI HTMLDOMImplementation_Release(IHTMLDOMImplementation *iface)
91 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
92 LONG ref = InterlockedDecrement(&This->ref);
94 TRACE("(%p) ref=%d\n", This, ref);
96 if(!ref) {
97 release_dispex(&This->dispex);
98 heap_free(This);
101 return ref;
104 static HRESULT WINAPI HTMLDOMImplementation_GetTypeInfoCount(IHTMLDOMImplementation *iface, UINT *pctinfo)
106 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
108 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
111 static HRESULT WINAPI HTMLDOMImplementation_GetTypeInfo(IHTMLDOMImplementation *iface, UINT iTInfo,
112 LCID lcid, ITypeInfo **ppTInfo)
114 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
116 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
119 static HRESULT WINAPI HTMLDOMImplementation_GetIDsOfNames(IHTMLDOMImplementation *iface, REFIID riid,
120 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
122 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
124 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames,
125 cNames, lcid, rgDispId);
128 static HRESULT WINAPI HTMLDOMImplementation_Invoke(IHTMLDOMImplementation *iface, DISPID dispIdMember,
129 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
130 EXCEPINFO *pExcepInfo, UINT *puArgErr)
132 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
134 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid,
135 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
138 static HRESULT WINAPI HTMLDOMImplementation_hasFeature(IHTMLDOMImplementation *iface, BSTR feature,
139 VARIANT version, VARIANT_BOOL *pfHasFeature)
141 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
143 FIXME("(%p)->(%s %s %p) returning false\n", This, debugstr_w(feature), debugstr_variant(&version), pfHasFeature);
145 *pfHasFeature = VARIANT_FALSE;
146 return S_OK;
149 static const IHTMLDOMImplementationVtbl HTMLDOMImplementationVtbl = {
150 HTMLDOMImplementation_QueryInterface,
151 HTMLDOMImplementation_AddRef,
152 HTMLDOMImplementation_Release,
153 HTMLDOMImplementation_GetTypeInfoCount,
154 HTMLDOMImplementation_GetTypeInfo,
155 HTMLDOMImplementation_GetIDsOfNames,
156 HTMLDOMImplementation_Invoke,
157 HTMLDOMImplementation_hasFeature
160 static const tid_t HTMLDOMImplementation_iface_tids[] = {
161 IHTMLDOMImplementation_tid,
164 static dispex_static_data_t HTMLDOMImplementation_dispex = {
165 NULL,
166 IHTMLDOMImplementation_tid,
167 HTMLDOMImplementation_iface_tids
170 HRESULT create_dom_implementation(IHTMLDOMImplementation **ret)
172 HTMLDOMImplementation *dom_implementation;
174 dom_implementation = heap_alloc_zero(sizeof(*dom_implementation));
175 if(!dom_implementation)
176 return E_OUTOFMEMORY;
178 dom_implementation->IHTMLDOMImplementation_iface.lpVtbl = &HTMLDOMImplementationVtbl;
179 dom_implementation->ref = 1;
181 init_dispex(&dom_implementation->dispex, (IUnknown*)&dom_implementation->IHTMLDOMImplementation_iface,
182 &HTMLDOMImplementation_dispex);
184 *ret = &dom_implementation->IHTMLDOMImplementation_iface;
185 return S_OK;
188 typedef struct {
189 DispatchEx dispex;
190 IHTMLScreen IHTMLScreen_iface;
192 LONG ref;
193 } HTMLScreen;
195 static inline HTMLScreen *impl_from_IHTMLScreen(IHTMLScreen *iface)
197 return CONTAINING_RECORD(iface, HTMLScreen, IHTMLScreen_iface);
200 static HRESULT WINAPI HTMLScreen_QueryInterface(IHTMLScreen *iface, REFIID riid, void **ppv)
202 HTMLScreen *This = impl_from_IHTMLScreen(iface);
204 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
206 if(IsEqualGUID(&IID_IUnknown, riid)) {
207 *ppv = &This->IHTMLScreen_iface;
208 }else if(IsEqualGUID(&IID_IHTMLScreen, riid)) {
209 *ppv = &This->IHTMLScreen_iface;
210 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
211 return *ppv ? S_OK : E_NOINTERFACE;
212 }else {
213 *ppv = NULL;
214 WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
215 return E_NOINTERFACE;
218 IUnknown_AddRef((IUnknown*)*ppv);
219 return S_OK;
222 static ULONG WINAPI HTMLScreen_AddRef(IHTMLScreen *iface)
224 HTMLScreen *This = impl_from_IHTMLScreen(iface);
225 LONG ref = InterlockedIncrement(&This->ref);
227 TRACE("(%p) ref=%d\n", This, ref);
229 return ref;
232 static ULONG WINAPI HTMLScreen_Release(IHTMLScreen *iface)
234 HTMLScreen *This = impl_from_IHTMLScreen(iface);
235 LONG ref = InterlockedDecrement(&This->ref);
237 TRACE("(%p) ref=%d\n", This, ref);
239 if(!ref) {
240 release_dispex(&This->dispex);
241 heap_free(This);
244 return ref;
247 static HRESULT WINAPI HTMLScreen_GetTypeInfoCount(IHTMLScreen *iface, UINT *pctinfo)
249 HTMLScreen *This = impl_from_IHTMLScreen(iface);
250 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
253 static HRESULT WINAPI HTMLScreen_GetTypeInfo(IHTMLScreen *iface, UINT iTInfo,
254 LCID lcid, ITypeInfo **ppTInfo)
256 HTMLScreen *This = impl_from_IHTMLScreen(iface);
257 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
260 static HRESULT WINAPI HTMLScreen_GetIDsOfNames(IHTMLScreen *iface, REFIID riid,
261 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
263 HTMLScreen *This = impl_from_IHTMLScreen(iface);
264 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
265 lcid, rgDispId);
268 static HRESULT WINAPI HTMLScreen_Invoke(IHTMLScreen *iface, DISPID dispIdMember,
269 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
270 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
272 HTMLScreen *This = impl_from_IHTMLScreen(iface);
273 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
274 pDispParams, pVarResult, pExcepInfo, puArgErr);
277 static HRESULT WINAPI HTMLScreen_get_colorDepth(IHTMLScreen *iface, LONG *p)
279 HTMLScreen *This = impl_from_IHTMLScreen(iface);
280 HDC hdc = GetDC(0);
282 TRACE("(%p)->(%p)\n", This, p);
284 *p = GetDeviceCaps(hdc, BITSPIXEL);
285 ReleaseDC(0, hdc);
286 return S_OK;
289 static HRESULT WINAPI HTMLScreen_put_bufferDepth(IHTMLScreen *iface, LONG v)
291 HTMLScreen *This = impl_from_IHTMLScreen(iface);
292 FIXME("(%p)->(%d)\n", This, v);
293 return E_NOTIMPL;
296 static HRESULT WINAPI HTMLScreen_get_bufferDepth(IHTMLScreen *iface, LONG *p)
298 HTMLScreen *This = impl_from_IHTMLScreen(iface);
299 FIXME("(%p)->(%p)\n", This, p);
300 return E_NOTIMPL;
303 static HRESULT WINAPI HTMLScreen_get_width(IHTMLScreen *iface, LONG *p)
305 HTMLScreen *This = impl_from_IHTMLScreen(iface);
307 TRACE("(%p)->(%p)\n", This, p);
309 *p = GetSystemMetrics(SM_CXSCREEN);
310 return S_OK;
313 static HRESULT WINAPI HTMLScreen_get_height(IHTMLScreen *iface, LONG *p)
315 HTMLScreen *This = impl_from_IHTMLScreen(iface);
317 TRACE("(%p)->(%p)\n", This, p);
319 *p = GetSystemMetrics(SM_CYSCREEN);
320 return S_OK;
323 static HRESULT WINAPI HTMLScreen_put_updateInterval(IHTMLScreen *iface, LONG v)
325 HTMLScreen *This = impl_from_IHTMLScreen(iface);
326 FIXME("(%p)->(%d)\n", This, v);
327 return E_NOTIMPL;
330 static HRESULT WINAPI HTMLScreen_get_updateInterval(IHTMLScreen *iface, LONG *p)
332 HTMLScreen *This = impl_from_IHTMLScreen(iface);
333 FIXME("(%p)->(%p)\n", This, p);
334 return E_NOTIMPL;
337 static HRESULT WINAPI HTMLScreen_get_availHeight(IHTMLScreen *iface, LONG *p)
339 HTMLScreen *This = impl_from_IHTMLScreen(iface);
340 RECT work_area;
342 TRACE("(%p)->(%p)\n", This, p);
344 if(!SystemParametersInfoW(SPI_GETWORKAREA, 0, &work_area, 0))
345 return E_FAIL;
347 *p = work_area.bottom-work_area.top;
348 return S_OK;
351 static HRESULT WINAPI HTMLScreen_get_availWidth(IHTMLScreen *iface, LONG *p)
353 HTMLScreen *This = impl_from_IHTMLScreen(iface);
354 RECT work_area;
356 TRACE("(%p)->(%p)\n", This, p);
358 if(!SystemParametersInfoW(SPI_GETWORKAREA, 0, &work_area, 0))
359 return E_FAIL;
361 *p = work_area.right-work_area.left;
362 return S_OK;
365 static HRESULT WINAPI HTMLScreen_get_fontSmoothingEnabled(IHTMLScreen *iface, VARIANT_BOOL *p)
367 HTMLScreen *This = impl_from_IHTMLScreen(iface);
368 FIXME("(%p)->(%p)\n", This, p);
369 return E_NOTIMPL;
372 static const IHTMLScreenVtbl HTMLSreenVtbl = {
373 HTMLScreen_QueryInterface,
374 HTMLScreen_AddRef,
375 HTMLScreen_Release,
376 HTMLScreen_GetTypeInfoCount,
377 HTMLScreen_GetTypeInfo,
378 HTMLScreen_GetIDsOfNames,
379 HTMLScreen_Invoke,
380 HTMLScreen_get_colorDepth,
381 HTMLScreen_put_bufferDepth,
382 HTMLScreen_get_bufferDepth,
383 HTMLScreen_get_width,
384 HTMLScreen_get_height,
385 HTMLScreen_put_updateInterval,
386 HTMLScreen_get_updateInterval,
387 HTMLScreen_get_availHeight,
388 HTMLScreen_get_availWidth,
389 HTMLScreen_get_fontSmoothingEnabled
392 static const tid_t HTMLScreen_iface_tids[] = {
393 IHTMLScreen_tid,
396 static dispex_static_data_t HTMLScreen_dispex = {
397 NULL,
398 DispHTMLScreen_tid,
399 HTMLScreen_iface_tids
402 HRESULT HTMLScreen_Create(IHTMLScreen **ret)
404 HTMLScreen *screen;
406 screen = heap_alloc_zero(sizeof(HTMLScreen));
407 if(!screen)
408 return E_OUTOFMEMORY;
410 screen->IHTMLScreen_iface.lpVtbl = &HTMLSreenVtbl;
411 screen->ref = 1;
413 init_dispex(&screen->dispex, (IUnknown*)&screen->IHTMLScreen_iface, &HTMLScreen_dispex);
415 *ret = &screen->IHTMLScreen_iface;
416 return S_OK;
419 static inline OmHistory *impl_from_IOmHistory(IOmHistory *iface)
421 return CONTAINING_RECORD(iface, OmHistory, IOmHistory_iface);
424 static HRESULT WINAPI OmHistory_QueryInterface(IOmHistory *iface, REFIID riid, void **ppv)
426 OmHistory *This = impl_from_IOmHistory(iface);
428 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
430 if(IsEqualGUID(&IID_IUnknown, riid)) {
431 *ppv = &This->IOmHistory_iface;
432 }else if(IsEqualGUID(&IID_IOmHistory, riid)) {
433 *ppv = &This->IOmHistory_iface;
434 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
435 return *ppv ? S_OK : E_NOINTERFACE;
436 }else {
437 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
438 *ppv = NULL;
439 return E_NOINTERFACE;
442 IUnknown_AddRef((IUnknown*)*ppv);
443 return S_OK;
446 static ULONG WINAPI OmHistory_AddRef(IOmHistory *iface)
448 OmHistory *This = impl_from_IOmHistory(iface);
449 LONG ref = InterlockedIncrement(&This->ref);
451 TRACE("(%p) ref=%d\n", This, ref);
453 return ref;
456 static ULONG WINAPI OmHistory_Release(IOmHistory *iface)
458 OmHistory *This = impl_from_IOmHistory(iface);
459 LONG ref = InterlockedDecrement(&This->ref);
461 TRACE("(%p) ref=%d\n", This, ref);
463 if(!ref) {
464 release_dispex(&This->dispex);
465 heap_free(This);
468 return ref;
471 static HRESULT WINAPI OmHistory_GetTypeInfoCount(IOmHistory *iface, UINT *pctinfo)
473 OmHistory *This = impl_from_IOmHistory(iface);
474 FIXME("(%p)->(%p)\n", This, pctinfo);
475 return E_NOTIMPL;
478 static HRESULT WINAPI OmHistory_GetTypeInfo(IOmHistory *iface, UINT iTInfo,
479 LCID lcid, ITypeInfo **ppTInfo)
481 OmHistory *This = impl_from_IOmHistory(iface);
483 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
486 static HRESULT WINAPI OmHistory_GetIDsOfNames(IOmHistory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames,
487 LCID lcid, DISPID *rgDispId)
489 OmHistory *This = impl_from_IOmHistory(iface);
491 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
492 lcid, rgDispId);
495 static HRESULT WINAPI OmHistory_Invoke(IOmHistory *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
496 WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
498 OmHistory *This = impl_from_IOmHistory(iface);
500 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
501 pDispParams, pVarResult, pExcepInfo, puArgErr);
504 static HRESULT WINAPI OmHistory_get_length(IOmHistory *iface, short *p)
506 OmHistory *This = impl_from_IOmHistory(iface);
508 TRACE("(%p)->(%p)\n", This, p);
510 if(!This->window || !This->window->base.outer_window->doc_obj
511 || !This->window->base.outer_window->doc_obj->travel_log) {
512 *p = 0;
513 }else {
514 *p = ITravelLog_CountEntries(This->window->base.outer_window->doc_obj->travel_log,
515 This->window->base.outer_window->doc_obj->browser_service);
517 return S_OK;
520 static HRESULT WINAPI OmHistory_back(IOmHistory *iface, VARIANT *pvargdistance)
522 OmHistory *This = impl_from_IOmHistory(iface);
523 FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance));
524 return E_NOTIMPL;
527 static HRESULT WINAPI OmHistory_forward(IOmHistory *iface, VARIANT *pvargdistance)
529 OmHistory *This = impl_from_IOmHistory(iface);
530 FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance));
531 return E_NOTIMPL;
534 static HRESULT WINAPI OmHistory_go(IOmHistory *iface, VARIANT *pvargdistance)
536 OmHistory *This = impl_from_IOmHistory(iface);
537 FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance));
538 return E_NOTIMPL;
541 static const IOmHistoryVtbl OmHistoryVtbl = {
542 OmHistory_QueryInterface,
543 OmHistory_AddRef,
544 OmHistory_Release,
545 OmHistory_GetTypeInfoCount,
546 OmHistory_GetTypeInfo,
547 OmHistory_GetIDsOfNames,
548 OmHistory_Invoke,
549 OmHistory_get_length,
550 OmHistory_back,
551 OmHistory_forward,
552 OmHistory_go
555 static const tid_t OmHistory_iface_tids[] = {
556 IOmHistory_tid,
559 static dispex_static_data_t OmHistory_dispex = {
560 NULL,
561 DispHTMLHistory_tid,
562 OmHistory_iface_tids
566 HRESULT create_history(HTMLInnerWindow *window, OmHistory **ret)
568 OmHistory *history;
570 history = heap_alloc_zero(sizeof(*history));
571 if(!history)
572 return E_OUTOFMEMORY;
574 init_dispex(&history->dispex, (IUnknown*)&history->IOmHistory_iface, &OmHistory_dispex);
575 history->IOmHistory_iface.lpVtbl = &OmHistoryVtbl;
576 history->ref = 1;
578 history->window = window;
580 *ret = history;
581 return S_OK;
584 struct HTMLPluginsCollection {
585 DispatchEx dispex;
586 IHTMLPluginsCollection IHTMLPluginsCollection_iface;
588 LONG ref;
590 OmNavigator *navigator;
593 static inline HTMLPluginsCollection *impl_from_IHTMLPluginsCollection(IHTMLPluginsCollection *iface)
595 return CONTAINING_RECORD(iface, HTMLPluginsCollection, IHTMLPluginsCollection_iface);
598 static HRESULT WINAPI HTMLPluginsCollection_QueryInterface(IHTMLPluginsCollection *iface, REFIID riid, void **ppv)
600 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
602 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
604 if(IsEqualGUID(&IID_IUnknown, riid)) {
605 *ppv = &This->IHTMLPluginsCollection_iface;
606 }else if(IsEqualGUID(&IID_IHTMLPluginsCollection, riid)) {
607 *ppv = &This->IHTMLPluginsCollection_iface;
608 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
609 return *ppv ? S_OK : E_NOINTERFACE;
610 }else {
611 *ppv = NULL;
612 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
613 return E_NOINTERFACE;
616 IUnknown_AddRef((IUnknown*)*ppv);
617 return S_OK;
620 static ULONG WINAPI HTMLPluginsCollection_AddRef(IHTMLPluginsCollection *iface)
622 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
623 LONG ref = InterlockedIncrement(&This->ref);
625 TRACE("(%p) ref=%d\n", This, ref);
627 return ref;
630 static ULONG WINAPI HTMLPluginsCollection_Release(IHTMLPluginsCollection *iface)
632 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
633 LONG ref = InterlockedDecrement(&This->ref);
635 TRACE("(%p) ref=%d\n", This, ref);
637 if(!ref) {
638 if(This->navigator)
639 This->navigator->plugins = NULL;
640 release_dispex(&This->dispex);
641 heap_free(This);
644 return ref;
647 static HRESULT WINAPI HTMLPluginsCollection_GetTypeInfoCount(IHTMLPluginsCollection *iface, UINT *pctinfo)
649 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
650 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
653 static HRESULT WINAPI HTMLPluginsCollection_GetTypeInfo(IHTMLPluginsCollection *iface, UINT iTInfo,
654 LCID lcid, ITypeInfo **ppTInfo)
656 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
657 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
660 static HRESULT WINAPI HTMLPluginsCollection_GetIDsOfNames(IHTMLPluginsCollection *iface, REFIID riid,
661 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
663 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
664 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
665 lcid, rgDispId);
668 static HRESULT WINAPI HTMLPluginsCollection_Invoke(IHTMLPluginsCollection *iface, DISPID dispIdMember,
669 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
670 EXCEPINFO *pExcepInfo, UINT *puArgErr)
672 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
673 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
674 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
677 static HRESULT WINAPI HTMLPluginsCollection_get_length(IHTMLPluginsCollection *iface, LONG *p)
679 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
681 TRACE("(%p)->(%p)\n", This, p);
683 /* IE always returns 0 here */
684 *p = 0;
685 return S_OK;
688 static HRESULT WINAPI HTMLPluginsCollection_refresh(IHTMLPluginsCollection *iface, VARIANT_BOOL reload)
690 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
692 TRACE("(%p)->(%x)\n", This, reload);
694 /* Nothing to do here. */
695 return S_OK;
698 static const IHTMLPluginsCollectionVtbl HTMLPluginsCollectionVtbl = {
699 HTMLPluginsCollection_QueryInterface,
700 HTMLPluginsCollection_AddRef,
701 HTMLPluginsCollection_Release,
702 HTMLPluginsCollection_GetTypeInfoCount,
703 HTMLPluginsCollection_GetTypeInfo,
704 HTMLPluginsCollection_GetIDsOfNames,
705 HTMLPluginsCollection_Invoke,
706 HTMLPluginsCollection_get_length,
707 HTMLPluginsCollection_refresh
710 static const tid_t HTMLPluginsCollection_iface_tids[] = {
711 IHTMLPluginsCollection_tid,
714 static dispex_static_data_t HTMLPluginsCollection_dispex = {
715 NULL,
716 DispCPlugins_tid,
717 HTMLPluginsCollection_iface_tids
720 static HRESULT create_plugins_collection(OmNavigator *navigator, HTMLPluginsCollection **ret)
722 HTMLPluginsCollection *col;
724 col = heap_alloc_zero(sizeof(*col));
725 if(!col)
726 return E_OUTOFMEMORY;
728 col->IHTMLPluginsCollection_iface.lpVtbl = &HTMLPluginsCollectionVtbl;
729 col->ref = 1;
730 col->navigator = navigator;
732 init_dispex(&col->dispex, (IUnknown*)&col->IHTMLPluginsCollection_iface,
733 &HTMLPluginsCollection_dispex);
735 *ret = col;
736 return S_OK;
739 struct HTMLMimeTypesCollection {
740 DispatchEx dispex;
741 IHTMLMimeTypesCollection IHTMLMimeTypesCollection_iface;
743 LONG ref;
745 OmNavigator *navigator;
748 static inline HTMLMimeTypesCollection *impl_from_IHTMLMimeTypesCollection(IHTMLMimeTypesCollection *iface)
750 return CONTAINING_RECORD(iface, HTMLMimeTypesCollection, IHTMLMimeTypesCollection_iface);
753 static HRESULT WINAPI HTMLMimeTypesCollection_QueryInterface(IHTMLMimeTypesCollection *iface, REFIID riid, void **ppv)
755 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
757 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
759 if(IsEqualGUID(&IID_IUnknown, riid)) {
760 *ppv = &This->IHTMLMimeTypesCollection_iface;
761 }else if(IsEqualGUID(&IID_IHTMLMimeTypesCollection, riid)) {
762 *ppv = &This->IHTMLMimeTypesCollection_iface;
763 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
764 return *ppv ? S_OK : E_NOINTERFACE;
765 }else {
766 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
767 *ppv = NULL;
768 return E_NOINTERFACE;
771 IUnknown_AddRef((IUnknown*)*ppv);
772 return S_OK;
775 static ULONG WINAPI HTMLMimeTypesCollection_AddRef(IHTMLMimeTypesCollection *iface)
777 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
778 LONG ref = InterlockedIncrement(&This->ref);
780 TRACE("(%p) ref=%d\n", This, ref);
782 return ref;
785 static ULONG WINAPI HTMLMimeTypesCollection_Release(IHTMLMimeTypesCollection *iface)
787 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
788 LONG ref = InterlockedDecrement(&This->ref);
790 TRACE("(%p) ref=%d\n", This, ref);
792 if(!ref) {
793 if(This->navigator)
794 This->navigator->mime_types = NULL;
795 release_dispex(&This->dispex);
796 heap_free(This);
799 return ref;
802 static HRESULT WINAPI HTMLMimeTypesCollection_GetTypeInfoCount(IHTMLMimeTypesCollection *iface, UINT *pctinfo)
804 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
805 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
808 static HRESULT WINAPI HTMLMimeTypesCollection_GetTypeInfo(IHTMLMimeTypesCollection *iface, UINT iTInfo,
809 LCID lcid, ITypeInfo **ppTInfo)
811 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
812 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
815 static HRESULT WINAPI HTMLMimeTypesCollection_GetIDsOfNames(IHTMLMimeTypesCollection *iface, REFIID riid,
816 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
818 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
819 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
820 lcid, rgDispId);
823 static HRESULT WINAPI HTMLMimeTypesCollection_Invoke(IHTMLMimeTypesCollection *iface, DISPID dispIdMember,
824 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
825 EXCEPINFO *pExcepInfo, UINT *puArgErr)
827 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
828 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
829 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
832 static HRESULT WINAPI HTMLMimeTypesCollection_get_length(IHTMLMimeTypesCollection *iface, LONG *p)
834 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
836 TRACE("(%p)->(%p)\n", This, p);
838 /* This is just a stub for compatibility with other browser in IE */
839 *p = 0;
840 return S_OK;
843 static const IHTMLMimeTypesCollectionVtbl HTMLMimeTypesCollectionVtbl = {
844 HTMLMimeTypesCollection_QueryInterface,
845 HTMLMimeTypesCollection_AddRef,
846 HTMLMimeTypesCollection_Release,
847 HTMLMimeTypesCollection_GetTypeInfoCount,
848 HTMLMimeTypesCollection_GetTypeInfo,
849 HTMLMimeTypesCollection_GetIDsOfNames,
850 HTMLMimeTypesCollection_Invoke,
851 HTMLMimeTypesCollection_get_length
854 static const tid_t HTMLMimeTypesCollection_iface_tids[] = {
855 IHTMLMimeTypesCollection_tid,
858 static dispex_static_data_t HTMLMimeTypesCollection_dispex = {
859 NULL,
860 IHTMLMimeTypesCollection_tid,
861 HTMLMimeTypesCollection_iface_tids
864 static HRESULT create_mime_types_collection(OmNavigator *navigator, HTMLMimeTypesCollection **ret)
866 HTMLMimeTypesCollection *col;
868 col = heap_alloc_zero(sizeof(*col));
869 if(!col)
870 return E_OUTOFMEMORY;
872 col->IHTMLMimeTypesCollection_iface.lpVtbl = &HTMLMimeTypesCollectionVtbl;
873 col->ref = 1;
874 col->navigator = navigator;
876 init_dispex(&col->dispex, (IUnknown*)&col->IHTMLMimeTypesCollection_iface,
877 &HTMLMimeTypesCollection_dispex);
879 *ret = col;
880 return S_OK;
883 static inline OmNavigator *impl_from_IOmNavigator(IOmNavigator *iface)
885 return CONTAINING_RECORD(iface, OmNavigator, IOmNavigator_iface);
888 static HRESULT WINAPI OmNavigator_QueryInterface(IOmNavigator *iface, REFIID riid, void **ppv)
890 OmNavigator *This = impl_from_IOmNavigator(iface);
892 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
894 if(IsEqualGUID(&IID_IUnknown, riid)) {
895 *ppv = &This->IOmNavigator_iface;
896 }else if(IsEqualGUID(&IID_IOmNavigator, riid)) {
897 *ppv = &This->IOmNavigator_iface;
898 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
899 return *ppv ? S_OK : E_NOINTERFACE;
900 }else {
901 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
902 *ppv = NULL;
903 return E_NOINTERFACE;
906 IUnknown_AddRef((IUnknown*)*ppv);
907 return S_OK;
910 static ULONG WINAPI OmNavigator_AddRef(IOmNavigator *iface)
912 OmNavigator *This = impl_from_IOmNavigator(iface);
913 LONG ref = InterlockedIncrement(&This->ref);
915 TRACE("(%p) ref=%d\n", This, ref);
917 return ref;
920 static ULONG WINAPI OmNavigator_Release(IOmNavigator *iface)
922 OmNavigator *This = impl_from_IOmNavigator(iface);
923 LONG ref = InterlockedDecrement(&This->ref);
925 TRACE("(%p) ref=%d\n", This, ref);
927 if(!ref) {
928 if(This->plugins)
929 This->plugins->navigator = NULL;
930 if(This->mime_types)
931 This->mime_types->navigator = NULL;
932 release_dispex(&This->dispex);
933 heap_free(This);
936 return ref;
939 static HRESULT WINAPI OmNavigator_GetTypeInfoCount(IOmNavigator *iface, UINT *pctinfo)
941 OmNavigator *This = impl_from_IOmNavigator(iface);
942 FIXME("(%p)->(%p)\n", This, pctinfo);
943 return E_NOTIMPL;
946 static HRESULT WINAPI OmNavigator_GetTypeInfo(IOmNavigator *iface, UINT iTInfo,
947 LCID lcid, ITypeInfo **ppTInfo)
949 OmNavigator *This = impl_from_IOmNavigator(iface);
951 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
954 static HRESULT WINAPI OmNavigator_GetIDsOfNames(IOmNavigator *iface, REFIID riid,
955 LPOLESTR *rgszNames, UINT cNames,
956 LCID lcid, DISPID *rgDispId)
958 OmNavigator *This = impl_from_IOmNavigator(iface);
960 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
961 lcid, rgDispId);
964 static HRESULT WINAPI OmNavigator_Invoke(IOmNavigator *iface, DISPID dispIdMember,
965 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
966 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
968 OmNavigator *This = impl_from_IOmNavigator(iface);
970 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
971 pDispParams, pVarResult, pExcepInfo, puArgErr);
974 static HRESULT WINAPI OmNavigator_get_appCodeName(IOmNavigator *iface, BSTR *p)
976 OmNavigator *This = impl_from_IOmNavigator(iface);
978 static const WCHAR mozillaW[] = {'M','o','z','i','l','l','a',0};
980 TRACE("(%p)->(%p)\n", This, p);
982 *p = SysAllocString(mozillaW);
983 return S_OK;
986 static HRESULT WINAPI OmNavigator_get_appName(IOmNavigator *iface, BSTR *p)
988 OmNavigator *This = impl_from_IOmNavigator(iface);
990 static const WCHAR app_nameW[] =
991 {'M','i','c','r','o','s','o','f','t',' ',
992 'I','n','t','e','r','n','e','t',' ',
993 'E','x','p','l','o','r','e','r',0};
995 TRACE("(%p)->(%p)\n", This, p);
997 *p = SysAllocString(app_nameW);
998 if(!*p)
999 return E_OUTOFMEMORY;
1001 return S_OK;
1004 static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
1006 OmNavigator *This = impl_from_IOmNavigator(iface);
1008 char user_agent[512];
1009 DWORD size;
1010 HRESULT hres;
1012 TRACE("(%p)->(%p)\n", This, p);
1014 size = sizeof(user_agent);
1015 hres = ObtainUserAgentString(0, user_agent, &size);
1016 if(FAILED(hres))
1017 return hres;
1019 if(strncmp(user_agent, "Mozilla/", 8)) {
1020 FIXME("Unsupported user agent\n");
1021 return E_FAIL;
1024 size = MultiByteToWideChar(CP_ACP, 0, user_agent+8, -1, NULL, 0);
1025 *p = SysAllocStringLen(NULL, size-1);
1026 if(!*p)
1027 return E_OUTOFMEMORY;
1029 MultiByteToWideChar(CP_ACP, 0, user_agent+8, -1, *p, size);
1030 return S_OK;
1033 static HRESULT WINAPI OmNavigator_get_userAgent(IOmNavigator *iface, BSTR *p)
1035 OmNavigator *This = impl_from_IOmNavigator(iface);
1036 char user_agent[512];
1037 DWORD size;
1038 HRESULT hres;
1040 TRACE("(%p)->(%p)\n", This, p);
1042 size = sizeof(user_agent);
1043 hres = ObtainUserAgentString(0, user_agent, &size);
1044 if(FAILED(hres))
1045 return hres;
1047 size = MultiByteToWideChar(CP_ACP, 0, user_agent, -1, NULL, 0);
1048 *p = SysAllocStringLen(NULL, size-1);
1049 if(!*p)
1050 return E_OUTOFMEMORY;
1052 MultiByteToWideChar(CP_ACP, 0, user_agent, -1, *p, size);
1053 return S_OK;
1056 static HRESULT WINAPI OmNavigator_javaEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
1058 OmNavigator *This = impl_from_IOmNavigator(iface);
1060 FIXME("(%p)->(%p) semi-stub\n", This, enabled);
1062 *enabled = VARIANT_TRUE;
1063 return S_OK;
1066 static HRESULT WINAPI OmNavigator_taintEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
1068 OmNavigator *This = impl_from_IOmNavigator(iface);
1069 FIXME("(%p)->(%p)\n", This, enabled);
1070 return E_NOTIMPL;
1073 static HRESULT WINAPI OmNavigator_get_mimeTypes(IOmNavigator *iface, IHTMLMimeTypesCollection **p)
1075 OmNavigator *This = impl_from_IOmNavigator(iface);
1077 TRACE("(%p)->(%p)\n", This, p);
1079 if(!This->mime_types) {
1080 HRESULT hres;
1082 hres = create_mime_types_collection(This, &This->mime_types);
1083 if(FAILED(hres))
1084 return hres;
1085 }else {
1086 IHTMLMimeTypesCollection_AddRef(&This->mime_types->IHTMLMimeTypesCollection_iface);
1089 *p = &This->mime_types->IHTMLMimeTypesCollection_iface;
1090 return S_OK;
1093 static HRESULT WINAPI OmNavigator_get_plugins(IOmNavigator *iface, IHTMLPluginsCollection **p)
1095 OmNavigator *This = impl_from_IOmNavigator(iface);
1097 TRACE("(%p)->(%p)\n", This, p);
1099 if(!This->plugins) {
1100 HRESULT hres;
1102 hres = create_plugins_collection(This, &This->plugins);
1103 if(FAILED(hres))
1104 return hres;
1105 }else {
1106 IHTMLPluginsCollection_AddRef(&This->plugins->IHTMLPluginsCollection_iface);
1109 *p = &This->plugins->IHTMLPluginsCollection_iface;
1110 return S_OK;
1113 static HRESULT WINAPI OmNavigator_get_cookieEnabled(IOmNavigator *iface, VARIANT_BOOL *p)
1115 OmNavigator *This = impl_from_IOmNavigator(iface);
1117 WARN("(%p)->(%p) semi-stub\n", This, p);
1119 *p = VARIANT_TRUE;
1120 return S_OK;
1123 static HRESULT WINAPI OmNavigator_get_opsProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
1125 OmNavigator *This = impl_from_IOmNavigator(iface);
1126 FIXME("(%p)->(%p)\n", This, p);
1127 return E_NOTIMPL;
1130 static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String)
1132 OmNavigator *This = impl_from_IOmNavigator(iface);
1134 static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
1136 TRACE("(%p)->(%p)\n", This, String);
1138 if(!String)
1139 return E_INVALIDARG;
1141 *String = SysAllocString(objectW);
1142 return *String ? S_OK : E_OUTOFMEMORY;
1145 static HRESULT WINAPI OmNavigator_get_cpuClass(IOmNavigator *iface, BSTR *p)
1147 OmNavigator *This = impl_from_IOmNavigator(iface);
1149 static const WCHAR cpu_classW[] =
1150 #ifdef _WIN64
1151 {'x','6','4',0};
1152 #else
1153 {'x','8','6',0};
1154 #endif
1156 TRACE("(%p)->(%p)\n", This, p);
1158 *p = SysAllocString(cpu_classW);
1159 return *p ? S_OK : E_OUTOFMEMORY;
1162 static HRESULT get_language_string(LCID lcid, BSTR *p)
1164 BSTR ret;
1165 int len;
1167 len = LCIDToLocaleName(lcid, NULL, 0, 0);
1168 if(!len) {
1169 WARN("LCIDToLocaleName failed: %u\n", GetLastError());
1170 return E_FAIL;
1173 ret = SysAllocStringLen(NULL, len-1);
1174 if(!ret)
1175 return E_OUTOFMEMORY;
1177 len = LCIDToLocaleName(lcid, ret, len, 0);
1178 if(!len) {
1179 WARN("LCIDToLocaleName failed: %u\n", GetLastError());
1180 SysFreeString(ret);
1181 return E_FAIL;
1184 *p = ret;
1185 return S_OK;
1188 static HRESULT WINAPI OmNavigator_get_systemLanguage(IOmNavigator *iface, BSTR *p)
1190 OmNavigator *This = impl_from_IOmNavigator(iface);
1192 TRACE("(%p)->(%p)\n", This, p);
1194 return get_language_string(LOCALE_SYSTEM_DEFAULT, p);
1197 static HRESULT WINAPI OmNavigator_get_browserLanguage(IOmNavigator *iface, BSTR *p)
1199 OmNavigator *This = impl_from_IOmNavigator(iface);
1201 TRACE("(%p)->(%p)\n", This, p);
1203 return get_language_string(GetUserDefaultUILanguage(), p);
1206 static HRESULT WINAPI OmNavigator_get_userLanguage(IOmNavigator *iface, BSTR *p)
1208 OmNavigator *This = impl_from_IOmNavigator(iface);
1210 TRACE("(%p)->(%p)\n", This, p);
1212 return get_language_string(LOCALE_USER_DEFAULT, p);
1215 static HRESULT WINAPI OmNavigator_get_platform(IOmNavigator *iface, BSTR *p)
1217 OmNavigator *This = impl_from_IOmNavigator(iface);
1219 #ifdef _WIN64
1220 static const WCHAR platformW[] = {'W','i','n','6','4',0};
1221 #else
1222 static const WCHAR platformW[] = {'W','i','n','3','2',0};
1223 #endif
1225 TRACE("(%p)->(%p)\n", This, p);
1227 *p = SysAllocString(platformW);
1228 return S_OK;
1231 static HRESULT WINAPI OmNavigator_get_appMinorVersion(IOmNavigator *iface, BSTR *p)
1233 OmNavigator *This = impl_from_IOmNavigator(iface);
1235 static const WCHAR zeroW[] = {'0',0};
1237 TRACE("(%p)->(%p)\n", This, p);
1239 /* NOTE: MSIE returns "0" or values like ";SP2;". Returning "0" should be enough. */
1240 *p = SysAllocString(zeroW);
1241 return S_OK;
1244 static HRESULT WINAPI OmNavigator_get_connectionSpeed(IOmNavigator *iface, LONG *p)
1246 OmNavigator *This = impl_from_IOmNavigator(iface);
1247 FIXME("(%p)->(%p)\n", This, p);
1248 return E_NOTIMPL;
1251 static HRESULT WINAPI OmNavigator_get_onLine(IOmNavigator *iface, VARIANT_BOOL *p)
1253 OmNavigator *This = impl_from_IOmNavigator(iface);
1255 WARN("(%p)->(%p) semi-stub, returning true\n", This, p);
1257 *p = VARIANT_TRUE;
1258 return S_OK;
1261 static HRESULT WINAPI OmNavigator_get_userProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
1263 OmNavigator *This = impl_from_IOmNavigator(iface);
1264 FIXME("(%p)->(%p)\n", This, p);
1265 return E_NOTIMPL;
1268 static const IOmNavigatorVtbl OmNavigatorVtbl = {
1269 OmNavigator_QueryInterface,
1270 OmNavigator_AddRef,
1271 OmNavigator_Release,
1272 OmNavigator_GetTypeInfoCount,
1273 OmNavigator_GetTypeInfo,
1274 OmNavigator_GetIDsOfNames,
1275 OmNavigator_Invoke,
1276 OmNavigator_get_appCodeName,
1277 OmNavigator_get_appName,
1278 OmNavigator_get_appVersion,
1279 OmNavigator_get_userAgent,
1280 OmNavigator_javaEnabled,
1281 OmNavigator_taintEnabled,
1282 OmNavigator_get_mimeTypes,
1283 OmNavigator_get_plugins,
1284 OmNavigator_get_cookieEnabled,
1285 OmNavigator_get_opsProfile,
1286 OmNavigator_toString,
1287 OmNavigator_get_cpuClass,
1288 OmNavigator_get_systemLanguage,
1289 OmNavigator_get_browserLanguage,
1290 OmNavigator_get_userLanguage,
1291 OmNavigator_get_platform,
1292 OmNavigator_get_appMinorVersion,
1293 OmNavigator_get_connectionSpeed,
1294 OmNavigator_get_onLine,
1295 OmNavigator_get_userProfile
1298 static const tid_t OmNavigator_iface_tids[] = {
1299 IOmNavigator_tid,
1302 static dispex_static_data_t OmNavigator_dispex = {
1303 NULL,
1304 DispHTMLNavigator_tid,
1305 OmNavigator_iface_tids
1308 IOmNavigator *OmNavigator_Create(void)
1310 OmNavigator *ret;
1312 ret = heap_alloc_zero(sizeof(*ret));
1313 if(!ret)
1314 return NULL;
1316 ret->IOmNavigator_iface.lpVtbl = &OmNavigatorVtbl;
1317 ret->ref = 1;
1319 init_dispex(&ret->dispex, (IUnknown*)&ret->IOmNavigator_iface, &OmNavigator_dispex);
1321 return &ret->IOmNavigator_iface;