/***************************************************************************
                            QComboTableItem.cpp -  description
                             -------------------
    begin                : Wed Nov 21 17:05:56 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 17:05:56 2001, 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 <qtable.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QComboTableItem.h>

class QComboTableItemJBridge : public QComboTableItem
{
public:
	QComboTableItemJBridge(QTable* table, const QStringList& list, bool editable) : QComboTableItem(table, list, editable) {}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QComboTableItem_newQComboTableItem__Lorg_kde_qt_QTable_2_3Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jobject table, jobjectArray list, jboolean editable)
{
static QStringList * _qlist_list = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QComboTableItemJBridge((QTable*) QtSupport::getQt(env, table), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, list, &_qlist_list), (bool) editable));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QComboTableItem_newQComboTableItem__Lorg_kde_qt_QTable_2_3Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject table, jobjectArray list)
{
static QStringList * _qlist_list = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QComboTableItemJBridge((QTable*) QtSupport::getQt(env, table), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, list, &_qlist_list), FALSE));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QComboTableItem_createEditor(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->createEditor(), "org.kde.qt.QWidget");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QComboTableItem_setContentFromEditor(JNIEnv *env, jobject obj, jobject w)
{
	((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->setContentFromEditor((QWidget*) QtSupport::getQt(env, w));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QComboTableItem_paint(JNIEnv *env, jobject obj, jobject p, jobject cg, jobject cr, jboolean selected)
{
	((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->paint((QPainter*) QtSupport::getQt(env, p), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, cg), (QRect&) *(QRect *) QtSupport::getQt(env, cr), (bool) selected);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QComboTableItem_setCurrentItem__I(JNIEnv *env, jobject obj, jint i)
{
	((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->setCurrentItem((int) i);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QComboTableItem_setCurrentItem__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring i)
{
static QString * _qstring_i = 0;
	((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->setCurrentItem((QString&) * (QString *) QtSupport::toQString(env, i, &_qstring_i));
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QComboTableItem_currentItem(JNIEnv *env, jobject obj)
{
	return (jint) ((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->currentItem();
}

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QComboTableItem_count(JNIEnv *env, jobject obj)
{
	return (jint) ((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->count();
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QComboTableItem_text(JNIEnv *env, jobject obj, jint i)
{
	QString  _qstring;
	_qstring = ((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->text((int) i);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QComboTableItem_setEditable(JNIEnv *env, jobject obj, jboolean b)
{
	((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->setEditable((bool) b);
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QComboTableItem_setStringList(JNIEnv *env, jobject obj, jobjectArray l)
{
static QStringList * _qlist_l = 0;
	((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->setStringList((QStringList&) * (QStringList *) QtSupport::toQStringList(env, l, &_qlist_l));
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QComboTableItem_rtti(JNIEnv *env, jobject obj)
{
	return (jint) ((QComboTableItemJBridge*) QtSupport::getQt(env, obj))->rtti();
}

