/***************************************************************************
                            KKeySequence.cpp -  description
                             -------------------
    begin                : Wed Jan 30 16:02:13 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Jan 30 16:02:13 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/KKeySequence.h>

class KKeySequenceJBridge : public KKeySequence
{
public:
	KKeySequenceJBridge() : KKeySequence() {}
	KKeySequenceJBridge(const QKeySequence& arg1) : KKeySequence(arg1) {}
	KKeySequenceJBridge(const KKey& arg1) : KKeySequence(arg1) {}
//	KKeySequenceJBridge(const KKeyNative& arg1) : KKeySequence(arg1) {}
	KKeySequenceJBridge(const KKeySequence& arg1) : KKeySequence(arg1) {}
	KKeySequenceJBridge(const QString& arg1) : KKeySequence(arg1) {}
	~KKeySequenceJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

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

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KKeySequence_newKKeySequence__Lorg_kde_koala_KKeyNative_2(JNIEnv *env, jobject obj, jobject arg1)
//{
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new KKeySequenceJBridge((KKeyNative&) *(KKeyNative *) QtSupport::getQt(env, arg1)));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KKeySequence_newKKeySequence__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 KKeySequenceJBridge((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KKeySequence_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KKeySequence_finalize(env, obj);
	return;
}

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

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

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

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

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

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

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

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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KKeySequence_isTriggerOnRelease(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KKeySequence*) QtSupport::getQt(env, obj))->isTriggerOnRelease();
}

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

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KKeySequence_setTriggerOnRelease(JNIEnv *env, jobject obj, jboolean arg1)
//{
//	((KKeySequence*) QtSupport::getQt(env, obj))->setTriggerOnRelease((bool) arg1);
//	return;
//}

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

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

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

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

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

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

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

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

