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

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

class KGuiItemJBridge : public KGuiItem
{
public:
	KGuiItemJBridge() : KGuiItem() {}
	KGuiItemJBridge(const QString& text, const QString& iconName, const QString& toolTip, const QString& whatsThis) : KGuiItem(text, iconName, toolTip, whatsThis) {}
	KGuiItemJBridge(const QString& text, const QIconSet& iconSet, const QString& toolTip, const QString& whatsThis) : KGuiItem(text, iconSet, toolTip, whatsThis) {}
	KGuiItemJBridge(const KGuiItem& rhs) : KGuiItem(rhs) {}
	~KGuiItemJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_newKGuiItem__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text, jstring iconName, jstring toolTip, jstring whatsThis)
{
static QString * _qstring_whatsThis = 0;
static QString * _qstring_toolTip = 0;
static QString * _qstring_iconName = 0;
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KGuiItemJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QString&) * (QString *) QtSupport::toQString(env, iconName, &_qstring_iconName), (QString&) * (QString *) QtSupport::toQString(env, toolTip, &_qstring_toolTip), (QString&) * (QString *) QtSupport::toQString(env, whatsThis, &_qstring_whatsThis)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_newKGuiItem__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text)
{
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KGuiItemJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), QString::null, QString::null, QString::null));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_newKGuiItem__Ljava_lang_String_2Lorg_kde_qt_QIconSet_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text, jobject iconSet, jstring toolTip, jstring whatsThis)
{
static QString * _qstring_whatsThis = 0;
static QString * _qstring_toolTip = 0;
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KGuiItemJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QIconSet&) *(QIconSet *) QtSupport::getQt(env, iconSet), (QString&) * (QString *) QtSupport::toQString(env, toolTip, &_qstring_toolTip), (QString&) * (QString *) QtSupport::toQString(env, whatsThis, &_qstring_whatsThis)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_newKGuiItem__Ljava_lang_String_2Lorg_kde_qt_QIconSet_2(JNIEnv *env, jobject obj, jstring text, jobject iconSet)
{
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KGuiItemJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QIconSet&) *(QIconSet *) QtSupport::getQt(env, iconSet), QString::null, QString::null));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_newKGuiItem__Lorg_kde_koala_KGuiItem_2(JNIEnv *env, jobject obj, jobject rhs)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KGuiItemJBridge((KGuiItem&) *(KGuiItem *) QtSupport::getQt(env, rhs)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KGuiItem_finalize(env, obj);
	return;
}

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

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KGuiItem_iconSet(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QIconSet (((KGuiItem*) QtSupport::getQt(env, obj))->iconSet()), "org.kde.qt.QIconSet", TRUE);
}

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

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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGuiItem_isEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KGuiItem*) QtSupport::getQt(env, obj))->isEnabled();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KGuiItem_hasIconSet(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KGuiItem*) QtSupport::getQt(env, obj))->hasIconSet();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_setText(JNIEnv *env, jobject obj, jstring text)
{
static QString * _qstring_text = 0;
	((KGuiItem*) QtSupport::getQt(env, obj))->setText((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_setIconSet(JNIEnv *env, jobject obj, jobject iconset)
{
	((KGuiItem*) QtSupport::getQt(env, obj))->setIconSet((QIconSet&) *(QIconSet *) QtSupport::getQt(env, iconset));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_setIconName(JNIEnv *env, jobject obj, jstring iconName)
{
static QString * _qstring_iconName = 0;
	((KGuiItem*) QtSupport::getQt(env, obj))->setIconName((QString&) * (QString *) QtSupport::toQString(env, iconName, &_qstring_iconName));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_setToolTip(JNIEnv *env, jobject obj, jstring tooltip)
{
static QString * _qstring_tooltip = 0;
	((KGuiItem*) QtSupport::getQt(env, obj))->setToolTip((QString&) * (QString *) QtSupport::toQString(env, tooltip, &_qstring_tooltip));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_setWhatsThis(JNIEnv *env, jobject obj, jstring whatsThis)
{
static QString * _qstring_whatsThis = 0;
	((KGuiItem*) QtSupport::getQt(env, obj))->setWhatsThis((QString&) * (QString *) QtSupport::toQString(env, whatsThis, &_qstring_whatsThis));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KGuiItem_setEnabled(JNIEnv *env, jobject obj, jboolean enable)
{
	((KGuiItem*) QtSupport::getQt(env, obj))->setEnabled((bool) enable);
	return;
}

