/***************************************************************************
                            kde_DOMNode.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_DOMNode.h"
}

#include <qrect.h>
#include <dom/dom_node.h>
#include <dom/dom_string.h>
#include <dom/dom_doc.h>

class NodeBridge : public DOM::Node
{
public:
	NodeBridge() : Node() {}
	NodeBridge(const Node& other) : Node(other) {}
	~NodeBridge() {}
};

kde_DOMNode * kde_new_DOMNode(){
	return (kde_DOMNode *) new NodeBridge();
}
kde_DOMNode * kde_new_DOMNode1(kde_DOMNode* other){
	return (kde_DOMNode *) new NodeBridge((DOM::Node&)* (DOM::Node*)other);
}
void kde_del_DOMNode( kde_DOMNode* p ){
	delete (NodeBridge*) p;
}
kde_DOMString* kde_DOMNode_nodeName( kde_DOMNode* instPointer){
	return (kde_DOMString*)new DOM::DOMString(((NodeBridge*)instPointer)->nodeName());
}
kde_DOMString* kde_DOMNode_nodeValue( kde_DOMNode* instPointer){
	return (kde_DOMString*)new DOM::DOMString(((NodeBridge*)instPointer)->nodeValue());
}
void kde_DOMNode_setNodeValue( kde_DOMNode* instPointer,kde_DOMString* arg1){
	((NodeBridge*)instPointer)->setNodeValue((DOM::DOMString&)* (DOM::DOMString*)arg1);
	return;
}
unsigned short kde_DOMNode_nodeType( kde_DOMNode* instPointer){
	return (unsigned short) ((NodeBridge*)instPointer)->nodeType();
}
kde_DOMNode* kde_DOMNode_parentNode( kde_DOMNode* instPointer){
	return (kde_DOMNode*)new DOM::Node(((NodeBridge*)instPointer)->parentNode());
}
kde_DOMNodeList* kde_DOMNode_childNodes( kde_DOMNode* instPointer){
	return (kde_DOMNodeList*)new DOM::NodeList(((NodeBridge*)instPointer)->childNodes());
}
kde_DOMNode* kde_DOMNode_firstChild( kde_DOMNode* instPointer){
	return (kde_DOMNode*)new DOM::Node(((NodeBridge*)instPointer)->firstChild());
}
kde_DOMNode* kde_DOMNode_lastChild( kde_DOMNode* instPointer){
	return (kde_DOMNode*)new DOM::Node(((NodeBridge*)instPointer)->lastChild());
}
kde_DOMNode* kde_DOMNode_previousSibling( kde_DOMNode* instPointer){
	return (kde_DOMNode*)new DOM::Node(((NodeBridge*)instPointer)->previousSibling());
}
kde_DOMNode* kde_DOMNode_nextSibling( kde_DOMNode* instPointer){
	return (kde_DOMNode*)new DOM::Node(((NodeBridge*)instPointer)->nextSibling());
}
kde_NamedNodeMap* kde_DOMNode_attributes( kde_DOMNode* instPointer){
	return (kde_NamedNodeMap*)new DOM::NamedNodeMap(((NodeBridge*)instPointer)->attributes());
}
kde_Document* kde_DOMNode_ownerDocument( kde_DOMNode* instPointer){
	return (kde_Document*)new DOM::Document(((NodeBridge*)instPointer)->ownerDocument());
}
kde_DOMNode* kde_DOMNode_insertBefore( kde_DOMNode* instPointer,kde_DOMNode* newChild, kde_DOMNode* refChild){
	return (kde_DOMNode*)new DOM::Node(((NodeBridge*)instPointer)->insertBefore((DOM::Node&)* (DOM::Node*)newChild, (DOM::Node&)* (DOM::Node*)refChild));
}
kde_DOMNode* kde_DOMNode_replaceChild( kde_DOMNode* instPointer,kde_DOMNode* newChild, kde_DOMNode* oldChild){
	return (kde_DOMNode*)new DOM::Node(((NodeBridge*)instPointer)->replaceChild((DOM::Node&)* (DOM::Node*)newChild, (DOM::Node&)* (DOM::Node*)oldChild));
}
kde_DOMNode* kde_DOMNode_removeChild( kde_DOMNode* instPointer,kde_DOMNode* oldChild){
	return (kde_DOMNode*)new DOM::Node(((NodeBridge*)instPointer)->removeChild((DOM::Node&)* (DOM::Node*)oldChild));
}
kde_DOMNode* kde_DOMNode_appendChild( kde_DOMNode* instPointer,kde_DOMNode* newChild){
	return (kde_DOMNode*)new DOM::Node(((NodeBridge*)instPointer)->appendChild((DOM::Node&)* (DOM::Node*)newChild));
}
int kde_DOMNode_hasChildNodes( kde_DOMNode* instPointer){
	return (int) ((NodeBridge*)instPointer)->hasChildNodes();
}
kde_DOMNode* kde_DOMNode_cloneNode( kde_DOMNode* instPointer,int deep){
	return (kde_DOMNode*)new DOM::Node(((NodeBridge*)instPointer)->cloneNode((bool)deep));
}
void kde_DOMNode_normalize( kde_DOMNode* instPointer){
	((NodeBridge*)instPointer)->normalize();
	return;
}
int kde_DOMNode_isSupported( kde_DOMNode* instPointer,kde_DOMString* feature, kde_DOMString* version){
	return (int) ((NodeBridge*)instPointer)->isSupported((DOM::DOMString&)* (DOM::DOMString*)feature, (DOM::DOMString&)* (DOM::DOMString*)version);
}
kde_DOMString* kde_DOMNode_namespaceURI( kde_DOMNode* instPointer){
	return (kde_DOMString*)new DOM::DOMString(((NodeBridge*)instPointer)->namespaceURI());
}
kde_DOMString* kde_DOMNode_prefix( kde_DOMNode* instPointer){
	return (kde_DOMString*)new DOM::DOMString(((NodeBridge*)instPointer)->prefix());
}
void kde_DOMNode_setPrefix( kde_DOMNode* instPointer,kde_DOMString* prefix){
	((NodeBridge*)instPointer)->setPrefix((DOM::DOMString&)* (DOM::DOMString*)prefix);
	return;
}
kde_DOMString* kde_DOMNode_localName( kde_DOMNode* instPointer){
	return (kde_DOMString*)new DOM::DOMString(((NodeBridge*)instPointer)->localName());
}
int kde_DOMNode_hasAttributes( kde_DOMNode* instPointer){
	return (int) ((NodeBridge*)instPointer)->hasAttributes();
}
void kde_DOMNode_addEventListener( kde_DOMNode* instPointer,kde_DOMString* type, kde_EventListener* listener, int useCapture){
	((NodeBridge*)instPointer)->addEventListener((DOM::DOMString&)* (DOM::DOMString*)type, (DOM::EventListener*)listener, (bool)useCapture);
	return;
}
void kde_DOMNode_removeEventListener( kde_DOMNode* instPointer,kde_DOMString* type, kde_EventListener* listener, int useCapture){
	((NodeBridge*)instPointer)->removeEventListener((DOM::DOMString&)* (DOM::DOMString*)type, (DOM::EventListener*)listener, (bool)useCapture);
	return;
}
unsigned int kde_DOMNode_elementId( kde_DOMNode* instPointer){
	return (unsigned int) ((NodeBridge*)instPointer)->elementId();
}
int kde_DOMNode_isNull( kde_DOMNode* instPointer){
	return (int) ((NodeBridge*)instPointer)->isNull();
}
//kde_DOMNodeImpl* kde_DOMNode_handle( kde_DOMNode* instPointer){
//	return (kde_DOMNodeImpl*) ((NodeBridge*)instPointer)->handle();
//}
unsigned long kde_DOMNode_index( kde_DOMNode* instPointer){
	return (unsigned long) ((NodeBridge*)instPointer)->index();
}
qt_QString * kde_DOMNode_toHTML( kde_DOMNode* instPointer){
	return (qt_QString *)new QString(((NodeBridge*)instPointer)->toHTML());
}
void kde_DOMNode_applyChanges( kde_DOMNode* instPointer){
	((NodeBridge*)instPointer)->applyChanges();
	return;
}
void kde_DOMNode_getCursor( kde_DOMNode* instPointer,int offset, int _x, int _y, int height){
	((NodeBridge*)instPointer)->getCursor((int)offset, (int&)_x, (int&)_y, (int&)height);
	return;
}
qt_QRect* kde_DOMNode_getRect( kde_DOMNode* instPointer){
	QRect _r= ((NodeBridge*)instPointer)->getRect();
	return (qt_QRect*)new QRect(_r.left(),_r.top(),_r.width(),_r.height());
}
