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

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

class QListBoxTextJBridge : public QListBoxText
{
public:
	QListBoxTextJBridge(QListBox* listbox, const QString& text) : QListBoxText(listbox, text) {}
	QListBoxTextJBridge(const QString& text) : QListBoxText(text) {}
	QListBoxTextJBridge(QListBox* listbox, const QString& text, QListBoxItem* after) : QListBoxText(listbox, text, after) {}
	~QListBoxTextJBridge() {QtSupport::qtKeyDeleted(this);}
	void protected_paint(QPainter* arg1) {
		QListBoxText::paint(arg1);
		return;
	}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QListBoxText_newQListBoxText__Lorg_kde_qt_QListBox_2(JNIEnv *env, jobject obj, jobject listbox)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QListBoxTextJBridge((QListBox*) QtSupport::getQt(env, listbox), QString::null));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QListBoxText_newQListBoxText__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 QListBoxTextJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QListBoxText_newQListBoxText__Lorg_kde_qt_QListBox_2Ljava_lang_String_2Lorg_kde_qt_QListBoxItem_2(JNIEnv *env, jobject obj, jobject listbox, jstring text, jobject after)
{
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QListBoxTextJBridge((QListBox*) QtSupport::getQt(env, listbox), (QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QListBoxItem*) QtSupport::getQt(env, after)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QListBoxText_height(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jint) ((QListBoxTextJBridge*) QtSupport::getQt(env, obj))->height((QListBox*) QtSupport::getQt(env, arg1));
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QListBoxText_width(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jint) ((QListBoxTextJBridge*) QtSupport::getQt(env, obj))->width((QListBox*) QtSupport::getQt(env, arg1));
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QListBoxText_paint(JNIEnv *env, jobject obj, jobject arg1)
{
	((QListBoxTextJBridge*) QtSupport::getQt(env, obj))->protected_paint((QPainter*) QtSupport::getQt(env, arg1));
	return;
}

