2002-05-05 21:40:57 +02:00
|
|
|
/*
|
2005-09-08 13:01:57 +02:00
|
|
|
* Implementation of IPersist interfaces for WebBrowser control
|
2002-05-05 21:40:57 +02:00
|
|
|
*
|
|
|
|
* Copyright 2001 John R. Sheets (for CodeWeavers)
|
2005-09-08 13:01:57 +02:00
|
|
|
* Copyright 2005 Jacek Caban
|
2002-05-05 21:40:57 +02:00
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-05-05 21:40:57 +02:00
|
|
|
*/
|
|
|
|
|
2011-07-27 14:46:48 +02:00
|
|
|
#include "ieframe.h"
|
|
|
|
|
2002-05-05 21:40:57 +02:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
2011-07-29 12:18:33 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
|
2002-05-05 21:40:57 +02:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* Implement the IPersistStorage interface
|
|
|
|
*/
|
|
|
|
|
2010-11-13 17:47:44 +01:00
|
|
|
static inline WebBrowser *impl_from_IPersistStorage(IPersistStorage *iface)
|
|
|
|
{
|
2010-11-24 14:06:38 +01:00
|
|
|
return CONTAINING_RECORD(iface, WebBrowser, IPersistStorage_iface);
|
2010-11-13 17:47:44 +01:00
|
|
|
}
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStorage_QueryInterface(IPersistStorage *iface,
|
|
|
|
REFIID riid, LPVOID *ppobj)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStorage(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppobj);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static ULONG WINAPI PersistStorage_AddRef(IPersistStorage *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStorage(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_AddRef(This->hlink_frame.outer);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static ULONG WINAPI PersistStorage_Release(IPersistStorage *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStorage(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_Release(This->hlink_frame.outer);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStorage_GetClassID(IPersistStorage *iface, CLSID *pClassID)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStorage(iface);
|
2005-09-08 13:01:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pClassID);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStorage_IsDirty(IPersistStorage *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStorage(iface);
|
2005-09-08 13:01:57 +02:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStorage_InitNew(IPersistStorage *iface, LPSTORAGE pStg)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStorage(iface);
|
2005-09-08 13:01:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pStg);
|
2006-10-07 03:11:46 +02:00
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStorage_Load(IPersistStorage *iface, LPSTORAGE pStg)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStorage(iface);
|
2005-09-08 13:01:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pStg);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStorage_Save(IPersistStorage *iface, LPSTORAGE pStg,
|
|
|
|
BOOL fSameAsLoad)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStorage(iface);
|
2005-09-08 13:01:57 +02:00
|
|
|
FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStorage_SaveCompleted(IPersistStorage *iface, LPSTORAGE pStgNew)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStorage(iface);
|
2005-09-08 13:01:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pStgNew);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static const IPersistStorageVtbl PersistStorageVtbl =
|
|
|
|
{
|
|
|
|
PersistStorage_QueryInterface,
|
|
|
|
PersistStorage_AddRef,
|
|
|
|
PersistStorage_Release,
|
|
|
|
PersistStorage_GetClassID,
|
|
|
|
PersistStorage_IsDirty,
|
|
|
|
PersistStorage_InitNew,
|
|
|
|
PersistStorage_Load,
|
|
|
|
PersistStorage_Save,
|
|
|
|
PersistStorage_SaveCompleted
|
2002-05-05 21:40:57 +02:00
|
|
|
};
|
|
|
|
|
2007-10-31 05:06:58 +01:00
|
|
|
/**********************************************************************
|
|
|
|
* Implement the IPersistMemory interface
|
|
|
|
*/
|
|
|
|
|
2010-11-13 17:47:44 +01:00
|
|
|
static inline WebBrowser *impl_from_IPersistMemory(IPersistMemory *iface)
|
|
|
|
{
|
2010-11-24 14:06:38 +01:00
|
|
|
return CONTAINING_RECORD(iface, WebBrowser, IPersistMemory_iface);
|
2010-11-13 17:47:44 +01:00
|
|
|
}
|
2007-10-31 05:06:58 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMemory_QueryInterface(IPersistMemory *iface,
|
|
|
|
REFIID riid, LPVOID *ppobj)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistMemory(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppobj);
|
2007-10-31 05:06:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistMemory_AddRef(IPersistMemory *iface)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistMemory(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_AddRef(This->hlink_frame.outer);
|
2007-10-31 05:06:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistMemory_Release(IPersistMemory *iface)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistMemory(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_Release(This->hlink_frame.outer);
|
2007-10-31 05:06:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMemory_GetClassID(IPersistMemory *iface, CLSID *pClassID)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistMemory(iface);
|
2007-10-31 05:06:58 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, pClassID);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMemory_IsDirty(IPersistMemory *iface)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistMemory(iface);
|
2007-10-31 05:06:58 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMemory_InitNew(IPersistMemory *iface)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistMemory(iface);
|
2007-10-31 05:06:58 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMemory_Load(IPersistMemory *iface, LPVOID pMem, ULONG cbSize)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistMemory(iface);
|
2007-10-31 05:06:58 +01:00
|
|
|
FIXME("(%p)->(%p %x)\n", This, pMem, cbSize);
|
2008-01-10 14:25:23 +01:00
|
|
|
return S_OK;
|
2007-10-31 05:06:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMemory_Save(IPersistMemory *iface, LPVOID pMem,
|
|
|
|
BOOL fClearDirty, ULONG cbSize)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistMemory(iface);
|
2007-10-31 05:06:58 +01:00
|
|
|
FIXME("(%p)->(%p %x %x)\n", This, pMem, fClearDirty, cbSize);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMemory_GetSizeMax(IPersistMemory *iface, ULONG *pCbSize)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistMemory(iface);
|
2007-10-31 05:06:58 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, pCbSize);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IPersistMemoryVtbl PersistMemoryVtbl =
|
|
|
|
{
|
|
|
|
PersistMemory_QueryInterface,
|
|
|
|
PersistMemory_AddRef,
|
|
|
|
PersistMemory_Release,
|
|
|
|
PersistMemory_GetClassID,
|
|
|
|
PersistMemory_IsDirty,
|
|
|
|
PersistMemory_Load,
|
|
|
|
PersistMemory_Save,
|
|
|
|
PersistMemory_GetSizeMax,
|
|
|
|
PersistMemory_InitNew
|
|
|
|
};
|
|
|
|
|
2002-05-05 21:40:57 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* Implement the IPersistStreamInit interface
|
|
|
|
*/
|
|
|
|
|
2010-11-13 17:47:44 +01:00
|
|
|
static inline WebBrowser *impl_from_IPersistStreamInit(IPersistStreamInit *iface)
|
|
|
|
{
|
2010-11-24 14:06:38 +01:00
|
|
|
return CONTAINING_RECORD(iface, WebBrowser, IPersistStreamInit_iface);
|
2010-11-13 17:47:44 +01:00
|
|
|
}
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface,
|
|
|
|
REFIID riid, LPVOID *ppobj)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStreamInit(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppobj);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStreamInit(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_AddRef(This->hlink_frame.outer);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStreamInit(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_Release(This->hlink_frame.outer);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
return IPersistStorage_GetClassID(&This->IPersistStorage_iface, pClassID);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStreamInit(iface);
|
|
|
|
return IPersistStorage_IsDirty(&This->IPersistStorage_iface);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStg)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStreamInit(iface);
|
2005-09-08 13:01:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pStg);
|
2006-07-22 15:13:36 +02:00
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStg,
|
|
|
|
BOOL fSameAsLoad)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStreamInit(iface);
|
2005-09-08 13:01:57 +02:00
|
|
|
FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface,
|
|
|
|
ULARGE_INTEGER *pcbSize)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStreamInit(iface);
|
2005-09-08 13:01:57 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pcbSize);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IPersistStreamInit(iface);
|
2005-09-08 13:01:57 +02:00
|
|
|
FIXME("(%p)\n", This);
|
2006-06-20 19:04:07 +02:00
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
static const IPersistStreamInitVtbl PersistStreamInitVtbl =
|
|
|
|
{
|
|
|
|
PersistStreamInit_QueryInterface,
|
|
|
|
PersistStreamInit_AddRef,
|
|
|
|
PersistStreamInit_Release,
|
|
|
|
PersistStreamInit_GetClassID,
|
|
|
|
PersistStreamInit_IsDirty,
|
|
|
|
PersistStreamInit_Load,
|
|
|
|
PersistStreamInit_Save,
|
|
|
|
PersistStreamInit_GetSizeMax,
|
|
|
|
PersistStreamInit_InitNew
|
2002-05-05 21:40:57 +02:00
|
|
|
};
|
|
|
|
|
2005-09-08 13:01:57 +02:00
|
|
|
void WebBrowser_Persist_Init(WebBrowser *This)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
This->IPersistStorage_iface.lpVtbl = &PersistStorageVtbl;
|
|
|
|
This->IPersistMemory_iface.lpVtbl = &PersistMemoryVtbl;
|
|
|
|
This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
|
2005-09-08 13:01:57 +02:00
|
|
|
}
|