/***************************************************************************
                            KFileMetaInfoItem.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 <kfilemetainfo.h>
#include <qstring.h>
#include <qcstring.h>

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

class KFileMetaInfoItemJBridge : public KFileMetaInfoItem
{
public:
//	KFileMetaInfoItemJBridge(const QString& key, const QString& translatedKey, const QVariant& value, bool editable, const QString& prefix, const QString& suffix) : KFileMetaInfoItem(key, translatedKey, value, editable, prefix, suffix) {}
	KFileMetaInfoItemJBridge(const KFileMetaInfoItem& item) : KFileMetaInfoItem(item) {}
	KFileMetaInfoItemJBridge() : KFileMetaInfoItem() {}
	~KFileMetaInfoItemJBridge() {QtSupport::qtKeyDeleted(this);}
};


//JNIEXPORT void JNICALL
//Java_org_kde_koala_KFileMetaInfoItem_newKFileMetaInfoItem__Ljava_lang_String_2Ljava_lang_String_2Lorg_kde_qt_QVariant_2ZLjava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring key, jstring translatedKey, jobject value, jboolean editable, jstring prefix, jstring suffix)
//{
//static QString * _qstring_suffix = 0;
//static QString * _qstring_prefix = 0;
//static QString * _qstring_translatedKey = 0;
//static QString * _qstring_key = 0;
//	if (QtSupport::getQt(env, obj) == 0) {
//		//pd
//		//QtSupport::setQt(env, obj, new KFileMetaInfoItemJBridge((QString&) * (QString *) QtSupport::toQString(env, key, &_qstring_key), (QString&) * (QString *) QtSupport::toQString(env, translatedKey, &_qstring_translatedKey), (QVariant&) *(QVariant *) QtSupport::getQt(env, value), (bool) editable, (QString&) * (QString *) QtSupport::toQString(env, prefix, &_qstring_prefix), (QString&) * (QString *) QtSupport::toQString(env, suffix, &_qstring_suffix)));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KFileMetaInfoItem_newKFileMetaInfoItem__Ljava_lang_String_2Ljava_lang_String_2Lorg_kde_qt_QVariant_2(JNIEnv *env, jobject obj, jstring key, jstring translatedKey, jobject value)
//{
//static QString * _qstring_translatedKey = 0;
//static QString * _qstring_key = 0;
//	if (QtSupport::getQt(env, obj) == 0) {
//		//pd
//		//QtSupport::setQt(env, obj, new KFileMetaInfoItemJBridge((QString&) * (QString *) QtSupport::toQString(env, key, &_qstring_key), (QString&) * (QString *) QtSupport::toQString(env, translatedKey, &_qstring_translatedKey), (QVariant&) *(QVariant *) QtSupport::getQt(env, value), false, QString::null, QString::null));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KFileMetaInfoItem_newKFileMetaInfoItem__(JNIEnv *env, jobject obj, j item)
//{
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new KFileMetaInfoItemJBridge((KFileMetaInfoItem) item));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileMetaInfoItem_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KFileMetaInfoItem_finalize(env, obj);
	return;
}

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

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KFileMetaInfoItem_value(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QVariant *) &((KFileMetaInfoItem*) QtSupport::getQt(env, obj))->value(), "org.kde.qt.QVariant");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileMetaInfoItem_setValue(JNIEnv *env, jobject obj, jobject value)
{
	((KFileMetaInfoItem*) QtSupport::getQt(env, obj))->setValue((QVariant&) *(QVariant *) QtSupport::getQt(env, value));
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KFileMetaInfoItem_type(JNIEnv *env, jobject obj)
{
	return (jint) ((KFileMetaInfoItem*) QtSupport::getQt(env, obj))->type();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFileMetaInfoItem_isEditable(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KFileMetaInfoItem*) QtSupport::getQt(env, obj))->isEditable();
}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KFileMetaInfoItem_remove(JNIEnv *env, jobject obj)
//{
//pd
//	((KFileMetaInfoItem*) QtSupport::getQt(env, obj))->remove();
//	return;
//}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFileMetaInfoItem_isRemoved(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KFileMetaInfoItem*) QtSupport::getQt(env, obj))->isRemoved();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFileMetaInfoItem_isModified(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KFileMetaInfoItem*) QtSupport::getQt(env, obj))->isModified();
}

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

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

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

