/***************************************************************************
                            QSqlPropertyMap.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 <qsqlpropertymap.h>
#include <qstring.h>
#include <qcstring.h>

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

class QSqlPropertyMapJBridge : public QSqlPropertyMap
{
public:
	QSqlPropertyMapJBridge() : QSqlPropertyMap() {}
	~QSqlPropertyMapJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSqlPropertyMap_property(JNIEnv *env, jobject obj, jobject widget)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QVariant (((QSqlPropertyMapJBridge*) QtSupport::getQt(env, obj))->property((QWidget*) QtSupport::getQt(env, widget))), "org.kde.qt.QVariant", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlPropertyMap_setProperty(JNIEnv *env, jobject obj, jobject widget, jobject value)
{
	((QSqlPropertyMapJBridge*) QtSupport::getQt(env, obj))->setProperty((QWidget*) QtSupport::getQt(env, widget), (QVariant&) *(QVariant *) QtSupport::getQt(env, value));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlPropertyMap_insert(JNIEnv *env, jobject obj, jstring classname, jstring property)
{
static QString * _qstring_property = 0;
static QString * _qstring_classname = 0;
	((QSqlPropertyMapJBridge*) QtSupport::getQt(env, obj))->insert((QString&) * (QString *) QtSupport::toQString(env, classname, &_qstring_classname), (QString&) * (QString *) QtSupport::toQString(env, property, &_qstring_property));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlPropertyMap_remove(JNIEnv *env, jobject obj, jstring classname)
{
static QString * _qstring_classname = 0;
	((QSqlPropertyMapJBridge*) QtSupport::getQt(env, obj))->remove((QString&) * (QString *) QtSupport::toQString(env, classname, &_qstring_classname));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSqlPropertyMap_defaultMap(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QSqlPropertyMapJBridge::defaultMap(), "org.kde.qt.QSqlPropertyMap");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlPropertyMap_installDefaultMap(JNIEnv *env, jclass obj, jobject map)
{
	QSqlPropertyMapJBridge::installDefaultMap((QSqlPropertyMap*) QtSupport::getQt(env, map));
	return;
}

