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

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

class QSettingsJBridge : public QSettings
{
public:
	QSettingsJBridge() : QSettings() {}
	~QSettingsJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSettings_writeEntry__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring arg1, jboolean arg2)
{
static QString * _qstring_arg1 = 0;
	return (jboolean) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->writeEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (bool) arg2);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSettings_writeEntry__Ljava_lang_String_2D(JNIEnv *env, jobject obj, jstring arg1, jdouble arg2)
{
static QString * _qstring_arg1 = 0;
	return (jboolean) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->writeEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (double) arg2);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSettings_writeEntry__Ljava_lang_String_2I(JNIEnv *env, jobject obj, jstring arg1, jint arg2)
{
static QString * _qstring_arg1 = 0;
	return (jboolean) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->writeEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (int) arg2);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSettings_writeEntry__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1, jstring arg2)
{
static QCString * _qstring_arg2 = 0;
static QString * _qstring_arg1 = 0;
	return (jboolean) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->writeEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (char*) QtSupport::toCharString(env, arg2, &_qstring_arg2));
}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QSettings_writeEntry__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1, jstring arg2)
//{
//static QString * _qstring_arg2 = 0;
//static QString * _qstring_arg1 = 0;
//	return (jboolean) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->writeEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (QString&) * (QString *) QtSupport::toQString(env, arg2, &_qstring_arg2));
//}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSettings_writeEntry__Ljava_lang_String_2_3Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1, jobjectArray arg2)
{
static QStringList * _qlist_arg2 = 0;
static QString * _qstring_arg1 = 0;
	return (jboolean) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->writeEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, arg2, &_qlist_arg2));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSettings_writeEntry__Ljava_lang_String_2_3Ljava_lang_String_2C(JNIEnv *env, jobject obj, jstring arg1, jobjectArray arg2, jchar sep)
{
static QChar * _qchar_sep = 0;
static QStringList * _qlist_arg2 = 0;
static QString * _qstring_arg1 = 0;
	return (jboolean) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->writeEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, arg2, &_qlist_arg2), (QChar&) * (QChar *) QtSupport::toQChar(env, sep, &_qchar_sep));
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSettings_entryList(JNIEnv *env, jobject obj, jstring arg1)
{
	QStringList  _qlist;
static QString * _qstring_arg1 = 0;
	_qlist = ((QSettingsJBridge*) QtSupport::getQt(env, obj))->entryList((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSettings_subkeyList(JNIEnv *env, jobject obj, jstring arg1)
{
	QStringList  _qlist;
static QString * _qstring_arg1 = 0;
	_qlist = ((QSettingsJBridge*) QtSupport::getQt(env, obj))->subkeyList((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSettings_readListEntry__Ljava_lang_String_2_3I(JNIEnv *env, jobject obj, jstring arg1, jintArray arg2)
{
	QStringList  _qlist;
static QString * _qstring_arg1 = 0;
	_qlist = ((QSettingsJBridge*) QtSupport::getQt(env, obj))->readListEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1),  (bool*) QtSupport::toIntPtr(env, arg2));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSettings_readListEntry__Ljava_lang_String_2C_3I(JNIEnv *env, jobject obj, jstring arg1, jchar sep, jintArray arg2)
{
	QStringList  _qlist;
static QChar * _qchar_sep = 0;
static QString * _qstring_arg1 = 0;
	_qlist = ((QSettingsJBridge*) QtSupport::getQt(env, obj))->readListEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (QChar&) * (QChar *) QtSupport::toQChar(env, sep, &_qchar_sep),  (bool*) QtSupport::toIntPtr(env, arg2));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QSettings_readEntry(JNIEnv *env, jobject obj, jstring arg1, jstring def, jintArray arg2)
{
	QString  _qstring;
static QString * _qstring_def = 0;
static QString * _qstring_arg1 = 0;
	_qstring = ((QSettingsJBridge*) QtSupport::getQt(env, obj))->readEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (QString&) * (QString *) QtSupport::toQString(env, def, &_qstring_def),  (bool*) QtSupport::toIntPtr(env, arg2));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSettings_readNumEntry__Ljava_lang_String_2I_3I(JNIEnv *env, jobject obj, jstring arg1, jint def, jintArray arg2)
{
static QString * _qstring_arg1 = 0;
	return (jint) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->readNumEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (int) def,  (bool*) QtSupport::toIntPtr(env, arg2));
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSettings_readNumEntry__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	return (jint) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->readNumEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), 0, 0);
}

JNIEXPORT jdouble JNICALL
Java_org_kde_qt_QSettings_readDoubleEntry__Ljava_lang_String_2D_3I(JNIEnv *env, jobject obj, jstring arg1, jdouble def, jintArray arg2)
{
static QString * _qstring_arg1 = 0;
	return (jdouble) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->readDoubleEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (double) def,  (bool*) QtSupport::toIntPtr(env, arg2));
}

JNIEXPORT jdouble JNICALL
Java_org_kde_qt_QSettings_readDoubleEntry__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	return (jdouble) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->readDoubleEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), 0, 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSettings_readBoolEntry__Ljava_lang_String_2Z_3I(JNIEnv *env, jobject obj, jstring arg1, jboolean def, jintArray arg2)
{
static QString * _qstring_arg1 = 0;
	return (jboolean) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->readBoolEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (bool) def,  (bool*) QtSupport::toIntPtr(env, arg2));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSettings_readBoolEntry__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	return (jboolean) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->readBoolEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), 0, 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSettings_removeEntry(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	return (jboolean) ((QSettingsJBridge*) QtSupport::getQt(env, obj))->removeEntry((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSettings_insertSearchPath(JNIEnv *env, jobject obj, jint arg1, jstring arg2)
{
static QString * _qstring_arg2 = 0;
	((QSettingsJBridge*) QtSupport::getQt(env, obj))->insertSearchPath((QSettings::System) arg1, (QString&) * (QString *) QtSupport::toQString(env, arg2, &_qstring_arg2));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSettings_removeSearchPath(JNIEnv *env, jobject obj, jint arg1, jstring arg2)
{
static QString * _qstring_arg2 = 0;
	((QSettingsJBridge*) QtSupport::getQt(env, obj))->removeSearchPath((QSettings::System) arg1, (QString&) * (QString *) QtSupport::toQString(env, arg2, &_qstring_arg2));
	return;
}

