/***************************************************************************
                            QCheckTableItem.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/QCheckTableItem.h>

class QCheckTableItemJBridge : public QCheckTableItem
{
public:
	QCheckTableItemJBridge(QTable* table, const QString& txt) : QCheckTableItem(table, txt) {}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QCheckTableItem_newQCheckTableItem(JNIEnv *env, jobject obj, jobject table, jstring txt)
{
static QString * _qstring_txt = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QCheckTableItemJBridge((QTable*) QtSupport::getQt(env, table), (QString&) * (QString *) QtSupport::toQString(env, txt, &_qstring_txt)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QCheckTableItem_paint(JNIEnv *env, jobject obj, jobject p, jobject cg, jobject cr, jboolean selected)
{
	((QCheckTableItemJBridge*) 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_QCheckTableItem_setChecked(JNIEnv *env, jobject obj, jboolean b)
{
	((QCheckTableItemJBridge*) QtSupport::getQt(env, obj))->setChecked((bool) b);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCheckTableItem_isChecked(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCheckTableItemJBridge*) QtSupport::getQt(env, obj))->isChecked();
}

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

