mshtml: Added IHTMLButtonElement stub implementation.

This commit is contained in:
Jacek Caban 2013-03-14 17:52:34 +01:00 committed by Alexandre Julliard
parent 532de89170
commit 78b579dff2
4 changed files with 247 additions and 2 deletions

View file

@ -38,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static const WCHAR aW[] = {'A',0};
static const WCHAR bodyW[] = {'B','O','D','Y',0};
static const WCHAR buttonW[] = {'B','U','T','T','O','N',0};
static const WCHAR embedW[] = {'E','M','B','E','D',0};
static const WCHAR formW[] = {'F','O','R','M',0};
static const WCHAR frameW[] = {'F','R','A','M','E',0};
@ -67,6 +68,7 @@ typedef struct {
static const tag_desc_t tag_descs[] = {
{aW, HTMLAnchorElement_Create},
{bodyW, HTMLBodyElement_Create},
{buttonW, HTMLButtonElement_Create},
{embedW, HTMLEmbedElement_Create},
{formW, HTMLFormElement_Create},
{frameW, HTMLFrameElement_Create},

View file

@ -1410,3 +1410,232 @@ HRESULT HTMLLabelElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem
*elem = &ret->element;
return S_OK;
}
typedef struct {
HTMLElement element;
IHTMLButtonElement IHTMLButtonElement_iface;
} HTMLButtonElement;
static inline HTMLButtonElement *impl_from_IHTMLButtonElement(IHTMLButtonElement *iface)
{
return CONTAINING_RECORD(iface, HTMLButtonElement, IHTMLButtonElement_iface);
}
static HRESULT WINAPI HTMLButtonElement_QueryInterface(IHTMLButtonElement *iface,
REFIID riid, void **ppv)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
}
static ULONG WINAPI HTMLButtonElement_AddRef(IHTMLButtonElement *iface)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
}
static ULONG WINAPI HTMLButtonElement_Release(IHTMLButtonElement *iface)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
}
static HRESULT WINAPI HTMLButtonElement_GetTypeInfoCount(IHTMLButtonElement *iface, UINT *pctinfo)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
}
static HRESULT WINAPI HTMLButtonElement_GetTypeInfo(IHTMLButtonElement *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
}
static HRESULT WINAPI HTMLButtonElement_GetIDsOfNames(IHTMLButtonElement *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
cNames, lcid, rgDispId);
}
static HRESULT WINAPI HTMLButtonElement_Invoke(IHTMLButtonElement *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLButtonElement_get_type(IHTMLButtonElement *iface, BSTR *p)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLButtonElement_put_value(IHTMLButtonElement *iface, BSTR v)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLButtonElement_get_value(IHTMLButtonElement *iface, BSTR *p)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLButtonElement_put_name(IHTMLButtonElement *iface, BSTR v)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLButtonElement_get_name(IHTMLButtonElement *iface, BSTR *p)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLButtonElement_put_status(IHTMLButtonElement *iface, VARIANT v)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLButtonElement_get_status(IHTMLButtonElement *iface, VARIANT *p)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLButtonElement_put_disabled(IHTMLButtonElement *iface, VARIANT_BOOL v)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLButtonElement_get_disabled(IHTMLButtonElement *iface, VARIANT_BOOL *p)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLButtonElement_get_form(IHTMLButtonElement *iface, IHTMLFormElement **p)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLButtonElement_createTextRange(IHTMLButtonElement *iface, IHTMLTxtRange **range)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
FIXME("(%p)->(%p)\n", This, range);
return E_NOTIMPL;
}
static const IHTMLButtonElementVtbl HTMLButtonElementVtbl = {
HTMLButtonElement_QueryInterface,
HTMLButtonElement_AddRef,
HTMLButtonElement_Release,
HTMLButtonElement_GetTypeInfoCount,
HTMLButtonElement_GetTypeInfo,
HTMLButtonElement_GetIDsOfNames,
HTMLButtonElement_Invoke,
HTMLButtonElement_get_type,
HTMLButtonElement_put_value,
HTMLButtonElement_get_value,
HTMLButtonElement_put_name,
HTMLButtonElement_get_name,
HTMLButtonElement_put_status,
HTMLButtonElement_get_status,
HTMLButtonElement_put_disabled,
HTMLButtonElement_get_disabled,
HTMLButtonElement_get_form,
HTMLButtonElement_createTextRange
};
static inline HTMLButtonElement *button_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLButtonElement, element.node);
}
static HRESULT HTMLButtonElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{
HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
*ppv = NULL;
if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
*ppv = &This->IHTMLButtonElement_iface;
}else if(IsEqualGUID(&IID_IHTMLButtonElement, riid)) {
TRACE("(%p)->(IID_IHTMLButtonElement %p)\n", This, ppv);
*ppv = &This->IHTMLButtonElement_iface;
}else {
return HTMLElement_QI(&This->element.node, riid, ppv);
}
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
static const NodeImplVtbl HTMLButtonElementImplVtbl = {
HTMLButtonElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
};
static const tid_t HTMLButtonElement_iface_tids[] = {
HTMLELEMENT_TIDS,
IHTMLButtonElement_tid,
0
};
static dispex_static_data_t HTMLButtonElement_dispex = {
NULL,
DispHTMLButtonElement_tid,
NULL,
HTMLButtonElement_iface_tids
};
HRESULT HTMLButtonElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
{
HTMLButtonElement *ret;
ERR("!!!\n");
ret = heap_alloc_zero(sizeof(*ret));
if(!ret)
return E_OUTOFMEMORY;
ret->IHTMLButtonElement_iface.lpVtbl = &HTMLButtonElementVtbl;
ret->element.node.vtbl = &HTMLButtonElementImplVtbl;
HTMLElement_Init(&ret->element, doc, nselem, &HTMLButtonElement_dispex);
*elem = &ret->element;
return S_OK;
}

