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

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

class KShortcutJBridge : public KShortcut
{
public:
	KShortcutJBridge() : KShortcut() {}
	KShortcutJBridge(int keyQt) : KShortcut(keyQt) {}
	KShortcutJBridge(const QKeySequence& arg1) : KShortcut(arg1) {}
	KShortcutJBridge(const KKey& arg1) : KShortcut(arg1) {}
	KShortcutJBridge(const KKeySequence& arg1) : KShortcut(arg1) {}
	KShortcutJBridge(const KShortcut& arg1) : KShortcut(arg1) {}
	KShortcutJBridge(const char* arg1) : KShortcut(arg1) {}
	KShortcutJBridge(const QString& arg1) : KShortcut(arg1) {}
	~KShortcutJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

JNIEXPORT void JNICALL
Java_org_kde_koala_KShortcut_newKShortcut__I(JNIEnv *env, jobject obj, jint keyQt)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KShortcutJBridge((int) keyQt));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KShortcut_newKShortcut__Lorg_kde_qt_QKeySequence_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KShortcutJBridge((QKeySequence&) *(QKeySequence *) QtSupport::getQt(env, arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KShortcut_newKShortcut__Lorg_kde_koala_KKey_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KShortcutJBridge((KKey&) *(KKey *) QtSupport::getQt(env, arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KShortcut_newKShortcut__Lorg_kde_koala_KKeySequence_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KShortcutJBridge((KKeySequence&) *(KKeySequence *) QtSupport::getQt(env, arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KShortcut_newKShortcut__Lorg_kde_koala_KShortcut_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KShortcutJBridge((KShortcut&) *(KShortcut *) QtSupport::getQt(env, arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KShortcut_newKShortcut__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1)
{
static QCString * _qstring_arg1 = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KShortcutJBridge((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KShortcut_newKShortcut__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1)
//{
//static QString * _qstring_arg1 = 0;
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new KShortcutJBridge((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1)));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KShortcut_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KShortcut_finalize(env, obj);
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KShortcut_clear(JNIEnv *env, jobject obj)
{
	((KShortcut*) QtSupport::getQt(env, obj))->clear();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_init__I(JNIEnv *env, jobject obj, jint keyQt)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->init((int) keyQt);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_init__Lorg_kde_qt_QKeySequence_2(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->init((QKeySequence&) *(QKeySequence *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_init__Lorg_kde_koala_KKey_2(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->init((KKey&) *(KKey *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_init__Lorg_kde_koala_KKeySequence_2(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->init((KKeySequence&) *(KKeySequence *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_init__Lorg_kde_koala_KShortcut_2(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->init((KShortcut&) *(KShortcut *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_init__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->init((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KShortcut_count(JNIEnv *env, jobject obj)
{
	return (jint) ((KShortcut*) QtSupport::getQt(env, obj))->count();
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KShortcut_seq(JNIEnv *env, jobject obj, jint i)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(KKeySequence *) &((KShortcut*) QtSupport::getQt(env, obj))->seq((uint) i), "org.kde.koala.KKeySequence");
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KShortcut_keyCodeQt(JNIEnv *env, jobject obj)
{
	return (jint) ((KShortcut*) QtSupport::getQt(env, obj))->keyCodeQt();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_isNull(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->isNull();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KShortcut_compare(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jint) ((KShortcut*) QtSupport::getQt(env, obj))->compare((KShortcut&) *(KShortcut *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_contains__Lorg_kde_koala_KKey_2(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->contains((KKey&) *(KKey *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_contains__Lorg_kde_koala_KKeyNative_2(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->contains((KKeyNative&) *(KKeyNative *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_contains__Lorg_kde_koala_KKeySequence_2(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->contains((KKeySequence&) *(KKeySequence *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_setSeq(JNIEnv *env, jobject obj, jint i, jobject arg1)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->setSeq((uint) i, (KKeySequence&) *(KKeySequence *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KShortcut_append(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((KShortcut*) QtSupport::getQt(env, obj))->append((KKeySequence&) *(KKeySequence *) QtSupport::getQt(env, arg1));
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KShortcut_toStringInternal__Lorg_kde_koala_KShortcut_2(JNIEnv *env, jobject obj, jobject pcutDefault)
{
	QString  _qstring;
	_qstring = ((KShortcut*) QtSupport::getQt(env, obj))->toStringInternal((KShortcut*) QtSupport::getQt(env, pcutDefault));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KShortcut_toStringInternal__(JNIEnv *env, jobject obj)
{
	QString _qstring;
	_qstring = ((KShortcut*) QtSupport::getQt(env, obj))->toStringInternal(0);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KShortcut_null(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(KShortcut *) &KShortcutJBridge::null(), "org.kde.koala.KShortcut");
}

