/***************************************************************************
                            QFileInfo.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 <qfileinfo.h>
#include <qstring.h>
#include <qcstring.h>
#include <qdir.h>

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

class QFileInfoJBridge : public QFileInfo
{
public:
	QFileInfoJBridge() : QFileInfo() {}
	QFileInfoJBridge(const QString& file) : QFileInfo(file) {}
	QFileInfoJBridge(const QFile& arg1) : QFileInfo(arg1) {}
	QFileInfoJBridge(const QDir& arg1, const QString& fileName) : QFileInfo(arg1, fileName) {}
	QFileInfoJBridge(const QFileInfo& arg1) : QFileInfo(arg1) {}
	~QFileInfoJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QFileInfo_newQFileInfo__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring file)
{
static QString * _qstring_file = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QFileInfoJBridge((QString&) * (QString *) QtSupport::toQString(env, file, &_qstring_file)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFileInfo_newQFileInfo__Lorg_kde_qt_QFile_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QFileInfoJBridge((QFile&) *(QFile *) QtSupport::getQt(env, arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFileInfo_newQFileInfo__Lorg_kde_qt_QDir_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject arg1, jstring fileName)
{
static QString * _qstring_fileName = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QFileInfoJBridge((QDir&) *(QDir *) QtSupport::getQt(env, arg1), (QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFileInfo_newQFileInfo__Lorg_kde_qt_QFileInfo_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QFileInfoJBridge((QFileInfo&) *(QFileInfo *) QtSupport::getQt(env, arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QFileInfo_setFile__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring file)
{
static QString * _qstring_file = 0;
	((QFileInfoJBridge*) QtSupport::getQt(env, obj))->setFile((QString&) * (QString *) QtSupport::toQString(env, file, &_qstring_file));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFileInfo_setFile__Lorg_kde_qt_QFile_2(JNIEnv *env, jobject obj, jobject arg1)
{
	((QFileInfoJBridge*) QtSupport::getQt(env, obj))->setFile((QFile&) *(QFile *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFileInfo_setFile__Lorg_kde_qt_QDir_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject arg1, jstring fileName)
{
static QString * _qstring_fileName = 0;
	((QFileInfoJBridge*) QtSupport::getQt(env, obj))->setFile((QDir&) *(QDir *) QtSupport::getQt(env, arg1), (QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFileInfo_exists(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->exists();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFileInfo_refresh(JNIEnv *env, jobject obj)
{
	((QFileInfoJBridge*) QtSupport::getQt(env, obj))->refresh();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFileInfo_caching(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->caching();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFileInfo_setCaching(JNIEnv *env, jobject obj, jboolean arg1)
{
	((QFileInfoJBridge*) QtSupport::getQt(env, obj))->setCaching((bool) arg1);
	return;
}

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

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

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

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QFileInfo_baseName(JNIEnv *env, jobject obj, jboolean complete)
{
	QString  _qstring;
	_qstring = ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->baseName((bool) complete);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QFileInfo_extension(JNIEnv *env, jobject obj, jboolean complete)
{
	QString  _qstring;
	_qstring = ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->extension((bool) complete);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QFileInfo_dirPath(JNIEnv *env, jobject obj, jboolean absPath)
{
	QString  _qstring;
	_qstring = ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->dirPath((bool) absPath);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QFileInfo_dir__Z(JNIEnv *env, jobject obj, jboolean absPath)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDir (((QFileInfoJBridge*) QtSupport::getQt(env, obj))->dir((bool) absPath)), "org.kde.qt.QDir", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QFileInfo_dir__(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDir(((QFileInfoJBridge*) QtSupport::getQt(env, obj))->dir(FALSE)), "org.kde.qt.QDir", TRUE);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFileInfo_isReadable(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->isReadable();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFileInfo_isWritable(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->isWritable();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFileInfo_isExecutable(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->isExecutable();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFileInfo_isRelative(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->isRelative();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFileInfo_convertToAbs(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->convertToAbs();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFileInfo_isFile(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->isFile();
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFileInfo_isSymLink(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->isSymLink();
}

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

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFileInfo_ownerId(JNIEnv *env, jobject obj)
{
	return (jint) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->ownerId();
}

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFileInfo_groupId(JNIEnv *env, jobject obj)
{
	return (jint) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->groupId();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFileInfo_permission(JNIEnv *env, jobject obj, jint permissionSpec)
{
	return (jboolean) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->permission((int) permissionSpec);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFileInfo_size(JNIEnv *env, jobject obj)
{
	return (jint) ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->size();
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QFileInfo_created(JNIEnv *env, jobject obj)
{
	QDateTime  _qdate;
	_qdate = ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->created();
	return (jobject) QtSupport::fromQDateTime(env, (QDateTime *) &_qdate);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QFileInfo_lastModified(JNIEnv *env, jobject obj)
{
	QDateTime  _qdate;
	_qdate = ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->lastModified();
	return (jobject) QtSupport::fromQDateTime(env, (QDateTime *) &_qdate);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QFileInfo_lastRead(JNIEnv *env, jobject obj)
{
	QDateTime  _qdate;
	_qdate = ((QFileInfoJBridge*) QtSupport::getQt(env, obj))->lastRead();
	return (jobject) QtSupport::fromQDateTime(env, (QDateTime *) &_qdate);
}

