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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 #define PERSTORAGE_THIS(ifce) DEFINE_THIS(WebBrowser, PersistStorage, iface)
97 static const IPersistStorageVtbl PersistStorageVtbl =
99 PersistStorage_QueryInterface,
100 PersistStorage_AddRef,
101 PersistStorage_Release,
102 PersistStorage_GetClassID,
103 PersistStorage_IsDirty,
104 PersistStorage_InitNew,
107 PersistStorage_SaveCompleted
110 /**********************************************************************
111 * Implement the IPersistStreamInit interface
114 #define PERSTRINIT_THIS(iface) DEFINE_THIS(WebBrowser, PersistStreamInit, iface)
116 static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface,
117 REFIID riid, LPVOID *ppobj)
119 WebBrowser *This = PERSTRINIT_THIS(iface);
120 return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
123 static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
125 WebBrowser *This = PERSTRINIT_THIS(iface);
126 return IWebBrowser_AddRef(WEBBROWSER(This));
129 static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
131 WebBrowser *This = PERSTRINIT_THIS(iface);
132 return IWebBrowser_Release(WEBBROWSER(This));
135 static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
137 WebBrowser *This = PERSTRINIT_THIS(iface);
138 return IPersistStorage_GetClassID(PERSTORAGE(This), pClassID);
141 static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
143 WebBrowser *This = PERSTRINIT_THIS(iface);
144 return IPersistStorage_IsDirty(PERSTORAGE(This));
147 static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStg)
149 WebBrowser *This = PERSTRINIT_THIS(iface);
150 FIXME("(%p)->(%p)\n", This, pStg);
154 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStg,
157 WebBrowser *This = PERSTRINIT_THIS(iface);
158 FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
162 static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface,
163 ULARGE_INTEGER *pcbSize)
165 WebBrowser *This = PERSTRINIT_THIS(iface);
166 FIXME("(%p)->(%p)\n", This, pcbSize);
170 static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
172 WebBrowser *This = PERSTRINIT_THIS(iface);
173 FIXME("(%p)\n", This);
177 #undef PERSTRINIT_THIS
179 static const IPersistStreamInitVtbl PersistStreamInitVtbl =
181 PersistStreamInit_QueryInterface,
182 PersistStreamInit_AddRef,
183 PersistStreamInit_Release,
184 PersistStreamInit_GetClassID,
185 PersistStreamInit_IsDirty,
186 PersistStreamInit_Load,
187 PersistStreamInit_Save,
188 PersistStreamInit_GetSizeMax,
189 PersistStreamInit_InitNew
192 void WebBrowser_Persist_Init(WebBrowser *This)
194 This->lpPersistStorageVtbl = &PersistStorageVtbl;
195 This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;