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

#include <qtjava/QtSupport.h>
#include <kdejava/KDESupport.h>
#include <kdejava/KDEJavaSlot.h>
#include <kdejava/KApplication.h>

class KApplicationJBridge : public KApplication
{
public:
	KApplicationJBridge(bool allowStyles, bool GUIenabled) : KApplication(allowStyles, GUIenabled) {}
	KApplicationJBridge(Display* display, int& argc, char* * argv, const QCString& rAppName, bool allowStyles, bool GUIenabled) : KApplication(display, argc, argv, rAppName, allowStyles, GUIenabled) {}
	KApplicationJBridge(int& argc, char* * argv, const QCString& rAppName, bool allowStyles, bool GUIenabled) : KApplication(argc, argv, rAppName, allowStyles, GUIenabled) {}
	~KApplicationJBridge() {QtSupport::qtKeyDeleted(this);}
	KApplicationJBridge(bool allowStyles, bool GUIenabled, KInstance* _instance) : KApplication(allowStyles, GUIenabled, _instance) {}
	bool  protected_x11EventFilter(XEvent* arg1) {
		return (bool ) KApplication::x11EventFilter(arg1);
	}
	void childEvent(QChildEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "childEvent", arg1, "org.kde.qt.QChildEvent")) {
			QObject::childEvent(arg1);
		}
		return;
	}
	void customEvent(QCustomEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "customEvent", arg1, "org.kde.qt.QCustomEvent")) {
			QObject::customEvent(arg1);
		}
		return;
	}
	void timerEvent(QTimerEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "timerEvent", arg1, "org.kde.qt.QTimerEvent")) {
			QObject::timerEvent(arg1);
		}
		return;
	}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_newKApplication__ZZ(JNIEnv *env, jobject obj, jboolean allowStyles, jboolean GUIenabled)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KApplicationJBridge((bool) allowStyles, (bool) GUIenabled));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KApplication_newKApplication__ILjava_lang_String_2Ljava_lang_String_2ZZ(JNIEnv *env, jobject obj, jDisplay* display, jint argc, jstring argv, jstring rAppName, jboolean allowStyles, jboolean GUIenabled)
