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

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

class KCharsetsJBridge : public KCharsets
{
public:
	KCharsetsJBridge() : KCharsets() {};
	~KCharsetsJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KCharsets_availableEncodingNames(JNIEnv* env, jobject obj)
{
	QStringList  _qlist;
	_qlist = ((KCharsets*) QtSupport::getQt(env, obj))->availableEncodingNames();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList*) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KCharsets_codecForName__Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring name)
{
static QString* _qstring_name = 0;
	jobject xret = QtSupport::objectForQtKey(env, (void*)((KCharsets*) QtSupport::getQt(env, obj))->codecForName((const QString&)*(QString*) QtSupport::toQString(env, name, &_qstring_name)), "org.kde.qt.QTextCodec");
	return xret;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KCharsets_codecForName__Ljava_lang_String_2Z(JNIEnv* env, jobject obj, jstring n, jboolean ok)
{
static QString* _qstring_n = 0;
	jobject xret = QtSupport::objectForQtKey(env, (void*)((KCharsets*) QtSupport::getQt(env, obj))->codecForName((const QString&)*(QString*) QtSupport::toQString(env, n, &_qstring_n), (bool&) ok), "org.kde.qt.QTextCodec");
	return xret;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KCharsets_descriptiveEncodingNames(JNIEnv* env, jobject obj)
{
	QStringList  _qlist;
	_qlist = ((KCharsets*) QtSupport::getQt(env, obj))->descriptiveEncodingNames();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList*) &_qlist);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KCharsets_dispose(JNIEnv* env, jobject obj)
{
	Java_org_kde_koala_KCharsets_finalize(env, obj);
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KCharsets_encodingForName(JNIEnv* env, jobject obj, jstring descriptiveName)
{
	QString  _qstring;
static QString* _qstring_descriptiveName = 0;
	_qstring = ((KCharsets*) QtSupport::getQt(env, obj))->encodingForName((const QString&)*(QString*) QtSupport::toQString(env, descriptiveName, &_qstring_descriptiveName));
	return QtSupport::fromQString(env, &_qstring);
}

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

JNIEXPORT jchar JNICALL
Java_org_kde_koala_KCharsets_fromEntity__Ljava_lang_String_2(JNIEnv* env, jclass cls, jstring str)
{
	QChar  _qchar;
	(void) cls;
static QString* _qstring_str = 0;
	_qchar = KCharsetsJBridge::fromEntity((const QString&)*(QString*) QtSupport::toQString(env, str, &_qstring_str));
	return (jchar) QtSupport::fromQChar(env, (QChar*) &_qchar);
}

JNIEXPORT jchar JNICALL
Java_org_kde_koala_KCharsets_fromEntity__Ljava_lang_String_2_3I(JNIEnv* env, jclass cls, jstring str, jintArray len)
{
	QChar  _qchar;
	(void) cls;
static QString* _qstring_str = 0;
	int* _int_len = QtSupport::toIntPtr(env, len);
	_qchar = KCharsetsJBridge::fromEntity((const QString&)*(QString*) QtSupport::toQString(env, str, &_qstring_str),  (int&) *_int_len);
	env->SetIntArrayRegion(len, 0, 1, (jint *) _int_len);
	return (jchar) QtSupport::fromQChar(env, (QChar*) &_qchar);
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KCharsets_languageForEncoding(JNIEnv* env, jobject obj, jstring encoding)
{
	QString  _qstring;
static QString* _qstring_encoding = 0;
	_qstring = ((KCharsets*) QtSupport::getQt(env, obj))->languageForEncoding((const QString&)*(QString*) QtSupport::toQString(env, encoding, &_qstring_encoding));
	return QtSupport::fromQString(env, &_qstring);
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KCharsets_resolveEntities(JNIEnv* env, jclass cls, jstring text)
{
	QString  _qstring;
	(void) cls;
static QString* _qstring_text = 0;
	_qstring = KCharsetsJBridge::resolveEntities((const QString&)*(QString*) QtSupport::toQString(env, text, &_qstring_text));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KCharsets_toEntity(JNIEnv* env, jclass cls, jchar ch)
{
	QString  _qstring;
	(void) cls;
static QChar* _qchar_ch = 0;
	_qstring = KCharsetsJBridge::toEntity((const QChar&)*(QChar*) QtSupport::toQChar(env, ch, &_qchar_ch));
	return QtSupport::fromQString(env, &_qstring);
}

