/***************************************************************************
                            kde_DOMDocument.cpp -  description
                             -------------------
    begin                : Wed Feb  6 15:12:26 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Feb  6 15:12:26 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

extern "C" {
#include "kde_DOMDocument.h"
}

#include <dom/dom_doc.h>
#include <dom/dom_element.h>
#include <dom/dom_text.h>
#include <dom/dom_node.h>
#include <dom/dom_xml.h>
#include <dom/dom2_range.h>
#include <dom/dom2_traversal.h>

class DocumentBridge : public DOM::Document
{
public:
	DocumentBridge() : Document() {}
	DocumentBridge(bool arg1) : Document(arg1) {}
	DocumentBridge(const Document& other) : Document(other) {}
	DocumentBridge(const Node& other) : Document(other) {}
	~DocumentBridge() {}
};

kde_DOMDocument * kde_new_DOMDocument(){
	return (kde_DOMDocument *) new DocumentBridge();
}
kde_DOMDocument * kde_new_DOMDocument1(int arg1){
	return (kde_DOMDocument *) new DocumentBridge((bool)arg1);
}
kde_DOMDocument * kde_new_DOMDocument2(kde_DOMDocument* other){
	return (kde_DOMDocument *) new DocumentBridge((DOM::Document&)* (DOM::Document*)other);
}
kde_DOMDocument * kde_new_DOMDocument3(kde_DOMNode* other){
	return (kde_DOMDocument *) new DocumentBridge((DOM::Node&)* (DOM::Node*)other);
}
void kde_del_DOMDocument( kde_DOMDocument* p ){
	delete (DocumentBridge*) p;
}
kde_DocumentType* kde_DOMDocument_doctype( kde_DOMDocument* instPointer){
	return (kde_DocumentType*)new DOM::DocumentType(((DocumentBridge*)instPointer)->doctype());
}
//kde_DOMImplementation* kde_DOMDocument_implementation( kde_DOMDocument* instPointer){
//	return (kde_DOMImplementation*)new DOM::DOMImplementation(((DocumentBridge*)instPointer)->implementation());
//}
kde_Element* kde_DOMDocument_documentElement( kde_DOMDocument* instPointer){
	return (kde_Element*)new DOM::Element(((DocumentBridge*)instPointer)->documentElement());
}
kde_Element* kde_DOMDocument_createElement( kde_DOMDocument* instPointer,kde_DOMString* tagName){
	return (kde_Element*)new DOM::Element(((DocumentBridge*)instPointer)->createElement((DOM::DOMString&)* (DOM::DOMString*)tagName));
}
kde_Element* kde_DOMDocument_createElementNS( kde_DOMDocument* instPointer,kde_DOMString* namespaceURI, kde_DOMString* qualifiedName){
	return (kde_Element*)new DOM::Element(((DocumentBridge*)instPointer)->createElementNS((DOM::DOMString&)* (DOM::DOMString*)namespaceURI, (DOM::DOMString&)* (DOM::DOMString*)qualifiedName));
}
//kde_DOMDocumentFragment* kde_DOMDocument_createDocumentFragment( kde_DOMDocument* instPointer){
//	return (kde_DOMDocumentFragment*)new DOM::DocumentFragment(((DocumentBridge*)instPointer)->createDocumentFragment());
//}
kde_Text* kde_DOMDocument_createTextNode( kde_DOMDocument* instPointer,kde_DOMString* data){
	return (kde_Text*)new DOM::Text(((DocumentBridge*)instPointer)->createTextNode((DOM::DOMString&)* (DOM::DOMString*)data));
}
kde_Comment* kde_DOMDocument_createComment( kde_DOMDocument* instPointer,kde_DOMString* data){
	return (kde_Comment*)new DOM::Comment(((DocumentBridge*)instPointer)->createComment((DOM::DOMString&)* (DOM::DOMString*)data));
}
kde_CDATASection* kde_DOMDocument_createCDATASection( kde_DOMDocument* instPointer,kde_DOMString* data){
	return (kde_CDATASection*)new DOM::CDATASection(((DocumentBridge*)instPointer)->createCDATASection((DOM::DOMString&)* (DOM::DOMString*)data));
}
kde_ProcessingInstruction* kde_DOMDocument_createProcessingInstruction( kde_DOMDocument* instPointer,kde_DOMString* target, kde_DOMString* data){
	return (kde_ProcessingInstruction*)new DOM::ProcessingInstruction(((DocumentBridge*)instPointer)->createProcessingInstruction((DOM::DOMString&)* (DOM::DOMString*)target, (DOM::DOMString&)* (DOM::DOMString*)data));
}
kde_Attr* kde_DOMDocument_createAttribute( kde_DOMDocument* instPointer,kde_DOMString* name){
	return (kde_Attr*)new DOM::Attr(((DocumentBridge*)instPointer)->createAttribute((DOM::DOMString&)* (DOM::DOMString*)name));
}
kde_Attr* kde_DOMDocument_createAttributeNS( kde_DOMDocument* instPointer,kde_DOMString* namespaceURI, kde_DOMString* qualifiedName){
	return (kde_Attr*)new DOM::Attr(((DocumentBridge*)instPointer)->createAttributeNS((DOM::DOMString&)* (DOM::DOMString*)namespaceURI, (DOM::DOMString&)* (DOM::DOMString*)qualifiedName));
}
kde_EntityReference* kde_DOMDocument_createEntityReference( kde_DOMDocument* instPointer,kde_DOMString* name){
	return (kde_EntityReference*)new DOM::EntityReference(((DocumentBridge*)instPointer)->createEntityReference((DOM::DOMString&)* (DOM::DOMString*)name));
}
kde_Element* kde_DOMDocument_getElementById( kde_DOMDocument* instPointer,kde_DOMString* elementId){
	return (kde_Element*)new DOM::Element(((DocumentBridge*)instPointer)->getElementById((DOM::DOMString&)* (DOM::DOMString*)elementId));
}
kde_DOMNodeList* kde_DOMDocument_getElementsByTagName( kde_DOMDocument* instPointer,kde_DOMString* tagname){
	return (kde_DOMNodeList*)new DOM::NodeList(((DocumentBridge*)instPointer)->getElementsByTagName((DOM::DOMString&)* (DOM::DOMString*)tagname));
}
kde_DOMNodeList* kde_DOMDocument_getElementsByTagNameNS( kde_DOMDocument* instPointer,kde_DOMString* namespaceURI, kde_DOMString* localName){
	return (kde_DOMNodeList*)new DOM::NodeList(((DocumentBridge*)instPointer)->getElementsByTagNameNS((DOM::DOMString&)* (DOM::DOMString*)namespaceURI, (DOM::DOMString&)* (DOM::DOMString*)localName));
}
kde_DOMNode* kde_DOMDocument_importNode( kde_DOMDocument* instPointer,kde_DOMNode* importedNode, int deep){
	return (kde_DOMNode*)new DOM::Node(((DocumentBridge*)instPointer)->importNode((DOM::Node&)* (DOM::Node*)importedNode, (bool)deep));
}
int kde_DOMDocument_isHTMLDocument( kde_DOMDocument* instPointer){
	return (int) ((DocumentBridge*)instPointer)->isHTMLDocument();
}
kde_Range* kde_DOMDocument_createRange( kde_DOMDocument* instPointer){
	return (kde_Range*)new DOM::Range(((DocumentBridge*)instPointer)->createRange());
}
kde_NodeIterator* kde_DOMDocument_createNodeIterator( kde_DOMDocument* instPointer,kde_DOMNode* root, unsigned long whatToShow, kde_NodeFilter* filter, int entityReferenceExpansion){
	return (kde_NodeIterator*)new DOM::NodeIterator(((DocumentBridge*)instPointer)->createNodeIterator((DOM::Node)* (DOM::Node*)root, (unsigned long)whatToShow, (DOM::NodeFilter)* (DOM::NodeFilter*)filter, (bool)entityReferenceExpansion));
}
kde_TreeWalker* kde_DOMDocument_createTreeWalker( kde_DOMDocument* instPointer,kde_DOMNode* root, unsigned long whatToShow, kde_NodeFilter* filter, int entityReferenceExpansion){
	return (kde_TreeWalker*)new DOM::TreeWalker(((DocumentBridge*)instPointer)->createTreeWalker((DOM::Node)* (DOM::Node*)root, (unsigned long)whatToShow, (DOM::NodeFilter)* (DOM::NodeFilter*)filter, (bool)entityReferenceExpansion));
}
//AbstractView kde_DOMDocument_defaultView( kde_DOMDocument* instPointer){
//	return (AbstractView) ((DocumentBridge*)instPointer)->defaultView();
//}
//kde_StyleSheetList kde_DOMDocument_styleSheets( kde_DOMDocument* instPointer){
//	return (kde_StyleSheetList)new DOM::StyleSheetList(((DocumentBridge*)instPointer)->styleSheets());
//}
kde_KHTMLView* kde_DOMDocument_view( kde_DOMDocument* instPointer){
	return (kde_KHTMLView*) ((DocumentBridge*)instPointer)->view();
}
kde_CSSStyleDeclaration* kde_DOMDocument_getOverrideStyle( kde_DOMDocument* instPointer,kde_Element* elt, kde_DOMString* pseudoElt){
	return (kde_CSSStyleDeclaration*)new DOM::CSSStyleDeclaration(((DocumentBridge*)instPointer)->getOverrideStyle((DOM::Element&)* (DOM::Element*)elt, (DOM::DOMString&)* (DOM::DOMString*)pseudoElt));
}
kde_DOMString* kde_DOMDocument_completeURL( kde_DOMDocument* instPointer,kde_DOMString* url){
	return (kde_DOMString*)new DOM::DOMString(((DocumentBridge*)instPointer)->completeURL((DOM::DOMString&)* (DOM::DOMString*)url));
}
