wineps: Fix a couple of typos in the path painting function.
[wine/testsucceed.git] / dlls / msxml3 / doctype.c
blob6a1952fa66121517d34d1541d2d453dbd3b9026e
1 /*
2 * DOM DTD node implementation
4 * Copyright 2010 Nikolay Sivov
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 #ifdef HAVE_LIBXML2
27 # include <libxml/parser.h>
28 # include <libxml/xmlerror.h>
29 #endif
31 #include "windef.h"
32 #include "winbase.h"
33 #include "winuser.h"
34 #include "winnls.h"
35 #include "ole2.h"
36 #include "msxml6.h"
38 #include "msxml_private.h"
40 #include "wine/debug.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
44 #ifdef HAVE_LIBXML2
46 typedef struct _domdoctype
48 xmlnode node;
49 IXMLDOMDocumentType IXMLDOMDocumentType_iface;
50 LONG ref;
51 } domdoctype;
53 static inline domdoctype *impl_from_IXMLDOMDocumentType( IXMLDOMDocumentType *iface )
55 return CONTAINING_RECORD(iface, domdoctype, IXMLDOMDocumentType_iface);
58 static HRESULT WINAPI domdoctype_QueryInterface(
59 IXMLDOMDocumentType *iface,
60 REFIID riid,
61 void** ppvObject )
63 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
65 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
67 if ( IsEqualGUID( riid, &IID_IXMLDOMDocumentType ) ||
68 IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
69 IsEqualGUID( riid, &IID_IDispatch ) ||
70 IsEqualGUID( riid, &IID_IUnknown ) )
72 *ppvObject = &This->IXMLDOMDocumentType_iface;
74 else if(node_query_interface(&This->node, riid, ppvObject))
76 return *ppvObject ? S_OK : E_NOINTERFACE;
78 else
80 TRACE("interface %s not implemented\n", debugstr_guid(riid));
81 *ppvObject = NULL;
82 return E_NOINTERFACE;
85 IUnknown_AddRef( (IUnknown*)*ppvObject );
86 return S_OK;
89 static ULONG WINAPI domdoctype_AddRef(
90 IXMLDOMDocumentType *iface )
92 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
93 LONG ref = InterlockedIncrement(&This->ref);
94 TRACE("(%p)->(%d)\n", This, ref);
95 return ref;
98 static ULONG WINAPI domdoctype_Release(
99 IXMLDOMDocumentType *iface )
101 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
102 ULONG ref = InterlockedDecrement(&This->ref);
104 TRACE("(%p)->(%d)\n", This, ref);
106 if(!ref) {
107 destroy_xmlnode(&This->node);
108 heap_free(This);
111 return ref;
114 static HRESULT WINAPI domdoctype_GetTypeInfoCount(
115 IXMLDOMDocumentType *iface,
116 UINT* pctinfo )
118 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
120 TRACE("(%p)->(%p)\n", This, pctinfo);
122 *pctinfo = 1;
124 return S_OK;
127 static HRESULT WINAPI domdoctype_GetTypeInfo(
128 IXMLDOMDocumentType *iface,
129 UINT iTInfo, LCID lcid,
130 ITypeInfo** ppTInfo )
132 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
133 HRESULT hr;
135 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
137 hr = get_typeinfo(IXMLDOMDocumentType_tid, ppTInfo);
139 return hr;
142 static HRESULT WINAPI domdoctype_GetIDsOfNames(
143 IXMLDOMDocumentType *iface,
144 REFIID riid, LPOLESTR* rgszNames,
145 UINT cNames, LCID lcid, DISPID* rgDispId )
147 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
148 ITypeInfo *typeinfo;
149 HRESULT hr;
151 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
152 lcid, rgDispId);
154 if(!rgszNames || cNames == 0 || !rgDispId)
155 return E_INVALIDARG;
157 hr = get_typeinfo(IXMLDOMDocumentType_tid, &typeinfo);
158 if(SUCCEEDED(hr))
160 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
161 ITypeInfo_Release(typeinfo);
164 return hr;
167 static HRESULT WINAPI domdoctype_Invoke(
168 IXMLDOMDocumentType *iface,
169 DISPID dispIdMember, REFIID riid, LCID lcid,
170 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
171 EXCEPINFO* pExcepInfo, UINT* puArgErr )
173 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
174 ITypeInfo *typeinfo;
175 HRESULT hr;
177 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
178 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
180 hr = get_typeinfo(IXMLDOMDocumentType_tid, &typeinfo);
181 if(SUCCEEDED(hr))
183 hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMDocumentType_iface, dispIdMember, wFlags,
184 pDispParams, pVarResult, pExcepInfo, puArgErr);
185 ITypeInfo_Release(typeinfo);
188 return hr;
191 static HRESULT WINAPI domdoctype_get_nodeName(
192 IXMLDOMDocumentType *iface,
193 BSTR* p )
195 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
196 FIXME("(%p)->(%p): stub\n", This, p);
197 return E_NOTIMPL;
200 static HRESULT WINAPI domdoctype_get_nodeValue(
201 IXMLDOMDocumentType *iface,
202 VARIANT* value)
204 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
205 FIXME("(%p)->(%p): stub\n", This, value);
206 return E_NOTIMPL;
209 static HRESULT WINAPI domdoctype_put_nodeValue(
210 IXMLDOMDocumentType *iface,
211 VARIANT value)
213 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
214 FIXME("(%p)->(%s): stub\n", This, debugstr_variant(&value));
215 return E_NOTIMPL;
218 static HRESULT WINAPI domdoctype_get_nodeType(
219 IXMLDOMDocumentType *iface,
220 DOMNodeType* domNodeType )
222 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
224 TRACE("(%p)->(%p)\n", This, domNodeType);
226 *domNodeType = NODE_DOCUMENT_TYPE;
227 return S_OK;
230 static HRESULT WINAPI domdoctype_get_parentNode(
231 IXMLDOMDocumentType *iface,
232 IXMLDOMNode** parent )
234 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
235 FIXME("(%p)->(%p): stub\n", This, parent);
236 return E_NOTIMPL;
239 static HRESULT WINAPI domdoctype_get_childNodes(
240 IXMLDOMDocumentType *iface,
241 IXMLDOMNodeList** outList)
243 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
244 FIXME("(%p)->(%p): stub\n", This, outList);
245 return E_NOTIMPL;
248 static HRESULT WINAPI domdoctype_get_firstChild(
249 IXMLDOMDocumentType *iface,
250 IXMLDOMNode** domNode)
252 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
253 FIXME("(%p)->(%p): stub\n", This, domNode);
254 return E_NOTIMPL;
257 static HRESULT WINAPI domdoctype_get_lastChild(
258 IXMLDOMDocumentType *iface,
259 IXMLDOMNode** domNode)
261 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
262 FIXME("(%p)->(%p): stub\n", This, domNode);
263 return E_NOTIMPL;
266 static HRESULT WINAPI domdoctype_get_previousSibling(
267 IXMLDOMDocumentType *iface,
268 IXMLDOMNode** domNode)
270 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
271 FIXME("(%p)->(%p): stub\n", This, domNode);
272 return E_NOTIMPL;
275 static HRESULT WINAPI domdoctype_get_nextSibling(
276 IXMLDOMDocumentType *iface,
277 IXMLDOMNode** domNode)
279 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
280 FIXME("(%p)->(%p): stub\n", This, domNode);
281 return E_NOTIMPL;
284 static HRESULT WINAPI domdoctype_get_attributes(
285 IXMLDOMDocumentType *iface,
286 IXMLDOMNamedNodeMap** attributeMap)
288 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
289 FIXME("(%p)->(%p): stub\n", This, attributeMap);
290 return E_NOTIMPL;
293 static HRESULT WINAPI domdoctype_insertBefore(
294 IXMLDOMDocumentType *iface,
295 IXMLDOMNode* newNode, VARIANT refChild,
296 IXMLDOMNode** outOldNode)
298 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
300 FIXME("(%p)->(%p %s %p): stub\n", This, newNode, debugstr_variant(&refChild), outOldNode);
302 return E_NOTIMPL;
305 static HRESULT WINAPI domdoctype_replaceChild(
306 IXMLDOMDocumentType *iface,
307 IXMLDOMNode* newNode,
308 IXMLDOMNode* oldNode,
309 IXMLDOMNode** outOldNode)
311 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
313 FIXME("(%p)->(%p %p %p): stub\n", This, newNode, oldNode, outOldNode);
315 return E_NOTIMPL;
318 static HRESULT WINAPI domdoctype_removeChild(
319 IXMLDOMDocumentType *iface,
320 IXMLDOMNode* domNode, IXMLDOMNode** oldNode)
322 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
323 FIXME("(%p)->(%p %p): stub\n", This, domNode, oldNode);
324 return E_NOTIMPL;
327 static HRESULT WINAPI domdoctype_appendChild(
328 IXMLDOMDocumentType *iface,
329 IXMLDOMNode* newNode, IXMLDOMNode** outNewNode)
331 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
332 FIXME("(%p)->(%p %p): stub\n", This, newNode, outNewNode);
333 return E_NOTIMPL;
336 static HRESULT WINAPI domdoctype_hasChildNodes(
337 IXMLDOMDocumentType *iface,
338 VARIANT_BOOL* pbool)
340 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
341 FIXME("(%p)->(%p): stub\n", This, pbool);
342 return E_NOTIMPL;
345 static HRESULT WINAPI domdoctype_get_ownerDocument(
346 IXMLDOMDocumentType *iface,
347 IXMLDOMDocument** domDocument)
349 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
350 FIXME("(%p)->(%p): stub\n", This, domDocument);
351 return E_NOTIMPL;
354 static HRESULT WINAPI domdoctype_cloneNode(
355 IXMLDOMDocumentType *iface,
356 VARIANT_BOOL deep, IXMLDOMNode** outNode)
358 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
359 FIXME("(%p)->(%d %p): stub\n", This, deep, outNode);
360 return E_NOTIMPL;
363 static HRESULT WINAPI domdoctype_get_nodeTypeString(
364 IXMLDOMDocumentType *iface,
365 BSTR* p)
367 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
368 FIXME("(%p)->(%p): stub\n", This, p);
369 return E_NOTIMPL;
372 static HRESULT WINAPI domdoctype_get_text(
373 IXMLDOMDocumentType *iface,
374 BSTR* p)
376 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
377 FIXME("(%p)->(%p): stub\n", This, p);
378 return E_NOTIMPL;
381 static HRESULT WINAPI domdoctype_put_text(
382 IXMLDOMDocumentType *iface,
383 BSTR p)
385 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
386 FIXME("(%p)->(%s): stub\n", This, debugstr_w(p));
387 return E_NOTIMPL;
390 static HRESULT WINAPI domdoctype_get_specified(
391 IXMLDOMDocumentType *iface,
392 VARIANT_BOOL* isSpecified)
394 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
395 FIXME("(%p)->(%p): stub\n", This, isSpecified);
396 return E_NOTIMPL;
399 static HRESULT WINAPI domdoctype_get_definition(
400 IXMLDOMDocumentType *iface,
401 IXMLDOMNode** definitionNode)
403 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
404 FIXME("(%p)->(%p)\n", This, definitionNode);
405 return E_NOTIMPL;
408 static HRESULT WINAPI domdoctype_get_nodeTypedValue(
409 IXMLDOMDocumentType *iface,
410 VARIANT* v)
412 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
413 TRACE("(%p)->(%p)\n", This, v);
414 return return_null_var(v);
417 static HRESULT WINAPI domdoctype_put_nodeTypedValue(
418 IXMLDOMDocumentType *iface,
419 VARIANT value)
421 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
422 FIXME("(%p)->(%s): stub\n", This, debugstr_variant(&value));
423 return E_NOTIMPL;
426 static HRESULT WINAPI domdoctype_get_dataType(
427 IXMLDOMDocumentType *iface,
428 VARIANT* typename)
430 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
431 FIXME("(%p)->(%p): stub\n", This, typename);
432 return E_NOTIMPL;
435 static HRESULT WINAPI domdoctype_put_dataType(
436 IXMLDOMDocumentType *iface,
437 BSTR p)
439 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
440 FIXME("(%p)->(%s): stub\n", This, debugstr_w(p));
441 return E_NOTIMPL;
444 static HRESULT WINAPI domdoctype_get_xml(
445 IXMLDOMDocumentType *iface,
446 BSTR* p)
448 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
449 FIXME("(%p)->(%p): stub\n", This, p);
450 return E_NOTIMPL;
453 static HRESULT WINAPI domdoctype_transformNode(
454 IXMLDOMDocumentType *iface,
455 IXMLDOMNode* domNode, BSTR* p)
457 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
458 FIXME("(%p)->(%p %p): stub\n", This, domNode, p);
459 return E_NOTIMPL;
462 static HRESULT WINAPI domdoctype_selectNodes(
463 IXMLDOMDocumentType *iface,
464 BSTR p, IXMLDOMNodeList** outList)
466 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
467 FIXME("(%p)->(%s %p): stub\n", This, debugstr_w(p), outList);
468 return E_NOTIMPL;
471 static HRESULT WINAPI domdoctype_selectSingleNode(
472 IXMLDOMDocumentType *iface,
473 BSTR p, IXMLDOMNode** outNode)
475 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
476 FIXME("(%p)->(%s %p): stub\n", This, debugstr_w(p), outNode);
477 return E_NOTIMPL;
480 static HRESULT WINAPI domdoctype_get_parsed(
481 IXMLDOMDocumentType *iface,
482 VARIANT_BOOL* isParsed)
484 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
485 FIXME("(%p)->(%p): stub\n", This, isParsed);
486 return E_NOTIMPL;
489 static HRESULT WINAPI domdoctype_get_namespaceURI(
490 IXMLDOMDocumentType *iface,
491 BSTR* p)
493 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
494 FIXME("(%p)->(%p): stub\n", This, p);
495 return E_NOTIMPL;
498 static HRESULT WINAPI domdoctype_get_prefix(
499 IXMLDOMDocumentType *iface,
500 BSTR* prefix)
502 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
503 FIXME("(%p)->(%p): stub\n", This, prefix);
504 return E_NOTIMPL;
507 static HRESULT WINAPI domdoctype_get_baseName(
508 IXMLDOMDocumentType *iface,
509 BSTR* name)
511 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
512 FIXME("(%p)->(%p): stub\n", This, name);
513 return E_NOTIMPL;
516 static HRESULT WINAPI domdoctype_transformNodeToObject(
517 IXMLDOMDocumentType *iface,
518 IXMLDOMNode* domNode, VARIANT var1)
520 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
521 FIXME("(%p)->(%p %s): stub\n", This, domNode, debugstr_variant(&var1));
522 return E_NOTIMPL;
525 static HRESULT WINAPI domdoctype_get_name(
526 IXMLDOMDocumentType *iface,
527 BSTR *p)
529 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
530 FIXME("(%p)->(%p): stub\n", This, p);
531 return E_NOTIMPL;
534 static HRESULT WINAPI domdoctype_get_entities(
535 IXMLDOMDocumentType *iface,
536 IXMLDOMNamedNodeMap **entityMap)
538 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
539 FIXME("(%p)->(%p): stub\n", This, entityMap);
540 return E_NOTIMPL;
543 static HRESULT WINAPI domdoctype_get_notations(
544 IXMLDOMDocumentType *iface,
545 IXMLDOMNamedNodeMap **notationMap)
547 domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
548 FIXME("(%p)->(%p): stub\n", This, notationMap);
549 return E_NOTIMPL;
552 static const struct IXMLDOMDocumentTypeVtbl domdoctype_vtbl =
554 domdoctype_QueryInterface,
555 domdoctype_AddRef,
556 domdoctype_Release,
557 domdoctype_GetTypeInfoCount,
558 domdoctype_GetTypeInfo,
559 domdoctype_GetIDsOfNames,
560 domdoctype_Invoke,
561 domdoctype_get_nodeName,
562 domdoctype_get_nodeValue,
563 domdoctype_put_nodeValue,
564 domdoctype_get_nodeType,
565 domdoctype_get_parentNode,
566 domdoctype_get_childNodes,
567 domdoctype_get_firstChild,
568 domdoctype_get_lastChild,
569 domdoctype_get_previousSibling,
570 domdoctype_get_nextSibling,
571 domdoctype_get_attributes,
572 domdoctype_insertBefore,
573 domdoctype_replaceChild,
574 domdoctype_removeChild,
575 domdoctype_appendChild,
576 domdoctype_hasChildNodes,
577 domdoctype_get_ownerDocument,
578 domdoctype_cloneNode,
579 domdoctype_get_nodeTypeString,
580 domdoctype_get_text,
581 domdoctype_put_text,
582 domdoctype_get_specified,
583 domdoctype_get_definition,
584 domdoctype_get_nodeTypedValue,
585 domdoctype_put_nodeTypedValue,
586 domdoctype_get_dataType,
587 domdoctype_put_dataType,
588 domdoctype_get_xml,
589 domdoctype_transformNode,
590 domdoctype_selectNodes,
591 domdoctype_selectSingleNode,
592 domdoctype_get_parsed,
593 domdoctype_get_namespaceURI,
594 domdoctype_get_prefix,
595 domdoctype_get_baseName,
596 domdoctype_transformNodeToObject,
597 domdoctype_get_name,
598 domdoctype_get_entities,
599 domdoctype_get_notations
602 static const tid_t domdoctype_iface_tids[] = {
603 IXMLDOMDocumentType_tid,
607 static dispex_static_data_t domdoctype_dispex = {
608 NULL,
609 IXMLDOMDocumentType_tid,
610 NULL,
611 domdoctype_iface_tids
614 IUnknown* create_doc_type( xmlNodePtr doctype )
616 domdoctype *This;
618 This = heap_alloc( sizeof *This );
619 if ( !This )
620 return NULL;
622 This->IXMLDOMDocumentType_iface.lpVtbl = &domdoctype_vtbl;
623 This->ref = 1;
625 init_xmlnode(&This->node, doctype, (IXMLDOMNode*)&This->IXMLDOMDocumentType_iface,
626 &domdoctype_dispex);
628 return (IUnknown*)&This->IXMLDOMDocumentType_iface;
631 #endif