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

class TransferJobJBridge : public KIO::TransferJob
{
public:
	TransferJobJBridge(const KURL& url, int command, const QByteArray& packedArgs, const QByteArray& _staticData, bool showProgressInfo) : TransferJob(url, command, packedArgs, _staticData, showProgressInfo) {}
	void protected_slotRedirection(const KURL& url) {
		TransferJob::slotRedirection(url);
		return;
	}
	void protected_slotFinished() {
		TransferJob::slotFinished();
		return;
	}
	void protected_slotData(const QByteArray& data) {
		TransferJob::slotData(data);
		return;
	}
	void protected_slotDataReq() {
		TransferJob::slotDataReq();
		return;
	}
	void protected_slotMimetype(const QString& mimetype) {
		TransferJob::slotMimetype(mimetype);
		return;
	}
	void protected_slotNeedSubURLData() {
		TransferJob::slotNeedSubURLData();
		return;
	}
	void protected_slotSubURLData(KIO::Job* arg1, const QByteArray& arg2) {
		TransferJob::slotSubURLData(arg1, arg2);
		return;
	}
	void protected_slotErrorPage() {
		TransferJob::slotErrorPage();
		return;
	}
	void protected_slotCanResume(KIO::filesize_t offset) {
		TransferJob::slotCanResume(offset);
		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_TransferJob_newTransferJob(JNIEnv *env, jobject obj, jobject url, jint command, jbyteArray packedArgs, jbyteArray _staticData, jboolean showProgressInfo)
{
static QByteArray * _qbyteArray__staticData = 0;
static QByteArray * _qbyteArray_packedArgs = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new TransferJobJBridge((KURL&) *(KURL *) QtSupport::getQt(env, url), (int) command, (QByteArray&) * (QByteArray *) QtSupport::toQByteArray(env, packedArgs, &_qbyteArray_packedArgs), (QByteArray&) * (QByteArray *) QtSupport::toQByteArray(env, _staticData, &_qbyteArray__staticData), (bool) showProgressInfo));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_TransferJob_slotResult(JNIEnv *env, jobject obj, jobject job)
{
	((KIO::TransferJob*) QtSupport::getQt(env, obj))->slotResult((KIO::Job*) QtSupport::getQt(env, job));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_TransferJob_suspend(JNIEnv *env, jobject obj)
{
	((KIO::TransferJob*) QtSupport::getQt(env, obj))->suspend();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_TransferJob_resume(JNIEnv *env, jobject obj)
{
	((KIO::TransferJob*) QtSupport::getQt(env, obj))->resume();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_TransferJob_isSuspended(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KIO::TransferJob*) QtSupport::getQt(env, obj))->isSuspended();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_TransferJob_isErrorPage(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KIO::TransferJob*) QtSupport::getQt(env, obj))->isErrorPage();
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_TransferJob_slotData(JNIEnv *env, jobject obj, jbyteArray data)
{
static QByteArray * _qbyteArray_data = 0;
	((TransferJobJBridge*) QtSupport::getQt(env, obj))->protected_slotData((QByteArray&) * (QByteArray *) QtSupport::toQByteArray(env, data, &_qbyteArray_data));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_TransferJob_slotDataReq(JNIEnv *env, jobject obj)
{
	((TransferJobJBridge*) QtSupport::getQt(env, obj))->protected_slotDataReq();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_TransferJob_slotMimetype(JNIEnv *env, jobject obj, jstring mimetype)
{
static QString * _qstring_mimetype = 0;
	((TransferJobJBridge*) QtSupport::getQt(env, obj))->protected_slotMimetype((QString&) * (QString *) QtSupport::toQString(env, mimetype, &_qstring_mimetype));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_TransferJob_slotNeedSubURLData(JNIEnv *env, jobject obj)
{
	((TransferJobJBridge*) QtSupport::getQt(env, obj))->protected_slotNeedSubURLData();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_TransferJob_slotSubURLData(JNIEnv *env, jobject obj, jobject arg1, jbyteArray arg2)
{
static QByteArray * _qbyteArray_arg2 = 0;
	((TransferJobJBridge*) QtSupport::getQt(env, obj))->protected_slotSubURLData((KIO::Job*) QtSupport::getQt(env, arg1), (QByteArray&) * (QByteArray *) QtSupport::toQByteArray(env, arg2, &_qbyteArray_arg2));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_TransferJob_slotErrorPage(JNIEnv *env, jobject obj)
{
	((TransferJobJBridge*) QtSupport::getQt(env, obj))->protected_slotErrorPage();
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_TransferJob_slotCanResume(JNIEnv *env, jobject obj, j offset)
//{
//	((TransferJobJBridge*) QtSupport::getQt(env, obj))->protected_slotCanResume((KIO::filesize_t) offset);
//	return;
//}

