2 * Copyright 2008 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 struct HTMLCommentElement
{
37 IHTMLCommentElement IHTMLCommentElement_iface
;
40 static inline HTMLCommentElement
*impl_from_IHTMLCommentElement(IHTMLCommentElement
*iface
)
42 return CONTAINING_RECORD(iface
, HTMLCommentElement
, IHTMLCommentElement_iface
);
45 static HRESULT WINAPI
HTMLCommentElement_QueryInterface(IHTMLCommentElement
*iface
,
46 REFIID riid
, void **ppv
)
48 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
50 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
53 static ULONG WINAPI
HTMLCommentElement_AddRef(IHTMLCommentElement
*iface
)
55 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
57 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
60 static ULONG WINAPI
HTMLCommentElement_Release(IHTMLCommentElement
*iface
)
62 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
64 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
67 static HRESULT WINAPI
HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement
*iface
, UINT
*pctinfo
)
69 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
70 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
73 static HRESULT WINAPI
HTMLCommentElement_GetTypeInfo(IHTMLCommentElement
*iface
, UINT iTInfo
,
74 LCID lcid
, ITypeInfo
**ppTInfo
)
76 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
77 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
81 static HRESULT WINAPI
HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement
*iface
, REFIID riid
,
82 LPOLESTR
*rgszNames
, UINT cNames
,
83 LCID lcid
, DISPID
*rgDispId
)
85 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
86 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
87 cNames
, lcid
, rgDispId
);
90 static HRESULT WINAPI
HTMLCommentElement_Invoke(IHTMLCommentElement
*iface
, DISPID dispIdMember
,
91 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
92 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
94 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
95 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
96 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
99 static HRESULT WINAPI
HTMLCommentElement_put_text(IHTMLCommentElement
*iface
, BSTR v
)
101 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
102 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
106 static HRESULT WINAPI
HTMLCommentElement_get_text(IHTMLCommentElement
*iface
, BSTR
*p
)
108 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
110 TRACE("(%p)->(%p)\n", This
, p
);
112 return IHTMLElement_get_outerHTML(&This
->element
.IHTMLElement_iface
, p
);
115 static HRESULT WINAPI
HTMLCommentElement_put_atomic(IHTMLCommentElement
*iface
, LONG v
)
117 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
118 FIXME("(%p)->(%d)\n", This
, v
);
122 static HRESULT WINAPI
HTMLCommentElement_get_atomic(IHTMLCommentElement
*iface
, LONG
*p
)
124 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
125 FIXME("(%p)->(%p)\n", This
, p
);
129 static const IHTMLCommentElementVtbl HTMLCommentElementVtbl
= {
130 HTMLCommentElement_QueryInterface
,
131 HTMLCommentElement_AddRef
,
132 HTMLCommentElement_Release
,
133 HTMLCommentElement_GetTypeInfoCount
,
134 HTMLCommentElement_GetTypeInfo
,
135 HTMLCommentElement_GetIDsOfNames
,
136 HTMLCommentElement_Invoke
,
137 HTMLCommentElement_put_text
,
138 HTMLCommentElement_get_text
,
139 HTMLCommentElement_put_atomic
,
140 HTMLCommentElement_get_atomic
143 static inline HTMLCommentElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
145 return CONTAINING_RECORD(iface
, HTMLCommentElement
, element
.node
);
148 static HRESULT
HTMLCommentElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
150 HTMLCommentElement
*This
= impl_from_HTMLDOMNode(iface
);
154 if(IsEqualGUID(&IID_IHTMLCommentElement
, riid
)) {
155 TRACE("(%p)->(IID_IHTMLCommentElement %p)\n", This
, ppv
);
156 *ppv
= &This
->IHTMLCommentElement_iface
;
158 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
161 IUnknown_AddRef((IUnknown
*)*ppv
);
165 static void HTMLCommentElement_destructor(HTMLDOMNode
*iface
)
167 HTMLCommentElement
*This
= impl_from_HTMLDOMNode(iface
);
169 HTMLElement_destructor(&This
->element
.node
);
172 static const NodeImplVtbl HTMLCommentElementImplVtbl
= {
173 HTMLCommentElement_QI
,
174 HTMLCommentElement_destructor
,
176 HTMLElement_get_attr_col
179 static const tid_t HTMLCommentElement_iface_tids
[] = {
181 IHTMLCommentElement_tid
,
184 static dispex_static_data_t HTMLCommentElement_dispex
= {
186 DispHTMLCommentElement_tid
,
188 HTMLCommentElement_iface_tids
191 HRESULT
HTMLCommentElement_Create(HTMLDocumentNode
*doc
, nsIDOMNode
*nsnode
, HTMLElement
**elem
)
193 HTMLCommentElement
*ret
;
195 ret
= heap_alloc_zero(sizeof(*ret
));
197 return E_OUTOFMEMORY
;
199 ret
->element
.node
.vtbl
= &HTMLCommentElementImplVtbl
;
200 ret
->IHTMLCommentElement_iface
.lpVtbl
= &HTMLCommentElementVtbl
;
202 HTMLElement_Init(&ret
->element
, doc
, NULL
, &HTMLCommentElement_dispex
);
204 nsIDOMNode_AddRef(nsnode
);
205 ret
->element
.node
.nsnode
= nsnode
;
207 *elem
= &ret
->element
;