View file

@ -77,6 +77,7 @@ typedef struct event_target_t event_target_t;
XDIID(DispHTMLAnchorElement) \
XDIID(DispHTMLAttributeCollection) \
XDIID(DispHTMLBody) \
XDIID(DispHTMLButtonElement) \
XDIID(DispHTMLCommentElement) \
XDIID(DispHTMLCurrentStyle) \
XDIID(DispHTMLDocument) \
@ -119,6 +120,7 @@ typedef struct event_target_t event_target_t;
XIID(IHTMLAttributeCollection3) \
XIID(IHTMLBodyElement) \
XIID(IHTMLBodyElement2) \
XIID(IHTMLButtonElement) \
XIID(IHTMLCommentElement) \
XIID(IHTMLCurrentStyle) \
XIID(IHTMLCurrentStyle2) \
@ -869,6 +871,7 @@ HRESULT HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLElement**) DEC
HRESULT HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLElement**) DECLSPEC_HIDDEN;
HRESULT HTMLAnchorElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
HRESULT HTMLBodyElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
HRESULT HTMLButtonElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
HRESULT HTMLEmbedElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
HRESULT HTMLFormElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
HRESULT HTMLFrameElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;

View file

@ -53,6 +53,7 @@ static const char elem_test_str[] =
"<a id=\"a\" href=\"http://test\" name=\"x\">link</a>"
"<label for=\"in\" id=\"labelid\">Label:</label>"
"<input id=\"in\" class=\"testclass\" tabIndex=\"2\" title=\"test title\" />"
"<button id=\"btnid\"></button>"
"<select id=\"s\"><option id=\"x\" value=\"val1\">opt1</option><option id=\"y\">opt2</option></select>"
"<textarea id=\"X\">text text</textarea>"
"<table id=\"tbl\"><tbody><tr></tr><tr id=\"row2\"><td>td1 text</td><td>td2 text</td></tr></tbody></table>"
@ -128,7 +129,8 @@ typedef enum {
ET_META,
ET_NOSCRIPT,
ET_LINK,
ET_LABEL
ET_LABEL,
ET_BUTTON
} elem_type_t;
static const IID * const none_iids[] = {
@ -207,6 +209,13 @@ static const IID * const input_iids[] = {
NULL
};
static const IID *const button_iids[] = {
ELEM_IFACES,
&IID_IHTMLButtonElement,
&IID_IConnectionPointContainer,
NULL
};
static const IID * const label_iids[] = {
ELEM_IFACES,
&IID_IHTMLLabelElement,
@ -457,7 +466,8 @@ static const elem_type_info_t elem_type_infos[] = {
{"META", meta_iids, &DIID_DispHTMLMetaElement},
{"NOSCRIPT", elem_iids, NULL /*&DIID_DispHTMLNoShowElement*/},
{"LINK", link_iids, &DIID_DispHTMLLinkElement},
{"LABEL", label_iids, &DIID_DispHTMLLabelElement}
{"LABEL", label_iids, &DIID_DispHTMLLabelElement},
{"BUTTON", button_iids, &DIID_DispHTMLButtonElement}
};
static const char *dbgstr_guid(REFIID riid)
@ -5768,6 +5778,7 @@ static void test_elems(IHTMLDocument2 *doc)
ET_A,
ET_LABEL,
ET_INPUT,
ET_BUTTON,
ET_SELECT,
ET_OPTION,
ET_OPTION,