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

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

class KIconViewItemJBridge : public KIconViewItem
{
public:
	KIconViewItemJBridge(QIconView* parent) : KIconViewItem(parent) {}
	KIconViewItemJBridge(QIconView* parent, QIconViewItem* after) : KIconViewItem(parent, after) {}
	KIconViewItemJBridge(QIconView* parent, const QString& text) : KIconViewItem(parent, text) {}
	KIconViewItemJBridge(QIconView* parent, QIconViewItem* after, const QString& text) : KIconViewItem(parent, after, text) {}
	KIconViewItemJBridge(QIconView* parent, const QString& text, const QPixmap& icon) : KIconViewItem(parent, text, icon) {}
	KIconViewItemJBridge(QIconView* parent, QIconViewItem* after, const QString& text, const QPixmap& icon) : KIconViewItem(parent, after, text, icon) {}
	KIconViewItemJBridge(QIconView* parent, const QString& text, const QPicture& picture) : KIconViewItem(parent, text, picture) {}
	KIconViewItemJBridge(QIconView* parent, QIconViewItem* after, const QString& text, const QPicture& picture) : KIconViewItem(parent, after, text, picture) {}
	~KIconViewItemJBridge() {QtSupport::qtKeyDeleted(this);}
	void protected_init() {
		KIconViewItem::init();
		return;
	}
	void protected_calcRect(const QString& text_) {
		KIconViewItem::calcRect(text_);
		return;
	}
	void protected_paintItem(QPainter* p, const QColorGroup& c) {
		KIconViewItem::paintItem(p, c);
		return;
	}
};


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

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_newKIconViewItem__Lorg_kde_qt_QIconView_2Lorg_kde_qt_QIconViewItem_2(JNIEnv *env, jobject obj, jobject parent, jobject after)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KIconViewItemJBridge((QIconView*) QtSupport::getQt(env, parent), (QIconViewItem*) QtSupport::getQt(env, after)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_newKIconViewItem__Lorg_kde_qt_QIconView_2Lorg_kde_qt_QIconViewItem_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject parent, jobject after, jstring text)
{
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KIconViewItemJBridge((QIconView*) QtSupport::getQt(env, parent), (QIconViewItem*) QtSupport::getQt(env, after), (QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_newKIconViewItem__Lorg_kde_qt_QIconView_2Ljava_lang_String_2Lorg_kde_qt_QPixmap_2(JNIEnv *env, jobject obj, jobject parent, jstring text, jobject icon)
{
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KIconViewItemJBridge((QIconView*) QtSupport::getQt(env, parent), (QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QPixmap&) *(QPixmap *) QtSupport::getQt(env, icon)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_newKIconViewItem__Lorg_kde_qt_QIconView_2Lorg_kde_qt_QIconViewItem_2Ljava_lang_String_2Lorg_kde_qt_QPixmap_2(JNIEnv *env, jobject obj, jobject parent, jobject after, jstring text, jobject icon)
{
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KIconViewItemJBridge((QIconView*) QtSupport::getQt(env, parent), (QIconViewItem*) QtSupport::getQt(env, after), (QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QPixmap&) *(QPixmap *) QtSupport::getQt(env, icon)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_newKIconViewItem__Lorg_kde_qt_QIconView_2Ljava_lang_String_2Lorg_kde_qt_QPicture_2(JNIEnv *env, jobject obj, jobject parent, jstring text, jobject picture)
{
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KIconViewItemJBridge((QIconView*) QtSupport::getQt(env, parent), (QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QPicture&) *(QPicture *) QtSupport::getQt(env, picture)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_newKIconViewItem__Lorg_kde_qt_QIconView_2Lorg_kde_qt_QIconViewItem_2Ljava_lang_String_2Lorg_kde_qt_QPicture_2(JNIEnv *env, jobject obj, jobject parent, jobject after, jstring text, jobject picture)
{
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KIconViewItemJBridge((QIconView*) QtSupport::getQt(env, parent), (QIconViewItem*) QtSupport::getQt(env, after), (QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QPicture&) *(QPicture *) QtSupport::getQt(env, picture)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KIconViewItem_finalize(env, obj);
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_init(JNIEnv *env, jobject obj)
{
	((KIconViewItemJBridge*) QtSupport::getQt(env, obj))->protected_init();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_calcRect__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text_)
{
static QString * _qstring_text_ = 0;
	((KIconViewItemJBridge*) QtSupport::getQt(env, obj))->protected_calcRect((QString&) * (QString *) QtSupport::toQString(env, text_, &_qstring_text_));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_calcRect__(JNIEnv *env, jobject obj)
{
	((KIconViewItemJBridge*) QtSupport::getQt(env, obj))->protected_calcRect(QString::null);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KIconViewItem_paintItem(JNIEnv *env, jobject obj, jobject p, jobject c)
{
	((KIconViewItemJBridge*) QtSupport::getQt(env, obj))->protected_paintItem((QPainter*) QtSupport::getQt(env, p), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, c));
	return;
}

