/***************************************************************************
                            KFileTreeViewItem.cpp -  description
                             -------------------
    begin                : Fri Mar 15 15:14:30 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Fri Mar 15 15:14:30 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 <kfiletreeviewitem.h>
#include <qstring.h>
#include <qcstring.h>

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

class KFileTreeViewItemJBridge : public KFileTreeViewItem
{
public:
	KFileTreeViewItemJBridge(KFileTreeViewItem* arg1, KFileItem* arg2, KFileTreeBranch* arg3) : KFileTreeViewItem(arg1, arg2, arg3) {}
	KFileTreeViewItemJBridge(KFileTreeView* arg1, KFileItem* arg2, KFileTreeBranch* arg3) : KFileTreeViewItem(arg1, arg2, arg3) {}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeViewItem_newKFileTreeViewItem__Lorg_kde_koala_KFileTreeViewItem_2Lorg_kde_koala_KFileItem_2Lorg_kde_koala_KFileTreeBranch_2(JNIEnv *env, jobject obj, jobject arg1, jobject arg2, jobject arg3)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KFileTreeViewItemJBridge((KFileTreeViewItem*) QtSupport::getQt(env, arg1), (KFileItem*) QtSupport::getQt(env, arg2), (KFileTreeBranch*) QtSupport::getQt(env, arg3)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeViewItem_newKFileTreeViewItem__Lorg_kde_koala_KFileTreeView_2Lorg_kde_koala_KFileItem_2Lorg_kde_koala_KFileTreeBranch_2(JNIEnv *env, jobject obj, jobject arg1, jobject arg2, jobject arg3)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KFileTreeViewItemJBridge((KFileTreeView*) QtSupport::getQt(env, arg1), (KFileItem*) QtSupport::getQt(env, arg2), (KFileTreeBranch*) QtSupport::getQt(env, arg3)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KFileTreeViewItem_branch(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KFileTreeViewItem*) QtSupport::getQt(env, obj))->branch(), "org.kde.koala.KFileTreeBranch");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KFileTreeViewItem_fileItem(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KFileTreeViewItem*) QtSupport::getQt(env, obj))->fileItem(), "org.kde.koala.KFileItem");
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KFileTreeViewItem_url(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new KURL (((KFileTreeViewItem*) QtSupport::getQt(env, obj))->url()), "org.kde.koala.KURL", TRUE);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFileTreeViewItem_isDir(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KFileTreeViewItem*) QtSupport::getQt(env, obj))->isDir();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFileTreeViewItem_alreadyListed(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KFileTreeViewItem*) QtSupport::getQt(env, obj))->alreadyListed();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeViewItem_setListed(JNIEnv *env, jobject obj, jboolean wasListed)
{
	((KFileTreeViewItem*) QtSupport::getQt(env, obj))->setListed((bool) wasListed);
	return;
}

