mshtml: Added IDispatchEx support to HTMLStyleSheetsCollection object.

This commit is contained in:
Jacek Caban 2010-11-08 12:48:44 +01:00 committed by Alexandre Julliard
parent 00ee406ea6
commit 2da5890ea1
5 changed files with 51 additions and 10 deletions

View File

@ -109,6 +109,7 @@ static REFIID tid_ids[] = {
&DIID_DispHTMLScriptElement,
&DIID_DispHTMLSelectElement,
&DIID_DispHTMLStyle,
&DIID_DispHTMLStyleSheetsCollection,
&DIID_DispHTMLTable,
&DIID_DispHTMLTableRow,
&DIID_DispHTMLTextAreaElement,
@ -160,6 +161,7 @@ static REFIID tid_ids[] = {
&IID_IHTMLStyle2,
&IID_IHTMLStyle3,
&IID_IHTMLStyle4,
&IID_IHTMLStyleSheetsCollection,
&IID_IHTMLTable,
&IID_IHTMLTableRow,
&IID_IHTMLTextAreaElement,

View File

@ -41,6 +41,7 @@ struct HTMLStyleSheet {
};
struct HTMLStyleSheetsCollection {
DispatchEx dispex;
const IHTMLStyleSheetsCollectionVtbl *lpHTMLStyleSheetsCollectionVtbl;
LONG ref;
@ -222,6 +223,8 @@ static HRESULT WINAPI HTMLStyleSheetsCollection_QueryInterface(IHTMLStyleSheetsC
}else if(IsEqualGUID(&IID_IHTMLStyleSheetsCollection, riid)) {
TRACE("(%p)->(IID_IHTMLStyleSheetsCollection %p)\n", This, ppv);
*ppv = HTMLSTYLESHEETSCOL(This);
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
return *ppv ? S_OK : E_NOINTERFACE;
}
if(*ppv) {
@ -263,25 +266,21 @@ static HRESULT WINAPI HTMLStyleSheetsCollection_GetTypeInfoCount(IHTMLStyleSheet
UINT *pctinfo)
{
HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
FIXME("(%p)->(%p)\n", This, pctinfo);
return E_NOTIMPL;
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
}
static HRESULT WINAPI HTMLStyleSheetsCollection_GetTypeInfo(IHTMLStyleSheetsCollection *iface,
UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
{
HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
return E_NOTIMPL;
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
}
static HRESULT WINAPI HTMLStyleSheetsCollection_GetIDsOfNames(IHTMLStyleSheetsCollection *iface,
REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
lcid, rgDispId);
return E_NOTIMPL;
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
}
static HRESULT WINAPI HTMLStyleSheetsCollection_Invoke(IHTMLStyleSheetsCollection *iface,
@ -289,9 +288,8 @@ static HRESULT WINAPI HTMLStyleSheetsCollection_Invoke(IHTMLStyleSheetsCollectio
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
return E_NOTIMPL;
return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLStyleSheetsCollection_get_length(IHTMLStyleSheetsCollection *iface,
@ -370,6 +368,17 @@ static const IHTMLStyleSheetsCollectionVtbl HTMLStyleSheetsCollectionVtbl = {
HTMLStyleSheetsCollection_item
};
static const tid_t HTMLStyleSheetsCollection_iface_tids[] = {
IHTMLStyleSheetsCollection_tid,
0
};
static dispex_static_data_t HTMLStyleSheetsCollection_dispex = {
NULL,
DispHTMLStyleSheetsCollection_tid,
NULL,
HTMLStyleSheetsCollection_iface_tids
};
IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList *nslist)
{
HTMLStyleSheetsCollection *ret = heap_alloc(sizeof(HTMLStyleSheetsCollection));
@ -381,6 +390,8 @@ IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetLis
nsIDOMStyleSheetList_AddRef(nslist);
ret->nslist = nslist;
init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLESHEETSCOL(ret), &HTMLStyleSheetsCollection_dispex);
return HTMLSTYLESHEETSCOL(ret);
}

View File

@ -91,6 +91,7 @@ typedef enum {
DispHTMLScriptElement_tid,
DispHTMLSelectElement_tid,
DispHTMLStyle_tid,
DispHTMLStyleSheetsCollection_tid,
DispHTMLTable_tid,
DispHTMLTableRow_tid,
DispHTMLTextAreaElement_tid,
@ -142,6 +143,7 @@ typedef enum {
IHTMLStyle2_tid,
IHTMLStyle3_tid,
IHTMLStyle4_tid,
IHTMLStyleSheetsCollection_tid,
IHTMLTable_tid,
IHTMLTableRow_tid,
IHTMLTextAreaElement_tid,

View File

@ -5850,6 +5850,8 @@ static void test_stylesheets(IHTMLDocument2 *doc)
ok(hres == S_OK, "get_styleSheets failed: %08x\n", hres);
ok(col != NULL, "col == NULL\n");
test_disp2((IUnknown*)col, &DIID_DispHTMLStyleSheetsCollection, &IID_IHTMLStyleSheetsCollection, "[object]");
hres = IHTMLStyleSheetsCollection_get_length(col, &len);
ok(hres == S_OK, "get_length failed: %08x\n", hres);
ok(len == 1, "len=%d\n", len);

View File

@ -6174,6 +6174,30 @@ interface IHTMLStyleSheetsCollection : IDispatch
[retval, out] VARIANT *pvarResult);
}
/*****************************************************************************
* DispHTMLStyleSheetsCollection dispinterface
*/
[
hidden,
uuid(3050f547-98b5-11cf-bb82-00aa00bdce0b)
]
dispinterface DispHTMLStyleSheetsCollection
{
properties:
methods:
[propget, id(DISPID_IHTMLSTYLESHEETSCOLLECTION_LENGTH)]
long length();
[propget, id(DISPID_IHTMLSTYLESHEETSCOLLECTION__NEWENUM), hidden, restricted]
IUnknown *_newEnum();
[id(DISPID_IHTMLSTYLESHEETSCOLLECTION_ITEM)]
VARIANT item([in] VARIANT *pvarIndex);
[propget, id(DISPID_IHTMLDOMCONSTRUCTOR_CONSTRUCTOR), hidden]
IDispatch *constructor();
}
/*****************************************************************************
* IHTMLTxtRange interface
*/