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

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

class KAppTreeListItemJBridge : public KAppTreeListItem
{
public:
	KAppTreeListItemJBridge(KListView* parent, const QString& name, const QPixmap& pixmap, bool parse, bool dir, QString p, QString c) : KAppTreeListItem(parent, name, pixmap, parse, dir, p, c) {}
	KAppTreeListItemJBridge(QListViewItem* parent, const QString& name, const QPixmap& pixmap, bool parse, bool dir, QString p, QString c) : KAppTreeListItem(parent, name, pixmap, parse, dir, p, c) {}
	QString  protected_key(int column, bool ascending) {
		return (QString ) KAppTreeListItem::key(column, ascending);
	}
	void protected_init(const QPixmap& pixmap, bool parse, bool dir, QString _path, QString exec) {
		KAppTreeListItem::init(pixmap, parse, dir, _path, exec);
		return;
	}
	void protected_activate() {
		KAppTreeListItem::activate();
		return;
	}
	void protected_setOpen(bool o) {
		KAppTreeListItem::setOpen(o);
		return;
	}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KAppTreeListItem_newKAppTreeListItem__Lorg_kde_koala_KListView_2Ljava_lang_String_2Lorg_kde_qt_QPixmap_2ZZLjava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject parent, jstring name, jobject pixmap, jboolean parse, jboolean dir, jstring p, jstring c)
{
static QString * _qstring_c = 0;
static QString * _qstring_p = 0;
static QString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KAppTreeListItemJBridge((KListView*) QtSupport::getQt(env, parent), (QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QPixmap&) *(QPixmap *) QtSupport::getQt(env, pixmap), (bool) parse, (bool) dir, (QString) * (QString *) QtSupport::toQString(env, p, &_qstring_p), (QString) * (QString *) QtSupport::toQString(env, c, &_qstring_c)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KAppTreeListItem_newKAppTreeListItem__Lorg_kde_qt_QListViewItem_2Ljava_lang_String_2Lorg_kde_qt_QPixmap_2ZZLjava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject parent, jstring name, jobject pixmap, jboolean parse, jboolean dir, jstring p, jstring c)
{
static QString * _qstring_c = 0;
static QString * _qstring_p = 0;
static QString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KAppTreeListItemJBridge((QListViewItem*) QtSupport::getQt(env, parent), (QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QPixmap&) *(QPixmap *) QtSupport::getQt(env, pixmap), (bool) parse, (bool) dir, (QString) * (QString *) QtSupport::toQString(env, p, &_qstring_p), (QString) * (QString *) QtSupport::toQString(env, c, &_qstring_c)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KAppTreeListItem_isDirectory(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KAppTreeListItem*) QtSupport::getQt(env, obj))->isDirectory();
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KAppTreeListItem_key(JNIEnv *env, jobject obj, jint column, jboolean ascending)
{
	QString  _qstring;
	_qstring = ((KAppTreeListItemJBridge*) QtSupport::getQt(env, obj))->protected_key((int) column, (bool) ascending);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KAppTreeListItem_init(JNIEnv *env, jobject obj, jobject pixmap, jboolean parse, jboolean dir, jstring _path, jstring exec)
{
static QString * _qstring_exec = 0;
static QString * _qstring__path = 0;
	((KAppTreeListItemJBridge*) QtSupport::getQt(env, obj))->protected_init((QPixmap&) *(QPixmap *) QtSupport::getQt(env, pixmap), (bool) parse, (bool) dir, (QString) * (QString *) QtSupport::toQString(env, _path, &_qstring__path), (QString) * (QString *) QtSupport::toQString(env, exec, &_qstring_exec));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KAppTreeListItem_activate(JNIEnv *env, jobject obj)
{
	((KAppTreeListItemJBridge*) QtSupport::getQt(env, obj))->protected_activate();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KAppTreeListItem_setOpen(JNIEnv *env, jobject obj, jboolean o)
{
	((KAppTreeListItemJBridge*) QtSupport::getQt(env, obj))->protected_setOpen((bool) o);
	return;
}

