2 * Implementation of IPersist interfaces for WebBrowser control
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
5 * Copyright 2005 Jacek Caban
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
27 /**********************************************************************
28 * Implement the IPersistStorage interface
31 #define PERSTORAGE_THIS(ifce) DEFINE_THIS(WebBrowser, PersistStorage, iface)
33 static HRESULT WINAPI PersistStorage_QueryInterface(IPersistStorage *iface,
34 REFIID riid, LPVOID *ppobj)
36 WebBrowser *This = PERSTORAGE_THIS(iface);
37 return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
40 static ULONG WINAPI PersistStorage_AddRef(IPersistStorage *iface)
42 WebBrowser *This = PERSTORAGE_THIS(iface);
43 return IWebBrowser_AddRef(WEBBROWSER(This));
46 static ULONG WINAPI PersistStorage_Release(IPersistStorage *iface)
48 WebBrowser *This = PERSTORAGE_THIS(iface);
49 return IWebBrowser_Release(WEBBROWSER(This));
52 static HRESULT WINAPI PersistStorage_GetClassID(IPersistStorage *iface, CLSID *pClassID)
54 WebBrowser *This = PERSTORAGE_THIS(iface);
55 FIXME("(%p)->(%p)\n", This, pClassID);
59 static HRESULT WINAPI PersistStorage_IsDirty(IPersistStorage *iface)
61 WebBrowser *This = PERSTORAGE_THIS(iface);
62 FIXME("(%p)\n", This);
66 static HRESULT WINAPI PersistStorage_InitNew(IPersistStorage *iface, LPSTORAGE pStg)
68 WebBrowser *This = PERSTORAGE_THIS(iface);
69 FIXME("(%p)->(%p)\n", This, pStg);
73 static HRESULT WINAPI PersistStorage_Load(IPersistStorage *iface, LPSTORAGE pStg)
75 WebBrowser *This = PERSTORAGE_THIS(iface);
76 FIXME("(%p)->(%p)\n", This, pStg);
80 static HRESULT WINAPI PersistStorage_Save(IPersistStorage *iface, LPSTORAGE pStg,
83 WebBrowser *This = PERSTORAGE_THIS(iface);
84 FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
88 static HRESULT WINAPI PersistStorage_SaveCompleted(IPersistStorage *iface, LPSTORAGE pStgNew)
90 WebBrowser *This = PERSTORAGE_THIS(iface);
91 FIXME("(%p)->(%p)\n", This, pStgNew);
95 static const IPersistStorageVtbl PersistStorageVtbl =
97 PersistStorage_QueryInterface,
98 PersistStorage_AddRef,
99 PersistStorage_Release,
100 PersistStorage_GetClassID,
101 PersistStorage_IsDirty,
102 PersistStorage_InitNew,
105 PersistStorage_SaveCompleted
108 /**********************************************************************
109 * Implement the IPersistMemory interface
112 #define PERMEMORY_THIS(ifce) DEFINE_THIS(WebBrowser, PersistMemory, iface)
114 static HRESULT WINAPI PersistMemory_QueryInterface(IPersistMemory *iface,
115 REFIID riid, LPVOID *ppobj)
117 WebBrowser *This = PERMEMORY_THIS(iface);
118 return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
121 static ULONG WINAPI PersistMemory_AddRef(IPersistMemory *iface)
123 WebBrowser *This = PERMEMORY_THIS(iface);
124 return IWebBrowser_AddRef(WEBBROWSER(This));
127 static ULONG WINAPI PersistMemory_Release(IPersistMemory *iface)
129 WebBrowser *This = PERMEMORY_THIS(iface);
130 return IWebBrowser_Release(WEBBROWSER(This));
133 static HRESULT WINAPI PersistMemory_GetClassID(IPersistMemory *iface, CLSID *pClassID)
135 WebBrowser *This = PERMEMORY_THIS(iface);
136 FIXME("(%p)->(%p)\n", This, pClassID);
140 static HRESULT WINAPI PersistMemory_IsDirty(IPersistMemory *iface)
142 WebBrowser *This = PERMEMORY_THIS(iface);
143 FIXME("(%p)\n", This);
147 static HRESULT WINAPI PersistMemory_InitNew(IPersistMemory *iface)
149 WebBrowser *This = PERMEMORY_THIS(iface);
150 FIXME("(%p)\n", This);
154 static HRESULT WINAPI PersistMemory_Load(IPersistMemory *iface, LPVOID pMem, ULONG cbSize)
156 WebBrowser *This = PERMEMORY_THIS(iface);
157 FIXME("(%p)->(%p %x)\n", This, pMem, cbSize);
161 static HRESULT WINAPI PersistMemory_Save(IPersistMemory *iface, LPVOID pMem,
162 BOOL fClearDirty, ULONG cbSize)
164 WebBrowser *This = PERMEMORY_THIS(iface);
165 FIXME("(%p)->(%p %x %x)\n", This, pMem, fClearDirty, cbSize);
169 static HRESULT WINAPI PersistMemory_GetSizeMax(IPersistMemory *iface, ULONG *pCbSize)
171 WebBrowser *This = PERMEMORY_THIS(iface);
172 FIXME("(%p)->(%p)\n", This, pCbSize);
176 static const IPersistMemoryVtbl PersistMemoryVtbl =
178 PersistMemory_QueryInterface,
179 PersistMemory_AddRef,
180 PersistMemory_Release,
181 PersistMemory_GetClassID,
182 PersistMemory_IsDirty,
185 PersistMemory_GetSizeMax,
186 PersistMemory_InitNew
189 /**********************************************************************
190 * Implement the IPersistStreamInit interface
193 #define PERSTRINIT_THIS(iface) DEFINE_THIS(WebBrowser, PersistStreamInit, iface)
195 static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface,
196 REFIID riid, LPVOID *ppobj)
198 WebBrowser *This = PERSTRINIT_THIS(iface);
199 return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
202 static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
204 WebBrowser *This = PERSTRINIT_THIS(iface);
205 return IWebBrowser_AddRef(WEBBROWSER(This));
208 static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
210 WebBrowser *This = PERSTRINIT_THIS(iface);
211 return IWebBrowser_Release(WEBBROWSER(This));
214 static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
216 WebBrowser *This = PERSTRINIT_THIS(iface);
217 return IPersistStorage_GetClassID(PERSTORAGE(This), pClassID);
220 static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
222 WebBrowser *This = PERSTRINIT_THIS(iface);
223 return IPersistStorage_IsDirty(PERSTORAGE(This));
226 static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStg)
228 WebBrowser *This = PERSTRINIT_THIS(iface);
229 FIXME("(%p)->(%p)\n", This, pStg);
233 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStg,
236 WebBrowser *This = PERSTRINIT_THIS(iface);
237 FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
241 static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface,
242 ULARGE_INTEGER *pcbSize)
244 WebBrowser *This = PERSTRINIT_THIS(iface);
245 FIXME("(%p)->(%p)\n", This, pcbSize);
249 static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
251 WebBrowser *This = PERSTRINIT_THIS(iface);
252 FIXME("(%p)\n", This);
256 #undef PERSTRINIT_THIS
258 static const IPersistStreamInitVtbl PersistStreamInitVtbl =
260 PersistStreamInit_QueryInterface,
261 PersistStreamInit_AddRef,
262 PersistStreamInit_Release,
263 PersistStreamInit_GetClassID,
264 PersistStreamInit_IsDirty,
265 PersistStreamInit_Load,
266 PersistStreamInit_Save,
267 PersistStreamInit_GetSizeMax,
268 PersistStreamInit_InitNew
271 void WebBrowser_Persist_Init(WebBrowser *This)
273 This->lpPersistStorageVtbl = &PersistStorageVtbl;
274 This->lpPersistMemoryVtbl = &PersistMemoryVtbl;
275 This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;