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

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

class KDEDesktopMimeTypeJBridge : public KDEDesktopMimeType
{
public:
	KDEDesktopMimeTypeJBridge(KDesktopFile* config) : KDEDesktopMimeType(config) {}
	KDEDesktopMimeTypeJBridge(QDataStream& _str, int offset) : KDEDesktopMimeType(_str, offset) {}
	 QPixmap  protected_pixmap(KIcon::Group a, int b, int c, QString* d) {
		return ( QPixmap ) KDEDesktopMimeType::pixmap(a, b, c, d);
	}
	 pid_t  protected_runFSDevice(const KURL& _url, const KSimpleConfig& cfg) {
		return ( pid_t ) KDEDesktopMimeType::runFSDevice(_url, cfg);
	}
	 pid_t  protected_runApplication(const KURL& _url, const QString& _serviceFile) {
		return ( pid_t ) KDEDesktopMimeType::runApplication(_url, _serviceFile);
	}
	 pid_t  protected_runLink(const KURL& _url, const KSimpleConfig& cfg) {
		return ( pid_t ) KDEDesktopMimeType::runLink(_url, cfg);
	}
	 pid_t  protected_runMimeType(const KURL& _url, const KSimpleConfig& cfg) {
		return ( pid_t ) KDEDesktopMimeType::runMimeType(_url, cfg);
	}
};


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

