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

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

class KArJBridge : public KAr
{
public:
	KArJBridge(const QString& arg1) : KAr(arg1) {};
	KArJBridge(QIODevice* 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_kde_koala_KAr_closeArchive(JNIEnv* env, jobject obj)
{
	jboolean xret = (jboolean) ((KArJBridge*) QtSupport::getQt(env, obj))->protected_closeArchive();
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KAr_dispose(JNIEnv* env, jobject obj)
{
	Java_org_kde_koala_KAr_finalize(env, obj);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_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_kde_koala_KAr_fileName(JNIEnv* env, jobject obj)
{
	QString  _qstring;
	_qstring = ((KAr*) QtSupport::getQt(env, obj))->fileName();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_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_kde_koala_KAr_isDisposed(JNIEnv* env, jobject obj)
{
	return (QtSupport::getQt(env, obj) == 0);
}

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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_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_kde_koala_KAr_prepareWriting(JNIEnv* env, jobject obj, jstring name, jstring user, jstring group, jint size)
{
static QString* _qstring_name = 0;
static QString* _qstring_user = 0;
static QString* _qstring_group = 0;
	jboolean xret = (jboolean) ((KAr*) QtSupport::getQt(env, obj))->prepareWriting((const QString&)*(QString*) QtSupport::toQString(env, name, &_qstring_name), (const QString&)*(QString*) QtSupport::toQString(env, user, &_qstring_user), (const QString&)*(QString*) QtSupport::toQString(env, group, &_qstring_group), (uint) size);
	return xret;
}

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

