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

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

class KSpellJBridge : public KSpell
{
public:
	KSpellJBridge(QWidget* _parent, const QString& _caption, QObject* obj, const char* slot, KSpellConfig* _kcs, bool _progressbar, bool _modal) : KSpell(_parent, _caption, obj, slot, _kcs, _progressbar, _modal) {}
	~KSpellJBridge() {QtSupport::qtKeyDeleted(this);}
	int  protected_parseOneResponse(const QString& _buffer, QString& word, QStringList& sugg) {
		return (int ) KSpell::parseOneResponse(_buffer, word, sugg);
	}
	QString  protected_funnyWord(const QString& word) {
		return (QString ) KSpell::funnyWord(word);
	}
	void protected_dialog(const QString& word, QStringList& sugg, const char* _slot) {
		KSpell::dialog(word, sugg, _slot);
		return;
	}
	QString  protected_replacement() {
		return (QString ) KSpell::replacement();
	}
	void protected_setUpDialog(bool reallyusedialogbox) {
		KSpell::setUpDialog(reallyusedialogbox);
		return;
	}
	void protected_emitProgress() {
		KSpell::emitProgress();
		return;
	}
	bool  protected_cleanFputs(const QString& s, bool appendCR) {
		return (bool ) KSpell::cleanFputs(s, appendCR);
	}
	bool  protected_cleanFputsWord(const QString& s, bool appendCR) {
		return (bool ) KSpell::cleanFputsWord(s, appendCR);
	}
	void protected_startIspell() {
		KSpell::startIspell();
		return;
	}
	bool  protected_writePersonalDictionary() {
		return (bool ) KSpell::writePersonalDictionary();
	}
	void protected_KSpell2(KProcIO* arg1) {
		KSpell::KSpell2(arg1);
		return;
	}
	void protected_checkWord2(KProcIO* arg1) {
		KSpell::checkWord2(arg1);
		return;
	}
	void protected_checkWord3() {
		KSpell::checkWord3();
		return;
	}
	void protected_check2(KProcIO* arg1) {
		KSpell::check2(arg1);
		return;
	}
	void protected_checkList2() {
		KSpell::checkList2();
		return;
	}
	void protected_checkList3a(KProcIO* arg1) {
		KSpell::checkList3a(arg1);
		return;
	}
	void protected_checkListReplaceCurrent() {
		KSpell::checkListReplaceCurrent();
		return;
	}
	void protected_checkList4() {
		KSpell::checkList4();
		return;
	}
	void protected_dialog2(int dlgresult) {
		KSpell::dialog2(dlgresult);
		return;
	}
	void protected_check3() {
		KSpell::check3();
		return;
	}
	void protected_slotStopCancel(int arg1) {
		KSpell::slotStopCancel(arg1);
		return;
	}
	void protected_ispellExit(KProcess* arg1) {
		KSpell::ispellExit(arg1);
		return;
	}
	void protected_emitDeath() {
		KSpell::emitDeath();
		return;
	}
	void protected_ispellErrors(KProcess* arg1, char* arg2, int arg3) {
		KSpell::ispellErrors(arg1, arg2, arg3);
		return;
	}
	void childEvent(QChildEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "childEvent", arg1, "org.kde.qt.QChildEvent")) {
			QObject::childEvent(arg1);
		}
		return;
	}
	void customEvent(QCustomEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "customEvent", arg1, "org.kde.qt.QCustomEvent")) {
			QObject::customEvent(arg1);
		}
		return;
	}
	void timerEvent(QTimerEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "timerEvent", arg1, "org.kde.qt.QTimerEvent")) {
			QObject::timerEvent(arg1);
		}
		return;
	}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_newKSpell__Lorg_kde_qt_QWidget_2Ljava_lang_String_2Lorg_kde_qt_QObject_2Ljava_lang_String_2Lorg_kde_koala_KSpellConfig_2ZZ(JNIEnv *env, jobject obj, jobject _parent, jstring _caption, jobject _obj, jstring slot, jobject _kcs, jboolean _progressbar, jboolean _modal)
{
static QCString * _qstring_slot = 0;
static QString * _qstring__caption = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KSpellJBridge((QWidget*) QtSupport::getQt(env, _parent), (QString&) * (QString *) QtSupport::toQString(env, _caption, &_qstring__caption), (QObject*) QtSupport::getQt(env, _obj), (char*) QtSupport::toCharString(env, slot, &_qstring_slot), (KSpellConfig*) QtSupport::getQt(env, _kcs), (bool) _progressbar, (bool) _modal));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_newKSpell__Lorg_kde_qt_QWidget_2Ljava_lang_String_2Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject _parent, jstring _caption, jobject _obj, jstring slot)
{
static QCString * _qstring_slot = 0;
static QString * _qstring__caption = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KSpellJBridge((QWidget*) QtSupport::getQt(env, _parent), (QString&) * (QString *) QtSupport::toQString(env, _caption, &_qstring__caption), (QObject*) QtSupport::getQt(env, _obj), (char*) QtSupport::toCharString(env, slot, &_qstring_slot), 0, TRUE, FALSE));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KSpell_status(JNIEnv *env, jobject obj)
{
	return (jint) ((KSpell*) QtSupport::getQt(env, obj))->status();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_cleanUp(JNIEnv *env, jobject obj)
{
	((KSpell*) QtSupport::getQt(env, obj))->cleanUp();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_setAutoDelete(JNIEnv *env, jobject obj, jboolean _autoDelete)
{
	((KSpell*) QtSupport::getQt(env, obj))->setAutoDelete((bool) _autoDelete);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_check(JNIEnv *env, jobject obj, jstring _buffer)
{
static QString * _qstring__buffer = 0;
	return (jboolean) ((KSpell*) QtSupport::getQt(env, obj))->check((QString&) * (QString *) QtSupport::toQString(env, _buffer, &_qstring__buffer));
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KSpell_lastPosition(JNIEnv *env, jobject obj)
{
	return (jint) ((KSpell*) QtSupport::getQt(env, obj))->lastPosition();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_checkList(JNIEnv *env, jobject obj, jobjectArray _wordlist)
{
static QStringList * _qlist__wordlist = 0;
	return (jboolean) ((KSpell*) QtSupport::getQt(env, obj))->checkList((QStringList*) QtSupport::toQStringList(env, _wordlist, &_qlist__wordlist));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_checkWord__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring _buffer, jboolean usedialog)
{
static QString * _qstring__buffer = 0;
	return (jboolean) ((KSpell*) QtSupport::getQt(env, obj))->checkWord((QString&) * (QString *) QtSupport::toQString(env, _buffer, &_qstring__buffer), (bool) usedialog);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_checkWord__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring _buffer)
{
static QString * _qstring__buffer = 0;
	return (jboolean) ((KSpell*) QtSupport::getQt(env, obj))->checkWord((QString&) * (QString *) QtSupport::toQString(env, _buffer, &_qstring__buffer), FALSE);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_hide(JNIEnv *env, jobject obj)
{
	((KSpell*) QtSupport::getQt(env, obj))->hide();
	return;
}

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

JNIEXPORT jint JNICALL
Java_org_kde_koala_KSpell_dlgResult(JNIEnv *env, jobject obj)
{
	return (jint) ((KSpell*) QtSupport::getQt(env, obj))->dlgResult();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_moveDlg(JNIEnv *env, jobject obj, jint x, jint y)
{
	((KSpell*) QtSupport::getQt(env, obj))->moveDlg((int) x, (int) y);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KSpell_heightDlg(JNIEnv *env, jobject obj)
{
	return (jint) ((KSpell*) QtSupport::getQt(env, obj))->heightDlg();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KSpell_widthDlg(JNIEnv *env, jobject obj)
{
	return (jint) ((KSpell*) QtSupport::getQt(env, obj))->widthDlg();
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_ignore(JNIEnv *env, jobject obj, jstring word)
{
static QString * _qstring_word = 0;
	return (jboolean) ((KSpell*) QtSupport::getQt(env, obj))->ignore((QString&) * (QString *) QtSupport::toQString(env, word, &_qstring_word));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_addPersonal(JNIEnv *env, jobject obj, jstring word)
{
static QString * _qstring_word = 0;
	return (jboolean) ((KSpell*) QtSupport::getQt(env, obj))->addPersonal((QString&) * (QString *) QtSupport::toQString(env, word, &_qstring_word));
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KSpell_ksConfig(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new KSpellConfig (((KSpell*) QtSupport::getQt(env, obj))->ksConfig()), "org.kde.koala.KSpellConfig", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_setProgressResolution(JNIEnv *env, jobject obj, jint res)
{
	((KSpell*) QtSupport::getQt(env, obj))->setProgressResolution((unsigned) res);
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KSpell_finalize(env, obj);
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_setIgnoreUpperWords(JNIEnv *env, jobject obj, jboolean _b)
{
	((KSpell*) QtSupport::getQt(env, obj))->setIgnoreUpperWords((bool) _b);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_setIgnoreTitleCase(JNIEnv *env, jobject obj, jboolean _b)
{
	((KSpell*) QtSupport::getQt(env, obj))->setIgnoreTitleCase((bool) _b);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KSpell_modalCheck__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring text)
{
static QString * _qstring_text = 0;
	return (jint) KSpellJBridge::modalCheck((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text));
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KSpell_modalCheck__Ljava_lang_String_2Lorg_kde_koala_KSpellConfig_2(JNIEnv *env, jclass obj, jstring text, jobject _kcs)
{
static QString * _qstring_text = 0;
	return (jint) KSpellJBridge::modalCheck((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (KSpellConfig*) QtSupport::getQt(env, _kcs));
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KSpell_parseOneResponse(JNIEnv *env, jobject obj, jstring _buffer, jstring word, jobjectArray sugg)
{
static QStringList * _qlist_sugg = 0;
static QString * _qstring_word = 0;
static QString * _qstring__buffer = 0;
	return (jint) ((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_parseOneResponse((QString&) * (QString *) QtSupport::toQString(env, _buffer, &_qstring__buffer), (QString&) * (QString *) QtSupport::toQString(env, word, &_qstring_word), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, sugg, &_qlist_sugg));
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KSpell_funnyWord(JNIEnv *env, jobject obj, jstring word)
{
	QString  _qstring;
static QString * _qstring_word = 0;
	_qstring = ((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_funnyWord((QString&) * (QString *) QtSupport::toQString(env, word, &_qstring_word));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_dialog(JNIEnv *env, jobject obj, jstring word, jobjectArray sugg, jstring _slot)
{
static QCString * _qstring__slot = 0;
static QStringList * _qlist_sugg = 0;
static QString * _qstring_word = 0;
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_dialog((QString&) * (QString *) QtSupport::toQString(env, word, &_qstring_word), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, sugg, &_qlist_sugg), (char*) QtSupport::toCharString(env, _slot, &_qstring__slot));
	return;
}

//JNIEXPORT jstring JNICALL
//Java_org_kde_koala_KSpell_replacement(JNIEnv *env, jobject obj)
//{
//	QString  _qstring;
//	_qstring = ((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_replacement();
//	return QtSupport::fromQString(env, &_qstring);
//}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_setUpDialog__Z(JNIEnv *env, jobject obj, jboolean reallyusedialogbox)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_setUpDialog((bool) reallyusedialogbox);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_setUpDialog__(JNIEnv *env, jobject obj)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_setUpDialog(TRUE);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_emitProgress(JNIEnv *env, jobject obj)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_emitProgress();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_cleanFputs__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring s, jboolean appendCR)
{
static QString * _qstring_s = 0;
	return (jboolean) ((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_cleanFputs((QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s), (bool) appendCR);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_cleanFputs__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring s)
{
static QString * _qstring_s = 0;
	return (jboolean) ((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_cleanFputs((QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s), TRUE);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_cleanFputsWord__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring s, jboolean appendCR)
{
static QString * _qstring_s = 0;
	return (jboolean) ((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_cleanFputsWord((QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s), (bool) appendCR);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_cleanFputsWord__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring s)
{
static QString * _qstring_s = 0;
	return (jboolean) ((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_cleanFputsWord((QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s), TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_startIspell(JNIEnv *env, jobject obj)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_startIspell();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KSpell_writePersonalDictionary(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_writePersonalDictionary();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_KSpell2(JNIEnv *env, jobject obj, jobject arg1)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_KSpell2((KProcIO*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_checkWord2(JNIEnv *env, jobject obj, jobject arg1)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_checkWord2((KProcIO*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_checkWord3(JNIEnv *env, jobject obj)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_checkWord3();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_check2(JNIEnv *env, jobject obj, jobject arg1)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_check2((KProcIO*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_checkList2(JNIEnv *env, jobject obj)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_checkList2();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_checkList3a(JNIEnv *env, jobject obj, jobject arg1)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_checkList3a((KProcIO*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_checkListReplaceCurrent(JNIEnv *env, jobject obj)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_checkListReplaceCurrent();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_checkList4(JNIEnv *env, jobject obj)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_checkList4();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_dialog2(JNIEnv *env, jobject obj, jint dlgresult)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_dialog2((int) dlgresult);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_check3(JNIEnv *env, jobject obj)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_check3();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_slotStopCancel(JNIEnv *env, jobject obj, jint arg1)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_slotStopCancel((int) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_ispellExit(JNIEnv *env, jobject obj, jobject arg1)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_ispellExit((KProcess*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_emitDeath(JNIEnv *env, jobject obj)
{
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_emitDeath();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSpell_ispellErrors(JNIEnv *env, jobject obj, jobject arg1, jstring arg2, jint arg3)
{
static QCString * _qstring_arg2 = 0;
	((KSpellJBridge*) QtSupport::getQt(env, obj))->protected_ispellErrors((KProcess*) QtSupport::getQt(env, arg1), (char*) QtSupport::toCharString(env, arg2, &_qstring_arg2), (int) arg3);
	return;
}

