/***************************************************************************
                            KIconTheme.cpp -  description
                             -------------------
    begin                : Tue Jan 29 14:50:06 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Tue Jan 29 14:50:06 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 <kicontheme.h>
#include <qstring.h>
#include <qcstring.h>

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

class KIconThemeJBridge : public KIconTheme
{
public:
	KIconThemeJBridge(const QString& name, const QString& appName) : KIconTheme(name, appName) {}
	~KIconThemeJBridge() {QtSupport::qtKeyDeleted(this);}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KIconTheme_newKIconTheme__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name, jstring appName)
{
static QString * _qstring_appName = 0;
static QString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KIconThemeJBridge((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QString&) * (QString *) QtSupport::toQString(env, appName, &_qstring_appName)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconTheme_newKIconTheme__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KIconThemeJBridge((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), QString::null));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconTheme_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KIconTheme_finalize(env, obj);
	return;
}

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

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

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

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

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

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

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

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KIconTheme_inherits(JNIEnv *env, jobject obj)
{
	QStringList  _qlist;
	_qlist = ((KIconTheme*) QtSupport::getQt(env, obj))->inherits();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KIconTheme_isValid(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KIconTheme*) QtSupport::getQt(env, obj))->isValid();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KIconTheme_depth(JNIEnv *env, jobject obj)
{
	return (jint) ((KIconTheme*) QtSupport::getQt(env, obj))->depth();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KIconTheme_defaultSize(JNIEnv *env, jobject obj, jint group)
{
	return (jint) ((KIconTheme*) QtSupport::getQt(env, obj))->defaultSize((KIcon::Group) group);
}

JNIEXPORT jintArray JNICALL
Java_org_kde_koala_KIconTheme_querySizes(JNIEnv *env, jobject obj, jint group)
{
	QValueList<int> _qintArray;
	_qintArray = ((KIconTheme*) QtSupport::getQt(env, obj))->querySizes((KIcon::Group) group);
	return QtSupport::fromQIntValueList(env, &_qintArray);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KIconTheme_queryIcons(JNIEnv *env, jobject obj, jint size, jint context)
{
	QStringList  _qlist;
	_qlist = ((KIconTheme*) QtSupport::getQt(env, obj))->queryIcons((int) size, (KIcon::Context) context);
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KIconTheme_queryIconsByContext(JNIEnv *env, jobject obj, jint size, jint context)
{
	QStringList  _qlist;
	_qlist = ((KIconTheme*) QtSupport::getQt(env, obj))->queryIconsByContext((int) size, (KIcon::Context) context);
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KIconTheme_iconPath(JNIEnv *env, jobject obj, jstring name, jint size, jint match)
{
static QString * _qstring_name = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new KIcon (((KIconTheme*) QtSupport::getQt(env, obj))->iconPath((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (int) size, (KIcon::MatchType) match)), "org.kde.koala.KIcon", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KIconTheme_list(JNIEnv *env, jclass obj)
{
	QStringList  _qlist;
	_qlist = KIconThemeJBridge::list();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KIconTheme_current(JNIEnv *env, jclass obj)
{
	QString  _qstring;
	_qstring = KIconThemeJBridge::current();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconTheme_reconfigure(JNIEnv *env, jclass obj)
{
	KIconThemeJBridge::reconfigure();
	return;
}

