2006-04-28 19:57:28 +02: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 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2006-04-28 19:57:28 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2011-01-03 01:08:23 +01:00
|
|
|
static inline HTMLTextContainer *impl_from_IHTMLTextContainer(IHTMLTextContainer *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLTextContainer, IHTMLTextContainer_iface);
|
|
|
|
}
|
2006-04-28 19:57:28 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_QueryInterface(IHTMLTextContainer *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2010-12-30 01:24:59 +01:00
|
|
|
return IHTMLElement_QueryInterface(&This->element.IHTMLElement_iface, riid, ppv);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTextContainer_AddRef(IHTMLTextContainer *iface)
|
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2010-12-30 01:24:59 +01:00
|
|
|
return IHTMLElement_AddRef(&This->element.IHTMLElement_iface);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTextContainer_Release(IHTMLTextContainer *iface)
|
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2010-12-30 01:24:59 +01:00
|
|
|
return IHTMLElement_Release(&This->element.IHTMLElement_iface);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_GetTypeInfoCount(IHTMLTextContainer *iface, UINT *pctinfo)
|
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_GetTypeInfo(IHTMLTextContainer *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
|
|
|
|
ppTInfo);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_GetIDsOfNames(IHTMLTextContainer *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
|
|
|
|
cNames, lcid, rgDispId);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_Invoke(IHTMLTextContainer *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_createControlRange(IHTMLTextContainer *iface,
|
|
|
|
IDispatch **range)
|
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2006-04-28 19:57:28 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, range);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:18 +01:00
|
|
|
static HRESULT WINAPI HTMLTextContainer_get_scrollHeight(IHTMLTextContainer *iface, LONG *p)
|
2006-04-28 19:57:28 +02:00
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2007-08-17 02:39:19 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2010-12-30 01:27:28 +01:00
|
|
|
return IHTMLElement2_get_scrollHeight(&This->element.IHTMLElement2_iface, p);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:18 +01:00
|
|
|
static HRESULT WINAPI HTMLTextContainer_get_scrollWidth(IHTMLTextContainer *iface, LONG *p)
|
2006-04-28 19:57:28 +02:00
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2007-08-17 02:39:19 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2010-12-30 01:27:28 +01:00
|
|
|
return IHTMLElement2_get_scrollWidth(&This->element.IHTMLElement2_iface, p);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:18 +01:00
|
|
|
static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface, LONG v)
|
2006-04-28 19:57:28 +02:00
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2006-08-01 14:50:52 +02:00
|
|
|
|
2009-03-12 01:43:18 +01:00
|
|
|
TRACE("(%p)->(%d)\n", This, v);
|
2006-08-01 14:50:52 +02:00
|
|
|
|
2010-12-30 01:27:28 +01:00
|
|
|
return IHTMLElement2_put_scrollTop(&This->element.IHTMLElement2_iface, v);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:18 +01:00
|
|
|
static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface, LONG *p)
|
2006-04-28 19:57:28 +02:00
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2008-07-28 22:02:45 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2010-12-30 01:27:28 +01:00
|
|
|
return IHTMLElement2_get_scrollTop(&This->element.IHTMLElement2_iface, p);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:18 +01:00
|
|
|
static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface, LONG v)
|
2006-04-28 19:57:28 +02:00
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2006-08-01 14:50:52 +02:00
|
|
|
|
2009-03-12 01:43:18 +01:00
|
|
|
TRACE("(%p)->(%d)\n", This, v);
|
2006-08-01 14:50:52 +02:00
|
|
|
|
2010-12-30 01:27:28 +01:00
|
|
|
return IHTMLElement2_put_scrollLeft(&This->element.IHTMLElement2_iface, v);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:18 +01:00
|
|
|
static HRESULT WINAPI HTMLTextContainer_get_scrollLeft(IHTMLTextContainer *iface, LONG *p)
|
2006-04-28 19:57:28 +02:00
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2008-09-10 12:51:29 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2010-12-30 01:27:28 +01:00
|
|
|
return IHTMLElement2_get_scrollLeft(&This->element.IHTMLElement2_iface, p);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_put_onscroll(IHTMLTextContainer *iface, VARIANT v)
|
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2006-04-28 19:57:28 +02:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_get_onscroll(IHTMLTextContainer *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
2006-04-28 19:57:28 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = {
|
|
|
|
HTMLTextContainer_QueryInterface,
|
|
|
|
HTMLTextContainer_AddRef,
|
|
|
|
HTMLTextContainer_Release,
|
|
|
|
HTMLTextContainer_GetTypeInfoCount,
|
|
|
|
HTMLTextContainer_GetTypeInfo,
|
|
|
|
HTMLTextContainer_GetIDsOfNames,
|
|
|
|
HTMLTextContainer_Invoke,
|
|
|
|
HTMLTextContainer_createControlRange,
|
|
|
|
HTMLTextContainer_get_scrollHeight,
|
|
|
|
HTMLTextContainer_get_scrollWidth,
|
|
|
|
HTMLTextContainer_put_scrollTop,
|
|
|
|
HTMLTextContainer_get_scrollTop,
|
|
|
|
HTMLTextContainer_put_scrollLeft,
|
|
|
|
HTMLTextContainer_get_scrollLeft,
|
|
|
|
HTMLTextContainer_put_onscroll,
|
|
|
|
HTMLTextContainer_get_onscroll
|
|
|
|
};
|
|
|
|
|
2009-11-01 19:16:48 +01:00
|
|
|
void HTMLTextContainer_Init(HTMLTextContainer *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem,
|
|
|
|
dispex_static_data_t *dispex_data)
|
2006-04-28 19:57:28 +02:00
|
|
|
{
|
2011-01-03 01:08:23 +01:00
|
|
|
This->IHTMLTextContainer_iface.lpVtbl = &HTMLTextContainerVtbl;
|
2007-12-04 13:38:31 +01:00
|
|
|
|
2009-11-01 19:16:48 +01:00
|
|
|
HTMLElement_Init(&This->element, doc, nselem, dispex_data);
|
2009-10-02 13:50:48 +02:00
|
|
|
|
2009-11-23 19:28:43 +01:00
|
|
|
ConnectionPoint_Init(&This->cp, &This->element.cp_container, &DIID_HTMLTextContainerEvents, NULL);
|
2006-04-28 19:57:28 +02:00
|
|
|
}
|