2006-03-08 23:20:19 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2006 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* 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
|
2006-03-08 23:20:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "winnls.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
|
|
|
typedef struct {
|
2007-09-15 14:05:34 +00:00
|
|
|
HTMLElement element;
|
|
|
|
|
2006-03-08 23:20:19 +00:00
|
|
|
const IHTMLBodyElementVtbl *lpHTMLBodyElementVtbl;
|
|
|
|
|
2006-04-28 17:57:28 +00:00
|
|
|
HTMLTextContainer text_container;
|
|
|
|
|
2007-06-29 00:50:39 +00:00
|
|
|
ConnectionPointContainer cp_container;
|
2007-06-29 00:58:42 +00:00
|
|
|
ConnectionPoint cp_propnotif;
|
|
|
|
ConnectionPoint cp_txtcontevents;
|
2007-06-29 00:50:39 +00:00
|
|
|
|
2006-03-08 23:20:19 +00:00
|
|
|
nsIDOMHTMLBodyElement *nsbody;
|
|
|
|
} HTMLBodyElement;
|
|
|
|
|
|
|
|
#define HTMLBODY(x) ((IHTMLBodyElement*) &(x)->lpHTMLBodyElementVtbl)
|
|
|
|
|
|
|
|
#define HTMLBODY_THIS(iface) DEFINE_THIS(HTMLBodyElement, HTMLBodyElement, iface)
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_QueryInterface(IHTMLBodyElement *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2006-03-18 18:43:05 +00:00
|
|
|
HRESULT hres;
|
2006-03-08 23:20:19 +00:00
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
|
|
|
*ppv = HTMLBODY(This);
|
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
|
|
|
*ppv = HTMLBODY(This);
|
|
|
|
}else if(IsEqualGUID(&IID_IHTMLBodyElement, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLBodyElement %p)\n", This, ppv);
|
|
|
|
*ppv = HTMLBODY(This);
|
2006-04-28 17:57:28 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLTextContainer, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLTextContainer %p)\n", This, ppv);
|
|
|
|
*ppv = HTMLTEXTCONT(&This->text_container);
|
2007-06-29 00:50:39 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
|
|
|
|
*ppv = CONPTCONT(&This->cp_container);
|
2006-03-08 23:20:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(*ppv) {
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2007-09-15 14:05:34 +00:00
|
|
|
hres = HTMLElement_QI(&This->element, riid, ppv);
|
2006-03-18 18:43:05 +00:00
|
|
|
if(FAILED(hres))
|
|
|
|
WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
return hres;
|
2006-03-08 23:20:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLBodyElement_AddRef(IHTMLBodyElement *iface)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2007-09-15 14:05:34 +00:00
|
|
|
return IHTMLDocument2_AddRef(HTMLDOC(This->element.node.doc));
|
2006-03-08 23:20:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLBodyElement_Release(IHTMLBodyElement *iface)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2007-09-15 14:05:34 +00:00
|
|
|
return IHTMLDocument2_Release(HTMLDOC(This->element.node.doc));
|
2006-03-08 23:20:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_GetTypeInfoCount(IHTMLBodyElement *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_GetTypeInfo(IHTMLBodyElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2006-10-05 21:50:39 +00:00
|
|
|
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_GetIDsOfNames(IHTMLBodyElement *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2006-10-05 21:50:39 +00:00
|
|
|
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
2006-03-08 23:20:19 +00:00
|
|
|
lcid, rgDispId);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_Invoke(IHTMLBodyElement *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2006-10-05 21:50:39 +00:00
|
|
|
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
2006-03-08 23:20:19 +00:00
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_background(IHTMLBodyElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_background(IHTMLBodyElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:22:51 +00:00
|
|
|
nsAString background_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&background_str, NULL);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLBodyElement_GetBackground(This->nsbody, &background_str);
|
|
|
|
if(NS_SUCCEEDED(nsres)) {
|
|
|
|
const PRUnichar *background;
|
|
|
|
nsAString_GetData(&background_str, &background, NULL);
|
|
|
|
*p = SysAllocString(background);
|
|
|
|
}else {
|
|
|
|
ERR("GetBackground failed: %08x\n", nsres);
|
|
|
|
*p = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_Finish(&background_str);
|
|
|
|
|
|
|
|
TRACE("*p = %s\n", debugstr_w(*p));
|
|
|
|
return S_OK;
|
2006-03-08 23:20:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_bgProperties(IHTMLBodyElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_bgProperties(IHTMLBodyElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_leftMargin(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_leftMargin(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_topMargin(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_topMargin(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_rightMargin(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_rightMargin(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_bottomMargin(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_bottomMargin(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_noWrap(IHTMLBodyElement *iface, VARIANT_BOOL v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%x)\n", This, v);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_noWrap(IHTMLBodyElement *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_bgColor(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_bgColor(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_text(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_text(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_link(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_link(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_vLink(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_vLink(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_aLink(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_aLink(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_onload(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_onload(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_onunload(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_onunload(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_onselect(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_onselect(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_onbeforeunload(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->()\n", This);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_onbeforeunload(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-04-12 19:21:49 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-08 23:20:19 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, IHTMLTxtRange **range)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
2007-05-09 23:13:13 +00:00
|
|
|
nsIDOMRange *nsrange = NULL;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, range);
|
|
|
|
|
2007-09-15 14:05:34 +00:00
|
|
|
if(This->element.node.doc->nscontainer) {
|
2007-05-09 23:13:13 +00:00
|
|
|
nsIDOMDocument *nsdoc;
|
|
|
|
nsIDOMDocumentRange *nsdocrange;
|
|
|
|
nsresult nsres;
|
|
|
|
|
2007-09-15 14:05:34 +00:00
|
|
|
nsIWebNavigation_GetDocument(This->element.node.doc->nscontainer->navigation, &nsdoc);
|
2007-05-09 23:13:13 +00:00
|
|
|
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentRange, (void**)&nsdocrange);
|
|
|
|
nsIDOMDocument_Release(nsdoc);
|
|
|
|
|
|
|
|
nsres = nsIDOMDocumentRange_CreateRange(nsdocrange, &nsrange);
|
|
|
|
if(NS_SUCCEEDED(nsres)) {
|
2007-09-15 14:05:34 +00:00
|
|
|
nsres = nsIDOMRange_SelectNodeContents(nsrange, This->element.node.nsnode);
|
2007-05-09 23:13:13 +00:00
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("SelectNodeContents failed: %08x\n", nsres);
|
|
|
|
}else {
|
|
|
|
ERR("CreateRange failed: %08x\n", nsres);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIDOMDocumentRange_Release(nsdocrange);
|
|
|
|
}
|
|
|
|
|
2007-09-15 14:05:34 +00:00
|
|
|
*range = HTMLTxtRange_Create(This->element.node.doc, nsrange);
|
2007-05-09 23:13:13 +00:00
|
|
|
return S_OK;
|
2006-03-08 23:20:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLBodyElement_destructor(IUnknown *iface)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
|
|
|
|
2007-06-29 00:50:39 +00:00
|
|
|
ConnectionPointContainer_Destroy(&This->cp_container);
|
2006-03-08 23:20:19 +00:00
|
|
|
nsIDOMHTMLBodyElement_Release(This->nsbody);
|
2006-07-17 19:21:21 +00:00
|
|
|
mshtml_free(This);
|
2006-03-08 23:20:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = {
|
|
|
|
HTMLBodyElement_QueryInterface,
|
|
|
|
HTMLBodyElement_AddRef,
|
|
|
|
HTMLBodyElement_Release,
|
|
|
|
HTMLBodyElement_GetTypeInfoCount,
|
|
|
|
HTMLBodyElement_GetTypeInfo,
|
|
|
|
HTMLBodyElement_GetIDsOfNames,
|
|
|
|
HTMLBodyElement_Invoke,
|
|
|
|
HTMLBodyElement_put_background,
|
|
|
|
HTMLBodyElement_get_background,
|
|
|
|
HTMLBodyElement_put_bgProperties,
|
|
|
|
HTMLBodyElement_get_bgProperties,
|
|
|
|
HTMLBodyElement_put_leftMargin,
|
|
|
|
HTMLBodyElement_get_leftMargin,
|
|
|
|
HTMLBodyElement_put_topMargin,
|
|
|
|
HTMLBodyElement_get_topMargin,
|
|
|
|
HTMLBodyElement_put_rightMargin,
|
|
|
|
HTMLBodyElement_get_rightMargin,
|
|
|
|
HTMLBodyElement_put_bottomMargin,
|
|
|
|
HTMLBodyElement_get_bottomMargin,
|
|
|
|
HTMLBodyElement_put_noWrap,
|
|
|
|
HTMLBodyElement_get_noWrap,
|
|
|
|
HTMLBodyElement_put_bgColor,
|
|
|
|
HTMLBodyElement_get_bgColor,
|
|
|
|
HTMLBodyElement_put_text,
|
|
|
|
HTMLBodyElement_get_text,
|
|
|
|
HTMLBodyElement_put_link,
|
|
|
|
HTMLBodyElement_get_link,
|
|
|
|
HTMLBodyElement_put_vLink,
|
|
|
|
HTMLBodyElement_get_vLink,
|
|
|
|
HTMLBodyElement_put_aLink,
|
|
|
|
HTMLBodyElement_get_aLink,
|
|
|
|
HTMLBodyElement_put_onload,
|
|
|
|
HTMLBodyElement_get_onload,
|
|
|
|
HTMLBodyElement_put_onunload,
|
|
|
|
HTMLBodyElement_get_onunload,
|
|
|
|
HTMLBodyElement_put_scroll,
|
|
|
|
HTMLBodyElement_get_scroll,
|
|
|
|
HTMLBodyElement_put_onselect,
|
|
|
|
HTMLBodyElement_get_onselect,
|
|
|
|
HTMLBodyElement_put_onbeforeunload,
|
|
|
|
HTMLBodyElement_get_onbeforeunload,
|
|
|
|
HTMLBodyElement_createTextRange
|
|
|
|
};
|
|
|
|
|
2007-09-15 14:05:34 +00:00
|
|
|
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
|
2006-03-08 23:20:19 +00:00
|
|
|
{
|
2006-07-17 19:21:21 +00:00
|
|
|
HTMLBodyElement *ret = mshtml_alloc(sizeof(HTMLBodyElement));
|
2006-03-08 23:20:19 +00:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl;
|
|
|
|
|
2007-09-15 14:05:34 +00:00
|
|
|
HTMLTextContainer_Init(&ret->text_container, &ret->element);
|
2006-04-28 17:57:28 +00:00
|
|
|
|
2007-06-29 00:58:42 +00:00
|
|
|
ConnectionPoint_Init(&ret->cp_propnotif, CONPTCONT(&ret->cp_container),
|
|
|
|
&IID_IPropertyNotifySink, NULL);
|
|
|
|
ConnectionPoint_Init(&ret->cp_txtcontevents, CONPTCONT(&ret->cp_container),
|
|
|
|
&DIID_HTMLTextContainerEvents, &ret->cp_propnotif);
|
|
|
|
ConnectionPointContainer_Init(&ret->cp_container, &ret->cp_propnotif, (IUnknown*)HTMLBODY(ret));
|
2007-06-29 00:50:39 +00:00
|
|
|
|
2007-09-15 14:05:34 +00:00
|
|
|
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLBodyElement,
|
2006-03-08 23:20:19 +00:00
|
|
|
(void**)&ret->nsbody);
|
|
|
|
if(NS_FAILED(nsres))
|
2006-10-05 21:50:39 +00:00
|
|
|
ERR("Could not get nsDOMHTMLBodyElement: %08x\n", nsres);
|
2006-03-08 23:20:19 +00:00
|
|
|
|
2007-09-15 14:05:34 +00:00
|
|
|
ret->element.impl = (IUnknown*)HTMLBODY(ret);
|
|
|
|
ret->element.destructor = HTMLBodyElement_destructor;
|
|
|
|
|
|
|
|
return &ret->element;
|
2006-03-08 23:20:19 +00:00
|
|
|
}
|