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

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

class KSSLSettingsJBridge : public KSSLSettings
{
public:
	KSSLSettingsJBridge(bool readConfig) : KSSLSettings(readConfig) {}
	~KSSLSettingsJBridge() {QtSupport::qtKeyDeleted(this);}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KSSLSettings_newKSSLSettings__Z(JNIEnv *env, jobject obj, jboolean readConfig)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KSSLSettingsJBridge((bool) readConfig));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KSSLSettings_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KSSLSettings_finalize(env, obj);
	return;
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_sslv2(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->sslv2();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_sslv3(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->sslv3();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_tlsv1(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->tlsv1();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_warnOnEnter(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->warnOnEnter();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_warnOnUnencrypted(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->warnOnUnencrypted();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSSLSettings_setWarnOnUnencrypted(JNIEnv *env, jobject obj, jboolean x)
{
	((KSSLSettings*) QtSupport::getQt(env, obj))->setWarnOnUnencrypted((bool) x);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_warnOnLeave(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->warnOnLeave();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_warnOnMixed(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->warnOnMixed();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_warnOnSelfSigned(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->warnOnSelfSigned();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_warnOnRevoked(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->warnOnRevoked();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_warnOnExpired(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->warnOnExpired();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_useEGD(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->useEGD();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_useEFile(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->useEFile();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSSLSettings_setTLSv1(JNIEnv *env, jobject obj, jboolean enabled)
{
	((KSSLSettings*) QtSupport::getQt(env, obj))->setTLSv1((bool) enabled);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSSLSettings_setSSLv2(JNIEnv *env, jobject obj, jboolean enabled)
{
	((KSSLSettings*) QtSupport::getQt(env, obj))->setSSLv2((bool) enabled);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSSLSettings_setSSLv3(JNIEnv *env, jobject obj, jboolean enabled)
{
	((KSSLSettings*) QtSupport::getQt(env, obj))->setSSLv3((bool) enabled);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_autoSendX509(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->autoSendX509();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSSLSettings_promptSendX509(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSSLSettings*) QtSupport::getQt(env, obj))->promptSendX509();
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KSSLSettings_load(JNIEnv *env, jobject obj)
{
	((KSSLSettings*) QtSupport::getQt(env, obj))->load();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSSLSettings_defaults(JNIEnv *env, jobject obj)
{
	((KSSLSettings*) QtSupport::getQt(env, obj))->defaults();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSSLSettings_save(JNIEnv *env, jobject obj)
{
	((KSSLSettings*) QtSupport::getQt(env, obj))->save();
	return;
}

