/***************************************************************************
                            ListJob.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 <kio/jobclasses.h>
#include <qstring.h>
#include <qcstring.h>

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

class ListJobJBridge : public KIO::ListJob
{
public:
	ListJobJBridge(const KURL& url, bool showProgressInfo, bool recursive, QString prefix, bool includeHidden) : ListJob(url, showProgressInfo, recursive, prefix, includeHidden) {}
	void protected_slotFinished() {
		ListJob::slotFinished();
		return;
	}
	void protected_slotResult(KIO::Job* job) {
		ListJob::slotResult(job);
		return;
	}
	void protected_slotListEntries(const KIO::UDSEntryList& list) {
		ListJob::slotListEntries(list);
		return;
	}
	void protected_slotRedirection(const KURL& url) {
		ListJob::slotRedirection(url);
		return;
	}
	void protected_gotEntries(KIO::Job* subjob, const KIO::UDSEntryList& list) {
		ListJob::gotEntries(subjob, list);
		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_ListJob_newListJob__Lorg_kde_koala_KURL_2ZZLjava_lang_String_2Z(JNIEnv *env, jobject obj, jobject url, jboolean showProgressInfo, jboolean recursive, jstring prefix, jboolean includeHidden)
{
static QString * _qstring_prefix = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new ListJobJBridge((KURL&) *(KURL *) QtSupport::getQt(env, url), (bool) showProgressInfo, (bool) recursive, (QString) * (QString *) QtSupport::toQString(env, prefix, &_qstring_prefix), (bool) includeHidden));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_ListJob_newListJob__Lorg_kde_koala_KURL_2Z(JNIEnv *env, jobject obj, jobject url, jboolean showProgressInfo)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new ListJobJBridge((KURL&) *(KURL *) QtSupport::getQt(env, url), (bool) showProgressInfo, false, QString::null, true));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_ListJob_start(JNIEnv *env, jobject obj, jobject slave)
{
	((KIO::ListJob*) QtSupport::getQt(env, obj))->start((KIO::Slave*) QtSupport::getQt(env, slave));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_ListJob_slotFinished(JNIEnv *env, jobject obj)
{
	((ListJobJBridge*) QtSupport::getQt(env, obj))->protected_slotFinished();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_ListJob_slotResult(JNIEnv *env, jobject obj, jobject job)
{
	((ListJobJBridge*) QtSupport::getQt(env, obj))->protected_slotResult((KIO::Job*) QtSupport::getQt(env, job));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_ListJob_slotListEntries(JNIEnv *env, jobject obj, jobject list)
{
	((ListJobJBridge*) QtSupport::getQt(env, obj))->protected_slotListEntries((KIO::UDSEntryList&) *(KIO::UDSEntryList *) QtSupport::getQt(env, list));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_ListJob_slotRedirection(JNIEnv *env, jobject obj, jobject url)
{
	((ListJobJBridge*) QtSupport::getQt(env, obj))->protected_slotRedirection((KURL&) *(KURL *) QtSupport::getQt(env, url));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_ListJob_gotEntries(JNIEnv *env, jobject obj, jobject subjob, jobject list)
{
	((ListJobJBridge*) QtSupport::getQt(env, obj))->protected_gotEntries((KIO::Job*) QtSupport::getQt(env, subjob), (KIO::UDSEntryList&) *(KIO::UDSEntryList *) QtSupport::getQt(env, list));
	return;
}

