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
24 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(ieframe
);
28 /**********************************************************************
29 * Implement the IPersistStorage interface
32 static inline WebBrowser
*impl_from_IPersistStorage(IPersistStorage
*iface
)
34 return CONTAINING_RECORD(iface
, WebBrowser
, IPersistStorage_iface
);
37 static HRESULT WINAPI
PersistStorage_QueryInterface(IPersistStorage
*iface
,
38 REFIID riid
, LPVOID
*ppobj
)
40 WebBrowser
*This
= impl_from_IPersistStorage(iface
);
41 return IWebBrowser_QueryInterface(&This
->IWebBrowser2_iface
, riid
, ppobj
);
44 static ULONG WINAPI
PersistStorage_AddRef(IPersistStorage
*iface
)
46 WebBrowser
*This
= impl_from_IPersistStorage(iface
);
47 return IWebBrowser_AddRef(&This
->IWebBrowser2_iface
);
50 static ULONG WINAPI
PersistStorage_Release(IPersistStorage
*iface
)
52 WebBrowser
*This
= impl_from_IPersistStorage(iface
);
53 return IWebBrowser_Release(&This
->IWebBrowser2_iface
);
56 static HRESULT WINAPI
PersistStorage_GetClassID(IPersistStorage
*iface
, CLSID
*pClassID
)
58 WebBrowser
*This
= impl_from_IPersistStorage(iface
);
59 FIXME("(%p)->(%p)\n", This
, pClassID
);
63 static HRESULT WINAPI
PersistStorage_IsDirty(IPersistStorage
*iface
)
65 WebBrowser
*This
= impl_from_IPersistStorage(iface
);
66 FIXME("(%p)\n", This
);
70 static HRESULT WINAPI
PersistStorage_InitNew(IPersistStorage
*iface
, LPSTORAGE pStg
)
72 WebBrowser
*This
= impl_from_IPersistStorage(iface
);
73 FIXME("(%p)->(%p)\n", This
, pStg
);
77 static HRESULT WINAPI
PersistStorage_Load(IPersistStorage
*iface
, LPSTORAGE pStg
)
79 WebBrowser
*This
= impl_from_IPersistStorage(iface
);
80 FIXME("(%p)->(%p)\n", This
, pStg
);
84 static HRESULT WINAPI
PersistStorage_Save(IPersistStorage
*iface
, LPSTORAGE pStg
,
87 WebBrowser
*This
= impl_from_IPersistStorage(iface
);
88 FIXME("(%p)->(%p %x)\n", This
, pStg
, fSameAsLoad
);
92 static HRESULT WINAPI
PersistStorage_SaveCompleted(IPersistStorage
*iface
, LPSTORAGE pStgNew
)
94 WebBrowser
*This
= impl_from_IPersistStorage(iface
);
95 FIXME("(%p)->(%p)\n", This
, pStgNew
);
99 static const IPersistStorageVtbl PersistStorageVtbl
=
101 PersistStorage_QueryInterface
,
102 PersistStorage_AddRef
,
103 PersistStorage_Release
,
104 PersistStorage_GetClassID
,
105 PersistStorage_IsDirty
,
106 PersistStorage_InitNew
,
109 PersistStorage_SaveCompleted
112 /**********************************************************************
113 * Implement the IPersistMemory interface
116 static inline WebBrowser
*impl_from_IPersistMemory(IPersistMemory
*iface
)
118 return CONTAINING_RECORD(iface
, WebBrowser
, IPersistMemory_iface
);
121 static HRESULT WINAPI
PersistMemory_QueryInterface(IPersistMemory
*iface
,
122 REFIID riid
, LPVOID
*ppobj
)
124 WebBrowser
*This
= impl_from_IPersistMemory(iface
);
125 return IWebBrowser_QueryInterface(&This
->IWebBrowser2_iface
, riid
, ppobj
);
128 static ULONG WINAPI
PersistMemory_AddRef(IPersistMemory
*iface
)
130 WebBrowser
*This
= impl_from_IPersistMemory(iface
);
131 return IWebBrowser_AddRef(&This
->IWebBrowser2_iface
);
134 static ULONG WINAPI
PersistMemory_Release(IPersistMemory
*iface
)
136 WebBrowser
*This
= impl_from_IPersistMemory(iface
);
137 return IWebBrowser_Release(&This
->IWebBrowser2_iface
);
140 static HRESULT WINAPI
PersistMemory_GetClassID(IPersistMemory
*iface
, CLSID
*pClassID
)
142 WebBrowser
*This
= impl_from_IPersistMemory(iface
);
143 FIXME("(%p)->(%p)\n", This
, pClassID
);
147 static HRESULT WINAPI
PersistMemory_IsDirty(IPersistMemory
*iface
)
149 WebBrowser
*This
= impl_from_IPersistMemory(iface
);
150 FIXME("(%p)\n", This
);
154 static HRESULT WINAPI
PersistMemory_InitNew(IPersistMemory
*iface
)
156 WebBrowser
*This
= impl_from_IPersistMemory(iface
);
157 FIXME("(%p)\n", This
);
161 static HRESULT WINAPI
PersistMemory_Load(IPersistMemory
*iface
, LPVOID pMem
, ULONG cbSize
)
163 WebBrowser
*This
= impl_from_IPersistMemory(iface
);
164 FIXME("(%p)->(%p %x)\n", This
, pMem
, cbSize
);
168 static HRESULT WINAPI
PersistMemory_Save(IPersistMemory
*iface
, LPVOID pMem
,
169 BOOL fClearDirty
, ULONG cbSize
)
171 WebBrowser
*This
= impl_from_IPersistMemory(iface
);
172 FIXME("(%p)->(%p %x %x)\n", This
, pMem
, fClearDirty
, cbSize
);
176 static HRESULT WINAPI
PersistMemory_GetSizeMax(IPersistMemory
*iface
, ULONG
*pCbSize
)
178 WebBrowser
*This
= impl_from_IPersistMemory(iface
);
179 FIXME("(%p)->(%p)\n", This
, pCbSize
);
183 static const IPersistMemoryVtbl PersistMemoryVtbl
=
185 PersistMemory_QueryInterface
,
186 PersistMemory_AddRef
,
187 PersistMemory_Release
,
188 PersistMemory_GetClassID
,
189 PersistMemory_IsDirty
,
192 PersistMemory_GetSizeMax
,
193 PersistMemory_InitNew
196 /**********************************************************************
197 * Implement the IPersistStreamInit interface
200 static inline WebBrowser
*impl_from_IPersistStreamInit(IPersistStreamInit
*iface
)
202 return CONTAINING_RECORD(iface
, WebBrowser
, IPersistStreamInit_iface
);
205 static HRESULT WINAPI
PersistStreamInit_QueryInterface(IPersistStreamInit
*iface
,
206 REFIID riid
, LPVOID
*ppobj
)
208 WebBrowser
*This
= impl_from_IPersistStreamInit(iface
);
209 return IWebBrowser_QueryInterface(&This
->IWebBrowser2_iface
, riid
, ppobj
);
212 static ULONG WINAPI
PersistStreamInit_AddRef(IPersistStreamInit
*iface
)
214 WebBrowser
*This
= impl_from_IPersistStreamInit(iface
);
215 return IWebBrowser_AddRef(&This
->IWebBrowser2_iface
);
218 static ULONG WINAPI
PersistStreamInit_Release(IPersistStreamInit
*iface
)
220 WebBrowser
*This
= impl_from_IPersistStreamInit(iface
);
221 return IWebBrowser_Release(&This
->IWebBrowser2_iface
);
224 static HRESULT WINAPI
PersistStreamInit_GetClassID(IPersistStreamInit
*iface
, CLSID
*pClassID
)
226 WebBrowser
*This
= impl_from_IPersistStreamInit(iface
);
227 return IPersistStorage_GetClassID(&This
->IPersistStorage_iface
, pClassID
);
230 static HRESULT WINAPI
PersistStreamInit_IsDirty(IPersistStreamInit
*iface
)
232 WebBrowser
*This
= impl_from_IPersistStreamInit(iface
);
233 return IPersistStorage_IsDirty(&This
->IPersistStorage_iface
);
236 static HRESULT WINAPI
PersistStreamInit_Load(IPersistStreamInit
*iface
, LPSTREAM pStg
)
238 WebBrowser
*This
= impl_from_IPersistStreamInit(iface
);
239 FIXME("(%p)->(%p)\n", This
, pStg
);
243 static HRESULT WINAPI
PersistStreamInit_Save(IPersistStreamInit
*iface
, LPSTREAM pStg
,
246 WebBrowser
*This
= impl_from_IPersistStreamInit(iface
);
247 FIXME("(%p)->(%p %x)\n", This
, pStg
, fSameAsLoad
);
251 static HRESULT WINAPI
PersistStreamInit_GetSizeMax(IPersistStreamInit
*iface
,
252 ULARGE_INTEGER
*pcbSize
)
254 WebBrowser
*This
= impl_from_IPersistStreamInit(iface
);
255 FIXME("(%p)->(%p)\n", This
, pcbSize
);
259 static HRESULT WINAPI
PersistStreamInit_InitNew(IPersistStreamInit
*iface
)
261 WebBrowser
*This
= impl_from_IPersistStreamInit(iface
);
262 FIXME("(%p)\n", This
);
266 static const IPersistStreamInitVtbl PersistStreamInitVtbl
=
268 PersistStreamInit_QueryInterface
,
269 PersistStreamInit_AddRef
,
270 PersistStreamInit_Release
,
271 PersistStreamInit_GetClassID
,
272 PersistStreamInit_IsDirty
,
273 PersistStreamInit_Load
,
274 PersistStreamInit_Save
,
275 PersistStreamInit_GetSizeMax
,
276 PersistStreamInit_InitNew
279 void WebBrowser_Persist_Init(WebBrowser
*This
)
281 This
->IPersistStorage_iface
.lpVtbl
= &PersistStorageVtbl
;
282 This
->IPersistMemory_iface
.lpVtbl
= &PersistMemoryVtbl
;
283 This
->IPersistStreamInit_iface
.lpVtbl
= &PersistStreamInitVtbl
;