/***************************************************************************
                            KEMailSettings.cpp -  description
                             -------------------
    begin                : Sun Jan 27 16:22:17 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Jan 27 16:22:17 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 <kemailsettings.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <kdejava/KDESupport.h>
#include <kdejava/KEMailSettings.h>

class KEMailSettingsJBridge : public KEMailSettings
{
public:
	KEMailSettingsJBridge() : KEMailSettings() {}
	~KEMailSettingsJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KEMailSettings_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KEMailSettings_finalize(env, obj);
	return;
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KEMailSettings_profiles(JNIEnv *env, jobject obj)
{
	QStringList  _qlist;
	_qlist = ((KEMailSettings*) QtSupport::getQt(env, obj))->profiles();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KEMailSettings_setProfile(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	((KEMailSettings*) QtSupport::getQt(env, obj))->setProfile((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KEMailSettings_setDefault(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	((KEMailSettings*) QtSupport::getQt(env, obj))->setDefault((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KEMailSettings_getSetting(JNIEnv *env, jobject obj, jint s)
{
	QString  _qstring;
	_qstring = ((KEMailSettings*) QtSupport::getQt(env, obj))->getSetting((KEMailSettings::Setting) s);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KEMailSettings_setSetting(JNIEnv *env, jobject obj, jint s, jstring v)
{
static QString * _qstring_v = 0;
	((KEMailSettings*) QtSupport::getQt(env, obj))->setSetting((KEMailSettings::Setting) s, (QString&) * (QString *) QtSupport::toQString(env, v, &_qstring_v));
	return;
}

//JNIEXPORT jstring JNICALL
//Java_org_kde_koala_KEMailSettings_getExtendedSetting(JNIEnv *env, jobject obj, jint e, jstring s)
//{
//	QString  _qstring;
//static QString * _qstring_s = 0;
//	_qstring = ((KEMailSettings*) QtSupport::getQt(env, obj))->getExtendedSetting((KEMailSettings::Extension) e, (QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s));
//	return QtSupport::fromQString(env, &_qstring);
//}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KEMailSettings_setExtendedSetting(JNIEnv *env, jobject obj, jint e, jstring s, jstring v)
//{
//static QString * _qstring_v = 0;
//static QString * _qstring_s = 0;
//	((KEMailSettings*) QtSupport::getQt(env, obj))->setExtendedSetting((KEMailSettings::Extension) e, (QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s), (QString&) * (QString *) QtSupport::toQString(env, v, &_qstring_v));
//	return;
//}

