/***************************************************************************
                            QDomImplementation.cpp -  description
                             -------------------
    begin                : Sun Nov  3 10:27:27 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Nov  3 10:27:27 2002, 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/QDomImplementation.h>

class QDomImplementationJBridge : public QDomImplementation
{
public:
	QDomImplementationJBridge() : QDomImplementation() {}
	~QDomImplementationJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QDomImplementation_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_qt_QDomImplementation_finalize(env, obj);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomImplementation_isDisposed(JNIEnv *env, jobject obj)
{
	return (QtSupport::getQt(env, obj) == 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomImplementation_hasFeature(JNIEnv *env, jobject obj, jstring feature, jstring version)
{
static QString * _qstring_version = 0;
static QString * _qstring_feature = 0;
	return (jboolean) ((QDomImplementation*) QtSupport::getQt(env, obj))->hasFeature((QString&) * (QString *) QtSupport::toQString(env, feature, &_qstring_feature), (QString&) * (QString *) QtSupport::toQString(env, version, &_qstring_version));
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomImplementation_createDocumentType(JNIEnv *env, jobject obj, jstring qName, jstring publicId, jstring systemId)
{
static QString * _qstring_systemId = 0;
static QString * _qstring_publicId = 0;
static QString * _qstring_qName = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomDocumentType(((QDomImplementation*) QtSupport::getQt(env, obj))->createDocumentType((QString&) * (QString *) QtSupport::toQString(env, qName, &_qstring_qName), (QString&) * (QString *) QtSupport::toQString(env, publicId, &_qstring_publicId), (QString&) * (QString *) QtSupport::toQString(env, systemId, &_qstring_systemId))), "org.kde.qt.QDomDocumentType", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDomImplementation_createDocument(JNIEnv *env, jobject obj, jstring nsURI, jstring qName, jobject doctype)
{
static QString * _qstring_qName = 0;
static QString * _qstring_nsURI = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomDocument(((QDomImplementation*) QtSupport::getQt(env, obj))->createDocument((QString&) * (QString *) QtSupport::toQString(env, nsURI, &_qstring_nsURI), (QString&) * (QString *) QtSupport::toQString(env, qName, &_qstring_qName), (QDomDocumentType&) *(QDomDocumentType *) QtSupport::getQt(env, doctype))), "org.kde.qt.QDomDocument", TRUE);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDomImplementation_isNull(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QDomImplementation*) QtSupport::getQt(env, obj))->isNull();
}