//{
//static QCString * _qcstring_rAppName = 0;
//static QCString * _qstring_argv = 0;
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new KApplicationJBridge((Display*) display, (int&) * (int *) argc, (char**) QtSupport::toCharString(env, argv, &_qstring_argv), (QCString&) * (QCString *) QtSupport::toQCString(env, rAppName, &_qcstring_rAppName), (bool) allowStyles, (bool) GUIenabled));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KApplication_newKApplication__ILjava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jDisplay* display, jint argc, jstring argv, jstring rAppName)
//{
//static QCString * _qcstring_rAppName = 0;
//static QCString * _qstring_argv = 0;
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new KApplicationJBridge((Display*) display, (int&) * (int *) argc, (char**) QtSupport::toCharString(env, argv, &_qstring_argv), (QCString&) * (QCString *) QtSupport::toQCString(env, rAppName, &_qcstring_rAppName), true, true));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_newKApplication___3Ljava_lang_String_2Ljava_lang_String_2ZZ(JNIEnv *env, jobject obj, jobjectArray args, jstring rAppName, jboolean allowStyles, jboolean GUIenabled)
{
static QCString * _qcstring_rAppName = 0;
 	int argc = (int) env->GetArrayLength(args) + 1;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KApplicationJBridge(argc, QtSupport::toArgv(env, args), (const QCString&) * (QString *) QtSupport::toQCString(env, rAppName, &_qcstring_rAppName), (bool) allowStyles, (bool) GUIenabled));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_newKApplication___3Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobjectArray args, jstring rAppName)
{
static QCString * _qcstring_rAppName = 0;
 	int argc = (int) env->GetArrayLength(args) + 1;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KApplicationJBridge(argc, QtSupport::toArgv(env, args), (const QCString&) * (QString *) QtSupport::toQCString(env, rAppName, &_qcstring_rAppName), true, true));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj) && ((KApplication*)QtSupport::getQt(env, obj))->parent() == (QObject *) 0) {
		delete (KApplication*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KApplication_finalize(env, obj);
	return;
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_sessionConfig(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KApplication*) QtSupport::getQt(env, obj))->sessionConfig(), "org.kde.koala.KConfig");
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KApplication_isRestored(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KApplication*) QtSupport::getQt(env, obj))->isRestored();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_disableSessionManagement(JNIEnv *env, jobject obj)
{
	((KApplication*) QtSupport::getQt(env, obj))->disableSessionManagement();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KApplication_requestShutDown__III(JNIEnv *env, jobject obj, jint confirm, jint sdtype, jint sdmode)
{
	return (jboolean) ((KApplication*) QtSupport::getQt(env, obj))->requestShutDown((KApplication::ShutdownConfirm) confirm, (KApplication::ShutdownType) sdtype, (KApplication::ShutdownMode) sdmode);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KApplication_requestShutDown__(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KApplication*) QtSupport::getQt(env, obj))->requestShutDown(KApplication::ShutdownConfirmDefault, KApplication::ShutdownTypeDefault, KApplication::ShutdownModeDefault);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_propagateSessionManager(JNIEnv *env, jobject obj)
{
	((KApplication*) QtSupport::getQt(env, obj))->propagateSessionManager();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_commitData(JNIEnv *env, jobject obj, jobject sm)
{
	((KApplication*) QtSupport::getQt(env, obj))->commitData((QSessionManager&) *(QSessionManager *) QtSupport::getQt(env, sm));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_saveState(JNIEnv *env, jobject obj, jobject sm)
{
	((KApplication*) QtSupport::getQt(env, obj))->saveState((QSessionManager&) *(QSessionManager *) QtSupport::getQt(env, sm));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_icon(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPixmap (((KApplication*) QtSupport::getQt(env, obj))->icon()), "org.kde.qt.QPixmap", TRUE);
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_miniIcon(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPixmap (((KApplication*) QtSupport::getQt(env, obj))->miniIcon()), "org.kde.qt.QPixmap", TRUE);
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_setTopWidget(JNIEnv *env, jobject obj, jobject topWidget)
{
	((KApplication*) QtSupport::getQt(env, obj))->setTopWidget((QWidget*) QtSupport::getQt(env, topWidget));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_invokeHelp__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring anchor, jstring appname)
{
static QString * _qstring_appname = 0;
static QString * _qstring_anchor = 0;
	((KApplication*) QtSupport::getQt(env, obj))->invokeHelp((QString&) * (QString *) QtSupport::toQString(env, anchor, &_qstring_anchor), (QString&) * (QString *) QtSupport::toQString(env, appname, &_qstring_appname));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_invokeHelp__(JNIEnv *env, jobject obj)
{
	((KApplication*) QtSupport::getQt(env, obj))->invokeHelp(QString::null, QString::null);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_invokeHTMLHelp__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring aFilename, jstring aTopic)
{
static QString * _qstring_aTopic = 0;
static QString * _qstring_aFilename = 0;
	((KApplication*) QtSupport::getQt(env, obj))->invokeHTMLHelp((QString&) * (QString *) QtSupport::toQString(env, aFilename, &_qstring_aFilename), (QString&) * (QString *) QtSupport::toQString(env, aTopic, &_qstring_aTopic));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_invokeHTMLHelp__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring aFilename)
{
static QString * _qstring_aFilename = 0;
	((KApplication*) QtSupport::getQt(env, obj))->invokeHTMLHelp((QString&) * (QString *) QtSupport::toQString(env, aFilename, &_qstring_aFilename), QString::null);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_invokeMailer__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring address, jstring subject)
{
static QString * _qstring_subject = 0;
static QString * _qstring_address = 0;
	((KApplication*) QtSupport::getQt(env, obj))->invokeMailer((QString&) * (QString *) QtSupport::toQString(env, address, &_qstring_address), (QString&) * (QString *) QtSupport::toQString(env, subject, &_qstring_subject));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_invokeMailer__Lorg_kde_koala_KURL_2(JNIEnv *env, jobject obj, jobject mailtoURL)
{
	((KApplication*) QtSupport::getQt(env, obj))->invokeMailer((KURL&) *(KURL *) QtSupport::getQt(env, mailtoURL));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_invokeMailer__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2_3Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring to, jstring cc, jstring bcc, jstring subject, jstring body, jstring messageFile, jobjectArray attachURLs)
{
static QStringList * _qlist_attachURLs = 0;
static QString * _qstring_messageFile = 0;
static QString * _qstring_body = 0;
static QString * _qstring_subject = 0;
static QString * _qstring_bcc = 0;
static QString * _qstring_cc = 0;
static QString * _qstring_to = 0;
	((KApplication*) QtSupport::getQt(env, obj))->invokeMailer((QString&) * (QString *) QtSupport::toQString(env, to, &_qstring_to), (QString&) * (QString *) QtSupport::toQString(env, cc, &_qstring_cc), (QString&) * (QString *) QtSupport::toQString(env, bcc, &_qstring_bcc), (QString&) * (QString *) QtSupport::toQString(env, subject, &_qstring_subject), (QString&) * (QString *) QtSupport::toQString(env, body, &_qstring_body), (QString&) * (QString *) QtSupport::toQString(env, messageFile, &_qstring_messageFile), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, attachURLs, &_qlist_attachURLs));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_invokeMailer__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring to, jstring cc, jstring bcc, jstring subject, jstring body)
{
static QString * _qstring_body = 0;
static QString * _qstring_subject = 0;
static QString * _qstring_bcc = 0;
static QString * _qstring_cc = 0;
static QString * _qstring_to = 0;
	((KApplication*) QtSupport::getQt(env, obj))->invokeMailer((QString&) * (QString *) QtSupport::toQString(env, to, &_qstring_to), (QString&) * (QString *) QtSupport::toQString(env, cc, &_qstring_cc), (QString&) * (QString *) QtSupport::toQString(env, bcc, &_qstring_bcc), (QString&) * (QString *) QtSupport::toQString(env, subject, &_qstring_subject), (QString&) * (QString *) QtSupport::toQString(env, body, &_qstring_body), QString::null, QStringList());
	return;
}

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_kstyle(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KApplication*) QtSupport::getQt(env, obj))->kstyle(), "org.kde.koala.KStyle");
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KApplication_makeStdCaption(JNIEnv *env, jobject obj, jstring userCaption, jboolean withAppName, jboolean modified)
{
	QString  _qstring;
static QString * _qstring_userCaption = 0;
	_qstring = ((KApplication*) QtSupport::getQt(env, obj))->makeStdCaption((QString&) * (QString *) QtSupport::toQString(env, userCaption, &_qstring_userCaption), (bool) withAppName, (bool) modified);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KApplication_makeStdCaption__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring userCaption)
{
static QString * _qstring_userCaption = 0;
	QString _qstring;
	_qstring = ((KApplication*) QtSupport::getQt(env, obj))->makeStdCaption((QString&) * (QString *) QtSupport::toQString(env, userCaption, &_qstring_userCaption), true, false);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KApplication_tempSaveName(JNIEnv *env, jobject obj, jstring pFilename)
{
	QString  _qstring;
static QString * _qstring_pFilename = 0;
	_qstring = ((KApplication*) QtSupport::getQt(env, obj))->tempSaveName((QString&) * (QString *) QtSupport::toQString(env, pFilename, &_qstring_pFilename));
	return QtSupport::fromQString(env, &_qstring);
}

//JNIEXPORT jstring JNICALL
//Java_org_kde_koala_KApplication_checkRecoverFile(JNIEnv *env, jobject obj, jstring pFilename, jboolean bRecover)
//{
//	QString  _qstring;
//static QString * _qstring_pFilename = 0;
//	_qstring = ((KApplication*) QtSupport::getQt(env, obj))->checkRecoverFile((QString&) * (QString *) QtSupport::toQString(env, pFilename, &_qstring_pFilename), (bool&) * (bool *) bRecover);
//	return QtSupport::fromQString(env, &_qstring);
//}

//JNIEXPORT jDisplay* JNICALL
//Java_org_kde_koala_KApplication_getDisplay(JNIEnv *env, jobject obj)
//{
//	return (jDisplay*) ((KApplication*) QtSupport::getQt(env, obj))->getDisplay();
//}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_enableStyles(JNIEnv *env, jobject obj)
{
	((KApplication*) QtSupport::getQt(env, obj))->enableStyles();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_disableStyles(JNIEnv *env, jobject obj)
{
	((KApplication*) QtSupport::getQt(env, obj))->disableStyles();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_installX11EventFilter(JNIEnv *env, jobject obj, jobject filter)
{
	((KApplication*) QtSupport::getQt(env, obj))->installX11EventFilter((QWidget*) QtSupport::getQt(env, filter));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_addKipcEventMask(JNIEnv *env, jobject obj, jint identifier)
{
	((KApplication*) QtSupport::getQt(env, obj))->addKipcEventMask((int) identifier);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_removeKipcEventMask(JNIEnv *env, jobject obj, jint identifier)
{
	((KApplication*) QtSupport::getQt(env, obj))->removeKipcEventMask((int) identifier);
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KApplication_startupId(JNIEnv *env, jobject obj)
{
	QCString  _qcstring;
	_qcstring = ((KApplication*) QtSupport::getQt(env, obj))->startupId();
	return QtSupport::fromQCString(env, &_qcstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_setStartupId(JNIEnv *env, jobject obj, jstring startup_id)
{
static QCString * _qcstring_startup_id = 0;
	((KApplication*) QtSupport::getQt(env, obj))->setStartupId((QCString&) * (QCString *) QtSupport::toQCString(env, startup_id, &_qcstring_startup_id));
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_installKDEPropertyMap(JNIEnv *env, jobject obj)
{
	((KApplication*) QtSupport::getQt(env, obj))->installKDEPropertyMap();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KApplication_notify(JNIEnv *env, jobject obj, jobject receiver, jobject event)
{
	return (jboolean) ((KApplication*) QtSupport::getQt(env, obj))->notify((QObject*) QtSupport::getQt(env, receiver), (QEvent*) QtSupport::getQt(env, event));
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_xioErrhandler(JNIEnv *env, jobject obj)
{
	return (jint) ((KApplication*) QtSupport::getQt(env, obj))->xioErrhandler();
}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KApplication_iceIOErrorHandler(JNIEnv *env, jobject obj, j conn)
//{
//	((KApplication*) QtSupport::getQt(env, obj))->iceIOErrorHandler((_IceConn*) conn);
//	return;
//}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_ref(JNIEnv *env, jobject obj)
{
	((KApplication*) QtSupport::getQt(env, obj))->ref();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_deref(JNIEnv *env, jobject obj)
{
	((KApplication*) QtSupport::getQt(env, obj))->deref();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_addCmdLineOptions(JNIEnv *env, jclass obj)
{
	KApplicationJBridge::addCmdLineOptions();
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_kApplication(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)KApplicationJBridge::kApplication(), "org.kde.koala.KApplication");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_dcopClient(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)KApplicationJBridge::dcopClient(), "org.kde.koala.DCOPClient");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_disableAutoDcopRegistration(JNIEnv *env, jclass obj)
{
	KApplicationJBridge::disableAutoDcopRegistration();
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KApplication_launcher(JNIEnv *env, jclass obj)
{
	QCString  _qcstring;
	_qcstring = KApplicationJBridge::launcher();
	return QtSupport::fromQCString(env, &_qcstring);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByName__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2_3ILjava_lang_String_2Z(JNIEnv *env, jclass obj, jstring _name, jstring URL, jstring error, jstring dcopService, jintArray pid, jstring startup_id, jboolean noWait)
{
static QCString * _qcstring_startup_id = 0;
static QCString * _qcstring_dcopService = 0;
static QString * _qstring_error = 0;
static QString * _qstring_URL = 0;
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByName((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), (QString&) * (QString *) QtSupport::toQString(env, URL, &_qstring_URL), (QString*) QtSupport::toQString(env, error, &_qstring_error), (QCString*) QtSupport::toQCString(env, dcopService, &_qcstring_dcopService),  (int*) QtSupport::toIntPtr(env, pid), (QCString&) * (QCString *) QtSupport::toQCString(env, startup_id, &_qcstring_startup_id), (bool) noWait);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByName__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring _name, jstring URL)
{
static QString * _qstring_URL = 0;
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByName((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), (QString&) * (QString *) QtSupport::toQString(env, URL, &_qstring_URL), 0, 0, 0, "", false);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByName__Ljava_lang_String_2_3Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2_3ILjava_lang_String_2Z(JNIEnv *env, jclass obj, jstring _name, jobjectArray URLs, jstring error, jstring dcopService, jintArray pid, jstring startup_id, jboolean noWait)
{
static QCString * _qcstring_startup_id = 0;
static QCString * _qcstring_dcopService = 0;
static QString * _qstring_error = 0;
static QStringList * _qlist_URLs = 0;
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByName((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, URLs, &_qlist_URLs), (QString*) QtSupport::toQString(env, error, &_qstring_error), (QCString*) QtSupport::toQCString(env, dcopService, &_qcstring_dcopService),  (int*) QtSupport::toIntPtr(env, pid), (QCString&) * (QCString *) QtSupport::toQCString(env, startup_id, &_qcstring_startup_id), (bool) noWait);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByName__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring _name)
{
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByName((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), QStringList(), 0, 0, 0, "", false);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByDesktopPath__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2_3ILjava_lang_String_2Z(JNIEnv *env, jclass obj, jstring _name, jstring URL, jstring error, jstring dcopService, jintArray pid, jstring startup_id, jboolean noWait)
{
static QCString * _qcstring_startup_id = 0;
static QCString * _qcstring_dcopService = 0;
static QString * _qstring_error = 0;
static QString * _qstring_URL = 0;
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByDesktopPath((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), (QString&) * (QString *) QtSupport::toQString(env, URL, &_qstring_URL), (QString*) QtSupport::toQString(env, error, &_qstring_error), (QCString*) QtSupport::toQCString(env, dcopService, &_qcstring_dcopService),  (int*) QtSupport::toIntPtr(env, pid), (QCString&) * (QCString *) QtSupport::toQCString(env, startup_id, &_qcstring_startup_id), (bool) noWait);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByDesktopPath__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring _name, jstring URL)
{
static QString * _qstring_URL = 0;
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByDesktopPath((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), (QString&) * (QString *) QtSupport::toQString(env, URL, &_qstring_URL), 0, 0, 0, "", false);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByDesktopPath__Ljava_lang_String_2_3Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2_3ILjava_lang_String_2Z(JNIEnv *env, jclass obj, jstring _name, jobjectArray URLs, jstring error, jstring dcopService, jintArray pid, jstring startup_id, jboolean noWait)
{
static QCString * _qcstring_startup_id = 0;
static QCString * _qcstring_dcopService = 0;
static QString * _qstring_error = 0;
static QStringList * _qlist_URLs = 0;
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByDesktopPath((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, URLs, &_qlist_URLs), (QString*) QtSupport::toQString(env, error, &_qstring_error), (QCString*) QtSupport::toQCString(env, dcopService, &_qcstring_dcopService),  (int*) QtSupport::toIntPtr(env, pid), (QCString&) * (QCString *) QtSupport::toQCString(env, startup_id, &_qcstring_startup_id), (bool) noWait);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByDesktopPath__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring _name)
{
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByDesktopPath((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), QStringList(), 0, 0, 0, "", false);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByDesktopName__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2_3ILjava_lang_String_2Z(JNIEnv *env, jclass obj, jstring _name, jstring URL, jstring error, jstring dcopService, jintArray pid, jstring startup_id, jboolean noWait)
{
static QCString * _qcstring_startup_id = 0;
static QCString * _qcstring_dcopService = 0;
static QString * _qstring_error = 0;
static QString * _qstring_URL = 0;
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByDesktopName((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), (QString&) * (QString *) QtSupport::toQString(env, URL, &_qstring_URL), (QString*) QtSupport::toQString(env, error, &_qstring_error), (QCString*) QtSupport::toQCString(env, dcopService, &_qcstring_dcopService),  (int*) QtSupport::toIntPtr(env, pid), (QCString&) * (QCString *) QtSupport::toQCString(env, startup_id, &_qcstring_startup_id), (bool) noWait);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByDesktopName__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring _name, jstring URL)
{
static QString * _qstring_URL = 0;
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByDesktopName((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), (QString&) * (QString *) QtSupport::toQString(env, URL, &_qstring_URL), 0, 0, 0, "", false);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByDesktopName__Ljava_lang_String_2_3Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2_3ILjava_lang_String_2Z(JNIEnv *env, jclass obj, jstring _name, jobjectArray URLs, jstring error, jstring dcopService, jintArray pid, jstring startup_id, jboolean noWait)
{
static QCString * _qcstring_startup_id = 0;
static QCString * _qcstring_dcopService = 0;
static QString * _qstring_error = 0;
static QStringList * _qlist_URLs = 0;
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByDesktopName((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, URLs, &_qlist_URLs), (QString*) QtSupport::toQString(env, error, &_qstring_error), (QCString*) QtSupport::toQCString(env, dcopService, &_qcstring_dcopService),  (int*) QtSupport::toIntPtr(env, pid), (QCString&) * (QCString *) QtSupport::toQCString(env, startup_id, &_qcstring_startup_id), (bool) noWait);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_startServiceByDesktopName__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring _name)
{
static QString * _qstring__name = 0;
	return (jint) KApplicationJBridge::startServiceByDesktopName((QString&) * (QString *) QtSupport::toQString(env, _name, &_qstring__name), QStringList(), 0, 0, 0, "", false);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_kdeinitExec__Ljava_lang_String_2_3Ljava_lang_String_2Ljava_lang_String_2_3I(JNIEnv *env, jclass obj, jstring name, jobjectArray args, jstring error, jintArray pid)
{
static QString * _qstring_error = 0;
static QStringList * _qlist_args = 0;
static QString * _qstring_name = 0;
	return (jint) KApplicationJBridge::kdeinitExec((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, args, &_qlist_args), (QString*) QtSupport::toQString(env, error, &_qstring_error),  (int*) QtSupport::toIntPtr(env, pid));
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_kdeinitExec__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring name)
{
static QString * _qstring_name = 0;
	return (jint) KApplicationJBridge::kdeinitExec((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), QStringList(), 0, 0);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_kdeinitExecWait__Ljava_lang_String_2_3Ljava_lang_String_2Ljava_lang_String_2_3I(JNIEnv *env, jclass obj, jstring name, jobjectArray args, jstring error, jintArray pid)
{
static QString * _qstring_error = 0;
static QStringList * _qlist_args = 0;
static QString * _qstring_name = 0;
	return (jint) KApplicationJBridge::kdeinitExecWait((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, args, &_qlist_args), (QString*) QtSupport::toQString(env, error, &_qstring_error),  (int*) QtSupport::toIntPtr(env, pid));
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_kdeinitExecWait__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring name)
{
static QString * _qstring_name = 0;
	return (jint) KApplicationJBridge::kdeinitExecWait((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), QStringList(), 0, 0);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KApplication_random(JNIEnv *env, jclass obj)
{
	return (jint) KApplicationJBridge::random();
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KApplication_randomString(JNIEnv *env, jclass obj, jint length)
{
	QString  _qstring;
	_qstring = KApplicationJBridge::randomString((int) length);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_startKdeinit(JNIEnv *env, jclass obj)
{
	KApplicationJBridge::startKdeinit();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_newKApplication__ZZLorg_kde_koala_KInstanceInterface_2(JNIEnv *env, jobject obj, jboolean allowStyles, jboolean GUIenabled, jobject _instance)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KApplicationJBridge((bool) allowStyles, (bool) GUIenabled, (KInstance*) QtSupport::getQt(env, _instance)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_koala_KApplication_x11EventFilter(JNIEnv *env, jobject obj, jXEvent* arg1)
//{
//	return (jboolean) ((KApplicationJBridge*) QtSupport::getQt(env, obj))->protected_x11EventFilter((XEvent*) arg1);
//}
JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_dirs(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KApplicationJBridge*) QtSupport::getQt(env, obj))->dirs(), "org.kde.koala.KStandardDirs");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_config(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KApplicationJBridge*) QtSupport::getQt(env, obj))->config(), "org.kde.koala.KConfig");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_iconLoader(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KApplicationJBridge*) QtSupport::getQt(env, obj))->iconLoader(), "org.kde.koala.KIconLoader");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_newIconLoader(JNIEnv *env, jobject obj)
{
	((KApplicationJBridge*) QtSupport::getQt(env, obj))->newIconLoader();
	return;
}

//JNIEXPORT jobject JNICALL
//Java_org_kde_koala_KApplication_charsets(JNIEnv *env, jobject obj)
//{
//	return (jobject) QtSupport::objectForQtKey(env, (void *)((KApplicationJBridge*) QtSupport::getQt(env, obj))->charsets(), "org.kde.koala.KCharsets");
//}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_aboutData(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KApplicationJBridge*) QtSupport::getQt(env, obj))->aboutData(), "org.kde.koala.KAboutData");
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KApplication_instanceName(JNIEnv *env, jobject obj)
{
	QCString  _qcstring;
	_qcstring = ((KApplicationJBridge*) QtSupport::getQt(env, obj))->instanceName();
	return QtSupport::fromQCString(env, &_qcstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KApplication_mimeSourceFactory(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KApplicationJBridge*) QtSupport::getQt(env, obj))->mimeSourceFactory(), "org.kde.koala.KMimeSourceFactory");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KApplication_setJavaSlotFactory(JNIEnv * env, jclass cls)
{
	JavaSlot::setJavaSlotFactory(new KDEJavaSlotFactory());
	return;
}
