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
19 #include "mshtml_private.h"
21 struct HTMLCommentElement
{
23 IHTMLCommentElement IHTMLCommentElement_iface
;
26 static inline HTMLCommentElement
*impl_from_IHTMLCommentElement(IHTMLCommentElement
*iface
)
28 return CONTAINING_RECORD(iface
, HTMLCommentElement
, IHTMLCommentElement_iface
);
31 static HRESULT WINAPI
HTMLCommentElement_QueryInterface(IHTMLCommentElement
*iface
,
32 REFIID riid
, void **ppv
)
34 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
36 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
39 static ULONG WINAPI
HTMLCommentElement_AddRef(IHTMLCommentElement
*iface
)
41 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
43 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
46 static ULONG WINAPI
HTMLCommentElement_Release(IHTMLCommentElement
*iface
)
48 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
50 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
53 static HRESULT WINAPI
HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement
*iface
, UINT
*pctinfo
)
55 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
56 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
59 static HRESULT WINAPI
HTMLCommentElement_GetTypeInfo(IHTMLCommentElement
*iface
, UINT iTInfo
,
60 LCID lcid
, ITypeInfo
**ppTInfo
)
62 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
63 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
67 static HRESULT WINAPI
HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement
*iface
, REFIID riid
,
68 LPOLESTR
*rgszNames
, UINT cNames
,
69 LCID lcid
, DISPID
*rgDispId
)
71 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
72 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
73 cNames
, lcid
, rgDispId
);
76 static HRESULT WINAPI
HTMLCommentElement_Invoke(IHTMLCommentElement
*iface
, DISPID dispIdMember
,
77 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
78 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
80 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
81 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
82 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
85 static HRESULT WINAPI
HTMLCommentElement_put_text(IHTMLCommentElement
*iface
, BSTR v
)
87 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
88 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
92 static HRESULT WINAPI
HTMLCommentElement_get_text(IHTMLCommentElement
*iface
, BSTR
*p
)
94 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
96 TRACE("(%p)->(%p)\n", This
, p
);
98 return IHTMLElement_get_outerHTML(&This
->element
.IHTMLElement_iface
, p
);
101 static HRESULT WINAPI
HTMLCommentElement_put_atomic(IHTMLCommentElement
*iface
, LONG v
)
103 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
104 FIXME("(%p)->(%d)\n", This
, v
);
108 static HRESULT WINAPI
HTMLCommentElement_get_atomic(IHTMLCommentElement
*iface
, LONG
*p
)
110 HTMLCommentElement
*This
= impl_from_IHTMLCommentElement(iface
);
111 FIXME("(%p)->(%p)\n", This
, p
);
115 static const IHTMLCommentElementVtbl HTMLCommentElementVtbl
= {
116 HTMLCommentElement_QueryInterface
,
117 HTMLCommentElement_AddRef
,
118 HTMLCommentElement_Release
,
119 HTMLCommentElement_GetTypeInfoCount
,
120 HTMLCommentElement_GetTypeInfo
,
121 HTMLCommentElement_GetIDsOfNames
,
122 HTMLCommentElement_Invoke
,
123 HTMLCommentElement_put_text
,
124 HTMLCommentElement_get_text
,
125 HTMLCommentElement_put_atomic
,
126 HTMLCommentElement_get_atomic
129 static inline HTMLCommentElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
131 return CONTAINING_RECORD(iface
, HTMLCommentElement
, element
.node
);
134 static HRESULT
HTMLCommentElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
136 HTMLCommentElement
*This
= impl_from_HTMLDOMNode(iface
);
140 if(IsEqualGUID(&IID_IHTMLCommentElement
, riid
)) {
141 TRACE("(%p)->(IID_IHTMLCommentElement %p)\n", This
, ppv
);
142 *ppv
= &This
->IHTMLCommentElement_iface
;
144 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
147 IUnknown_AddRef((IUnknown
*)*ppv
);
151 static void HTMLCommentElement_destructor(HTMLDOMNode
*iface
)
153 HTMLCommentElement
*This
= impl_from_HTMLDOMNode(iface
);
155 HTMLElement_destructor(&This
->element
.node
);
158 static const NodeImplVtbl HTMLCommentElementImplVtbl
= {
159 HTMLCommentElement_QI
,
160 HTMLCommentElement_destructor
,
163 HTMLElement_handle_event
,
164 HTMLElement_get_attr_col
167 static const tid_t HTMLCommentElement_iface_tids
[] = {
169 IHTMLCommentElement_tid
,
172 static dispex_static_data_t HTMLCommentElement_dispex
= {
174 DispHTMLCommentElement_tid
,
176 HTMLCommentElement_iface_tids
179 HRESULT
HTMLCommentElement_Create(HTMLDocumentNode
*doc
, nsIDOMNode
*nsnode
, HTMLElement
**elem
)
181 HTMLCommentElement
*ret
;
183 ret
= heap_alloc_zero(sizeof(*ret
));
185 return E_OUTOFMEMORY
;
187 ret
->element
.node
.vtbl
= &HTMLCommentElementImplVtbl
;
188 ret
->IHTMLCommentElement_iface
.lpVtbl
= &HTMLCommentElementVtbl
;
190 HTMLElement_Init(&ret
->element
, doc
, NULL
, &HTMLCommentElement_dispex
);
191 HTMLDOMNode_Init(doc
, &ret
->element
.node
, nsnode
);
193 *elem
= &ret
->element
;