/***************************************************************************
                            KGlobalAccel.cpp -  description
                             -------------------
    begin                : Fri Mar 15 15:14:30 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Fri Mar 15 15:14:30 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 <kglobalaccel.h>
#include <qstring.h>
#include <qcstring.h>

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

class KGlobalAccelJBridge : public KGlobalAccel
{
public:
	KGlobalAccelJBridge(QObject* pParent, const char* psName) : KGlobalAccel(pParent, psName) {}
	~KGlobalAccelJBridge() {QtSupport::qtKeyDeleted(this);}
	void protected_virtual_hook(int id, void* data) {
		KGlobalAccel::virtual_hook(id, data);
		return;
	}
	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_KGlobalAccel_newKGlobalAccel__Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject pParent, jstring psName)
{
static QCString * _qstring_psName = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KGlobalAccelJBridge((QObject*) QtSupport::getQt(env, pParent), (char*) QtSupport::toCharString(env, psName, &_qstring_psName)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KGlobalAccel_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KGlobalAccel_finalize(env, obj);
	return;
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGlobalAccel_isEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KGlobalAccel*) QtSupport::getQt(env, obj))->isEnabled();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGlobalAccel_setEnabled__Z(JNIEnv *env, jobject obj, jboolean bEnabled)
{
	((KGlobalAccel*) QtSupport::getQt(env, obj))->setEnabled((bool) bEnabled);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KGlobalAccel_insert__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Lorg_kde_koala_KShortcut_2Lorg_kde_koala_KShortcut_2Lorg_kde_qt_QObject_2Ljava_lang_String_2ZZ(JNIEnv *env, jobject obj, jstring sAction, jstring sLabel, jstring sWhatsThis, jobject cutDef3, jobject cutDef4, jobject pObjSlot, jstring psMethodSlot, jboolean bConfigurable, jboolean bEnabled)
{
static QCString * _qstring_psMethodSlot = 0;
static QString * _qstring_sWhatsThis = 0;
static QString * _qstring_sLabel = 0;
static QString * _qstring_sAction = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KGlobalAccel*) QtSupport::getQt(env, obj))->insert((QString&) * (QString *) QtSupport::toQString(env, sAction, &_qstring_sAction), (QString&) * (QString *) QtSupport::toQString(env, sLabel, &_qstring_sLabel), (QString&) * (QString *) QtSupport::toQString(env, sWhatsThis, &_qstring_sWhatsThis), (KShortcut&) *(KShortcut *) QtSupport::getQt(env, cutDef3), (KShortcut&) *(KShortcut *) QtSupport::getQt(env, cutDef4), (QObject*) QtSupport::getQt(env, pObjSlot), (char*) QtSupport::toCharString(env, psMethodSlot, &_qstring_psMethodSlot), (bool) bConfigurable, (bool) bEnabled), "org.kde.koala.KAccelAction");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KGlobalAccel_insert__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Lorg_kde_koala_KShortcut_2Lorg_kde_koala_KShortcut_2Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring sAction, jstring sLabel, jstring sWhatsThis, jobject cutDef3, jobject cutDef4, jobject pObjSlot, jstring psMethodSlot)
{
static QCString * _qstring_psMethodSlot = 0;
static QString * _qstring_sWhatsThis = 0;
static QString * _qstring_sLabel = 0;
static QString * _qstring_sAction = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KGlobalAccel*) QtSupport::getQt(env, obj))->insert((QString&) * (QString *) QtSupport::toQString(env, sAction, &_qstring_sAction), (QString&) * (QString *) QtSupport::toQString(env, sLabel, &_qstring_sLabel), (QString&) * (QString *) QtSupport::toQString(env, sWhatsThis, &_qstring_sWhatsThis), (KShortcut&) *(KShortcut *) QtSupport::getQt(env, cutDef3), (KShortcut&) *(KShortcut *) QtSupport::getQt(env, cutDef4), (QObject*) QtSupport::getQt(env, pObjSlot), (char*) QtSupport::toCharString(env, psMethodSlot, &_qstring_psMethodSlot), true, true), "org.kde.koala.KAccelAction");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KGlobalAccel_insert__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring sName, jstring sLabel)
{
static QString * _qstring_sLabel = 0;
static QString * _qstring_sName = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KGlobalAccel*) QtSupport::getQt(env, obj))->insert((QString&) * (QString *) QtSupport::toQString(env, sName, &_qstring_sName), (QString&) * (QString *) QtSupport::toQString(env, sLabel, &_qstring_sLabel)), "org.kde.koala.KAccelAction");
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGlobalAccel_updateConnections(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KGlobalAccel*) QtSupport::getQt(env, obj))->updateConnections();
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KGlobalAccel_shortcut(JNIEnv *env, jobject obj, jstring sAction)
{
static QString * _qstring_sAction = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)(KShortcut *) &((KGlobalAccel*) QtSupport::getQt(env, obj))->shortcut((QString&) * (QString *) QtSupport::toQString(env, sAction, &_qstring_sAction)), "org.kde.koala.KShortcut");
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGlobalAccel_setShortcut(JNIEnv *env, jobject obj, jstring sAction, jobject arg1)
{
static QString * _qstring_sAction = 0;
	return (jboolean) ((KGlobalAccel*) QtSupport::getQt(env, obj))->setShortcut((QString&) * (QString *) QtSupport::toQString(env, sAction, &_qstring_sAction), (KShortcut&) *(KShortcut *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGlobalAccel_setSlot(JNIEnv *env, jobject obj, jstring sAction, jobject pObjSlot, jstring psMethodSlot)
{
static QCString * _qstring_psMethodSlot = 0;
static QString * _qstring_sAction = 0;
	return (jboolean) ((KGlobalAccel*) QtSupport::getQt(env, obj))->setSlot((QString&) * (QString *) QtSupport::toQString(env, sAction, &_qstring_sAction), (QObject*) QtSupport::getQt(env, pObjSlot), (char*) QtSupport::toCharString(env, psMethodSlot, &_qstring_psMethodSlot));
}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_koala_KGlobalAccel_setEnabled__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring sAction, jboolean bEnabled)
//{
//static QString * _qstring_sAction = 0;
//	return (jboolean) ((KGlobalAccel*) QtSupport::getQt(env, obj))->setEnabled((QString&) * (QString *) QtSupport::toQString(env, sAction, &_qstring_sAction), (bool) bEnabled);
//}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KGlobalAccel_setConfigGroup(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	((KGlobalAccel*) QtSupport::getQt(env, obj))->setConfigGroup((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGlobalAccel_readSettings__Lorg_kde_koala_KConfigBase_2(JNIEnv *env, jobject obj, jobject pConfig)
{
	return (jboolean) ((KGlobalAccel*) QtSupport::getQt(env, obj))->readSettings((KConfigBase*) QtSupport::getQt(env, pConfig));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGlobalAccel_readSettings__(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KGlobalAccel*) QtSupport::getQt(env, obj))->readSettings(0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGlobalAccel_writeSettings__Lorg_kde_koala_KConfigBase_2(JNIEnv *env, jobject obj, jobject pConfig)
{
	return (jboolean) ((KGlobalAccel*) QtSupport::getQt(env, obj))->writeSettings((KConfigBase*) QtSupport::getQt(env, pConfig));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGlobalAccel_writeSettings__(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KGlobalAccel*) QtSupport::getQt(env, obj))->writeSettings(0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGlobalAccel_useFourModifierKeys(JNIEnv *env, jclass obj)
{
	return (jboolean) KGlobalAccelJBridge::useFourModifierKeys();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGlobalAccel_virtual_1hook(JNIEnv *env, jobject obj, jint identifier, jint data)
{
	((KGlobalAccelJBridge*) QtSupport::getQt(env, obj))->protected_virtual_hook((int) identifier, (void*) data);
	return;
}

