//Auto-generated by kalyptus. DO NOT EDIT.
#include <ksslpkcs12.h>
#include <ksmimecrypto.h>
#include <qcstring.h>

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

class KSMIMECryptoJBridge : public KSMIMECrypto
{
public:
	KSMIMECryptoJBridge() : KSMIMECrypto() {};
	~KSMIMECryptoJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jint JNICALL
Java_org_kde_koala_KSMIMECrypto_decryptMessage(JNIEnv* env, jobject obj, jbyteArray cipherText, jobject clearText, jobject privKey)
{
static QByteArray* _qbyteArray_cipherText = 0;
static QCString* _qcstring_clearText = 0;
	if (_qcstring_clearText == 0) {
		_qcstring_clearText = new QCString();
	}
	jint xret = (jint) ((KSMIMECrypto*) QtSupport::getQt(env, obj))->decryptMessage((const QByteArray&)*(QByteArray*) QtSupport::toQByteArray(env, cipherText, &_qbyteArray_cipherText), (QCString&)*(QCString*) _qcstring_clearText, (const KSSLPKCS12&)*(const KSSLPKCS12*) QtSupport::getQt(env, privKey));
	QtSupport::fromQCStringToStringBuffer(env, _qcstring_clearText, clearText);
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KSMIMECrypto_dispose(JNIEnv* env, jobject obj)
{
	Java_org_kde_koala_KSMIMECrypto_finalize(env, obj);
	return;
}

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

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

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

