//Auto-generated by kalyptus. DO NOT EDIT.
#include <qstring.h>
#include <qevent.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QIMEvent.h>

class QIMEventJBridge : public QIMEvent
{
public:
	QIMEventJBridge(QEvent::Type arg1,const QString& arg2,int arg3) : QIMEvent(arg1,arg2,arg3) {};
	~QIMEventJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT void JNICALL
Java_org_kde_qt_QIMEvent_accept(JNIEnv* env, jobject obj)
{
	((QIMEvent*) QtSupport::getQt(env, obj))->accept();
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QIMEvent_cursorPos(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QIMEvent*) QtSupport::getQt(env, obj))->cursorPos();
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QIMEvent_dispose(JNIEnv* env, jobject obj)
{
	Java_org_kde_qt_QIMEvent_finalize(env, obj);
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QIMEvent_ignore(JNIEnv* env, jobject obj)
{
	((QIMEvent*) QtSupport::getQt(env, obj))->ignore();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QIMEvent_isAccepted(JNIEnv* env, jobject obj)
{
	jboolean xret = (jboolean) ((QIMEvent*) QtSupport::getQt(env, obj))->isAccepted();
	return xret;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QIMEvent_newQIMEvent(JNIEnv* env, jobject obj, jint type, jstring text, jint cursorPosition)
{
static QString* _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QIMEventJBridge((QEvent::Type) type, (const QString&)*(QString*) QtSupport::toQString(env, text, &_qstring_text), (int) cursorPosition));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QIMEvent_selectionLength(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QIMEvent*) QtSupport::getQt(env, obj))->selectionLength();
	return xret;
}

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

