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
23 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw
);
28 /**********************************************************************
29 * Implement the IPersistStorage interface
32 #define PERSTORAGE_THIS(ifce) DEFINE_THIS(WebBrowser, PersistStorage, iface)
34 static HRESULT WINAPI
PersistStorage_QueryInterface(IPersistStorage
*iface
,
35 REFIID riid
, LPVOID
*ppobj
)
37 WebBrowser
*This
= PERSTORAGE_THIS(iface
);
38 return IWebBrowser_QueryInterface(WEBBROWSER(This
), riid
, ppobj
);
41 static ULONG WINAPI
PersistStorage_AddRef(IPersistStorage
*iface
)
43 WebBrowser
*This
= PERSTORAGE_THIS(iface
);
44 return IWebBrowser_AddRef(WEBBROWSER(This
));
47 static ULONG WINAPI
PersistStorage_Release(IPersistStorage
*iface
)
49 WebBrowser
*This
= PERSTORAGE_THIS(iface
);
50 return IWebBrowser_Release(WEBBROWSER(This
));
53 static HRESULT WINAPI
PersistStorage_GetClassID(IPersistStorage
*iface
, CLSID
*pClassID
)
55 WebBrowser
*This
= PERSTORAGE_THIS(iface
);
56 FIXME("(%p)->(%p)\n", This
, pClassID
);
60 static HRESULT WINAPI
PersistStorage_IsDirty(IPersistStorage
*iface
)
62 WebBrowser
*This
= PERSTORAGE_THIS(iface
);
63 FIXME("(%p)\n", This
);
67 static HRESULT WINAPI
PersistStorage_InitNew(IPersistStorage
*iface
, LPSTORAGE pStg
)
69 WebBrowser
*This
= PERSTORAGE_THIS(iface
);
70 FIXME("(%p)->(%p)\n", This
, pStg
);
74 static HRESULT WINAPI
PersistStorage_Load(IPersistStorage
*iface
, LPSTORAGE pStg
)
76 WebBrowser
*This
= PERSTORAGE_THIS(iface
);
77 FIXME("(%p)->(%p)\n", This
, pStg
);
81 static HRESULT WINAPI
PersistStorage_Save(IPersistStorage
*iface
, LPSTORAGE pStg
,
84 WebBrowser
*This
= PERSTORAGE_THIS(iface
);
85 FIXME("(%p)->(%p %x)\n", This
, pStg
, fSameAsLoad
);
89 static HRESULT WINAPI
PersistStorage_SaveCompleted(IPersistStorage
*iface
, LPSTORAGE pStgNew
)
91 WebBrowser
*This
= PERSTORAGE_THIS(iface
);
92 FIXME("(%p)->(%p)\n", This
, pStgNew
);
96 #define PERSTORAGE_THIS(ifce) DEFINE_THIS(WebBrowser, PersistStorage, iface)
98 static const IPersistStorageVtbl PersistStorageVtbl
=
100 PersistStorage_QueryInterface
,
101 PersistStorage_AddRef
,
102 PersistStorage_Release
,
103 PersistStorage_GetClassID
,
104 PersistStorage_IsDirty
,
105 PersistStorage_InitNew
,
108 PersistStorage_SaveCompleted
111 /**********************************************************************
112 * Implement the IPersistStreamInit interface
115 #define PERSTRINIT_THIS(iface) DEFINE_THIS(WebBrowser, PersistStreamInit, iface)
117 static HRESULT WINAPI
PersistStreamInit_QueryInterface(IPersistStreamInit
*iface
,
118 REFIID riid
, LPVOID
*ppobj
)
120 WebBrowser
*This
= PERSTRINIT_THIS(iface
);
121 return IWebBrowser_QueryInterface(WEBBROWSER(This
), riid
, ppobj
);
124 static ULONG WINAPI
PersistStreamInit_AddRef(IPersistStreamInit
*iface
)
126 WebBrowser
*This
= PERSTRINIT_THIS(iface
);
127 return IWebBrowser_AddRef(WEBBROWSER(This
));
130 static ULONG WINAPI
PersistStreamInit_Release(IPersistStreamInit
*iface
)
132 WebBrowser
*This
= PERSTRINIT_THIS(iface
);
133 return IWebBrowser_Release(WEBBROWSER(This
));
136 static HRESULT WINAPI
PersistStreamInit_GetClassID(IPersistStreamInit
*iface
, CLSID
*pClassID
)
138 WebBrowser
*This
= PERSTRINIT_THIS(iface
);
139 return IPersistStorage_GetClassID(PERSTORAGE(This
), pClassID
);
142 static HRESULT WINAPI
PersistStreamInit_IsDirty(IPersistStreamInit
*iface
)
144 WebBrowser
*This
= PERSTRINIT_THIS(iface
);
145 return IPersistStorage_IsDirty(PERSTORAGE(This
));
148 static HRESULT WINAPI
PersistStreamInit_Load(IPersistStreamInit
*iface
, LPSTREAM pStg
)
150 WebBrowser
*This
= PERSTRINIT_THIS(iface
);
151 FIXME("(%p)->(%p)\n", This
, pStg
);
155 static HRESULT WINAPI
PersistStreamInit_Save(IPersistStreamInit
*iface
, LPSTREAM pStg
,
158 WebBrowser
*This
= PERSTRINIT_THIS(iface
);
159 FIXME("(%p)->(%p %x)\n", This
, pStg
, fSameAsLoad
);
163 static HRESULT WINAPI
PersistStreamInit_GetSizeMax(IPersistStreamInit
*iface
,
164 ULARGE_INTEGER
*pcbSize
)
166 WebBrowser
*This
= PERSTRINIT_THIS(iface
);
167 FIXME("(%p)->(%p)\n", This
, pcbSize
);
171 static HRESULT WINAPI
PersistStreamInit_InitNew(IPersistStreamInit
*iface
)
173 WebBrowser
*This
= PERSTRINIT_THIS(iface
);
174 FIXME("(%p)\n", This
);
178 #undef PERSTRINIT_THIS
180 static const IPersistStreamInitVtbl PersistStreamInitVtbl
=
182 PersistStreamInit_QueryInterface
,
183 PersistStreamInit_AddRef
,
184 PersistStreamInit_Release
,
185 PersistStreamInit_GetClassID
,
186 PersistStreamInit_IsDirty
,
187 PersistStreamInit_Load
,
188 PersistStreamInit_Save
,
189 PersistStreamInit_GetSizeMax
,
190 PersistStreamInit_InitNew
193 void WebBrowser_Persist_Init(WebBrowser
*This
)
195 This
->lpPersistStorageVtbl
= &PersistStorageVtbl
;
196 This
->lpPersistStreamInitVtbl
= &PersistStreamInitVtbl
;