/***************************************************************************
                            KURIFilter.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 <qstringlist.h>
#include <kurifilter.h>
#include <qstring.h>
#include <qcstring.h>

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

class KURIFilterJBridge : public KURIFilter
{
public:
	KURIFilterJBridge() : KURIFilter() {}
	void protected_loadPlugins() {
		KURIFilter::loadPlugins();
		return;
	}
};


JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilter_filterURI__Lorg_kde_koala_KURIFilterData_2_3Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject data, jobjectArray filters)
{
static QStringList * _qlist_filters = 0;
	return (jboolean) ((KURIFilter*) QtSupport::getQt(env, obj))->filterURI((KURIFilterData&) *(KURIFilterData *) QtSupport::getQt(env, data), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, filters, &_qlist_filters));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilter_filterURI__Lorg_kde_koala_KURIFilterData_2(JNIEnv *env, jobject obj, jobject data)
{
	return (jboolean) ((KURIFilter*) QtSupport::getQt(env, obj))->filterURI((KURIFilterData&) *(KURIFilterData *) QtSupport::getQt(env, data), QStringList());
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilter_filterURI__Lorg_kde_koala_KURL_2_3Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject uri, jobjectArray filters)
{
static QStringList * _qlist_filters = 0;
	return (jboolean) ((KURIFilter*) QtSupport::getQt(env, obj))->filterURI((KURL&) *(KURL *) QtSupport::getQt(env, uri), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, filters, &_qlist_filters));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilter_filterURI__Lorg_kde_koala_KURL_2(JNIEnv *env, jobject obj, jobject uri)
{
	return (jboolean) ((KURIFilter*) QtSupport::getQt(env, obj))->filterURI((KURL&) *(KURL *) QtSupport::getQt(env, uri), QStringList());
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilter_filterURI__Ljava_lang_String_2_3Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring uri, jobjectArray filters)
{
static QStringList * _qlist_filters = 0;
static QString * _qstring_uri = 0;
	return (jboolean) ((KURIFilter*) QtSupport::getQt(env, obj))->filterURI((QString&) * (QString *) QtSupport::toQString(env, uri, &_qstring_uri), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, filters, &_qlist_filters));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilter_filterURI__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring uri)
{
static QString * _qstring_uri = 0;
	return (jboolean) ((KURIFilter*) QtSupport::getQt(env, obj))->filterURI((QString&) * (QString *) QtSupport::toQString(env, uri, &_qstring_uri), QStringList());
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KURIFilter_filteredURI__Lorg_kde_koala_KURL_2_3Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject uri, jobjectArray filters)
{
static QStringList * _qlist_filters = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new KURL (((KURIFilter*) QtSupport::getQt(env, obj))->filteredURI((KURL&) *(KURL *) QtSupport::getQt(env, uri), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, filters, &_qlist_filters))), "org.kde.koala.KURL", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KURIFilter_filteredURI__Lorg_kde_koala_KURL_2(JNIEnv *env, jobject obj, jobject uri)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new KURL(((KURIFilter*) QtSupport::getQt(env, obj))->filteredURI((KURL&) *(KURL *) QtSupport::getQt(env, uri), QStringList())), "org.kde.koala.KURL", TRUE);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KURIFilter_filteredURI__Ljava_lang_String_2_3Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring uri, jobjectArray filters)
{
	QString  _qstring;
static QStringList * _qlist_filters = 0;
static QString * _qstring_uri = 0;
	_qstring = ((KURIFilter*) QtSupport::getQt(env, obj))->filteredURI((QString&) * (QString *) QtSupport::toQString(env, uri, &_qstring_uri), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, filters, &_qlist_filters));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KURIFilter_filteredURI__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring uri)
{
static QString * _qstring_uri = 0;
	QString _qstring;
	_qstring = ((KURIFilter*) QtSupport::getQt(env, obj))->filteredURI((QString&) * (QString *) QtSupport::toQString(env, uri, &_qstring_uri), QStringList());
	return QtSupport::fromQString(env, &_qstring);
}

//JNIEXPORT  JNICALL
//Java_org_kde_koala_KURIFilter_pluginsIterator(JNIEnv *env, jobject obj)
//{
//	return () ((KURIFilter*) QtSupport::getQt(env, obj))->pluginsIterator();
//}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KURIFilter_self(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)KURIFilterJBridge::self(), "org.kde.koala.KURIFilter");
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KURIFilter_loadPlugins(JNIEnv *env, jobject obj)
{
	((KURIFilterJBridge*) QtSupport::getQt(env, obj))->protected_loadPlugins();
	return;
}

