2005-04-11 16:11:52 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2005 Jacek Caban
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-04-11 16:11:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
2005-08-11 18:36:48 +00:00
|
|
|
#define NONAMELESSUNION
|
|
|
|
#define NONAMELESSSTRUCT
|
2005-04-11 16:11:52 +00:00
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
2005-08-25 15:19:19 +00:00
|
|
|
#include "shlguid.h"
|
2005-04-11 16:11:52 +00:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
2006-02-15 10:52:33 +00:00
|
|
|
#include "wine/unicode.h"
|
2005-04-11 16:11:52 +00:00
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
|
|
|
/**********************************************************
|
|
|
|
* IPersistMoniker implementation
|
|
|
|
*/
|
|
|
|
|
2005-08-09 20:46:05 +00:00
|
|
|
#define PERSISTMON_THIS(iface) DEFINE_THIS(HTMLDocument, PersistMoniker, iface)
|
2005-04-11 16:11:52 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid,
|
|
|
|
void **ppvObject)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTMON_THIS(iface);
|
2005-04-11 16:11:52 +00:00
|
|
|
return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTMON_THIS(iface);
|
2005-04-11 16:11:52 +00:00
|
|
|
return IHTMLDocument2_AddRef(HTMLDOC(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTMON_THIS(iface);
|
2005-04-11 16:11:52 +00:00
|
|
|
return IHTMLDocument2_Release(HTMLDOC(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTMON_THIS(iface);
|
2005-04-11 16:11:52 +00:00
|
|
|
return IPersist_GetClassID(PERSIST(This), pClassID);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTMON_THIS(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
2005-04-11 16:11:52 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2006-02-15 10:52:33 +00:00
|
|
|
static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
|
|
|
|
{
|
|
|
|
nsIInputStream *ret = NULL;
|
|
|
|
IBindStatusCallback *callback;
|
|
|
|
IHttpNegotiate *http_negotiate;
|
|
|
|
BINDINFO bindinfo;
|
|
|
|
DWORD bindf = 0;
|
|
|
|
DWORD post_len = 0, headers_len = 0;
|
|
|
|
LPWSTR headers = NULL;
|
|
|
|
WCHAR emptystr[] = {0};
|
|
|
|
char *data;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
static WCHAR _BSCB_Holder_[] =
|
|
|
|
{'_','B','S','C','B','_','H','o','l','d','e','r','_',0};
|
|
|
|
|
|
|
|
|
|
|
|
/* FIXME: This should be done in URLMoniker */
|
|
|
|
if(!bctx)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
hres = IBindCtx_GetObjectParam(bctx, _BSCB_Holder_, (IUnknown**)&callback);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
hres = IBindStatusCallback_QueryInterface(callback, &IID_IHttpNegotiate,
|
|
|
|
(void**)&http_negotiate);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
hres = IHttpNegotiate_BeginningTransaction(http_negotiate, emptystr,
|
|
|
|
emptystr, 0, &headers);
|
|
|
|
IHttpNegotiate_Release(http_negotiate);
|
|
|
|
|
|
|
|
if(SUCCEEDED(hres) && headers)
|
|
|
|
headers_len = WideCharToMultiByte(CP_ACP, 0, headers, -1, NULL, 0, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
memset(&bindinfo, 0, sizeof(bindinfo));
|
|
|
|
bindinfo.cbSize = sizeof(bindinfo);
|
|
|
|
|
|
|
|
hres = IBindStatusCallback_GetBindInfo(callback, &bindf, &bindinfo);
|
|
|
|
|
|
|
|
if(SUCCEEDED(hres) && bindinfo.dwBindVerb == BINDVERB_POST)
|
2006-02-24 19:29:37 +00:00
|
|
|
post_len = bindinfo.cbStgmedData;
|
2006-02-15 10:52:33 +00:00
|
|
|
|
|
|
|
if(headers_len || post_len) {
|
2006-02-24 19:29:37 +00:00
|
|
|
int len = headers_len ? headers_len-1 : 0;
|
2006-02-15 10:52:33 +00:00
|
|
|
|
|
|
|
static const char content_length[] = "Content-Length: %lu\r\n\r\n";
|
|
|
|
|
|
|
|
data = HeapAlloc(GetProcessHeap(), 0, headers_len+post_len+sizeof(content_length)+8);
|
|
|
|
|
|
|
|
if(headers_len) {
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, headers, -1, data, -1, NULL, NULL);
|
|
|
|
CoTaskMemFree(headers);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(post_len) {
|
2006-02-24 19:29:37 +00:00
|
|
|
sprintf(data+len, content_length, post_len);
|
2006-02-15 10:52:33 +00:00
|
|
|
len = strlen(data);
|
|
|
|
|
|
|
|
memcpy(data+len, bindinfo.stgmedData.u.hGlobal, post_len);
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("data = %s\n", debugstr_an(data, len+post_len));
|
|
|
|
|
2006-02-24 19:29:37 +00:00
|
|
|
ret = create_nsstream(data, len+post_len);
|
2006-02-15 10:52:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ReleaseBindInfo(&bindinfo);
|
|
|
|
IBindStatusCallback_Release(callback);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2005-04-11 16:11:52 +00:00
|
|
|
static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable,
|
|
|
|
IMoniker *pimkName, LPBC pibc, DWORD grfMode)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTMON_THIS(iface);
|
2006-06-02 22:39:39 +00:00
|
|
|
BSCallback *bscallback;
|
2005-08-11 18:36:48 +00:00
|
|
|
LPOLESTR url;
|
2005-08-01 10:59:45 +00:00
|
|
|
HRESULT hres;
|
|
|
|
nsresult nsres;
|
|
|
|
|
2005-08-25 15:19:19 +00:00
|
|
|
TRACE("(%p)->(%x %p %p %08lx)\n", This, fFullyAvailable, pimkName, pibc, grfMode);
|
2005-08-01 10:59:45 +00:00
|
|
|
|
2005-08-22 09:23:14 +00:00
|
|
|
if(pibc) {
|
|
|
|
IUnknown *unk = NULL;
|
|
|
|
|
|
|
|
/* FIXME:
|
|
|
|
* Use params:
|
|
|
|
* "__PrecreatedObject"
|
|
|
|
* "BIND_CONTEXT_PARAM"
|
|
|
|
* "__HTMLLOADOPTIONS"
|
|
|
|
* "__DWNBINDINFO"
|
|
|
|
* "URL Context"
|
|
|
|
* "CBinding Context"
|
|
|
|
* "_ITransData_Object_"
|
|
|
|
* "_EnumFORMATETC_"
|
|
|
|
*/
|
|
|
|
|
2006-02-10 14:14:14 +00:00
|
|
|
IBindCtx_GetObjectParam(pibc, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM, &unk);
|
2005-08-22 09:23:14 +00:00
|
|
|
if(unk) {
|
|
|
|
IOleClientSite *client = NULL;
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(unk, &IID_IOleClientSite, (void**)&client);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
TRACE("Got client site %p\n", client);
|
|
|
|
IOleObject_SetClientSite(OLEOBJ(This), client);
|
|
|
|
IOleClientSite_Release(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
}
|
|
|
|
}
|
2005-08-25 15:19:19 +00:00
|
|
|
|
|
|
|
HTMLDocument_LockContainer(This, TRUE);
|
2005-08-22 09:23:14 +00:00
|
|
|
|
2005-08-11 18:36:48 +00:00
|
|
|
hres = IMoniker_GetDisplayName(pimkName, pibc, NULL, &url);
|
|
|
|
if(FAILED(hres)) {
|
|
|
|
WARN("GetDiaplayName failed: %08lx\n", hres);
|
|
|
|
return hres;
|
|
|
|
}
|
2005-08-01 10:59:45 +00:00
|
|
|
|
2005-08-11 18:36:48 +00:00
|
|
|
TRACE("got url: %s\n", debugstr_w(url));
|
|
|
|
|
2005-08-25 15:19:19 +00:00
|
|
|
if(This->client) {
|
|
|
|
IOleCommandTarget *cmdtrg = NULL;
|
|
|
|
|
|
|
|
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
|
|
|
|
(void**)&cmdtrg);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
VARIANT var;
|
|
|
|
|
|
|
|
V_VT(&var) = VT_I4;
|
|
|
|
V_I4(&var) = 0;
|
|
|
|
IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-06-02 22:39:39 +00:00
|
|
|
bscallback = create_bscallback(This, url);
|
|
|
|
|
2006-06-02 22:33:48 +00:00
|
|
|
if(This->nscontainer) {
|
2006-02-24 19:29:37 +00:00
|
|
|
nsIInputStream *post_data_stream = get_post_data_stream(pibc);
|
2006-02-15 10:52:33 +00:00
|
|
|
|
2006-06-02 22:39:39 +00:00
|
|
|
This->nscontainer->bscallback = bscallback;
|
2005-08-10 09:54:02 +00:00
|
|
|
nsres = nsIWebNavigation_LoadURI(This->nscontainer->navigation, url,
|
2006-02-15 10:52:33 +00:00
|
|
|
LOAD_FLAGS_NONE, NULL, post_data_stream, NULL);
|
2006-06-02 22:39:39 +00:00
|
|
|
This->nscontainer->bscallback = NULL;
|
2006-02-09 11:19:33 +00:00
|
|
|
|
2006-02-15 10:52:33 +00:00
|
|
|
if(post_data_stream)
|
|
|
|
nsIInputStream_Release(post_data_stream);
|
|
|
|
|
2006-06-02 22:41:48 +00:00
|
|
|
if(!bscallback->nschannel)
|
|
|
|
ERR("bscallback->nschannel == NULL\n");
|
|
|
|
|
2006-02-15 10:52:33 +00:00
|
|
|
if(NS_SUCCEEDED(nsres)) {
|
2006-06-02 22:41:48 +00:00
|
|
|
/* FIXME: don't return here (URL Moniker needs to be good enough) */
|
|
|
|
|
2006-06-02 22:39:39 +00:00
|
|
|
IBindStatusCallback_Release(STATUSCLB(bscallback));
|
2006-02-15 10:52:33 +00:00
|
|
|
CoTaskMemFree(url);
|
2005-08-09 20:46:05 +00:00
|
|
|
return S_OK;
|
2006-02-15 10:52:33 +00:00
|
|
|
}else {
|
2005-08-10 09:54:02 +00:00
|
|
|
WARN("LoadURI failed: %08lx\n", nsres);
|
2006-02-15 10:52:33 +00:00
|
|
|
}
|
2006-06-02 22:39:39 +00:00
|
|
|
}
|
2005-08-09 20:46:05 +00:00
|
|
|
|
|
|
|
/* FIXME: Use grfMode */
|
|
|
|
|
|
|
|
if(fFullyAvailable)
|
|
|
|
FIXME("not supported fFullyAvailable\n");
|
2006-06-02 22:33:48 +00:00
|
|
|
if(pibc)
|
|
|
|
FIXME("not supported pibc\n");
|
2005-08-09 20:46:05 +00:00
|
|
|
|
2006-06-02 22:41:48 +00:00
|
|
|
hres = start_binding(bscallback, pimkName);
|
|
|
|
|
2006-06-02 22:39:39 +00:00
|
|
|
IBindStatusCallback_Release(STATUSCLB(bscallback));
|
|
|
|
CoTaskMemFree(url);
|
|
|
|
|
2006-06-02 22:41:48 +00:00
|
|
|
return hres;
|
2005-04-11 16:11:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName,
|
|
|
|
LPBC pbc, BOOL fRemember)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTMON_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p %p %x)\n", This, pimkName, pbc, fRemember);
|
2005-04-11 16:11:52 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTMON_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p %p)\n", This, pimkName, pibc);
|
2005-04-11 16:11:52 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTMON_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, ppimkName);
|
2005-04-11 16:11:52 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2005-06-01 19:57:42 +00:00
|
|
|
static const IPersistMonikerVtbl PersistMonikerVtbl = {
|
2005-04-11 16:11:52 +00:00
|
|
|
PersistMoniker_QueryInterface,
|
|
|
|
PersistMoniker_AddRef,
|
|
|
|
PersistMoniker_Release,
|
|
|
|
PersistMoniker_GetClassID,
|
|
|
|
PersistMoniker_IsDirty,
|
|
|
|
PersistMoniker_Load,
|
|
|
|
PersistMoniker_Save,
|
|
|
|
PersistMoniker_SaveCompleted,
|
|
|
|
PersistMoniker_GetCurMoniker
|
|
|
|
};
|
|
|
|
|
|
|
|
/**********************************************************
|
|
|
|
* IMonikerProp implementation
|
|
|
|
*/
|
|
|
|
|
2005-08-09 20:46:05 +00:00
|
|
|
#define MONPROP_THIS(iface) DEFINE_THIS(HTMLDocument, MonikerProp, iface)
|
2005-04-11 16:11:52 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI MonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppvObject)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = MONPROP_THIS(iface);
|
2005-04-11 16:11:52 +00:00
|
|
|
return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI MonikerProp_AddRef(IMonikerProp *iface)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = MONPROP_THIS(iface);
|
2005-04-11 16:11:52 +00:00
|
|
|
return IHTMLDocument2_AddRef(HTMLDOC(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI MonikerProp_Release(IMonikerProp *iface)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = MONPROP_THIS(iface);
|
2005-04-11 16:11:52 +00:00
|
|
|
return IHTMLDocument_Release(HTMLDOC(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = MONPROP_THIS(iface);
|
|
|
|
FIXME("(%p)->(%d %s)\n", This, mkp, debugstr_w(val));
|
2005-04-11 16:11:52 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2005-06-01 19:57:42 +00:00
|
|
|
static const IMonikerPropVtbl MonikerPropVtbl = {
|
2005-04-11 16:11:52 +00:00
|
|
|
MonikerProp_QueryInterface,
|
|
|
|
MonikerProp_AddRef,
|
|
|
|
MonikerProp_Release,
|
|
|
|
MonikerProp_PutProperty
|
|
|
|
};
|
|
|
|
|
|
|
|
/**********************************************************
|
|
|
|
* IPersistFile implementation
|
|
|
|
*/
|
|
|
|
|
2005-08-09 20:46:05 +00:00
|
|
|
#define PERSISTFILE_THIS(iface) DEFINE_THIS(HTMLDocument, PersistFile, iface)
|
2005-04-11 16:11:52 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppvObject)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTFILE_THIS(iface);
|
2005-04-11 16:11:52 +00:00
|
|
|
return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistFile_AddRef(IPersistFile *iface)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTFILE_THIS(iface);
|
2005-04-11 16:11:52 +00:00
|
|
|
return IHTMLDocument2_AddRef(HTMLDOC(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistFile_Release(IPersistFile *iface)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTFILE_THIS(iface);
|
2005-04-11 16:11:52 +00:00
|
|
|
return IHTMLDocument2_Release(HTMLDOC(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTFILE_THIS(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pClassID);
|
2005-04-11 16:11:52 +00:00
|
|
|
|
|
|
|
if(!pClassID)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
memcpy(pClassID, &CLSID_HTMLDocument, sizeof(CLSID));
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *iface)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTFILE_THIS(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
2005-04-11 16:11:52 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTFILE_THIS(iface);
|
|
|
|
FIXME("(%p)->(%s %08lx)\n", This, debugstr_w(pszFileName), dwMode);
|
2005-04-11 16:11:52 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTFILE_THIS(iface);
|
|
|
|
FIXME("(%p)->(%s %x)\n", This, debugstr_w(pszFileName), fRemember);
|
2005-04-11 16:11:52 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTFILE_THIS(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(pszFileName));
|
2005-04-11 16:11:52 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName)
|
|
|
|
{
|
2005-08-09 20:46:05 +00:00
|
|
|
HTMLDocument *This = PERSISTFILE_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pszFileName);
|
2005-04-11 16:11:52 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2005-06-01 19:57:42 +00:00
|
|
|
static const IPersistFileVtbl PersistFileVtbl = {
|
2005-04-11 16:11:52 +00:00
|
|
|
PersistFile_QueryInterface,
|
|
|
|
PersistFile_AddRef,
|
|
|
|
PersistFile_Release,
|
|
|
|
PersistFile_GetClassID,
|
|
|
|
PersistFile_IsDirty,
|
|
|
|
PersistFile_Load,
|
|
|
|
PersistFile_Save,
|
|
|
|
PersistFile_SaveCompleted,
|
|
|
|
PersistFile_GetCurFile
|
|
|
|
};
|
|
|
|
|
2006-05-23 20:16:26 +00:00
|
|
|
#define PERSTRINIT_THIS(iface) DEFINE_THIS(HTMLDocument, PersistStreamInit, iface);
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = PERSTRINIT_THIS(iface);
|
|
|
|
return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = PERSTRINIT_THIS(iface);
|
|
|
|
return IHTMLDocument2_AddRef(HTMLDOC(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = PERSTRINIT_THIS(iface);
|
|
|
|
return IHTMLDocument2_AddRef(HTMLDOC(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = PERSTRINIT_THIS(iface);
|
|
|
|
return IPersist_GetClassID(PERSIST(This), pClassID);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = PERSTRINIT_THIS(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStm)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = PERSTRINIT_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pStm);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,
|
|
|
|
BOOL fClearDirty)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = PERSTRINIT_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p %x)\n", This, pStm, fClearDirty);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface,
|
|
|
|
ULARGE_INTEGER *pcbSize)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = PERSTRINIT_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pcbSize);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = PERSTRINIT_THIS(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef PERSTRINIT_THIS
|
|
|
|
|
|
|
|
static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
|
|
|
|
PersistStreamInit_QueryInterface,
|
|
|
|
PersistStreamInit_AddRef,
|
|
|
|
PersistStreamInit_Release,
|
|
|
|
PersistStreamInit_GetClassID,
|
|
|
|
PersistStreamInit_IsDirty,
|
|
|
|
PersistStreamInit_Load,
|
|
|
|
PersistStreamInit_Save,
|
|
|
|
PersistStreamInit_GetSizeMax,
|
|
|
|
PersistStreamInit_InitNew
|
|
|
|
};
|
|
|
|
|
2005-04-11 16:11:52 +00:00
|
|
|
void HTMLDocument_Persist_Init(HTMLDocument *This)
|
|
|
|
{
|
|
|
|
This->lpPersistMonikerVtbl = &PersistMonikerVtbl;
|
|
|
|
This->lpPersistFileVtbl = &PersistFileVtbl;
|
|
|
|
This->lpMonikerPropVtbl = &MonikerPropVtbl;
|
2006-05-23 20:16:26 +00:00
|
|
|
This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;
|
2005-04-11 16:11:52 +00:00
|
|
|
}
|