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

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

class QUriDragJBridge : public QUriDrag
{
public:
	QUriDragJBridge(QStrList uris, QWidget* dragSource, const char* name) : QUriDrag(uris, dragSource, name) {}
	QUriDragJBridge(QWidget* dragSource, const char* name) : QUriDrag(dragSource, name) {}
	~QUriDragJBridge() {QtSupport::qtKeyDeleted(this);}
	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_QUriDrag_newQUriDrag___3Ljava_lang_String_2Lorg_kde_qt_QWidget_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobjectArray uris, jobject dragSource, jstring name)
{
static QCString * _qstring_name = 0;
static QStrList * _qlist_uris = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QUriDragJBridge((QStrList) * (QStrList *) QtSupport::toQStrList(env, uris, &_qlist_uris), (QWidget*) QtSupport::getQt(env, dragSource), (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUriDrag_newQUriDrag___3Ljava_lang_String_2(JNIEnv *env, jobject obj, jobjectArray uris)
{
static QStrList * _qlist_uris = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QUriDragJBridge((QStrList) * (QStrList *) QtSupport::toQStrList(env, uris, &_qlist_uris), 0, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUriDrag_newQUriDrag__Lorg_kde_qt_QWidget_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject dragSource, jstring name)
{
static QCString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QUriDragJBridge((QWidget*) QtSupport::getQt(env, dragSource), (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUriDrag_newQUriDrag__(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QUriDragJBridge(0, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QUriDrag_setFilenames(JNIEnv *env, jobject obj, jobjectArray fnames)
{
static QStringList * _qlist_fnames = 0;
	((QUriDragJBridge*) QtSupport::getQt(env, obj))->setFilenames((QStringList&) * (QStringList *) QtSupport::toQStringList(env, fnames, &_qlist_fnames));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUriDrag_setFileNames(JNIEnv *env, jobject obj, jobjectArray fnames)
{
static QStringList * _qlist_fnames = 0;
	((QUriDragJBridge*) QtSupport::getQt(env, obj))->setFileNames((QStringList&) * (QStringList *) QtSupport::toQStringList(env, fnames, &_qlist_fnames));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUriDrag_setUnicodeUris(JNIEnv *env, jobject obj, jobjectArray uuris)
{
static QStringList * _qlist_uuris = 0;
	((QUriDragJBridge*) QtSupport::getQt(env, obj))->setUnicodeUris((QStringList&) * (QStringList *) QtSupport::toQStringList(env, uuris, &_qlist_uuris));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUriDrag_setUris(JNIEnv *env, jobject obj, jobjectArray uris)
{
static QStrList * _qlist_uris = 0;
	((QUriDragJBridge*) QtSupport::getQt(env, obj))->setUris((QStrList) * (QStrList *) QtSupport::toQStrList(env, uris, &_qlist_uris));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QUriDrag_uriToLocalFile(JNIEnv *env, jclass obj, jstring arg1)
{
	QString  _qstring;
static QCString * _qstring_arg1 = 0;
	_qstring = QUriDragJBridge::uriToLocalFile((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QUriDrag_localFileToUri(JNIEnv *env, jclass obj, jstring arg1)
{
	QCString  _qcstring;
static QString * _qstring_arg1 = 0;
	_qcstring = QUriDragJBridge::localFileToUri((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return QtSupport::fromQCString(env, &_qcstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QUriDrag_uriToUnicodeUri(JNIEnv *env, jclass obj, jstring arg1)
{
	QString  _qstring;
static QCString * _qstring_arg1 = 0;
	_qstring = QUriDragJBridge::uriToUnicodeUri((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QUriDrag_unicodeUriToUri(JNIEnv *env, jclass obj, jstring arg1)
{
	QCString  _qcstring;
static QString * _qstring_arg1 = 0;
	_qcstring = QUriDragJBridge::unicodeUriToUri((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return QtSupport::fromQCString(env, &_qcstring);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QUriDrag_canDecode(JNIEnv *env, jclass obj, jobject e)
{
	return (jboolean) QUriDragJBridge::canDecode(QtSupport::mimeSource(env, e));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QUriDrag_decode(JNIEnv *env, jclass obj, jobject e, jobject i)
{
static QStrList * _qlist_i = 0;
	if (_qlist_i == 0) {
		_qlist_i = new QStrList();
	}
	jboolean result = (jboolean) QUriDragJBridge::decode(QtSupport::mimeSource(env, e), *_qlist_i);
	QtSupport::arrayWithQStrList(env, _qlist_i, i);
	return result;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QUriDrag_decodeToUnicodeUris(JNIEnv *env, jclass obj, jobject e, jobject i)
{
static QStringList * _qlist_i = 0;
	if (_qlist_i == 0) {
		_qlist_i = new QStringList();
	}
	jboolean result = (jboolean) QUriDragJBridge::decodeToUnicodeUris(QtSupport::mimeSource(env, e), *_qlist_i);
	QtSupport::arrayWithQStringList(env, _qlist_i, i);
	return result;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QUriDrag_decodeLocalFiles(JNIEnv *env, jclass obj, jobject e, jobject i)
{
static QStringList * _qlist_i = 0;
	if (_qlist_i == 0) {
		_qlist_i = new QStringList();
	}
	jboolean result = (jboolean) QUriDragJBridge::decodeLocalFiles(QtSupport::mimeSource(env, e), *_qlist_i);
	QtSupport::arrayWithQStringList(env, _qlist_i, i);
	return result;
}

