Stub implementation od IPersist, IPersistMoniker, IPersistFile,
IMonikerProp.
This commit is contained in:
parent
d6fdac2676
commit
93eb433ec2
|
@ -9,7 +9,8 @@ EXTRADEFS = -DCOM_NO_WINDOWS_H
|
|||
|
||||
C_SRCS = \
|
||||
htmldoc.c \
|
||||
main.c
|
||||
main.c \
|
||||
persist.c
|
||||
|
||||
@MAKE_DLL_RULES@
|
||||
|
||||
|
|
|
@ -37,32 +37,37 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
typedef struct {
|
||||
IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl;
|
||||
ULONG ref;
|
||||
} HTMLDocument;
|
||||
|
||||
#define HTMLDOC(x) ((IHTMLDocument2*)&(x)->lpHTMLDocument2Vtbl)
|
||||
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID riid, void **ppvObject)
|
||||
{
|
||||
HTMLDocument *This = (HTMLDocument*)iface;
|
||||
|
||||
*ppvObject = NULL;
|
||||
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
||||
TRACE("(%p)->(IID_IUnknown, %s)\n", This, debugstr_guid(riid));
|
||||
TRACE("(%p)->(IID_IUnknown, %p)\n", This, ppvObject);
|
||||
*ppvObject = HTMLDOC(This);
|
||||
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
||||
TRACE("(%p)->(IID_IDispatch, %s)\n", This, debugstr_guid(riid));
|
||||
TRACE("(%p)->(IID_IDispatch, %p)\n", This, ppvObject);
|
||||
*ppvObject = HTMLDOC(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLDocument, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLDocument, %s)\n", This, debugstr_guid(riid));
|
||||
TRACE("(%p)->(IID_IHTMLDocument, %p)\n", This, ppvObject);
|
||||
*ppvObject = HTMLDOC(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLDocument2, riid)) {
|
||||
TRACE("(%p)->(IID_IDocument2, %s)\n", This, debugstr_guid(riid));
|
||||
TRACE("(%p)->(IID_IDocument2, %p)\n", This, ppvObject);
|
||||
*ppvObject = HTMLDOC(This);
|
||||
}else if(IsEqualGUID(&IID_IPersist, riid)) {
|
||||
TRACE("(%p)->(IID_IPersist, %p)\n", This, ppvObject);
|
||||
*ppvObject = PERSIST(This);
|
||||
}else if(IsEqualGUID(&IID_IPersistMoniker, riid)) {
|
||||
TRACE("(%p)->(IID_IPersistMoniker, %p)\n", This, ppvObject);
|
||||
*ppvObject = PERSISTMON(This);
|
||||
}else if(IsEqualGUID(&IID_IPersistFile, riid)) {
|
||||
TRACE("(%p)->(IID_IPersistFile, %p)\n", This, ppvObject);
|
||||
*ppvObject = PERSISTFILE(This);
|
||||
}else if(IsEqualGUID(&IID_IMonikerProp, riid)) {
|
||||
TRACE("(%p)->(IID_IMonikerProp, %p)\n", This, ppvObject);
|
||||
*ppvObject = MONPROP(This);
|
||||
}
|
||||
|
||||
if(*ppvObject) {
|
||||
IHTMLDocument2_AddRef(iface);
|
||||
return S_OK;
|
||||
|
@ -925,5 +930,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
|
|||
if(FAILED(hres))
|
||||
HeapFree(GetProcessHeap(), 0, ret);
|
||||
|
||||
HTMLDocument_Persist_Init(ret);
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
|
|
@ -16,4 +16,21 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl;
|
||||
IPersistMonikerVtbl *lpPersistMonikerVtbl;
|
||||
IPersistFileVtbl *lpPersistFileVtbl;
|
||||
IMonikerPropVtbl *lpMonikerPropVtbl;
|
||||
|
||||
ULONG ref;
|
||||
} HTMLDocument;
|
||||
|
||||
#define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
|
||||
#define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
|
||||
#define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
|
||||
#define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
|
||||
#define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
|
||||
|
||||
HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
|
||||
|
||||
void HTMLDocument_Persist_Init(HTMLDocument*);
|
||||
|
|
|
@ -0,0 +1,236 @@
|
|||
/*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "mshtml.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
/**********************************************************
|
||||
* IPersistMoniker implementation
|
||||
*/
|
||||
|
||||
#define PERSISTMON_THIS \
|
||||
HTMLDocument* const This=(HTMLDocument*)((char*)(iface)-offsetof(HTMLDocument,lpPersistMonikerVtbl));
|
||||
|
||||
static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid,
|
||||
void **ppvObject)
|
||||
{
|
||||
PERSISTMON_THIS
|
||||
return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
|
||||
}
|
||||
|
||||
static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface)
|
||||
{
|
||||
PERSISTMON_THIS
|
||||
return IHTMLDocument2_AddRef(HTMLDOC(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface)
|
||||
{
|
||||
PERSISTMON_THIS
|
||||
return IHTMLDocument2_Release(HTMLDOC(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID)
|
||||
{
|
||||
PERSISTMON_THIS
|
||||
return IPersist_GetClassID(PERSIST(This), pClassID);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface)
|
||||
{
|
||||
FIXME("(%p)\n", iface);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable,
|
||||
IMoniker *pimkName, LPBC pibc, DWORD grfMode)
|
||||
{
|
||||
FIXME("(%p)->(%x %p %p %08lx)\n", iface, fFullyAvailable, pimkName, pibc, grfMode);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName,
|
||||
LPBC pbc, BOOL fRemember)
|
||||
{
|
||||
FIXME("(%p)->(%p %p %x)\n", iface, pimkName, pbc, fRemember);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
|
||||
{
|
||||
FIXME("(%p)->(%p %p)\n", iface, pimkName, pibc);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName)
|
||||
{
|
||||
FIXME("(%p)->(%p)\n", iface, ppimkName);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static IPersistMonikerVtbl PersistMonikerVtbl = {
|
||||
PersistMoniker_QueryInterface,
|
||||
PersistMoniker_AddRef,
|
||||
PersistMoniker_Release,
|
||||
PersistMoniker_GetClassID,
|
||||
PersistMoniker_IsDirty,
|
||||
PersistMoniker_Load,
|
||||
PersistMoniker_Save,
|
||||
PersistMoniker_SaveCompleted,
|
||||
PersistMoniker_GetCurMoniker
|
||||
};
|
||||
|
||||
/**********************************************************
|
||||
* IMonikerProp implementation
|
||||
*/
|
||||
|
||||
#define MONPROP_THIS \
|
||||
HTMLDocument* const This=(HTMLDocument*)((char*)(iface)-offsetof(HTMLDocument,lpMonikerPropVtbl));
|
||||
|
||||
static HRESULT WINAPI MonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppvObject)
|
||||
{
|
||||
MONPROP_THIS
|
||||
return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
|
||||
}
|
||||
|
||||
static ULONG WINAPI MonikerProp_AddRef(IMonikerProp *iface)
|
||||
{
|
||||
MONPROP_THIS
|
||||
return IHTMLDocument2_AddRef(HTMLDOC(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI MonikerProp_Release(IMonikerProp *iface)
|
||||
{
|
||||
MONPROP_THIS
|
||||
return IHTMLDocument_Release(HTMLDOC(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
|
||||
{
|
||||
FIXME("(%p)->(%d %s)\n", iface, mkp, debugstr_w(val));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static IMonikerPropVtbl MonikerPropVtbl = {
|
||||
MonikerProp_QueryInterface,
|
||||
MonikerProp_AddRef,
|
||||
MonikerProp_Release,
|
||||
MonikerProp_PutProperty
|
||||
};
|
||||
|
||||
/**********************************************************
|
||||
* IPersistFile implementation
|
||||
*/
|
||||
|
||||
#define PERSISTFILE_THIS \
|
||||
HTMLDocument* const This=(HTMLDocument*)((char*)(iface)-offsetof(HTMLDocument,lpPersistFileVtbl));
|
||||
|
||||
static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppvObject)
|
||||
{
|
||||
PERSISTFILE_THIS
|
||||
return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
|
||||
}
|
||||
|
||||
static ULONG WINAPI PersistFile_AddRef(IPersistFile *iface)
|
||||
{
|
||||
PERSISTFILE_THIS
|
||||
return IHTMLDocument2_AddRef(HTMLDOC(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI PersistFile_Release(IPersistFile *iface)
|
||||
{
|
||||
PERSISTFILE_THIS
|
||||
return IHTMLDocument2_Release(HTMLDOC(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID)
|
||||
{
|
||||
TRACE("(%p)->(%p)\n", iface, pClassID);
|
||||
|
||||
if(!pClassID)
|
||||
return E_INVALIDARG;
|
||||
|
||||
memcpy(pClassID, &CLSID_HTMLDocument, sizeof(CLSID));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *iface)
|
||||
{
|
||||
FIXME("(%p)\n", iface);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
|
||||
{
|
||||
FIXME("(%p)->(%s %08lx)\n", iface, debugstr_w(pszFileName), dwMode);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
|
||||
{
|
||||
FIXME("(%p)->(%s %x)\n", iface, debugstr_w(pszFileName), fRemember);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
|
||||
{
|
||||
FIXME("(%p)->(%s)\n", iface, debugstr_w(pszFileName));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName)
|
||||
{
|
||||
FIXME("(%p)->(%p)\n", iface, pszFileName);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static IPersistFileVtbl PersistFileVtbl = {
|
||||
PersistFile_QueryInterface,
|
||||
PersistFile_AddRef,
|
||||
PersistFile_Release,
|
||||
PersistFile_GetClassID,
|
||||
PersistFile_IsDirty,
|
||||
PersistFile_Load,
|
||||
PersistFile_Save,
|
||||
PersistFile_SaveCompleted,
|
||||
PersistFile_GetCurFile
|
||||
};
|
||||
|
||||
void HTMLDocument_Persist_Init(HTMLDocument *This)
|
||||
{
|
||||
This->lpPersistMonikerVtbl = &PersistMonikerVtbl;
|
||||
This->lpPersistFileVtbl = &PersistFileVtbl;
|
||||
This->lpMonikerPropVtbl = &MonikerPropVtbl;
|
||||
}
|
Loading…
Reference in New Issue