ReactOS  0.4.13-dev-990-g6d23816
htmlcomment.c
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18 
19 #include "mshtml_private.h"
20 
23  IHTMLCommentElement IHTMLCommentElement_iface;
24 };
25 
26 static inline HTMLCommentElement *impl_from_IHTMLCommentElement(IHTMLCommentElement *iface)
27 {
28  return CONTAINING_RECORD(iface, HTMLCommentElement, IHTMLCommentElement_iface);
29 }
30 
31 static HRESULT WINAPI HTMLCommentElement_QueryInterface(IHTMLCommentElement *iface,
32  REFIID riid, void **ppv)
33 {
35 
36  return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
37 }
38 
39 static ULONG WINAPI HTMLCommentElement_AddRef(IHTMLCommentElement *iface)
40 {
42 
43  return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
44 }
45 
46 static ULONG WINAPI HTMLCommentElement_Release(IHTMLCommentElement *iface)
47 {
49 
50  return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
51 }
52 
53 static HRESULT WINAPI HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement *iface, UINT *pctinfo)
54 {
56  return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
57 }
58 
59 static HRESULT WINAPI HTMLCommentElement_GetTypeInfo(IHTMLCommentElement *iface, UINT iTInfo,
60  LCID lcid, ITypeInfo **ppTInfo)
61 {
63  return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
64  ppTInfo);
65 }
66 
67 static HRESULT WINAPI HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement *iface, REFIID riid,
68  LPOLESTR *rgszNames, UINT cNames,
69  LCID lcid, DISPID *rgDispId)
70 {
72  return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
73  cNames, lcid, rgDispId);
74 }
75 
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)
79 {
81  return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
82  lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
83 }
84 
85 static HRESULT WINAPI HTMLCommentElement_put_text(IHTMLCommentElement *iface, BSTR v)
86 {
88  FIXME("(%p)->(%s)\n", This, debugstr_w(v));
89  return E_NOTIMPL;
90 }
91 
92 static HRESULT WINAPI HTMLCommentElement_get_text(IHTMLCommentElement *iface, BSTR *p)
93 {
95 
96  TRACE("(%p)->(%p)\n", This, p);
97 
98  return IHTMLElement_get_outerHTML(&This->element.IHTMLElement_iface, p);
99 }
100 
101 static HRESULT WINAPI HTMLCommentElement_put_atomic(IHTMLCommentElement *iface, LONG v)
102 {
104  FIXME("(%p)->(%d)\n", This, v);
105  return E_NOTIMPL;
106 }
107 
108 static HRESULT WINAPI HTMLCommentElement_get_atomic(IHTMLCommentElement *iface, LONG *p)
109 {
111  FIXME("(%p)->(%p)\n", This, p);
112  return E_NOTIMPL;
113 }
114 
115 static const IHTMLCommentElementVtbl HTMLCommentElementVtbl = {
127 };
128 
130 {
131  return CONTAINING_RECORD(iface, HTMLCommentElement, element.node);
132 }
133 
135 {
137 
138  *ppv = NULL;
139 
140  if(IsEqualGUID(&IID_IHTMLCommentElement, riid)) {
141  TRACE("(%p)->(IID_IHTMLCommentElement %p)\n", This, ppv);
142  *ppv = &This->IHTMLCommentElement_iface;
143  }else {
144  return HTMLElement_QI(&This->element.node, riid, ppv);
145  }
146 
147  IUnknown_AddRef((IUnknown*)*ppv);
148  return S_OK;
149 }
150 
152 {
154 
155  HTMLElement_destructor(&This->element.node);
156 }
157 
165 };
166 
169  IHTMLCommentElement_tid,
170  0
171 };
173  NULL,
174  DispHTMLCommentElement_tid,
175  NULL,
177 };
178 
180 {
182 
183  ret = heap_alloc_zero(sizeof(*ret));
184  if(!ret)
185  return E_OUTOFMEMORY;
186 
187  ret->element.node.vtbl = &HTMLCommentElementImplVtbl;
188  ret->IHTMLCommentElement_iface.lpVtbl = &HTMLCommentElementVtbl;
189 
191  HTMLDOMNode_Init(doc, &ret->element.node, nsnode);
192 
193  *elem = &ret->element;
194  return S_OK;
195 }
static ULONG WINAPI HTMLCommentElement_AddRef(IHTMLCommentElement *iface)
Definition: htmlcomment.c:39
#define REFIID
Definition: guiddef.h:118
static const NodeImplVtbl HTMLCommentElementImplVtbl
Definition: htmlcomment.c:158
void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsnode)
Definition: htmlnode.c:1196
static HRESULT WINAPI HTMLCommentElement_put_atomic(IHTMLCommentElement *iface, LONG v)
Definition: htmlcomment.c:101
HRESULT HTMLElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *event, BOOL *prevent_default)
Definition: htmlelem.c:3815
HRESULT HTMLCommentElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLElement **elem)
Definition: htmlcomment.c:179
const cpc_entry_t HTMLElement_cpc[]
Definition: htmlelem.c:3847
REFIID riid
Definition: precomp.h:44
tid_t
Definition: ieframe.h:311
static void HTMLCommentElement_destructor(HTMLDOMNode *iface)
Definition: htmlcomment.c:151
HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac)
Definition: htmlelem.c:4827
static const tid_t HTMLCommentElement_iface_tids[]
Definition: htmlcomment.c:167
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlelem.c:3738
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:1934
static LPOLESTR
Definition: stg_prop.c:27
static HRESULT WINAPI HTMLCommentElement_Invoke(IHTMLCommentElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlcomment.c:76
static HTMLCommentElement * impl_from_IHTMLCommentElement(IHTMLCommentElement *iface)
Definition: htmlcomment.c:26
#define HTMLELEMENT_TIDS
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
static size_t elem
Definition: string.c:68
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static HRESULT WINAPI HTMLCommentElement_get_atomic(IHTMLCommentElement *iface, LONG *p)
Definition: htmlcomment.c:108
static HRESULT WINAPI HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlcomment.c:67
#define TRACE(s)
Definition: solgame.cpp:4
static ULONG WINAPI HTMLCommentElement_Release(IHTMLCommentElement *iface)
Definition: htmlcomment.c:46
static HRESULT WINAPI HTMLCommentElement_put_text(IHTMLCommentElement *iface, BSTR v)
Definition: htmlcomment.c:85
LONG HRESULT
Definition: typedefs.h:77
#define WINAPI
Definition: msvc.h:8
unsigned short WORD
Definition: ntddk_ex.h:93
void HTMLElement_destructor(HTMLDOMNode *iface)
Definition: htmlelem.c:3764
static HRESULT WINAPI HTMLCommentElement_QueryInterface(IHTMLCommentElement *iface, REFIID riid, void **ppv)
Definition: htmlcomment.c:31
int ret
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
Definition: htmlelem.c:4008
HTMLElement element
Definition: htmlcomment.c:22
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
Definition: htmlelem.c:3793
struct stdole::EXCEPINFO EXCEPINFO
static dispex_static_data_t HTMLCommentElement_dispex
Definition: htmlcomment.c:172
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
const GLdouble * v
Definition: gl.h:2040
static HTMLCommentElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlcomment.c:129
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI HTMLCommentElement_GetTypeInfo(IHTMLCommentElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlcomment.c:59
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
IHTMLCommentElement IHTMLCommentElement_iface
Definition: htmlcomment.c:23
static HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlcomment.c:134
static const IHTMLCommentElementVtbl HTMLCommentElementVtbl
Definition: htmlcomment.c:115
struct stdole::DISPPARAMS DISPPARAMS
unsigned int ULONG
Definition: retypes.h:1
GLfloat GLfloat p
Definition: glext.h:8902
static HRESULT WINAPI HTMLCommentElement_get_text(IHTMLCommentElement *iface, BSTR *p)
Definition: htmlcomment.c:92
static HRESULT WINAPI HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement *iface, UINT *pctinfo)
Definition: htmlcomment.c:53