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

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

class KFileTreeBranchJBridge : public KFileTreeBranch
{
public:
	KFileTreeBranchJBridge(KFileTreeView* arg1, const KURL& url, const QString& name, const QPixmap& pix, bool showHidden, KFileTreeViewItem* branchRoot) : KFileTreeBranch(arg1, url, name, pix, showHidden, branchRoot) {}
	 KFileTreeViewItem * protected_createTreeViewItem(KFileTreeViewItem* parent, KFileItem* fileItem) {
		return ( KFileTreeViewItem *) KFileTreeBranch::createTreeViewItem(parent, fileItem);
	}
	 KFileTreeViewItem * protected_findTVIByURL(const KURL& arg1) {
		return ( KFileTreeViewItem *) KFileTreeBranch::findTVIByURL(arg1);
	}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_newKFileTreeBranch__Lorg_kde_koala_KFileTreeView_2Lorg_kde_koala_KURL_2Ljava_lang_String_2Lorg_kde_qt_QPixmap_2ZLorg_kde_koala_KFileTreeViewItem_2(JNIEnv *env, jobject obj, jobject arg1, jobject url, jstring name, jobject pix, jboolean showHidden, jobject branchRoot)
{
static QString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KFileTreeBranchJBridge((KFileTreeView*) QtSupport::getQt(env, arg1), (KURL&) *(KURL *) QtSupport::getQt(env, url), (QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QPixmap&) *(QPixmap *) QtSupport::getQt(env, pix), (bool) showHidden, (KFileTreeViewItem*) QtSupport::getQt(env, branchRoot)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_newKFileTreeBranch__Lorg_kde_koala_KFileTreeView_2Lorg_kde_koala_KURL_2Ljava_lang_String_2Lorg_kde_qt_QPixmap_2(JNIEnv *env, jobject obj, jobject arg1, jobject url, jstring name, jobject pix)
{
static QString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KFileTreeBranchJBridge((KFileTreeView*) QtSupport::getQt(env, arg1), (KURL&) *(KURL *) QtSupport::getQt(env, url), (QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QPixmap&) *(QPixmap *) QtSupport::getQt(env, pix), false, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_setRoot(JNIEnv *env, jobject obj, jobject r)
{
	((KFileTreeBranch*) QtSupport::getQt(env, obj))->setRoot((KFileTreeViewItem*) QtSupport::getQt(env, r));
	return;
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_setName(JNIEnv *env, jobject obj, jstring n)
{
static QString * _qstring_n = 0;
	((KFileTreeBranch*) QtSupport::getQt(env, obj))->setName((QString) * (QString *) QtSupport::toQString(env, n, &_qstring_n));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KFileTreeBranch_pixmap(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QPixmap *) &((KFileTreeBranch*) QtSupport::getQt(env, obj))->pixmap(), "org.kde.qt.QPixmap");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KFileTreeBranch_openPixmap(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QPixmap *) &((KFileTreeBranch*) QtSupport::getQt(env, obj))->openPixmap(), "org.kde.qt.QPixmap");
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFileTreeBranch_showExtensions(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KFileTreeBranch*) QtSupport::getQt(env, obj))->showExtensions();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_setOpen__Z(JNIEnv *env, jobject obj, jboolean setopen)
{
	((KFileTreeBranch*) QtSupport::getQt(env, obj))->setOpen((bool) setopen);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_setOpen__(JNIEnv *env, jobject obj)
{
	((KFileTreeBranch*) QtSupport::getQt(env, obj))->setOpen(true);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_setChildRecurse__Z(JNIEnv *env, jobject obj, jboolean t)
{
	((KFileTreeBranch*) QtSupport::getQt(env, obj))->setChildRecurse((bool) t);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_setChildRecurse__(JNIEnv *env, jobject obj)
{
	((KFileTreeBranch*) QtSupport::getQt(env, obj))->setChildRecurse(true);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFileTreeBranch_childRecurse(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KFileTreeBranch*) QtSupport::getQt(env, obj))->childRecurse();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFileTreeBranch_populate(JNIEnv *env, jobject obj, jobject url, jobject currItem)
{
	return (jboolean) ((KFileTreeBranch*) QtSupport::getQt(env, obj))->populate((KURL&) *(KURL *) QtSupport::getQt(env, url), (KFileTreeViewItem*) QtSupport::getQt(env, currItem));
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_setShowExtensions__Z(JNIEnv *env, jobject obj, jboolean visible)
{
	((KFileTreeBranch*) QtSupport::getQt(env, obj))->setShowExtensions((bool) visible);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_setShowExtensions__(JNIEnv *env, jobject obj)
{
	((KFileTreeBranch*) QtSupport::getQt(env, obj))->setShowExtensions(true);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFileTreeBranch_setOpenPixmap(JNIEnv *env, jobject obj, jobject pix)
{
	((KFileTreeBranch*) QtSupport::getQt(env, obj))->setOpenPixmap((QPixmap&) *(QPixmap *) QtSupport::getQt(env, pix));
	return;
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KFileTreeBranch_findTVIByURL(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KFileTreeBranchJBridge*) QtSupport::getQt(env, obj))->protected_findTVIByURL((KURL&) *(KURL *) QtSupport::getQt(env, arg1)), "org.kde.koala.KFileTreeViewItem");
}

