2008-04-07 12:34:24 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2010-11-08 12:48:55 +01:00
|
|
|
typedef struct HTMLPluginsCollection HTMLPluginsCollection;
|
|
|
|
|
2008-04-07 12:34:24 +02:00
|
|
|
typedef struct {
|
2008-04-17 02:31:43 +02:00
|
|
|
DispatchEx dispex;
|
2010-12-06 23:32:14 +01:00
|
|
|
IOmNavigator IOmNavigator_iface;
|
2008-04-07 12:34:24 +02:00
|
|
|
|
|
|
|
LONG ref;
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
HTMLPluginsCollection *plugins;
|
2008-04-07 12:34:24 +02:00
|
|
|
} OmNavigator;
|
|
|
|
|
2010-12-06 23:32:14 +01:00
|
|
|
static inline OmNavigator *impl_from_IOmNavigator(IOmNavigator *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, OmNavigator, IOmNavigator_iface);
|
|
|
|
}
|
2008-04-07 12:34:24 +02:00
|
|
|
|
2010-11-08 12:48:55 +01:00
|
|
|
struct HTMLPluginsCollection {
|
|
|
|
DispatchEx dispex;
|
2010-12-08 01:09:32 +01:00
|
|
|
IHTMLPluginsCollection IHTMLPluginsCollection_iface;
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
OmNavigator *navigator;
|
|
|
|
};
|
|
|
|
|
2010-12-08 01:09:32 +01:00
|
|
|
static inline HTMLPluginsCollection *impl_from_IHTMLPluginsCollection(IHTMLPluginsCollection *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLPluginsCollection, IHTMLPluginsCollection_iface);
|
|
|
|
}
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_QueryInterface(IHTMLPluginsCollection *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
2010-12-08 01:09:32 +01:00
|
|
|
*ppv = &This->IHTMLPluginsCollection_iface;
|
2010-11-08 12:48:55 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLPluginsCollection, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLPluginCollection %p)\n", This, ppv);
|
2010-12-08 01:09:32 +01:00
|
|
|
*ppv = &This->IHTMLPluginsCollection_iface;
|
2010-11-08 12:48:55 +01:00
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
|
|
|
}else {
|
|
|
|
*ppv = NULL;
|
|
|
|
WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPluginsCollection_AddRef(IHTMLPluginsCollection *iface)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPluginsCollection_Release(IHTMLPluginsCollection *iface)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
|
|
|
if(This->navigator)
|
|
|
|
This->navigator->plugins = NULL;
|
|
|
|
release_dispex(&This->dispex);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_GetTypeInfoCount(IHTMLPluginsCollection *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_GetTypeInfo(IHTMLPluginsCollection *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_GetIDsOfNames(IHTMLPluginsCollection *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_Invoke(IHTMLPluginsCollection *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
|
|
|
|
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_get_length(IHTMLPluginsCollection *iface, LONG *p)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_refresh(IHTMLPluginsCollection *iface, VARIANT_BOOL reload)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
FIXME("(%p)->(%x)\n", This, reload);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLPluginsCollectionVtbl HTMLPluginsCollectionVtbl = {
|
|
|
|
HTMLPluginsCollection_QueryInterface,
|
|
|
|
HTMLPluginsCollection_AddRef,
|
|
|
|
HTMLPluginsCollection_Release,
|
|
|
|
HTMLPluginsCollection_GetTypeInfoCount,
|
|
|
|
HTMLPluginsCollection_GetTypeInfo,
|
|
|
|
HTMLPluginsCollection_GetIDsOfNames,
|
|
|
|
HTMLPluginsCollection_Invoke,
|
|
|
|
HTMLPluginsCollection_get_length,
|
|
|
|
HTMLPluginsCollection_refresh
|
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t HTMLPluginsCollection_iface_tids[] = {
|
|
|
|
IHTMLPluginsCollection_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLPluginsCollection_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispCPlugins_tid,
|
|
|
|
NULL,
|
|
|
|
HTMLPluginsCollection_iface_tids
|
|
|
|
};
|
|
|
|
|
|
|
|
static HRESULT create_plugins_collection(OmNavigator *navigator, HTMLPluginsCollection **ret)
|
|
|
|
{
|
|
|
|
HTMLPluginsCollection *col;
|
|
|
|
|
|
|
|
col = heap_alloc_zero(sizeof(*col));
|
|
|
|
if(!col)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2010-12-08 01:09:32 +01:00
|
|
|
col->IHTMLPluginsCollection_iface.lpVtbl = &HTMLPluginsCollectionVtbl;
|
2010-11-08 12:48:55 +01:00
|
|
|
col->ref = 1;
|
|
|
|
col->navigator = navigator;
|
|
|
|
|
2010-12-08 01:09:32 +01:00
|
|
|
init_dispex(&col->dispex, (IUnknown*)&col->IHTMLPluginsCollection_iface,
|
|
|
|
&HTMLPluginsCollection_dispex);
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
*ret = col;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2008-04-07 12:34:24 +02:00
|
|
|
static HRESULT WINAPI OmNavigator_QueryInterface(IOmNavigator *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
2010-12-06 23:32:14 +01:00
|
|
|
*ppv = &This->IOmNavigator_iface;
|
2008-04-07 12:34:24 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IOmNavigator, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOmNavigator %p)\n", This, ppv);
|
2010-12-06 23:32:14 +01:00
|
|
|
*ppv = &This->IOmNavigator_iface;
|
2008-06-30 21:38:23 +02:00
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if(*ppv) {
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OmNavigator_AddRef(IOmNavigator *iface)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OmNavigator_Release(IOmNavigator *iface)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
2009-08-31 20:47:55 +02:00
|
|
|
if(!ref) {
|
2010-11-08 12:48:55 +01:00
|
|
|
if(This->plugins) {
|
|
|
|
This->plugins->navigator = NULL;
|
2010-12-08 01:09:32 +01:00
|
|
|
IHTMLPluginsCollection_Release(&This->plugins->IHTMLPluginsCollection_iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
}
|
2009-08-31 20:47:55 +02:00
|
|
|
release_dispex(&This->dispex);
|
2008-04-07 12:34:24 +02:00
|
|
|
heap_free(This);
|
2009-08-31 20:47:55 +02:00
|
|
|
}
|
2008-04-07 12:34:24 +02:00
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_GetTypeInfoCount(IOmNavigator *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_GetTypeInfo(IOmNavigator *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-18 22:33:44 +02:00
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_GetIDsOfNames(IOmNavigator *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-18 22:33:44 +02:00
|
|
|
|
|
|
|
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_Invoke(IOmNavigator *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-18 22:33:44 +02:00
|
|
|
|
|
|
|
return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
|
|
|
pVarResult, pExcepInfo, puArgErr);
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_appCodeName(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-07-23 13:17:48 +02:00
|
|
|
|
|
|
|
static const WCHAR mozillaW[] = {'M','o','z','i','l','l','a',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
*p = SysAllocString(mozillaW);
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_appName(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2009-08-18 10:15:34 +02:00
|
|
|
|
|
|
|
static const WCHAR app_nameW[] =
|
|
|
|
{'M','i','c','r','o','s','o','f','t',' ',
|
|
|
|
'I','n','t','e','r','n','e','t',' ',
|
|
|
|
'E','x','p','l','o','r','e','r',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
*p = SysAllocString(app_nameW);
|
|
|
|
if(!*p)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-10-13 21:51:42 +02:00
|
|
|
|
2010-03-13 16:46:18 +01:00
|
|
|
char user_agent[512];
|
|
|
|
DWORD size;
|
|
|
|
HRESULT hres;
|
2008-10-13 21:51:42 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2010-03-13 16:46:18 +01:00
|
|
|
size = sizeof(user_agent);
|
|
|
|
hres = ObtainUserAgentString(0, user_agent, &size);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
if(strncmp(user_agent, "Mozilla/", 8)) {
|
|
|
|
FIXME("Unsupported user agent\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
size = MultiByteToWideChar(CP_ACP, 0, user_agent+8, -1, NULL, 0);
|
|
|
|
*p = SysAllocStringLen(NULL, size-1);
|
2008-10-13 21:51:42 +02:00
|
|
|
if(!*p)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2010-03-13 16:46:18 +01:00
|
|
|
MultiByteToWideChar(CP_ACP, 0, user_agent+8, -1, *p, size);
|
2008-10-13 21:51:42 +02:00
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_userAgent(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2009-09-02 12:28:07 +02:00
|
|
|
char user_agent[512];
|
|
|
|
DWORD size;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
size = sizeof(user_agent);
|
|
|
|
hres = ObtainUserAgentString(0, user_agent, &size);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
size = MultiByteToWideChar(CP_ACP, 0, user_agent, -1, NULL, 0);
|
|
|
|
*p = SysAllocStringLen(NULL, size-1);
|
|
|
|
if(!*p)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, user_agent, -1, *p, size);
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_javaEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2010-12-17 03:38:56 +01:00
|
|
|
|
|
|
|
FIXME("(%p)->(%p) semi-stub\n", This, enabled);
|
|
|
|
|
|
|
|
*enabled = VARIANT_FALSE;
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_taintEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, enabled);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_mimeTypes(IOmNavigator *iface, IHTMLMimeTypesCollection **p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_plugins(IOmNavigator *iface, IHTMLPluginsCollection **p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->plugins) {
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = create_plugins_collection(This, &This->plugins);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}else {
|
2010-12-08 01:09:32 +01:00
|
|
|
IHTMLPluginsCollection_AddRef(&This->plugins->IHTMLPluginsCollection_iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
}
|
|
|
|
|
2010-12-08 01:09:32 +01:00
|
|
|
*p = &This->plugins->IHTMLPluginsCollection_iface;
|
2010-11-08 12:48:55 +01:00
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_cookieEnabled(IOmNavigator *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_opsProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2009-08-31 20:44:47 +02:00
|
|
|
|
|
|
|
static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, String);
|
|
|
|
|
|
|
|
if(!String)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*String = SysAllocString(objectW);
|
|
|
|
return *String ? S_OK : E_OUTOFMEMORY;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_cpuClass(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_systemLanguage(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_browserLanguage(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_userLanguage(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_platform(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-07-28 22:01:25 +02:00
|
|
|
|
2009-01-05 18:17:50 +01:00
|
|
|
#ifdef _WIN64
|
|
|
|
static const WCHAR platformW[] = {'W','i','n','6','4',0};
|
|
|
|
#else
|
|
|
|
static const WCHAR platformW[] = {'W','i','n','3','2',0};
|
|
|
|
#endif
|
2008-07-28 22:01:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2009-01-05 18:17:50 +01:00
|
|
|
*p = SysAllocString(platformW);
|
2008-07-28 22:01:25 +02:00
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_appMinorVersion(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI OmNavigator_get_connectionSpeed(IOmNavigator *iface, LONG *p)
|
2008-04-07 12:34:24 +02:00
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_onLine(IOmNavigator *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_userProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IOmNavigatorVtbl OmNavigatorVtbl = {
|
|
|
|
OmNavigator_QueryInterface,
|
|
|
|
OmNavigator_AddRef,
|
|
|
|
OmNavigator_Release,
|
|
|
|
OmNavigator_GetTypeInfoCount,
|
|
|
|
OmNavigator_GetTypeInfo,
|
|
|
|
OmNavigator_GetIDsOfNames,
|
|
|
|
OmNavigator_Invoke,
|
|
|
|
OmNavigator_get_appCodeName,
|
|
|
|
OmNavigator_get_appName,
|
|
|
|
OmNavigator_get_appVersion,
|
|
|
|
OmNavigator_get_userAgent,
|
|
|
|
OmNavigator_javaEnabled,
|
|
|
|
OmNavigator_taintEnabled,
|
|
|
|
OmNavigator_get_mimeTypes,
|
|
|
|
OmNavigator_get_plugins,
|
|
|
|
OmNavigator_get_cookieEnabled,
|
|
|
|
OmNavigator_get_opsProfile,
|
|
|
|
OmNavigator_toString,
|
|
|
|
OmNavigator_get_cpuClass,
|
|
|
|
OmNavigator_get_systemLanguage,
|
|
|
|
OmNavigator_get_browserLanguage,
|
|
|
|
OmNavigator_get_userLanguage,
|
|
|
|
OmNavigator_get_platform,
|
|
|
|
OmNavigator_get_appMinorVersion,
|
|
|
|
OmNavigator_get_connectionSpeed,
|
|
|
|
OmNavigator_get_onLine,
|
|
|
|
OmNavigator_get_userProfile
|
|
|
|
};
|
|
|
|
|
2008-05-06 16:04:58 +02:00
|
|
|
static const tid_t OmNavigator_iface_tids[] = {
|
|
|
|
IOmNavigator_tid,
|
|
|
|
0
|
|
|
|
};
|
2008-04-19 12:55:24 +02:00
|
|
|
static dispex_static_data_t OmNavigator_dispex = {
|
2008-04-29 01:38:09 +02:00
|
|
|
NULL,
|
2009-06-22 19:25:58 +02:00
|
|
|
DispHTMLNavigator_tid,
|
2008-04-19 12:55:24 +02:00
|
|
|
NULL,
|
2008-05-06 16:04:58 +02:00
|
|
|
OmNavigator_iface_tids
|
2008-04-19 12:55:24 +02:00
|
|
|
};
|
|
|
|
|
2008-04-07 12:34:24 +02:00
|
|
|
IOmNavigator *OmNavigator_Create(void)
|
|
|
|
{
|
|
|
|
OmNavigator *ret;
|
|
|
|
|
2008-06-19 00:05:23 +02:00
|
|
|
ret = heap_alloc_zero(sizeof(*ret));
|
2010-12-06 23:32:14 +01:00
|
|
|
ret->IOmNavigator_iface.lpVtbl = &OmNavigatorVtbl;
|
2008-04-07 12:34:24 +02:00
|
|
|
ret->ref = 1;
|
|
|
|
|
2010-12-06 23:32:14 +01:00
|
|
|
init_dispex(&ret->dispex, (IUnknown*)&ret->IOmNavigator_iface, &OmNavigator_dispex);
|
2008-04-17 02:31:43 +02:00
|
|
|
|
2010-12-06 23:32:14 +01:00
|
|
|
return &ret->IOmNavigator_iface;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|