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

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

class QSqlRecordJBridge : public QSqlRecord
{
public:
	QSqlRecordJBridge() : QSqlRecord() {}
	QSqlRecordJBridge(const QSqlRecord& other) : QSqlRecord(other) {}
	~QSqlRecordJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_newQSqlRecord__Lorg_kde_qt_QSqlRecord_2(JNIEnv *env, jobject obj, jobject other)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSqlRecordJBridge((QSqlRecord&) *(QSqlRecord *) QtSupport::getQt(env, other)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSqlRecord_value__I(JNIEnv *env, jobject obj, jint i)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QVariant (((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->value((int) i)), "org.kde.qt.QVariant", TRUE);
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_setValue__ILorg_kde_qt_QVariant_2(JNIEnv *env, jobject obj, jint i, jobject val)
{
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->setValue((int) i, (QVariant&) *(QVariant *) QtSupport::getQt(env, val));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_setValue__Ljava_lang_String_2Lorg_kde_qt_QVariant_2(JNIEnv *env, jobject obj, jstring name, jobject val)
{
static QString * _qstring_name = 0;
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->setValue((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QVariant&) *(QVariant *) QtSupport::getQt(env, val));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSqlRecord_isGenerated__I(JNIEnv *env, jobject obj, jint i)
{
	return (jboolean) ((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->isGenerated((int) i);
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_setGenerated__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring name, jboolean generated)
{
static QString * _qstring_name = 0;
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->setGenerated((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (bool) generated);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_setGenerated__IZ(JNIEnv *env, jobject obj, jint i, jboolean generated)
{
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->setGenerated((int) i, (bool) generated);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_setNull__I(JNIEnv *env, jobject obj, jint i)
{
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->setNull((int) i);
	return;
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSqlRecord_isNull__I(JNIEnv *env, jobject obj, jint i)
{
	return (jboolean) ((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->isNull((int) i);
}

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSqlRecord_position(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	return (jint) ((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->position((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name));
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QSqlRecord_fieldName(JNIEnv *env, jobject obj, jint i)
{
	QString  _qstring;
	_qstring = ((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->fieldName((int) i);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSqlRecord_field__I(JNIEnv *env, jobject obj, jint i)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->field((int) i), "org.kde.qt.QSqlField");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSqlRecord_field__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->field((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name)), "org.kde.qt.QSqlField");
}

//JNIEXPORT jobject JNICALL
//Java_org_kde_qt_QSqlRecord_field__I(JNIEnv *env, jobject obj, jint i)
//{
//	return (jobject) QtSupport::objectForQtKey(env, (void *)((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->field((int) i), "org.kde.qt.QSqlField");
//}

//JNIEXPORT jobject JNICALL
//Java_org_kde_qt_QSqlRecord_field__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name)
//{
//static QString * _qstring_name = 0;
//	return (jobject) QtSupport::objectForQtKey(env, (void *)((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->field((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name)), "org.kde.qt.QSqlField");
//}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_append(JNIEnv *env, jobject obj, jobject field)
{
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->append((QSqlField&) *(QSqlField *) QtSupport::getQt(env, field));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_insert(JNIEnv *env, jobject obj, jint pos, jobject field)
{
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->insert((int) pos, (QSqlField&) *(QSqlField *) QtSupport::getQt(env, field));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_remove(JNIEnv *env, jobject obj, jint pos)
{
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->remove((int) pos);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSqlRecord_isEmpty(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->isEmpty();
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_clear(JNIEnv *env, jobject obj)
{
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->clear();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_clearValues__Z(JNIEnv *env, jobject obj, jboolean nullify)
{
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->clearValues((bool) nullify);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSqlRecord_clearValues__(JNIEnv *env, jobject obj)
{
	((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->clearValues(FALSE);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSqlRecord_count(JNIEnv *env, jobject obj)
{
	return (jint) ((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->count();
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QSqlRecord_toString(JNIEnv *env, jobject obj, jstring prefix, jstring arg1)
{
	QString  _qstring;
static QString * _qstring_arg1 = 0;
static QString * _qstring_prefix = 0;
	_qstring = ((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->toString((QString&) * (QString *) QtSupport::toQString(env, prefix, &_qstring_prefix), (QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSqlRecord_toStringList(JNIEnv *env, jobject obj, jstring prefix)
{
	QStringList  _qlist;
static QString * _qstring_prefix = 0;
	_qlist = ((QSqlRecordJBridge*) QtSupport::getQt(env, obj))->toStringList((QString&) * (QString *) QtSupport::toQString(env, prefix, &_qstring_prefix));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

