/***************************************************************************
                            KMimeMagicResult.cpp -  description
                             -------------------
    begin                : Sun Jan 27 16:22:17 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Jan 27 16:22:17 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
***************************************************************************/

#define _BOOL_H_
#include <kmimemagic.h>
#include <qstring.h>
#include <qcstring.h>

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

class KMimeMagicResultJBridge : public KMimeMagicResult
{
public:
	KMimeMagicResultJBridge() : KMimeMagicResult() {}
	~KMimeMagicResultJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KMimeMagicResult_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KMimeMagicResult_finalize(env, obj);
	return;
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KMimeMagicResult_mimeType(JNIEnv *env, jobject obj)
{
	QString  _qstring;
	_qstring = ((KMimeMagicResult*) QtSupport::getQt(env, obj))->mimeType();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KMimeMagicResult_accuracy(JNIEnv *env, jobject obj)
{
	return (jint) ((KMimeMagicResult*) QtSupport::getQt(env, obj))->accuracy();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KMimeMagicResult_isValid(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KMimeMagicResult*) QtSupport::getQt(env, obj))->isValid();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KMimeMagicResult_setMimeType(JNIEnv *env, jobject obj, jstring _mime)
{
static QString * _qstring__mime = 0;
	((KMimeMagicResult*) QtSupport::getQt(env, obj))->setMimeType((QString&) * (QString *) QtSupport::toQString(env, _mime, &_qstring__mime));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KMimeMagicResult_setAccuracy(JNIEnv *env, jobject obj, jint _accuracy)
{
	((KMimeMagicResult*) QtSupport::getQt(env, obj))->setAccuracy((int) _accuracy);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KMimeMagicResult_setInvalid(JNIEnv *env, jobject obj)
{
	((KMimeMagicResult*) QtSupport::getQt(env, obj))->setInvalid();
	return;
}

