/***************************************************************************
                            DeleteJob.cpp -  description
                             -------------------
    begin                : Sun Aug 26 09:45:02 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Aug 26 09:45:02 2001, using kdoc parser/custom Java conversion backend.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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/DeleteJob.h>

class DeleteJobJBridge : public KIO::DeleteJob
{
public:
	DeleteJobJBridge(const KURL::List& src, bool shred, bool showProgressInfo) : DeleteJob(src, shred, showProgressInfo) {}
	void protected_startNextJob() {
		DeleteJob::startNextJob();
		return;
	}
	void protected_deleteNextFile() {
		DeleteJob::deleteNextFile();
		return;
	}
	void protected_deleteNextDir() {
		DeleteJob::deleteNextDir();
		return;
	}
	void protected_slotEntries(KIO::Job* arg1, const KIO::UDSEntryList& list) {
		DeleteJob::slotEntries(arg1, list);
		return;
	}
	void protected_slotResult(KIO::Job* job) {
		DeleteJob::slotResult(job);
		return;
	}
	void protected_slotProcessedSize(KIO::Job* arg1, unsigned long data_size) {
		DeleteJob::slotProcessedSize(arg1, data_size);
		return;
	}
	void protected_slotReport() {
		DeleteJob::slotReport();
		return;
	}
	void childEvent(QChildEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "childEvent", arg1, "org.kde.qt.QChildEvent")) {
			QObject::childEvent(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_DeleteJob_newDeleteJob(JNIEnv *env, jobject obj, jobjectArray src, jboolean shred, jboolean showProgressInfo)
{
static KURL::List * _qlist_src = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new DeleteJobJBridge((KURL::List&) * (KURL::List *) KDESupport::toKURLList(env, src, &_qlist_src), (bool) shred, (bool) showProgressInfo));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_DeleteJob_urls(JNIEnv *env, jobject obj)
{
	KURL::List  _qlist;
	_qlist = ((DeleteJobJBridge*) QtSupport::getQt(env, obj))->urls();
	return (jobject) KDESupport::arrayWithKURLList(env, (KURL::List *) &_qlist);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_DeleteJob_startNextJob(JNIEnv *env, jobject obj)
{
	((DeleteJobJBridge*) QtSupport::getQt(env, obj))->protected_startNextJob();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_DeleteJob_deleteNextFile(JNIEnv *env, jobject obj)
{
	((DeleteJobJBridge*) QtSupport::getQt(env, obj))->protected_deleteNextFile();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_DeleteJob_deleteNextDir(JNIEnv *env, jobject obj)
{
	((DeleteJobJBridge*) QtSupport::getQt(env, obj))->protected_deleteNextDir();
	return;
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_DeleteJob_slotProcessedSize(JNIEnv *env, jobject obj, jobject arg1, jlong data_size)
{
	((DeleteJobJBridge*) QtSupport::getQt(env, obj))->protected_slotProcessedSize((KIO::Job*) QtSupport::getQt(env, arg1), (unsigned long) data_size);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_DeleteJob_slotReport(JNIEnv *env, jobject obj)
{
	((DeleteJobJBridge*) QtSupport::getQt(env, obj))->protected_slotReport();
	return;
}

