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

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

class KStandardDirsJBridge : public KStandardDirs
{
public:
	KStandardDirsJBridge() : KStandardDirs() {}
	~KStandardDirsJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KStandardDirs_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KStandardDirs_finalize(env, obj);
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KStandardDirs_addPrefix(JNIEnv *env, jobject obj, jstring dir)
{
static QString * _qstring_dir = 0;
	((KStandardDirs*) QtSupport::getQt(env, obj))->addPrefix((QString&) * (QString *) QtSupport::toQString(env, dir, &_qstring_dir));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KStandardDirs_addResourceType(JNIEnv *env, jobject obj, jstring type, jstring relativename)
{
static QString * _qstring_relativename = 0;
static QCString * _qstring_type = 0;
	return (jboolean) ((KStandardDirs*) QtSupport::getQt(env, obj))->addResourceType((char*) QtSupport::toCharString(env, type, &_qstring_type), (QString&) * (QString *) QtSupport::toQString(env, relativename, &_qstring_relativename));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KStandardDirs_addResourceDir(JNIEnv *env, jobject obj, jstring type, jstring absdir)
{
static QString * _qstring_absdir = 0;
static QCString * _qstring_type = 0;
	return (jboolean) ((KStandardDirs*) QtSupport::getQt(env, obj))->addResourceDir((char*) QtSupport::toCharString(env, type, &_qstring_type), (QString&) * (QString *) QtSupport::toQString(env, absdir, &_qstring_absdir));
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStandardDirs_findResource(JNIEnv *env, jobject obj, jstring type, jstring filename)
{
	QString  _qstring;
static QString * _qstring_filename = 0;
static QCString * _qstring_type = 0;
	_qstring = ((KStandardDirs*) QtSupport::getQt(env, obj))->findResource((char*) QtSupport::toCharString(env, type, &_qstring_type), (QString&) * (QString *) QtSupport::toQString(env, filename, &_qstring_filename));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KStandardDirs_calcResourceHash(JNIEnv *env, jobject obj, jstring type, jstring filename, jboolean deep)
{
static QString * _qstring_filename = 0;
static QCString * _qstring_type = 0;
	return (jint) ((KStandardDirs*) QtSupport::getQt(env, obj))->calcResourceHash((char*) QtSupport::toCharString(env, type, &_qstring_type), (QString&) * (QString *) QtSupport::toQString(env, filename, &_qstring_filename), (bool) deep);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KStandardDirs_findDirs(JNIEnv *env, jobject obj, jstring type, jstring reldir)
{
	QStringList  _qlist;
static QString * _qstring_reldir = 0;
static QCString * _qstring_type = 0;
	_qlist = ((KStandardDirs*) QtSupport::getQt(env, obj))->findDirs((char*) QtSupport::toCharString(env, type, &_qstring_type), (QString&) * (QString *) QtSupport::toQString(env, reldir, &_qstring_reldir));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStandardDirs_findResourceDir(JNIEnv *env, jobject obj, jstring type, jstring filename)
{
	QString  _qstring;
static QString * _qstring_filename = 0;
static QCString * _qstring_type = 0;
	_qstring = ((KStandardDirs*) QtSupport::getQt(env, obj))->findResourceDir((char*) QtSupport::toCharString(env, type, &_qstring_type), (QString&) * (QString *) QtSupport::toQString(env, filename, &_qstring_filename));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KStandardDirs_findAllResources__Ljava_lang_String_2Ljava_lang_String_2ZZ(JNIEnv *env, jobject obj, jstring type, jstring filter, jboolean recursive, jboolean uniq)
{
	QStringList  _qlist;
static QString * _qstring_filter = 0;
static QCString * _qstring_type = 0;
	_qlist = ((KStandardDirs*) QtSupport::getQt(env, obj))->findAllResources((char*) QtSupport::toCharString(env, type, &_qstring_type), (QString&) * (QString *) QtSupport::toQString(env, filter, &_qstring_filter), (bool) recursive, (bool) uniq);
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KStandardDirs_findAllResources__Ljava_lang_String_2Ljava_lang_String_2ZZ_3Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring type, jstring filter, jboolean recursive, jboolean uniq, jobjectArray relPaths)
{
	QStringList  _qlist;
static QStringList * _qlist_relPaths = 0;
static QString * _qstring_filter = 0;
static QCString * _qstring_type = 0;
	_qlist = ((KStandardDirs*) QtSupport::getQt(env, obj))->findAllResources((char*) QtSupport::toCharString(env, type, &_qstring_type), (QString&) * (QString *) QtSupport::toQString(env, filter, &_qstring_filter), (bool) recursive, (bool) uniq, (QStringList&) * (QStringList *) QtSupport::toQStringList(env, relPaths, &_qlist_relPaths));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KStandardDirs_addKDEDefaults(JNIEnv *env, jobject obj)
{
	((KStandardDirs*) QtSupport::getQt(env, obj))->addKDEDefaults();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KStandardDirs_addCustomized(JNIEnv *env, jobject obj, jobject config)
{
	return (jboolean) ((KStandardDirs*) QtSupport::getQt(env, obj))->addCustomized((KConfig*) QtSupport::getQt(env, config));
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KStandardDirs_resourceDirs(JNIEnv *env, jobject obj, jstring type)
{
	QStringList  _qlist;
static QCString * _qstring_type = 0;
	_qlist = ((KStandardDirs*) QtSupport::getQt(env, obj))->resourceDirs((char*) QtSupport::toCharString(env, type, &_qstring_type));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStandardDirs_saveLocation__Ljava_lang_String_2Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring type, jstring suffix, jboolean create)
{
	QString  _qstring;
static QString * _qstring_suffix = 0;
static QCString * _qstring_type = 0;
	_qstring = ((KStandardDirs*) QtSupport::getQt(env, obj))->saveLocation((char*) QtSupport::toCharString(env, type, &_qstring_type), (QString&) * (QString *) QtSupport::toQString(env, suffix, &_qstring_suffix), (bool) create);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStandardDirs_saveLocation__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring type)
{
static QCString * _qstring_type = 0;
	QString _qstring;
	_qstring = ((KStandardDirs*) QtSupport::getQt(env, obj))->saveLocation((char*) QtSupport::toCharString(env, type, &_qstring_type), QString::null, true);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStandardDirs_relativeLocation(JNIEnv *env, jobject obj, jstring type, jstring absPath)
{
	QString  _qstring;
static QString * _qstring_absPath = 0;
static QCString * _qstring_type = 0;
	_qstring = ((KStandardDirs*) QtSupport::getQt(env, obj))->relativeLocation((char*) QtSupport::toCharString(env, type, &_qstring_type), (QString&) * (QString *) QtSupport::toQString(env, absPath, &_qstring_absPath));
	return QtSupport::fromQString(env, &_qstring);
}

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

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStandardDirs_findExe__Ljava_lang_String_2Ljava_lang_String_2Z(JNIEnv *env, jclass obj, jstring appname, jstring pathstr, jboolean ignoreExecBit)
{
	QString  _qstring;
static QString * _qstring_pathstr = 0;
static QString * _qstring_appname = 0;
	_qstring = KStandardDirsJBridge::findExe((QString&) * (QString *) QtSupport::toQString(env, appname, &_qstring_appname), (QString&) * (QString *) QtSupport::toQString(env, pathstr, &_qstring_pathstr), (bool) ignoreExecBit);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStandardDirs_findExe__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring appname)
{
static QString * _qstring_appname = 0;
	QString _qstring;
	_qstring = KStandardDirsJBridge::findExe((QString&) * (QString *) QtSupport::toQString(env, appname, &_qstring_appname), QString::null, false);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KStandardDirs_findAllExe___3Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Z(JNIEnv *env, jclass obj, jobjectArray list, jstring appname, jstring pathstr, jboolean ignoreExecBit)
{
static QString * _qstring_pathstr = 0;
static QString * _qstring_appname = 0;
static QStringList * _qlist_list = 0;
	return (jint) KStandardDirsJBridge::findAllExe((QStringList&) * (QStringList *) QtSupport::toQStringList(env, list, &_qlist_list), (QString&) * (QString *) QtSupport::toQString(env, appname, &_qstring_appname), (QString&) * (QString *) QtSupport::toQString(env, pathstr, &_qstring_pathstr), (bool) ignoreExecBit);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KStandardDirs_findAllExe___3Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jclass obj, jobjectArray list, jstring appname)
{
static QString * _qstring_appname = 0;
static QStringList * _qlist_list = 0;
	return (jint) KStandardDirsJBridge::findAllExe((QStringList&) * (QStringList *) QtSupport::toQStringList(env, list, &_qlist_list), (QString&) * (QString *) QtSupport::toQString(env, appname, &_qstring_appname), QString::null, false);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KStandardDirs_makeDir__Ljava_lang_String_2I(JNIEnv *env, jclass obj, jstring dir, jint mode)
{
static QString * _qstring_dir = 0;
	return (jboolean) KStandardDirsJBridge::makeDir((QString&) * (QString *) QtSupport::toQString(env, dir, &_qstring_dir), (int) mode);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KStandardDirs_makeDir__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring dir)
{
static QString * _qstring_dir = 0;
	return (jboolean) KStandardDirsJBridge::makeDir((QString&) * (QString *) QtSupport::toQString(env, dir, &_qstring_dir), 0755);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStandardDirs_kde_1default(JNIEnv *env, jclass obj, jstring type)
{
	QString  _qstring;
static QCString * _qstring_type = 0;
	_qstring = KStandardDirsJBridge::kde_default((char*) QtSupport::toCharString(env, type, &_qstring_type));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KStandardDirs_exists(JNIEnv *env, jclass obj, jstring fullPath)
{
static QString * _qstring_fullPath = 0;
	return (jboolean) KStandardDirsJBridge::exists((QString&) * (QString *) QtSupport::toQString(env, fullPath, &_qstring_fullPath));
}

