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

class KURIFilterDataJBridge : public KURIFilterData
{
public:
	KURIFilterDataJBridge() : KURIFilterData() {}
	KURIFilterDataJBridge(const KURL& url) : KURIFilterData(url) {}
	KURIFilterDataJBridge(const QString& url) : KURIFilterData(url) {}
	KURIFilterDataJBridge(const KURIFilterData& arg1) : KURIFilterData(arg1) {}
	~KURIFilterDataJBridge() {QtSupport::qtKeyDeleted(this);}
	void protected_init(const KURL& url) {
		KURIFilterData::init(url);
		return;
	}
};


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

JNIEXPORT void JNICALL
Java_org_kde_koala_KURIFilterData_newKURIFilterData__Lorg_kde_koala_KURL_2(JNIEnv *env, jobject obj, jobject url)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KURIFilterDataJBridge((KURL&) *(KURL *) QtSupport::getQt(env, url)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURIFilterData_newKURIFilterData__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring url)
{
static QString * _qstring_url = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KURIFilterDataJBridge((QString&) * (QString *) QtSupport::toQString(env, url, &_qstring_url)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURIFilterData_newKURIFilterData__Lorg_kde_koala_KURIFilterData_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KURIFilterDataJBridge((KURIFilterData&) *(KURIFilterData *) QtSupport::getQt(env, arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURIFilterData_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj)) {
		delete (KURIFilterData*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURIFilterData_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KURIFilterData_finalize(env, obj);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilterData_isDisposed(JNIEnv *env, jobject obj)
{
	return (QtSupport::getQt(env, obj) == 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilterData_hasBeenFiltered(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KURIFilterData*) QtSupport::getQt(env, obj))->hasBeenFiltered();
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KURIFilterData_errorMsg(JNIEnv *env, jobject obj)
{
	QString  _qstring;
	_qstring = ((KURIFilterData*) QtSupport::getQt(env, obj))->errorMsg();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KURIFilterData_uriType(JNIEnv *env, jobject obj)
{
	return (jint) ((KURIFilterData*) QtSupport::getQt(env, obj))->uriType();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURIFilterData_setData__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring url)
{
static QString * _qstring_url = 0;
	((KURIFilterData*) QtSupport::getQt(env, obj))->setData((QString&) * (QString *) QtSupport::toQString(env, url, &_qstring_url));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURIFilterData_setData__Lorg_kde_koala_KURL_2(JNIEnv *env, jobject obj, jobject url)
{
	((KURIFilterData*) QtSupport::getQt(env, obj))->setData((KURL&) *(KURL *) QtSupport::getQt(env, url));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilterData_setAbsolutePath(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	return (jboolean) ((KURIFilterData*) QtSupport::getQt(env, obj))->setAbsolutePath((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KURIFilterData_absolutePath(JNIEnv *env, jobject obj)
{
	QString  _qstring;
	_qstring = ((KURIFilterData*) QtSupport::getQt(env, obj))->absolutePath();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilterData_hasAbsolutePath(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KURIFilterData*) QtSupport::getQt(env, obj))->hasAbsolutePath();
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KURIFilterData_argsAndOptions(JNIEnv *env, jobject obj)
{
	QString  _qstring;
	_qstring = ((KURIFilterData*) QtSupport::getQt(env, obj))->argsAndOptions();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KURIFilterData_hasArgsAndOptions(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KURIFilterData*) QtSupport::getQt(env, obj))->hasArgsAndOptions();
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KURIFilterData_iconName(JNIEnv *env, jobject obj)
{
	QString  _qstring;
	_qstring = ((KURIFilterData*) QtSupport::getQt(env, obj))->iconName();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURIFilterData_init__Lorg_kde_koala_KURL_2(JNIEnv *env, jobject obj, jobject url)
{
	((KURIFilterDataJBridge*) QtSupport::getQt(env, obj))->protected_init((KURL&) *(KURL *) QtSupport::getQt(env, url));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KURIFilterData_init__(JNIEnv *env, jobject obj)
{
	((KURIFilterDataJBridge*) QtSupport::getQt(env, obj))->protected_init(QString::null);
	return;
}

