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

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

class KHTMLSettingsJBridge : public KHTMLSettings
{
public:
	KHTMLSettingsJBridge() : KHTMLSettings() {}
	KHTMLSettingsJBridge(const KHTMLSettings& other) : KHTMLSettings(other) {}
	~KHTMLSettingsJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLSettings_init__(JNIEnv *env, jobject obj)
{
	((KHTMLSettings*) QtSupport::getQt(env, obj))->init();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLSettings_init__Lorg_kde_koala_KConfig_2Z(JNIEnv *env, jobject obj, jobject config, jboolean reset)
{
	((KHTMLSettings*) QtSupport::getQt(env, obj))->init((KConfig*) QtSupport::getQt(env, config), (bool) reset);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLSettings_init__Lorg_kde_koala_KConfig_2(JNIEnv *env, jobject obj, jobject config)
{
	((KHTMLSettings*) QtSupport::getQt(env, obj))->init((KConfig*) QtSupport::getQt(env, config), true);
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLSettings_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KHTMLSettings_finalize(env, obj);
	return;
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_changeCursor(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->changeCursor();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_underlineLink(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->underlineLink();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_hoverLink(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->hoverLink();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KHTMLSettings_showAnimations(JNIEnv *env, jobject obj)
{
	return (jint) ((KHTMLSettings*) QtSupport::getQt(env, obj))->showAnimations();
}

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

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

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

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

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLSettings_setStdFontName(JNIEnv *env, jobject obj, jstring n)
{
static QString * _qstring_n = 0;
	((KHTMLSettings*) QtSupport::getQt(env, obj))->setStdFontName((QString&) * (QString *) QtSupport::toQString(env, n, &_qstring_n));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLSettings_setFixedFontName(JNIEnv *env, jobject obj, jstring n)
{
static QString * _qstring_n = 0;
	((KHTMLSettings*) QtSupport::getQt(env, obj))->setFixedFontName((QString&) * (QString *) QtSupport::toQString(env, n, &_qstring_n));
	return;
}

//JNIEXPORT jintArray JNICALL
//Java_org_kde_koala_KHTMLSettings_fontSizes(JNIEnv *env, jobject obj)
//{
//	QValueList<int> _qintArray;
//	_qintArray = ((KHTMLSettings*) QtSupport::getQt(env, obj))->fontSizes();
//	return QtSupport::fromQIntValueList(env, &_qintArray);
//}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KHTMLSettings_setFontSizes(JNIEnv *env, jobject obj, jintArray newFontSizes)
//{
//static QValueList<int> * _qlist_newFontSizes = 0;
//	((KHTMLSettings*) QtSupport::getQt(env, obj))->setFontSizes( (QValueList<int>&) QtSupport::toQIntValueList(env, newFontSizes, &_qlist_newFontSizes));
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KHTMLSettings_resetFontSizes(JNIEnv *env, jobject obj)
//{
//	((KHTMLSettings*) QtSupport::getQt(env, obj))->resetFontSizes();
//	return;
//}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KHTMLSettings_minFontSize(JNIEnv *env, jobject obj)
{
	return (jint) ((KHTMLSettings*) QtSupport::getQt(env, obj))->minFontSize();
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLSettings_textColor(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QColor *) &((KHTMLSettings*) QtSupport::getQt(env, obj))->textColor(), "org.kde.qt.QColor");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLSettings_linkColor(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QColor *) &((KHTMLSettings*) QtSupport::getQt(env, obj))->linkColor(), "org.kde.qt.QColor");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLSettings_vLinkColor(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QColor *) &((KHTMLSettings*) QtSupport::getQt(env, obj))->vLinkColor(), "org.kde.qt.QColor");
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_autoLoadImages(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->autoLoadImages();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_isJavaEnabled__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring hostname)
{
static QString * _qstring_hostname = 0;
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->isJavaEnabled((QString&) * (QString *) QtSupport::toQString(env, hostname, &_qstring_hostname));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_isJavaEnabled__(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->isJavaEnabled(QString::null);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_isJavaScriptEnabled__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring hostname)
{
static QString * _qstring_hostname = 0;
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->isJavaScriptEnabled((QString&) * (QString *) QtSupport::toQString(env, hostname, &_qstring_hostname));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_isJavaScriptEnabled__(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->isJavaScriptEnabled(QString::null);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_isJavaScriptDebugEnabled__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring hostname)
{
static QString * _qstring_hostname = 0;
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->isJavaScriptDebugEnabled((QString&) * (QString *) QtSupport::toQString(env, hostname, &_qstring_hostname));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_isJavaScriptDebugEnabled__(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->isJavaScriptDebugEnabled(QString::null);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_isPluginsEnabled__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring hostname)
{
static QString * _qstring_hostname = 0;
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->isPluginsEnabled((QString&) * (QString *) QtSupport::toQString(env, hostname, &_qstring_hostname));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_isPluginsEnabled__(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->isPluginsEnabled(QString::null);
}

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

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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLSettings_isFormCompletionEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLSettings*) QtSupport::getQt(env, obj))->isFormCompletionEnabled();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KHTMLSettings_maxFormCompletionItems(JNIEnv *env, jobject obj)
{
	return (jint) ((KHTMLSettings*) QtSupport::getQt(env, obj))->maxFormCompletionItems();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KHTMLSettings_strToAdvice(JNIEnv *env, jclass obj, jstring _str)
{
static QString * _qstring__str = 0;
	return (jint) KHTMLSettingsJBridge::strToAdvice((QString&) * (QString *) QtSupport::toQString(env, _str, &_qstring__str));
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLSettings_splitDomainAdvice(JNIEnv *env, jclass obj, jstring configStr, jstring domain, jobject javaAdvice, jobject javaScriptAdvice)
{
static QString * _qstring_domain = 0;
static QString * _qstring_configStr = 0;
	KHTMLSettingsJBridge::splitDomainAdvice((QString&) * (QString *) QtSupport::toQString(env, configStr, &_qstring_configStr), (QString&) * (QString *) QtSupport::toQString(env, domain, &_qstring_domain), (KHTMLSettings::KJavaScriptAdvice&) *(KHTMLSettings::KJavaScriptAdvice *) QtSupport::getQt(env, javaAdvice), (KHTMLSettings::KJavaScriptAdvice&) *(KHTMLSettings::KJavaScriptAdvice *) QtSupport::getQt(env, javaScriptAdvice));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KHTMLSettings_adviceToStr(JNIEnv *env, jclass obj, jint _advice)
{
	 const char*  _qcstring;
	_qcstring = (const char *)KHTMLSettingsJBridge::adviceToStr((KHTMLSettings::KJavaScriptAdvice) _advice);
	return QtSupport::fromCharString(env, (char *) _qcstring);
}

