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

#include <qtjava/QtSupport.h>
#include <tdejava/TDESupport.h>
#include <tdejava/KCharsets.h>

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

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

JNIEXPORT jobject JNICALL
Java_org_trinitydesktop_koala_KCharsets_codecForName__Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring name)
{
static TQString* _qstring_name = 0;
	jobject xret = QtSupport::objectForQtKey(env, (void*)((KCharsets*) QtSupport::getQt(env, obj))->codecForName((const TQString&)*(TQString*) QtSupport::toTQString(env, name, &_qstring_name)), "org.trinitydesktop.qt.TQTextCodec");
	return xret;
}

JNIEXPORT jobject JNICALL
Java_org_trinitydesktop_koala_KCharsets_codecForName__Ljava_lang_String_2Z(JNIEnv* env, jobject obj, jstring n, jboolean ok)
{
static TQString* _qstring_n = 0;
	jobject xret = QtSupport::objectForQtKey(env, (void*)((KCharsets*) QtSupport::getQt(env, obj))->codecForName((const TQString&)*(TQString*) QtSupport::toTQString(env, n, &_qstring_n), (bool&) ok), "org.trinitydesktop.qt.TQTextCodec");
	return xret;
}

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

JNIEXPORT void JNICALL
Java_org_trinitydesktop_koala_KCharsets_dispose(JNIEnv* env, jobject obj)
{
	Java_org_trinitydesktop_koala_KCharsets_finalize(env, obj);
	return;
}

JNIEXPORT jstring JNICALL
Java_org_trinitydesktop_koala_KCharsets_encodingForName(JNIEnv* env, jobject obj, jstring descriptiveName)
{
	TQString  _qstring;
static TQString* _qstring_descriptiveName = 0;
	_qstring = ((KCharsets*) QtSupport::getQt(env, obj))->encodingForName((const TQString&)*(TQString*) QtSupport::toTQString(env, descriptiveName, &_qstring_descriptiveName));
	return QtSupport::fromTQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_trinitydesktop_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_trinitydesktop_koala_KCharsets_fromEntity__Ljava_lang_String_2(JNIEnv* env, jclass cls, jstring str)
{
	TQChar  _qchar;
	(void) cls;
static TQString* _qstring_str = 0;
	_qchar = KCharsetsJBridge::fromEntity((const TQString&)*(TQString*) QtSupport::toTQString(env, str, &_qstring_str));
	return (jchar) QtSupport::fromTQChar(env, (TQChar*) &_qchar);
}

JNIEXPORT jchar JNICALL
Java_org_trinitydesktop_koala_KCharsets_fromEntity__Ljava_lang_String_2_3I(JNIEnv* env, jclass cls, jstring str, jintArray len)
{
	TQChar  _qchar;
	(void) cls;
static TQString* _qstring_str = 0;
	int* _int_len = QtSupport::toIntPtr(env, len);
	_qchar = KCharsetsJBridge::fromEntity((const TQString&)*(TQString*) QtSupport::toTQString(env, str, &_qstring_str),  (int&) *_int_len);
	env->SetIntArrayRegion(len, 0, 1, (jint *) _int_len);
	return (jchar) QtSupport::fromTQChar(env, (TQChar*) &_qchar);
}

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

JNIEXPORT jstring JNICALL
Java_org_trinitydesktop_koala_KCharsets_languageForEncoding(JNIEnv* env, jobject obj, jstring encoding)
{
	TQString  _qstring;
static TQString* _qstring_encoding = 0;
	_qstring = ((KCharsets*) QtSupport::getQt(env, obj))->languageForEncoding((const TQString&)*(TQString*) QtSupport::toTQString(env, encoding, &_qstring_encoding));
	return QtSupport::fromTQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_trinitydesktop_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_trinitydesktop_koala_KCharsets_resolveEntities(JNIEnv* env, jclass cls, jstring text)
{
	TQString  _qstring;
	(void) cls;
static TQString* _qstring_text = 0;
	_qstring = KCharsetsJBridge::resolveEntities((const TQString&)*(TQString*) QtSupport::toTQString(env, text, &_qstring_text));
	return QtSupport::fromTQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_trinitydesktop_koala_KCharsets_toEntity(JNIEnv* env, jclass cls, jchar ch)
{
	TQString  _qstring;
	(void) cls;
static TQChar* _qchar_ch = 0;
	_qstring = KCharsetsJBridge::toEntity((const TQChar&)*(TQChar*) QtSupport::toTQChar(env, ch, &_qchar_ch));
	return QtSupport::fromTQString(env, &_qstring);
}

