/***************************************************************************
                            QDomElement.cpp -  description
                             -------------------
    begin                : Wed Nov 21 17:05:56 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 17:05:56 2001, using kalyptus 0.9.
 ***************************************************************************/

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

#define _BOOL_H_
#include <qdom.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QDomElement.h>

class QDomElementJBridge : public QDomElement
{
public:
	QDomElementJBridge() : QDomElement() {}
	QDomElementJBridge(const QDomElement& x) : QDomElement(x) {}
	~QDomElementJBridge() {QtSupport::qtKeyDeleted(this);}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_newQDomElement__(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QDomElementJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_newQDomElement__Lorg_kde_qt_QDomElement_2(JNIEnv *env, jobject obj, jobject x)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QDomElementJBridge((QDomElement&) *(QDomElement *) QtSupport::getQt(env, x)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj)) {
		delete (QDomElement*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QDomElement_attribute(JNIEnv *env, jobject obj, jstring name, jstring defValue)
{
	QString  _qstring;
static QString * _qstring_defValue = 0;
static QString * _qstring_name = 0;
	_qstring = ((QDomElementJBridge*) QtSupport::getQt(env, obj))->attribute((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QString&) * (QString *) QtSupport::toQString(env, defValue, &_qstring_defValue));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_setAttribute__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name, jstring value)
{
static QString * _qstring_value = 0;
static QString * _qstring_name = 0;
	((QDomElementJBridge*) QtSupport::getQt(env, obj))->setAttribute((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QString&) * (QString *) QtSupport::toQString(env, value, &_qstring_value));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_setAttribute__Ljava_lang_String_2I(JNIEnv *env, jobject obj, jstring name, jint value)
{
static QString * _qstring_name = 0;
	((QDomElementJBridge*) QtSupport::getQt(env, obj))->setAttribute((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (int) value);
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QDomElement_setAttribute__Ljava_lang_String_2I(JNIEnv *env, jobject obj, jstring name, jint value)
//{
//static QString * _qstring_name = 0;
//	((QDomElementJBridge*) QtSupport::getQt(env, obj))->setAttribute((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (uint) value);
//	return;
//}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_setAttribute__Ljava_lang_String_2D(JNIEnv *env, jobject obj, jstring name, jdouble value)
{
static QString * _qstring_name = 0;
	((QDomElementJBridge*) QtSupport::getQt(env, obj))->setAttribute((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (double) value);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_removeAttribute(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	((QDomElementJBridge*) QtSupport::getQt(env, obj))->removeAttribute((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomElement_attributeNode(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomAttr (((QDomElementJBridge*) QtSupport::getQt(env, obj))->attributeNode((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name))), "org.kde.qt.QDomAttr", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomElement_setAttributeNode(JNIEnv *env, jobject obj, jobject newAttr)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomAttr (((QDomElementJBridge*) QtSupport::getQt(env, obj))->setAttributeNode((QDomAttr&) *(QDomAttr *) QtSupport::getQt(env, newAttr))), "org.kde.qt.QDomAttr", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomElement_removeAttributeNode(JNIEnv *env, jobject obj, jobject oldAttr)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomAttr (((QDomElementJBridge*) QtSupport::getQt(env, obj))->removeAttributeNode((QDomAttr&) *(QDomAttr *) QtSupport::getQt(env, oldAttr))), "org.kde.qt.QDomAttr", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomElement_elementsByTagName(JNIEnv *env, jobject obj, jstring tagname)
{
	QDomNodeList  _qlist;
static QString * _qstring_tagname = 0;
	_qlist = ((QDomElementJBridge*) QtSupport::getQt(env, obj))->elementsByTagName((QString&) * (QString *) QtSupport::toQString(env, tagname, &_qstring_tagname));
	return (jobject) QtSupport::arrayWithQDomNodeList(env, (QDomNodeList *) &_qlist);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomElement_hasAttribute(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	return (jboolean) ((QDomElementJBridge*) QtSupport::getQt(env, obj))->hasAttribute((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name));
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QDomElement_attributeNS(JNIEnv *env, jobject obj, jstring nsURI, jstring localName, jstring defValue)
{
	QString  _qstring;
static QString * _qstring_defValue = 0;
static QString * _qstring_localName = 0;
static QString * _qstring_nsURI = 0;
	_qstring = ((QDomElementJBridge*) QtSupport::getQt(env, obj))->attributeNS((QString) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, localName, &_qstring_localName), (QString&) * (QString *) QtSupport::toQString(env, defValue, &_qstring_defValue));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_setAttributeNS__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring nsURI, jstring qName, jstring value)
{
static QString * _qstring_value = 0;
static QString * _qstring_qName = 0;
static QString * _qstring_nsURI = 0;
	((QDomElementJBridge*) QtSupport::getQt(env, obj))->setAttributeNS((QString) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, qName, &_qstring_qName), (QString&) * (QString *) QtSupport::toQString(env, value, &_qstring_value));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_setAttributeNS__Ljava_lang_String_2Ljava_lang_String_2I(JNIEnv *env, jobject obj, jstring nsURI, jstring qName, jint value)
{
static QString * _qstring_qName = 0;
static QString * _qstring_nsURI = 0;
	((QDomElementJBridge*) QtSupport::getQt(env, obj))->setAttributeNS((QString) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, qName, &_qstring_qName), (int) value);
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QDomElement_setAttributeNS__Ljava_lang_String_2Ljava_lang_String_2I(JNIEnv *env, jobject obj, jstring nsURI, jstring qName, jint value)
//{
//static QString * _qstring_qName = 0;
//static QString * _qstring_nsURI = 0;
//	((QDomElementJBridge*) QtSupport::getQt(env, obj))->setAttributeNS((QString) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, qName, &_qstring_qName), (uint) value);
//	return;
//}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_setAttributeNS__Ljava_lang_String_2Ljava_lang_String_2D(JNIEnv *env, jobject obj, jstring nsURI, jstring qName, jdouble value)
{
static QString * _qstring_qName = 0;
static QString * _qstring_nsURI = 0;
	((QDomElementJBridge*) QtSupport::getQt(env, obj))->setAttributeNS((QString) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, qName, &_qstring_qName), (double) value);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_removeAttributeNS(JNIEnv *env, jobject obj, jstring nsURI, jstring localName)
{
static QString * _qstring_localName = 0;
static QString * _qstring_nsURI = 0;
	((QDomElementJBridge*) QtSupport::getQt(env, obj))->removeAttributeNS((QString&) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, localName, &_qstring_localName));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomElement_attributeNodeNS(JNIEnv *env, jobject obj, jstring nsURI, jstring localName)
{
static QString * _qstring_localName = 0;
static QString * _qstring_nsURI = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomAttr (((QDomElementJBridge*) QtSupport::getQt(env, obj))->attributeNodeNS((QString&) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, localName, &_qstring_localName))), "org.kde.qt.QDomAttr", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomElement_setAttributeNodeNS(JNIEnv *env, jobject obj, jobject newAttr)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomAttr (((QDomElementJBridge*) QtSupport::getQt(env, obj))->setAttributeNodeNS((QDomAttr&) *(QDomAttr *) QtSupport::getQt(env, newAttr))), "org.kde.qt.QDomAttr", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomElement_elementsByTagNameNS(JNIEnv *env, jobject obj, jstring nsURI, jstring localName)
{
	QDomNodeList  _qlist;
static QString * _qstring_localName = 0;
static QString * _qstring_nsURI = 0;
	_qlist = ((QDomElementJBridge*) QtSupport::getQt(env, obj))->elementsByTagNameNS((QString&) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, localName, &_qstring_localName));
	return (jobject) QtSupport::arrayWithQDomNodeList(env, (QDomNodeList *) &_qlist);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomElement_hasAttributeNS(JNIEnv *env, jobject obj, jstring nsURI, jstring localName)
{
static QString * _qstring_localName = 0;
static QString * _qstring_nsURI = 0;
	return (jboolean) ((QDomElementJBridge*) QtSupport::getQt(env, obj))->hasAttributeNS((QString&) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, localName, &_qstring_localName));
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QDomElement_tagName(JNIEnv *env, jobject obj)
{
	QString  _qstring;
	_qstring = ((QDomElementJBridge*) QtSupport::getQt(env, obj))->tagName();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomElement_setTagName(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	((QDomElementJBridge*) QtSupport::getQt(env, obj))->setTagName((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomElement_attributes(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomNamedNodeMap (((QDomElementJBridge*) QtSupport::getQt(env, obj))->attributes()), "org.kde.qt.QDomNamedNodeMap", TRUE);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QDomElement_nodeType(JNIEnv *env, jobject obj)
{
	return (jint) ((QDomElementJBridge*) QtSupport::getQt(env, obj))->nodeType();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomElement_isElement(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QDomElementJBridge*) QtSupport::getQt(env, obj))->isElement();
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QDomElement_text(JNIEnv *env, jobject obj)
{
	QString  _qstring;
	_qstring = ((QDomElementJBridge*) QtSupport::getQt(env, obj))->text();
	return QtSupport::fromQString(env, &_qstring);
}

