//Auto-generated by kalyptus. DO NOT EDIT.
#include <qstrlist.h>
#include <qasyncimageio.h>
#include <qimage.h>

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

class QImageDecoderJBridge : public QImageDecoder
{
public:
	QImageDecoderJBridge(QImageConsumer* arg1) : QImageDecoder(arg1) {};
	~QImageDecoderJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImageDecoder_decode(JNIEnv* env, jobject obj, jcharArray buffer, jint length)
{
static QByteArray* _qbytearray_buffer = 0;
	jint xret = (jint) ((QImageDecoder*) QtSupport::getQt(env, obj))->decode((const uchar*) QtSupport::toUcharArray(env, buffer, &_qbytearray_buffer), (int) length);
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImageDecoder_dispose(JNIEnv* env, jobject obj)
{
	Java_org_kde_qt_QImageDecoder_finalize(env, obj);
	return;
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QImageDecoder_formatName(JNIEnv* env, jclass cls, jcharArray buffer, jint length)
{
	const char* _qstring;
	(void) cls;
static QByteArray* _qbytearray_buffer = 0;
	_qstring = QImageDecoderJBridge::formatName((const uchar*) QtSupport::toUcharArray(env, buffer, &_qbytearray_buffer), (int) length);
	return QtSupport::fromCharString(env, (char *) _qstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImageDecoder_format(JNIEnv* env, jclass cls, jstring name)
{
	(void) cls;
static QCString* _qstring_name = 0;
	jobject xret = QtSupport::objectForQtKey(env, (void*)QImageDecoderJBridge::format((const char*) QtSupport::toCharString(env, name, &_qstring_name)), "org.kde.qt.QImageFormatType");
	return xret;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImageDecoder_image(JNIEnv* env, jobject obj)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)(QImage *) &((QImageDecoder*) QtSupport::getQt(env, obj))->image(), "org.kde.qt.QImage");
	return xret;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImageDecoder_inputFormats(JNIEnv* env, jclass cls)
{
	QStrList  _qlist;
	(void) cls;
	_qlist = QImageDecoderJBridge::inputFormats();
	return (jobject) QtSupport::arrayWithQStrList(env, (QStrList*) &_qlist);
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QImageDecoder_registerDecoderFactory(JNIEnv* env, jclass cls, jobject arg1)
{
	(void) cls;
	QImageDecoderJBridge::registerDecoderFactory((QImageFormatType*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImageDecoder_unregisterDecoderFactory(JNIEnv* env, jclass cls, jobject arg1)
{
	(void) cls;
	QImageDecoderJBridge::unregisterDecoderFactory((QImageFormatType*) QtSupport::getQt(env, arg1));
	return;
}

