configure: Make the libXi soname check depend on the header check.
[wine/dibdrv.git] / dlls / msxml3 / comment.c
blobf9fc927923d9708ca67d199c61356faa82f7dc09
1 /*
2 * DOM comment node implementation
4 * Copyright 2006 Huw Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define COBJMACROS
23 #include "config.h"
25 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "ole2.h"
30 #include "msxml2.h"
32 #include "msxml_private.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
38 #ifdef HAVE_LIBXML2
40 typedef struct _domcomment
42 const struct IXMLDOMCommentVtbl *lpVtbl;
43 LONG ref;
44 IUnknown *node_unk;
45 IXMLDOMNode *node;
46 } domcomment;
48 static inline domcomment *impl_from_IXMLDOMComment( IXMLDOMComment *iface )
50 return (domcomment *)((char*)iface - FIELD_OFFSET(domcomment, lpVtbl));
53 static HRESULT WINAPI domcomment_QueryInterface(
54 IXMLDOMComment *iface,
55 REFIID riid,
56 void** ppvObject )
58 domcomment *This = impl_from_IXMLDOMComment( iface );
59 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
61 if ( IsEqualGUID( riid, &IID_IXMLDOMComment ) ||
62 IsEqualGUID( riid, &IID_IUnknown ) )
64 *ppvObject = iface;
66 else if ( IsEqualGUID( riid, &IID_IDispatch ) ||
67 IsEqualGUID( riid, &IID_IXMLDOMNode ) )
69 return IUnknown_QueryInterface(This->node_unk, riid, ppvObject);
71 else
73 FIXME("Unsupported inteferace %s\n", debugstr_guid(riid));
74 return E_NOINTERFACE;
77 IXMLDOMComment_AddRef( iface );
79 return S_OK;
82 static ULONG WINAPI domcomment_AddRef(
83 IXMLDOMComment *iface )
85 domcomment *This = impl_from_IXMLDOMComment( iface );
86 return InterlockedIncrement( &This->ref );
89 static ULONG WINAPI domcomment_Release(
90 IXMLDOMComment *iface )
92 domcomment *This = impl_from_IXMLDOMComment( iface );
93 ULONG ref;
95 ref = InterlockedDecrement( &This->ref );
96 if ( ref == 0 )
98 IUnknown_Release( This->node_unk );
99 HeapFree( GetProcessHeap(), 0, This );
102 return ref;
105 static HRESULT WINAPI domcomment_GetTypeInfoCount(
106 IXMLDOMComment *iface,
107 UINT* pctinfo )
109 FIXME("\n");
110 return E_NOTIMPL;
113 static HRESULT WINAPI domcomment_GetTypeInfo(
114 IXMLDOMComment *iface,
115 UINT iTInfo, LCID lcid,
116 ITypeInfo** ppTInfo )
118 FIXME("\n");
119 return E_NOTIMPL;
122 static HRESULT WINAPI domcomment_GetIDsOfNames(
123 IXMLDOMComment *iface,
124 REFIID riid, LPOLESTR* rgszNames,
125 UINT cNames, LCID lcid, DISPID* rgDispId )
127 FIXME("\n");
128 return E_NOTIMPL;
131 static HRESULT WINAPI domcomment_Invoke(
132 IXMLDOMComment *iface,
133 DISPID dispIdMember, REFIID riid, LCID lcid,
134 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
135 EXCEPINFO* pExcepInfo, UINT* puArgErr )
137 FIXME("\n");
138 return E_NOTIMPL;
141 static HRESULT WINAPI domcomment_get_nodeName(
142 IXMLDOMComment *iface,
143 BSTR* p )
145 domcomment *This = impl_from_IXMLDOMComment( iface );
146 return IXMLDOMNode_get_nodeName( This->node, p );
149 static HRESULT WINAPI domcomment_get_nodeValue(
150 IXMLDOMComment *iface,
151 VARIANT* var1 )
153 domcomment *This = impl_from_IXMLDOMComment( iface );
154 return IXMLDOMNode_get_nodeValue( This->node, var1 );
157 static HRESULT WINAPI domcomment_put_nodeValue(
158 IXMLDOMComment *iface,
159 VARIANT var1 )
161 domcomment *This = impl_from_IXMLDOMComment( iface );
162 return IXMLDOMNode_put_nodeValue( This->node, var1 );
165 static HRESULT WINAPI domcomment_get_nodeType(
166 IXMLDOMComment *iface,
167 DOMNodeType* domNodeType )
169 domcomment *This = impl_from_IXMLDOMComment( iface );
170 return IXMLDOMNode_get_nodeType( This->node, domNodeType );
173 static HRESULT WINAPI domcomment_get_parentNode(
174 IXMLDOMComment *iface,
175 IXMLDOMNode** parent )
177 domcomment *This = impl_from_IXMLDOMComment( iface );
178 return IXMLDOMNode_get_parentNode( This->node, parent );
181 static HRESULT WINAPI domcomment_get_childNodes(
182 IXMLDOMComment *iface,
183 IXMLDOMNodeList** outList)
185 domcomment *This = impl_from_IXMLDOMComment( iface );
186 return IXMLDOMNode_get_childNodes( This->node, outList );
189 static HRESULT WINAPI domcomment_get_firstChild(
190 IXMLDOMComment *iface,
191 IXMLDOMNode** domNode)
193 domcomment *This = impl_from_IXMLDOMComment( iface );
194 return IXMLDOMNode_get_firstChild( This->node, domNode );
197 static HRESULT WINAPI domcomment_get_lastChild(
198 IXMLDOMComment *iface,
199 IXMLDOMNode** domNode)
201 domcomment *This = impl_from_IXMLDOMComment( iface );
202 return IXMLDOMNode_get_lastChild( This->node, domNode );
205 static HRESULT WINAPI domcomment_get_previousSibling(
206 IXMLDOMComment *iface,
207 IXMLDOMNode** domNode)
209 domcomment *This = impl_from_IXMLDOMComment( iface );
210 return IXMLDOMNode_get_previousSibling( This->node, domNode );
213 static HRESULT WINAPI domcomment_get_nextSibling(
214 IXMLDOMComment *iface,
215 IXMLDOMNode** domNode)
217 domcomment *This = impl_from_IXMLDOMComment( iface );
218 return IXMLDOMNode_get_nextSibling( This->node, domNode );
221 static HRESULT WINAPI domcomment_get_attributes(
222 IXMLDOMComment *iface,
223 IXMLDOMNamedNodeMap** attributeMap)
225 domcomment *This = impl_from_IXMLDOMComment( iface );
226 return IXMLDOMNode_get_attributes( This->node, attributeMap );
229 static HRESULT WINAPI domcomment_insertBefore(
230 IXMLDOMComment *iface,
231 IXMLDOMNode* newNode, VARIANT var1,
232 IXMLDOMNode** outOldNode)
234 domcomment *This = impl_from_IXMLDOMComment( iface );
235 return IXMLDOMNode_insertBefore( This->node, newNode, var1, outOldNode );
238 static HRESULT WINAPI domcomment_replaceChild(
239 IXMLDOMComment *iface,
240 IXMLDOMNode* newNode,
241 IXMLDOMNode* oldNode,
242 IXMLDOMNode** outOldNode)
244 domcomment *This = impl_from_IXMLDOMComment( iface );
245 return IXMLDOMNode_replaceChild( This->node, newNode, oldNode, outOldNode );
248 static HRESULT WINAPI domcomment_removeChild(
249 IXMLDOMComment *iface,
250 IXMLDOMNode* domNode, IXMLDOMNode** oldNode)
252 domcomment *This = impl_from_IXMLDOMComment( iface );
253 return IXMLDOMNode_removeChild( This->node, domNode, oldNode );
256 static HRESULT WINAPI domcomment_appendChild(
257 IXMLDOMComment *iface,
258 IXMLDOMNode* newNode, IXMLDOMNode** outNewNode)
260 domcomment *This = impl_from_IXMLDOMComment( iface );
261 return IXMLDOMNode_appendChild( This->node, newNode, outNewNode );
264 static HRESULT WINAPI domcomment_hasChildNodes(
265 IXMLDOMComment *iface,
266 VARIANT_BOOL* pbool)
268 domcomment *This = impl_from_IXMLDOMComment( iface );
269 return IXMLDOMNode_hasChildNodes( This->node, pbool );
272 static HRESULT WINAPI domcomment_get_ownerDocument(
273 IXMLDOMComment *iface,
274 IXMLDOMDocument** domDocument)
276 domcomment *This = impl_from_IXMLDOMComment( iface );
277 return IXMLDOMNode_get_ownerDocument( This->node, domDocument );
280 static HRESULT WINAPI domcomment_cloneNode(
281 IXMLDOMComment *iface,
282 VARIANT_BOOL pbool, IXMLDOMNode** outNode)
284 domcomment *This = impl_from_IXMLDOMComment( iface );
285 return IXMLDOMNode_cloneNode( This->node, pbool, outNode );
288 static HRESULT WINAPI domcomment_get_nodeTypeString(
289 IXMLDOMComment *iface,
290 BSTR* p)
292 domcomment *This = impl_from_IXMLDOMComment( iface );
293 return IXMLDOMNode_get_nodeTypeString( This->node, p );
296 static HRESULT WINAPI domcomment_get_text(
297 IXMLDOMComment *iface,
298 BSTR* p)
300 domcomment *This = impl_from_IXMLDOMComment( iface );
301 return IXMLDOMNode_get_text( This->node, p );
304 static HRESULT WINAPI domcomment_put_text(
305 IXMLDOMComment *iface,
306 BSTR p)
308 domcomment *This = impl_from_IXMLDOMComment( iface );
309 return IXMLDOMNode_put_text( This->node, p );
312 static HRESULT WINAPI domcomment_get_specified(
313 IXMLDOMComment *iface,
314 VARIANT_BOOL* pbool)
316 domcomment *This = impl_from_IXMLDOMComment( iface );
317 return IXMLDOMNode_get_specified( This->node, pbool );
320 static HRESULT WINAPI domcomment_get_definition(
321 IXMLDOMComment *iface,
322 IXMLDOMNode** domNode)
324 domcomment *This = impl_from_IXMLDOMComment( iface );
325 return IXMLDOMNode_get_definition( This->node, domNode );
328 static HRESULT WINAPI domcomment_get_nodeTypedValue(
329 IXMLDOMComment *iface,
330 VARIANT* var1)
332 domcomment *This = impl_from_IXMLDOMComment( iface );
333 return IXMLDOMNode_get_nodeTypedValue( This->node, var1 );
336 static HRESULT WINAPI domcomment_put_nodeTypedValue(
337 IXMLDOMComment *iface,
338 VARIANT var1)
340 domcomment *This = impl_from_IXMLDOMComment( iface );
341 return IXMLDOMNode_put_nodeTypedValue( This->node, var1 );
344 static HRESULT WINAPI domcomment_get_dataType(
345 IXMLDOMComment *iface,
346 VARIANT* var1)
348 domcomment *This = impl_from_IXMLDOMComment( iface );
349 return IXMLDOMNode_get_dataType( This->node, var1 );
352 static HRESULT WINAPI domcomment_put_dataType(
353 IXMLDOMComment *iface,
354 BSTR p)
356 domcomment *This = impl_from_IXMLDOMComment( iface );
357 return IXMLDOMNode_put_dataType( This->node, p );
360 static HRESULT WINAPI domcomment_get_xml(
361 IXMLDOMComment *iface,
362 BSTR* p)
364 domcomment *This = impl_from_IXMLDOMComment( iface );
365 return IXMLDOMNode_get_xml( This->node, p );
368 static HRESULT WINAPI domcomment_transformNode(
369 IXMLDOMComment *iface,
370 IXMLDOMNode* domNode, BSTR* p)
372 domcomment *This = impl_from_IXMLDOMComment( iface );
373 return IXMLDOMNode_transformNode( This->node, domNode, p );
376 static HRESULT WINAPI domcomment_selectNodes(
377 IXMLDOMComment *iface,
378 BSTR p, IXMLDOMNodeList** outList)
380 domcomment *This = impl_from_IXMLDOMComment( iface );
381 return IXMLDOMNode_selectNodes( This->node, p, outList );
384 static HRESULT WINAPI domcomment_selectSingleNode(
385 IXMLDOMComment *iface,
386 BSTR p, IXMLDOMNode** outNode)
388 domcomment *This = impl_from_IXMLDOMComment( iface );
389 return IXMLDOMNode_selectSingleNode( This->node, p, outNode );
392 static HRESULT WINAPI domcomment_get_parsed(
393 IXMLDOMComment *iface,
394 VARIANT_BOOL* pbool)
396 domcomment *This = impl_from_IXMLDOMComment( iface );
397 return IXMLDOMNode_get_parsed( This->node, pbool );
400 static HRESULT WINAPI domcomment_get_namespaceURI(
401 IXMLDOMComment *iface,
402 BSTR* p)
404 domcomment *This = impl_from_IXMLDOMComment( iface );
405 return IXMLDOMNode_get_namespaceURI( This->node, p );
408 static HRESULT WINAPI domcomment_get_prefix(
409 IXMLDOMComment *iface,
410 BSTR* p)
412 domcomment *This = impl_from_IXMLDOMComment( iface );
413 return IXMLDOMNode_get_prefix( This->node, p );
416 static HRESULT WINAPI domcomment_get_baseName(
417 IXMLDOMComment *iface,
418 BSTR* p)
420 domcomment *This = impl_from_IXMLDOMComment( iface );
421 return IXMLDOMNode_get_baseName( This->node, p );
424 static HRESULT WINAPI domcomment_transformNodeToObject(
425 IXMLDOMComment *iface,
426 IXMLDOMNode* domNode, VARIANT var1)
428 domcomment *This = impl_from_IXMLDOMComment( iface );
429 return IXMLDOMNode_transformNodeToObject( This->node, domNode, var1 );
432 static HRESULT WINAPI domcomment_get_data(
433 IXMLDOMComment *iface,
434 BSTR *p)
436 FIXME("\n");
437 return E_NOTIMPL;
440 static HRESULT WINAPI domcomment_put_data(
441 IXMLDOMComment *iface,
442 BSTR data)
444 FIXME("\n");
445 return E_NOTIMPL;
448 static HRESULT WINAPI domcomment_get_length(
449 IXMLDOMComment *iface,
450 long *len)
452 FIXME("\n");
453 return E_NOTIMPL;
456 static HRESULT WINAPI domcomment_substringData(
457 IXMLDOMComment *iface,
458 long offset, long count, BSTR *p)
460 FIXME("\n");
461 return E_NOTIMPL;
464 static HRESULT WINAPI domcomment_appendData(
465 IXMLDOMComment *iface,
466 BSTR p)
468 FIXME("\n");
469 return E_NOTIMPL;
472 static HRESULT WINAPI domcomment_insertData(
473 IXMLDOMComment *iface,
474 long offset, BSTR p)
476 FIXME("\n");
477 return E_NOTIMPL;
480 static HRESULT WINAPI domcomment_deleteData(
481 IXMLDOMComment *iface,
482 long offset, long count)
484 FIXME("\n");
485 return E_NOTIMPL;
488 static HRESULT WINAPI domcomment_replaceData(
489 IXMLDOMComment *iface,
490 long offset, long count, BSTR p)
492 FIXME("\n");
493 return E_NOTIMPL;
496 static const struct IXMLDOMCommentVtbl domcomment_vtbl =
498 domcomment_QueryInterface,
499 domcomment_AddRef,
500 domcomment_Release,
501 domcomment_GetTypeInfoCount,
502 domcomment_GetTypeInfo,
503 domcomment_GetIDsOfNames,
504 domcomment_Invoke,
505 domcomment_get_nodeName,
506 domcomment_get_nodeValue,
507 domcomment_put_nodeValue,
508 domcomment_get_nodeType,
509 domcomment_get_parentNode,
510 domcomment_get_childNodes,
511 domcomment_get_firstChild,
512 domcomment_get_lastChild,
513 domcomment_get_previousSibling,
514 domcomment_get_nextSibling,
515 domcomment_get_attributes,
516 domcomment_insertBefore,
517 domcomment_replaceChild,
518 domcomment_removeChild,
519 domcomment_appendChild,
520 domcomment_hasChildNodes,
521 domcomment_get_ownerDocument,
522 domcomment_cloneNode,
523 domcomment_get_nodeTypeString,
524 domcomment_get_text,
525 domcomment_put_text,
526 domcomment_get_specified,
527 domcomment_get_definition,
528 domcomment_get_nodeTypedValue,
529 domcomment_put_nodeTypedValue,
530 domcomment_get_dataType,
531 domcomment_put_dataType,
532 domcomment_get_xml,
533 domcomment_transformNode,
534 domcomment_selectNodes,
535 domcomment_selectSingleNode,
536 domcomment_get_parsed,
537 domcomment_get_namespaceURI,
538 domcomment_get_prefix,
539 domcomment_get_baseName,
540 domcomment_transformNodeToObject,
541 domcomment_get_data,
542 domcomment_put_data,
543 domcomment_get_length,
544 domcomment_substringData,
545 domcomment_appendData,
546 domcomment_insertData,
547 domcomment_deleteData,
548 domcomment_replaceData
551 IUnknown* create_comment( xmlNodePtr comment )
553 domcomment *This;
554 HRESULT hr;
556 This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
557 if ( !This )
558 return NULL;
560 This->lpVtbl = &domcomment_vtbl;
561 This->ref = 1;
563 This->node_unk = create_basic_node( comment, (IUnknown*)&This->lpVtbl );
564 if(!This->node_unk)
566 HeapFree(GetProcessHeap(), 0, This);
567 return NULL;
570 hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode, (LPVOID*)&This->node);
571 if(FAILED(hr))
573 IUnknown_Release(This->node_unk);
574 HeapFree( GetProcessHeap(), 0, This );
575 return NULL;
577 /* The ref on This->node is actually looped back into this object, so release it */
578 IXMLDOMNode_Release(This->node);
580 return (IUnknown*) &This->lpVtbl;
583 #endif