2 * Copyright 2011 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "mshtml_private.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 static inline HTMLDOMAttribute *impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute *iface)
37 return CONTAINING_RECORD(iface, HTMLDOMAttribute, IHTMLDOMAttribute_iface);
40 static HRESULT WINAPI HTMLDOMAttribute_QueryInterface(IHTMLDOMAttribute *iface,
41 REFIID riid, void **ppv)
43 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
45 if(IsEqualGUID(&IID_IUnknown, riid)) {
46 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
47 *ppv = &This->IHTMLDOMAttribute_iface;
48 }else if(IsEqualGUID(&IID_IHTMLDOMAttribute, riid)) {
49 TRACE("(%p)->(IID_IHTMLDOMAttribute %p)\n", This, ppv);
50 *ppv = &This->IHTMLDOMAttribute_iface;
52 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
57 IUnknown_AddRef((IUnknown*)*ppv);
61 static ULONG WINAPI HTMLDOMAttribute_AddRef(IHTMLDOMAttribute *iface)
63 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
64 LONG ref = InterlockedIncrement(&This->ref);
66 TRACE("(%p) ref=%d\n", This, ref);
71 static ULONG WINAPI HTMLDOMAttribute_Release(IHTMLDOMAttribute *iface)
73 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
74 LONG ref = InterlockedDecrement(&This->ref);
76 TRACE("(%p) ref=%d\n", This, ref);
79 nsIDOMAttr_Release(This->nsattr);
86 static HRESULT WINAPI HTMLDOMAttribute_GetTypeInfoCount(IHTMLDOMAttribute *iface, UINT *pctinfo)
88 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
93 static HRESULT WINAPI HTMLDOMAttribute_GetTypeInfo(IHTMLDOMAttribute *iface, UINT iTInfo,
94 LCID lcid, ITypeInfo **ppTInfo)
96 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
101 static HRESULT WINAPI HTMLDOMAttribute_GetIDsOfNames(IHTMLDOMAttribute *iface, REFIID riid,
102 LPOLESTR *rgszNames, UINT cNames,
103 LCID lcid, DISPID *rgDispId)
105 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
110 static HRESULT WINAPI HTMLDOMAttribute_Invoke(IHTMLDOMAttribute *iface, DISPID dispIdMember,
111 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
112 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
114 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
119 static HRESULT WINAPI HTMLDOMAttribute_get_nodeName(IHTMLDOMAttribute *iface, BSTR *p)
121 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
122 FIXME("(%p)->(%p)\n", This, p);
126 static HRESULT WINAPI HTMLDOMAttribute_put_nodeName(IHTMLDOMAttribute *iface, VARIANT v)
128 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
129 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
133 static HRESULT WINAPI HTMLDOMAttribute_get_nodeValue(IHTMLDOMAttribute *iface, VARIANT *p)
135 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
136 FIXME("(%p)->(%p)\n", This, p);
140 static HRESULT WINAPI HTMLDOMAttribute_get_specified(IHTMLDOMAttribute *iface, VARIANT_BOOL *p)
142 HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
143 FIXME("(%p)->(%p)\n", This, p);
147 static const IHTMLDOMAttributeVtbl HTMLDOMAttributeVtbl = {
148 HTMLDOMAttribute_QueryInterface,
149 HTMLDOMAttribute_AddRef,
150 HTMLDOMAttribute_Release,
151 HTMLDOMAttribute_GetTypeInfoCount,
152 HTMLDOMAttribute_GetTypeInfo,
153 HTMLDOMAttribute_GetIDsOfNames,
154 HTMLDOMAttribute_Invoke,
155 HTMLDOMAttribute_get_nodeName,
156 HTMLDOMAttribute_put_nodeName,
157 HTMLDOMAttribute_get_nodeValue,
158 HTMLDOMAttribute_get_specified
161 HRESULT HTMLDOMAttribute_Create(HTMLDocumentNode *doc, nsIDOMAttr *nsattr, HTMLDOMAttribute **attr)
163 HTMLDOMAttribute *ret;
165 ret = heap_alloc_zero(sizeof(*ret));
167 return E_OUTOFMEMORY;
169 ret->IHTMLDOMAttribute_iface.lpVtbl = &HTMLDOMAttributeVtbl;
172 nsIDOMAttr_AddRef(nsattr);
173 ret->nsattr = nsattr;