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

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

class KArJBridge : public KAr
{
public:
	KArJBridge(const TQString& arg1) : KAr(arg1) {};
	KArJBridge(TQIODevice* arg1) : KAr(arg1) {};
	bool protected_openArchive(int arg1) {
		return (bool) KAr::openArchive(arg1);
	}
	bool protected_closeArchive() {
		return (bool) KAr::closeArchive();
	}
	~KArJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jboolean JNICALL
Java_org_trinitydesktop_koala_KAr_closeArchive(JNIEnv* env, jobject obj)
{
	jboolean xret = (jboolean) ((KArJBridge*) QtSupport::getQt(env, obj))->protected_closeArchive();
	return xret;
}

JNIEXPORT void JNICALL
Java_org_trinitydesktop_koala_KAr_dispose(JNIEnv* env, jobject obj)
{
	Java_org_trinitydesktop_koala_KAr_finalize(env, obj);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_trinitydesktop_koala_KAr_doneWriting(JNIEnv* env, jobject obj, jint size)
{
	jboolean xret = (jboolean) ((KAr*) QtSupport::getQt(env, obj))->doneWriting((uint) size);
	return xret;
}

JNIEXPORT jstring JNICALL
Java_org_trinitydesktop_koala_KAr_fileName(JNIEnv* env, jobject obj)
{
	TQString  _qstring;
	_qstring = ((KAr*) QtSupport::getQt(env, obj))->fileName();
	return QtSupport::fromTQString(env, &_qstring);
}

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

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

JNIEXPORT void JNICALL
Java_org_trinitydesktop_koala_KAr_newKAr__Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring filename)
{
static TQString* _qstring_filename = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KArJBridge((const TQString&)*(TQString*) QtSupport::toTQString(env, filename, &_qstring_filename)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT jboolean JNICALL
Java_org_trinitydesktop_koala_KAr_openArchive(JNIEnv* env, jobject obj, jint mode)
{
	jboolean xret = (jboolean) ((KArJBridge*) QtSupport::getQt(env, obj))->protected_openArchive((int) mode);
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_trinitydesktop_koala_KAr_prepareWriting(JNIEnv* env, jobject obj, jstring name, jstring user, jstring group, jint size)
{
static TQString* _qstring_name = 0;
static TQString* _qstring_user = 0;
static TQString* _qstring_group = 0;
	jboolean xret = (jboolean) ((KAr*) QtSupport::getQt(env, obj))->prepareWriting((const TQString&)*(TQString*) QtSupport::toTQString(env, name, &_qstring_name), (const TQString&)*(TQString*) QtSupport::toTQString(env, user, &_qstring_user), (const TQString&)*(TQString*) QtSupport::toTQString(env, group, &_qstring_group), (uint) size);
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_trinitydesktop_koala_KAr_writeDir(JNIEnv* env, jobject obj, jstring name, jstring user, jstring group)
{
static TQString* _qstring_name = 0;
static TQString* _qstring_user = 0;
static TQString* _qstring_group = 0;
	jboolean xret = (jboolean) ((KAr*) QtSupport::getQt(env, obj))->writeDir((const TQString&)*(TQString*) QtSupport::toTQString(env, name, &_qstring_name), (const TQString&)*(TQString*) QtSupport::toTQString(env, user, &_qstring_user), (const TQString&)*(TQString*) QtSupport::toTQString(env, group, &_qstring_group));
	return xret;
}

