/***************************************************************************
                            QNetworkProtocol.cpp -  description
                             -------------------
    begin                : Wed Nov 21 17:05:56 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 17:05:56 2001, 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 <qnetworkprotocol.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QNetworkProtocol.h>

class QNetworkProtocolJBridge : public QNetworkProtocol
{
public:
	QNetworkProtocolJBridge() : QNetworkProtocol() {}
	~QNetworkProtocolJBridge() {QtSupport::qtKeyDeleted(this);}
	void protected_processOperation(QNetworkOperation* op) {
		QNetworkProtocol::processOperation(op);
		return;
	}
	void protected_operationListChildren(QNetworkOperation* op) {
		QNetworkProtocol::operationListChildren(op);
		return;
	}
	void protected_operationMkDir(QNetworkOperation* op) {
		QNetworkProtocol::operationMkDir(op);
		return;
	}
	void protected_operationRemove(QNetworkOperation* op) {
		QNetworkProtocol::operationRemove(op);
		return;
	}
	void protected_operationRename(QNetworkOperation* op) {
		QNetworkProtocol::operationRename(op);
		return;
	}
	void protected_operationGet(QNetworkOperation* op) {
		QNetworkProtocol::operationGet(op);
		return;
	}
	void protected_operationPut(QNetworkOperation* op) {
		QNetworkProtocol::operationPut(op);
		return;
	}
	void protected_operationPutChunk(QNetworkOperation* op) {
		QNetworkProtocol::operationPutChunk(op);
		return;
	}
	 bool  protected_checkConnection(QNetworkOperation* op) {
		return ( bool ) QNetworkProtocol::checkConnection(op);
	}
	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_qt_QNetworkProtocol_newQNetworkProtocol(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QNetworkProtocolJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_setUrl(JNIEnv *env, jobject obj, jobject u)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->setUrl((QUrlOperator*) QtSupport::getQt(env, u));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_setAutoDelete__ZI(JNIEnv *env, jobject obj, jboolean b, jint i)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->setAutoDelete((bool) b, (int) i);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_setAutoDelete__Z(JNIEnv *env, jobject obj, jboolean b)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->setAutoDelete((bool) b, 10000);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QNetworkProtocol_autoDelete(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->autoDelete();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QNetworkProtocol_supportedOperations(JNIEnv *env, jobject obj)
{
	return (jint) ((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->supportedOperations();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_addOperation(JNIEnv *env, jobject obj, jobject op)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->addOperation((QNetworkOperation*) QtSupport::getQt(env, op));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QNetworkProtocol_url(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->url(), "org.kde.qt.QUrlOperator");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QNetworkProtocol_operationInProgress(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->operationInProgress(), "org.kde.qt.QNetworkOperation");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_clearOperationQueue(JNIEnv *env, jobject obj)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->clearOperationQueue();
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_registerNetworkProtocol(JNIEnv *env, jclass obj, jstring protocol, jobject protocolFactory)
{
static QString * _qstring_protocol = 0;
	QNetworkProtocolJBridge::registerNetworkProtocol((QString&) * (QString *) QtSupport::toQString(env, protocol, &_qstring_protocol), (QNetworkProtocolFactoryBase*) QtSupport::getQt(env, protocolFactory));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QNetworkProtocol_getNetworkProtocol(JNIEnv *env, jclass obj, jstring protocol)
{
static QString * _qstring_protocol = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)QNetworkProtocolJBridge::getNetworkProtocol((QString&) * (QString *) QtSupport::toQString(env, protocol, &_qstring_protocol)), "org.kde.qt.QNetworkProtocol");
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QNetworkProtocol_hasOnlyLocalFileSystem(JNIEnv *env, jclass obj)
{
	return (jboolean) QNetworkProtocolJBridge::hasOnlyLocalFileSystem();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_processOperation(JNIEnv *env, jobject obj, jobject op)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->protected_processOperation((QNetworkOperation*) QtSupport::getQt(env, op));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_operationListChildren(JNIEnv *env, jobject obj, jobject op)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->protected_operationListChildren((QNetworkOperation*) QtSupport::getQt(env, op));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_operationMkDir(JNIEnv *env, jobject obj, jobject op)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->protected_operationMkDir((QNetworkOperation*) QtSupport::getQt(env, op));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_operationRemove(JNIEnv *env, jobject obj, jobject op)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->protected_operationRemove((QNetworkOperation*) QtSupport::getQt(env, op));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_operationRename(JNIEnv *env, jobject obj, jobject op)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->protected_operationRename((QNetworkOperation*) QtSupport::getQt(env, op));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_operationGet(JNIEnv *env, jobject obj, jobject op)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->protected_operationGet((QNetworkOperation*) QtSupport::getQt(env, op));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_operationPut(JNIEnv *env, jobject obj, jobject op)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->protected_operationPut((QNetworkOperation*) QtSupport::getQt(env, op));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QNetworkProtocol_operationPutChunk(JNIEnv *env, jobject obj, jobject op)
{
	((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->protected_operationPutChunk((QNetworkOperation*) QtSupport::getQt(env, op));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QNetworkProtocol_checkConnection(JNIEnv *env, jobject obj, jobject op)
{
	return (jboolean) ((QNetworkProtocolJBridge*) QtSupport::getQt(env, obj))->protected_checkConnection((QNetworkOperation*) QtSupport::getQt(env, op));
}

