/***************************************************************************
                            QDomDocument.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/QDomDocument.h>

class QDomDocumentJBridge : public QDomDocument
{
public:
	QDomDocumentJBridge() : QDomDocument() {}
	QDomDocumentJBridge(const QString& name) : QDomDocument(name) {}
	QDomDocumentJBridge(const QDomDocumentType& doctype) : QDomDocument(doctype) {}
	QDomDocumentJBridge(const QDomDocument& x) : QDomDocument(x) {}
	~QDomDocumentJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomDocument_newQDomDocument__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QDomDocumentJBridge((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomDocument_newQDomDocument__Lorg_kde_qt_QDomDocumentType_2(JNIEnv *env, jobject obj, jobject doctype)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QDomDocumentJBridge((QDomDocumentType&) *(QDomDocumentType *) QtSupport::getQt(env, doctype)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_createElement(JNIEnv *env, jobject obj, jstring tagName)
{
static QString * _qstring_tagName = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomElement (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->createElement((QString&) * (QString *) QtSupport::toQString(env, tagName, &_qstring_tagName))), "org.kde.qt.QDomElement", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_createDocumentFragment(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomDocumentFragment (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->createDocumentFragment()), "org.kde.qt.QDomDocumentFragment", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_createTextNode(JNIEnv *env, jobject obj, jstring data)
{
static QString * _qstring_data = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomText (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->createTextNode((QString&) * (QString *) QtSupport::toQString(env, data, &_qstring_data))), "org.kde.qt.QDomText", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_createComment(JNIEnv *env, jobject obj, jstring data)
{
static QString * _qstring_data = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomComment (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->createComment((QString&) * (QString *) QtSupport::toQString(env, data, &_qstring_data))), "org.kde.qt.QDomComment", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_createCDATASection(JNIEnv *env, jobject obj, jstring data)
{
static QString * _qstring_data = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomCDATASection (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->createCDATASection((QString&) * (QString *) QtSupport::toQString(env, data, &_qstring_data))), "org.kde.qt.QDomCDATASection", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_createProcessingInstruction(JNIEnv *env, jobject obj, jstring target, jstring data)
{
static QString * _qstring_data = 0;
static QString * _qstring_target = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomProcessingInstruction (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->createProcessingInstruction((QString&) * (QString *) QtSupport::toQString(env, target, &_qstring_target), (QString&) * (QString *) QtSupport::toQString(env, data, &_qstring_data))), "org.kde.qt.QDomProcessingInstruction", TRUE);
}

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

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_importNode(JNIEnv *env, jobject obj, jobject importedNode, jboolean deep)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomNode (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->importNode((QDomNode&) *(QDomNode *) QtSupport::getQt(env, importedNode), (bool) deep)), "org.kde.qt.QDomNode", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_createElementNS(JNIEnv *env, jobject obj, jstring nsURI, jstring qName)
{
static QString * _qstring_qName = 0;
static QString * _qstring_nsURI = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomElement (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->createElementNS((QString&) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, qName, &_qstring_qName))), "org.kde.qt.QDomElement", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_createAttributeNS(JNIEnv *env, jobject obj, jstring nsURI, jstring qName)
{
static QString * _qstring_qName = 0;
static QString * _qstring_nsURI = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomAttr (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->createAttributeNS((QString&) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, qName, &_qstring_qName))), "org.kde.qt.QDomAttr", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_elementsByTagNameNS(JNIEnv *env, jobject obj, jstring nsURI, jstring localName)
{
	QDomNodeList  _qlist;
static QString * _qstring_localName = 0;
static QString * _qstring_nsURI = 0;
	_qlist = ((QDomDocumentJBridge*) 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 jobject JNICALL
Java_org_kde_qt_QDomDocument_elementById(JNIEnv *env, jobject obj, jstring elementId)
{
static QString * _qstring_elementId = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomElement (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->elementById((QString&) * (QString *) QtSupport::toQString(env, elementId, &_qstring_elementId))), "org.kde.qt.QDomElement", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_doctype(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomDocumentType (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->doctype()), "org.kde.qt.QDomDocumentType", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_implementation(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomImplementation (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->implementation()), "org.kde.qt.QDomImplementation", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomDocument_documentElement(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomElement (((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->documentElement()), "org.kde.qt.QDomElement", TRUE);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent__Ljava_lang_String_2ZLjava_lang_String_2_3I_3I(JNIEnv *env, jobject obj, jstring text, jboolean namespaceProcessing, jstring errorMsg, jintArray errorLine, jintArray errorColumn)
{
static QString * _qstring_errorMsg = 0;
static QCString * _qcstring_text = 0;
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QCString&) * (QCString *) QtSupport::toQCString(env, text, &_qcstring_text), (bool) namespaceProcessing, (QString*) QtSupport::toQString(env, errorMsg, &_qstring_errorMsg),  (int*) QtSupport::toIntPtr(env, errorLine),  (int*) QtSupport::toIntPtr(env, errorColumn));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring text, jboolean namespaceProcessing)
{
static QCString * _qcstring_text = 0;
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QCString&) * (QCString *) QtSupport::toQCString(env, text, &_qcstring_text), (bool) namespaceProcessing, 0, 0, 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent___3BZLjava_lang_String_2_3I_3I(JNIEnv *env, jobject obj, jbyteArray text, jboolean namespaceProcessing, jstring errorMsg, jintArray errorLine, jintArray errorColumn)
{
static QString * _qstring_errorMsg = 0;
static QByteArray * _qbyteArray_text = 0;
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QByteArray&) * (QByteArray *) QtSupport::toQByteArray(env, text, &_qbyteArray_text), (bool) namespaceProcessing, (QString*) QtSupport::toQString(env, errorMsg, &_qstring_errorMsg),  (int*) QtSupport::toIntPtr(env, errorLine),  (int*) QtSupport::toIntPtr(env, errorColumn));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent___3BZ(JNIEnv *env, jobject obj, jbyteArray text, jboolean namespaceProcessing)
{
static QByteArray * _qbyteArray_text = 0;
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QByteArray&) * (QByteArray *) QtSupport::toQByteArray(env, text, &_qbyteArray_text), (bool) namespaceProcessing, 0, 0, 0);
}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QDomDocument_setContent__Ljava_lang_String_2ZLjava_lang_String_2_3I_3I(JNIEnv *env, jobject obj, jstring text, jboolean namespaceProcessing, jstring errorMsg, jintArray errorLine, jintArray errorColumn)
//{
//static QString * _qstring_errorMsg = 0;
//static QString * _qstring_text = 0;
//	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (bool) namespaceProcessing, (QString*) QtSupport::toQString(env, errorMsg, &_qstring_errorMsg),  (int*) QtSupport::toIntPtr(env, errorLine),  (int*) QtSupport::toIntPtr(env, errorColumn));
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QDomDocument_setContent__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring text, jboolean namespaceProcessing)
//{
//static QString * _qstring_text = 0;
//	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (bool) namespaceProcessing, 0, 0, 0);
//}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent__Lorg_kde_qt_QIODeviceInterface_2ZLjava_lang_String_2_3I_3I(JNIEnv *env, jobject obj, jobject dev, jboolean namespaceProcessing, jstring errorMsg, jintArray errorLine, jintArray errorColumn)
{
static QString * _qstring_errorMsg = 0;
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QIODevice*) QtSupport::getQt(env, dev), (bool) namespaceProcessing, (QString*) QtSupport::toQString(env, errorMsg, &_qstring_errorMsg),  (int*) QtSupport::toIntPtr(env, errorLine),  (int*) QtSupport::toIntPtr(env, errorColumn));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent__Lorg_kde_qt_QIODeviceInterface_2Z(JNIEnv *env, jobject obj, jobject dev, jboolean namespaceProcessing)
{
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QIODevice*) QtSupport::getQt(env, dev), (bool) namespaceProcessing, 0, 0, 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent__Ljava_lang_String_2Ljava_lang_String_2_3I_3I(JNIEnv *env, jobject obj, jstring text, jstring errorMsg, jintArray errorLine, jintArray errorColumn)
{
static QString * _qstring_errorMsg = 0;
static QCString * _qcstring_text = 0;
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QCString&) * (QCString *) QtSupport::toQCString(env, text, &_qcstring_text), (QString*) QtSupport::toQString(env, errorMsg, &_qstring_errorMsg),  (int*) QtSupport::toIntPtr(env, errorLine),  (int*) QtSupport::toIntPtr(env, errorColumn));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text)
{
static QCString * _qcstring_text = 0;
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((const QCString&) * (QCString *) QtSupport::toQCString(env, text, &_qcstring_text), (QString *) 0, 0, (int *) 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent___3BLjava_lang_String_2_3I_3I(JNIEnv *env, jobject obj, jbyteArray text, jstring errorMsg, jintArray errorLine, jintArray errorColumn)
{
static QString * _qstring_errorMsg = 0;
static QByteArray * _qbyteArray_text = 0;
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QByteArray&) * (QByteArray *) QtSupport::toQByteArray(env, text, &_qbyteArray_text), (QString*) QtSupport::toQString(env, errorMsg, &_qstring_errorMsg),  (int*) QtSupport::toIntPtr(env, errorLine),  (int*) QtSupport::toIntPtr(env, errorColumn));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent___3B(JNIEnv *env, jobject obj, jbyteArray text)
{
static QByteArray * _qbyteArray_text = 0;
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((const QByteArray&) * (QByteArray *) QtSupport::toQByteArray(env, text, &_qbyteArray_text), (QString *) 0, 0, 0);
}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QDomDocument_setContent__Ljava_lang_String_2Ljava_lang_String_2_3I_3I(JNIEnv *env, jobject obj, jstring text, jstring errorMsg, jintArray errorLine, jintArray errorColumn)
//{
//static QString * _qstring_errorMsg = 0;
//static QString * _qstring_text = 0;
//	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QString*) QtSupport::toQString(env, errorMsg, &_qstring_errorMsg),  (int*) QtSupport::toIntPtr(env, errorLine),  (int*) QtSupport::toIntPtr(env, errorColumn));
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QDomDocument_setContent__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text)
//{
//static QString * _qstring_text = 0;
//	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), 0, 0, 0);
//}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent__Lorg_kde_qt_QIODeviceInterface_2Ljava_lang_String_2_3I_3I(JNIEnv *env, jobject obj, jobject dev, jstring errorMsg, jintArray errorLine, jintArray errorColumn)
{
static QString * _qstring_errorMsg = 0;
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QIODevice*) QtSupport::getQt(env, dev), (QString*) QtSupport::toQString(env, errorMsg, &_qstring_errorMsg),  (int*) QtSupport::toIntPtr(env, errorLine),  (int*) QtSupport::toIntPtr(env, errorColumn));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_setContent__Lorg_kde_qt_QIODeviceInterface_2(JNIEnv *env, jobject obj, jobject dev)
{
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->setContent((QIODevice*) QtSupport::getQt(env, dev), (QString *) 0, 0, 0);
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomDocument_isDocument(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->isDocument();
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QDomDocument_toCString(JNIEnv *env, jobject obj)
{
	QCString  _qcstring;
	_qcstring = ((QDomDocumentJBridge*) QtSupport::getQt(env, obj))->toCString();
	return QtSupport::fromQCString(env, &_qcstring);
}