JNIEXPORT void JNICALL
Java_org_kde_koala_KDEDesktopMimeType_newKDEDesktopMimeType__Lorg_kde_qt_QDataStream_2I(JNIEnv *env, jobject obj, jobject _str, jint offset)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KDEDesktopMimeTypeJBridge((QDataStream&) *(QDataStream *) QtSupport::getQt(env, _str), (int) offset));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KDEDesktopMimeType_icon__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring _url, jboolean _is_local)
{
	QString  _qstring;
static QString * _qstring__url = 0;
	_qstring = ((KDEDesktopMimeType*) QtSupport::getQt(env, obj))->icon((QString&) * (QString *) QtSupport::toQString(env, _url, &_qstring__url), (bool) _is_local);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KDEDesktopMimeType_icon__Lorg_kde_koala_KURL_2Z(JNIEnv *env, jobject obj, jobject _url, jboolean _is_local)
{
	QString  _qstring;
	_qstring = ((KDEDesktopMimeType*) QtSupport::getQt(env, obj))->icon((KURL&) *(KURL *) QtSupport::getQt(env, _url), (bool) _is_local);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KDEDesktopMimeType_pixmap__Lorg_kde_koala_KURL_2IIILjava_lang_String_2(JNIEnv *env, jobject obj, jobject _url, jint _group, jint _force_size, jint _state, jstring _path)
{
static QString * _qstring__path = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QPixmap (((KDEDesktopMimeType*) QtSupport::getQt(env, obj))->pixmap((KURL&) *(KURL *) QtSupport::getQt(env, _url), (KIcon::Group) _group, (int) _force_size, (int) _state, (QString*) QtSupport::toQString(env, _path, &_qstring__path))), "org.kde.qt.QPixmap", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KDEDesktopMimeType_pixmap__Lorg_kde_koala_KURL_2I(JNIEnv *env, jobject obj, jobject _url, jint _group)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPixmap(((KDEDesktopMimeType*) QtSupport::getQt(env, obj))->pixmap((KURL&) *(KURL *) QtSupport::getQt(env, _url), (KIcon::Group) _group, 0, 0, 0L)), "org.kde.qt.QPixmap", TRUE);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KDEDesktopMimeType_comment__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring _url, jboolean _is_local)
{
	QString  _qstring;
static QString * _qstring__url = 0;
	_qstring = ((KDEDesktopMimeType*) QtSupport::getQt(env, obj))->comment((QString&) * (QString *) QtSupport::toQString(env, _url, &_qstring__url), (bool) _is_local);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KDEDesktopMimeType_comment__Lorg_kde_koala_KURL_2Z(JNIEnv *env, jobject obj, jobject _url, jboolean _is_local)
{
	QString  _qstring;
	_qstring = ((KDEDesktopMimeType*) QtSupport::getQt(env, obj))->comment((KURL&) *(KURL *) QtSupport::getQt(env, _url), (bool) _is_local);
	return QtSupport::fromQString(env, &_qstring);
}

//JNIEXPORT  JNICALL
//Java_org_kde_koala_KDEDesktopMimeType_builtinServices(JNIEnv *env, jclass obj, jobject _url)
//{
//	return () KDEDesktopMimeTypeJBridge::builtinServices((KURL&) *(KURL *) QtSupport::getQt(env, _url));
//}

//JNIEXPORT  JNICALL
//Java_org_kde_koala_KDEDesktopMimeType_userDefinedServices(JNIEnv *env, jclass obj, jstring path, jboolean bLocalFiles)
//{
//static QString * _qstring_path = 0;
//	return () KDEDesktopMimeTypeJBridge::userDefinedServices((QString&) * (QString *) QtSupport::toQString(env, path, &_qstring_path), (bool) bLocalFiles);
//}

JNIEXPORT void JNICALL
Java_org_kde_koala_KDEDesktopMimeType_executeService__Ljava_lang_String_2Lorg_kde_koala_KDEDesktopMimeType_Service_2(JNIEnv *env, jclass obj, jstring _path, jobject _service)
{
static QString * _qstring__path = 0;
	KDEDesktopMimeTypeJBridge::executeService((QString&) * (QString *) QtSupport::toQString(env, _path, &_qstring__path), (KDEDesktopMimeType::Service&) *(KDEDesktopMimeType::Service *) QtSupport::getQt(env, _service));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KDEDesktopMimeType_executeService__Ljava_util_ArrayList_2Lorg_kde_koala_KDEDesktopMimeType_Service_2(JNIEnv *env, jclass obj, jobjectArray urls, jobject service)
{
static KURL::List * _qlist_urls = 0;
	KDEDesktopMimeTypeJBridge::executeService((KURL::List&) * (KURL::List *) KDESupport::toKURLList(env, urls, &_qlist_urls), (KDEDesktopMimeType::Service&) *(KDEDesktopMimeType::Service *) QtSupport::getQt(env, service));
	return;
}

JNIEXPORT jlong JNICALL
Java_org_kde_koala_KDEDesktopMimeType_run(JNIEnv *env, jclass obj, jobject _url, jboolean _is_local)
{
	return (jlong) KDEDesktopMimeTypeJBridge::run((KURL&) *(KURL *) QtSupport::getQt(env, _url), (bool) _is_local);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KDEDesktopMimeType_pixmap__IIILjava_lang_String_2(JNIEnv *env, jobject obj, jint a, jint b, jint c, jstring d)
{
static QString * _qstring_d = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QPixmap (((KDEDesktopMimeTypeJBridge*) QtSupport::getQt(env, obj))->protected_pixmap((KIcon::Group) a, (int) b, (int) c, (QString*) QtSupport::toQString(env, d, &_qstring_d))), "org.kde.qt.QPixmap", TRUE);
}

//JNIEXPORT jlong JNICALL
//Java_org_kde_koala_KDEDesktopMimeType_runFSDevice(JNIEnv *env, jclass obj, jobject _url, jobject cfg)
//{
//	return (jlong) KDEDesktopMimeTypeJBridge::protected_runFSDevice((KURL&) *(KURL *) QtSupport::getQt(env, _url), (KSimpleConfig&) *(KSimpleConfig *) QtSupport::getQt(env, cfg));
//}

//JNIEXPORT jlong JNICALL
//Java_org_kde_koala_KDEDesktopMimeType_runApplication(JNIEnv *env, jclass obj, jobject _url, jstring _serviceFile)
//{
//static QString * _qstring__serviceFile = 0;
//	return (jlong) KDEDesktopMimeTypeJBridge::protected_runApplication((KURL&) *(KURL *) QtSupport::getQt(env, _url), (QString&) * (QString *) QtSupport::toQString(env, _serviceFile, &_qstring__serviceFile));
//}

//JNIEXPORT jlong JNICALL
//Java_org_kde_koala_KDEDesktopMimeType_runLink(JNIEnv *env, jclass obj, jobject _url, jobject cfg)
//{
//	return (jlong) KDEDesktopMimeTypeJBridge::protected_runLink((KURL&) *(KURL *) QtSupport::getQt(env, _url), (KSimpleConfig&) *(KSimpleConfig *) QtSupport::getQt(env, cfg));
//}

//JNIEXPORT jlong JNICALL
//Java_org_kde_koala_KDEDesktopMimeType_runMimeType(JNIEnv *env, jclass obj, jobject _url, jobject cfg)
//{
//	return (jlong) KDEDesktopMimeTypeJBridge::protected_runMimeType((KURL&) *(KURL *) QtSupport::getQt(env, _url), (KSimpleConfig&) *(KSimpleConfig *) QtSupport::getQt(env, cfg));
//}

