include: Add event trace flags and guid to evntrace.h.
[wine.git] / dlls / ieframe / persist.c
blob4c890d7ebfaaddb0266c7008fa852fd75f6110d8
1 /*
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 "ieframe.h"
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 IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj);
44 static ULONG WINAPI PersistStorage_AddRef(IPersistStorage *iface)
46 WebBrowser *This = impl_from_IPersistStorage(iface);
47 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
50 static ULONG WINAPI PersistStorage_Release(IPersistStorage *iface)
52 WebBrowser *This = impl_from_IPersistStorage(iface);
53 return IWebBrowser2_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);
60 return E_NOTIMPL;
63 static HRESULT WINAPI PersistStorage_IsDirty(IPersistStorage *iface)
65 WebBrowser *This = impl_from_IPersistStorage(iface);
66 FIXME("(%p)\n", This);
67 return E_NOTIMPL;
70 static HRESULT WINAPI PersistStorage_InitNew(IPersistStorage *iface, LPSTORAGE pStg)
72 WebBrowser *This = impl_from_IPersistStorage(iface);
73 FIXME("(%p)->(%p)\n", This, pStg);
74 return S_OK;
77 static HRESULT WINAPI PersistStorage_Load(IPersistStorage *iface, LPSTORAGE pStg)
79 WebBrowser *This = impl_from_IPersistStorage(iface);
80 FIXME("(%p)->(%p)\n", This, pStg);
81 return E_NOTIMPL;
84 static HRESULT WINAPI PersistStorage_Save(IPersistStorage *iface, LPSTORAGE pStg,
85 BOOL fSameAsLoad)
87 WebBrowser *This = impl_from_IPersistStorage(iface);
88 FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
89 return E_NOTIMPL;
92 static HRESULT WINAPI PersistStorage_SaveCompleted(IPersistStorage *iface, LPSTORAGE pStgNew)
94 WebBrowser *This = impl_from_IPersistStorage(iface);
95 FIXME("(%p)->(%p)\n", This, pStgNew);
96 return E_NOTIMPL;
99 static const IPersistStorageVtbl PersistStorageVtbl =
101 PersistStorage_QueryInterface,
102 PersistStorage_AddRef,
103 PersistStorage_Release,
104 PersistStorage_GetClassID,
105 PersistStorage_IsDirty,
106 PersistStorage_InitNew,
107 PersistStorage_Load,
108 PersistStorage_Save,
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 IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj);
128 static ULONG WINAPI PersistMemory_AddRef(IPersistMemory *iface)
130 WebBrowser *This = impl_from_IPersistMemory(iface);
131 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
134 static ULONG WINAPI PersistMemory_Release(IPersistMemory *iface)
136 WebBrowser *This = impl_from_IPersistMemory(iface);
137 return IWebBrowser2_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);
144 return E_NOTIMPL;
147 static HRESULT WINAPI PersistMemory_IsDirty(IPersistMemory *iface)
149 WebBrowser *This = impl_from_IPersistMemory(iface);
150 FIXME("(%p)\n", This);
151 return E_NOTIMPL;
154 static HRESULT WINAPI PersistMemory_InitNew(IPersistMemory *iface)
156 WebBrowser *This = impl_from_IPersistMemory(iface);
157 FIXME("(%p)\n", This);
158 return S_OK;
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);
165 return S_OK;
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);
173 return E_NOTIMPL;
176 static HRESULT WINAPI PersistMemory_GetSizeMax(IPersistMemory *iface, ULONG *pCbSize)
178 WebBrowser *This = impl_from_IPersistMemory(iface);
179 FIXME("(%p)->(%p)\n", This, pCbSize);
180 return E_NOTIMPL;
183 static const IPersistMemoryVtbl PersistMemoryVtbl =
185 PersistMemory_QueryInterface,
186 PersistMemory_AddRef,
187 PersistMemory_Release,
188 PersistMemory_GetClassID,
189 PersistMemory_IsDirty,
190 PersistMemory_Load,
191 PersistMemory_Save,
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 IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj);
212 static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
214 WebBrowser *This = impl_from_IPersistStreamInit(iface);
215 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
218 static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
220 WebBrowser *This = impl_from_IPersistStreamInit(iface);
221 return IWebBrowser2_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);
240 return S_OK;
243 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStg,
244 BOOL fSameAsLoad)
246 WebBrowser *This = impl_from_IPersistStreamInit(iface);
247 FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
248 return E_NOTIMPL;
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);
256 return E_NOTIMPL;
259 static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
261 WebBrowser *This = impl_from_IPersistStreamInit(iface);
262 FIXME("(%p)\n", This);
263 return S_OK;
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;