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

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

class KURLCompletionJBridge : public KURLCompletion
{
public:
	KURLCompletionJBridge() : KURLCompletion() {}
	KURLCompletionJBridge(Mode arg1) : KURLCompletion(arg1) {}
	~KURLCompletionJBridge() {QtSupport::qtKeyDeleted(this);}
	void protected_postProcessMatch(QString* match) {
		KURLCompletion::postProcessMatch(match);
		return;
	}
	void protected_postProcessMatches(QStringList* matches) {
		KURLCompletion::postProcessMatches(matches);
		return;
	}
	void protected_postProcessMatches(KCompletionMatches* matches) {
		KURLCompletion::postProcessMatches(matches);
		return;
	}
	void protected_slotEntries(KIO::Job* arg1, const KIO::UDSEntryList& arg2) {
		KURLCompletion::slotEntries(arg1, arg2);
		return;
	}
	void protected_slotIOFinished(KIO::Job* arg1) {
		KURLCompletion::slotIOFinished(arg1);
		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_KURLCompletion_newKURLCompletion__(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KURLCompletionJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_newKURLCompletion__I(JNIEnv *env, jobject obj, jint arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KURLCompletionJBridge((KURLCompletion::Mode) arg1));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj) && ((KURLCompletion*)QtSupport::getQt(env, obj))->parent() == (QObject *) 0) {
		delete (KURLCompletion*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KURLCompletion_finalize(env, obj);
	return;
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KURLCompletion_makeCompletion(JNIEnv *env, jobject obj, jstring arg1)
{
	QString  _qstring;
static QString * _qstring_arg1 = 0;
	_qstring = ((KURLCompletion*) QtSupport::getQt(env, obj))->makeCompletion((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_setDir(JNIEnv *env, jobject obj, jstring dir)
{
static QString * _qstring_dir = 0;
	((KURLCompletion*) QtSupport::getQt(env, obj))->setDir((QString&) * (QString *) QtSupport::toQString(env, dir, &_qstring_dir));
	return;
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURLCompletion_isRunning(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KURLCompletion*) QtSupport::getQt(env, obj))->isRunning();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_stop(JNIEnv *env, jobject obj)
{
	((KURLCompletion*) QtSupport::getQt(env, obj))->stop();
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KURLCompletion_mode(JNIEnv *env, jobject obj)
{
	return (jint) ((KURLCompletion*) QtSupport::getQt(env, obj))->mode();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_setMode(JNIEnv *env, jobject obj, jint mode)
{
	((KURLCompletion*) QtSupport::getQt(env, obj))->setMode((KURLCompletion::Mode) mode);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURLCompletion_replaceEnv(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KURLCompletion*) QtSupport::getQt(env, obj))->replaceEnv();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_setReplaceEnv(JNIEnv *env, jobject obj, jboolean replace)
{
	((KURLCompletion*) QtSupport::getQt(env, obj))->setReplaceEnv((bool) replace);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURLCompletion_replaceHome(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KURLCompletion*) QtSupport::getQt(env, obj))->replaceHome();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_setReplaceHome(JNIEnv *env, jobject obj, jboolean replace)
{
	((KURLCompletion*) QtSupport::getQt(env, obj))->setReplaceHome((bool) replace);
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KURLCompletion_replacedPath(JNIEnv *env, jobject obj, jstring text)
{
	QString  _qstring;
static QString * _qstring_text = 0;
	_qstring = ((KURLCompletion*) QtSupport::getQt(env, obj))->replacedPath((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_postProcessMatch(JNIEnv *env, jobject obj, jstring match)
{
static QString * _qstring_match = 0;
	((KURLCompletionJBridge*) QtSupport::getQt(env, obj))->protected_postProcessMatch((QString*) QtSupport::toQString(env, match, &_qstring_match));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_postProcessMatches___3Ljava_lang_String_2(JNIEnv *env, jobject obj, jobjectArray matches)
{
static QStringList * _qlist_matches = 0;
	((KURLCompletionJBridge*) QtSupport::getQt(env, obj))->protected_postProcessMatches((QStringList*) QtSupport::toQStringList(env, matches, &_qlist_matches));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_postProcessMatches__Lorg_kde_koala_KCompletionMatches_2(JNIEnv *env, jobject obj, jobject matches)
{
	((KURLCompletionJBridge*) QtSupport::getQt(env, obj))->protected_postProcessMatches((KCompletionMatches*) QtSupport::getQt(env, matches));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_slotEntries(JNIEnv *env, jobject obj, jobject arg1, jobject arg2)
{
	((KURLCompletionJBridge*) QtSupport::getQt(env, obj))->protected_slotEntries((KIO::Job*) QtSupport::getQt(env, arg1), (KIO::UDSEntryList&) *(KIO::UDSEntryList *) QtSupport::getQt(env, arg2));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURLCompletion_slotIOFinished(JNIEnv *env, jobject obj, jobject arg1)
{
	((KURLCompletionJBridge*) QtSupport::getQt(env, obj))->protected_slotIOFinished((KIO::Job*) QtSupport::getQt(env, arg1));
	return;
}

