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

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

class QUrlInfoJBridge : public QUrlInfo
{
public:
	QUrlInfoJBridge() : QUrlInfo() {}
	QUrlInfoJBridge(const QUrlOperator& path, const QString& file) : QUrlInfo(path, file) {}
	QUrlInfoJBridge(const QUrlInfo& ui) : QUrlInfo(ui) {}
	QUrlInfoJBridge(const QString& name, int permissions, const QString& owner, const QString& group, uint size, const QDateTime& lastModified, const QDateTime& lastRead, bool isDir, bool isFile, bool isSymLink, bool isWritable, bool isReadable, bool isExecutable) : QUrlInfo(name, permissions, owner, group, size, lastModified, lastRead, isDir, isFile, isSymLink, isWritable, isReadable, isExecutable) {}
	QUrlInfoJBridge(const QUrl& url, int permissions, const QString& owner, const QString& group, uint size, const QDateTime& lastModified, const QDateTime& lastRead, bool isDir, bool isFile, bool isSymLink, bool isWritable, bool isReadable, bool isExecutable) : QUrlInfo(url, permissions, owner, group, size, lastModified, lastRead, isDir, isFile, isSymLink, isWritable, isReadable, isExecutable) {}
	~QUrlInfoJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_newQUrlInfo__Lorg_kde_qt_QUrlInfo_2(JNIEnv *env, jobject obj, jobject ui)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QUrlInfoJBridge((QUrlInfo&) *(QUrlInfo *) QtSupport::getQt(env, ui)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_newQUrlInfo__Ljava_lang_String_2ILjava_lang_String_2Ljava_lang_String_2ILjava_util_Calendar_2Ljava_util_Calendar_2ZZZZZZ(JNIEnv *env, jobject obj, jstring name, jint permissions, jstring owner, jstring group, jint size, jobject lastModified, jobject lastRead, jboolean isDir, jboolean isFile, jboolean isSymLink, jboolean isWritable, jboolean isReadable, jboolean isExecutable)
{
static QDateTime * _qdate_lastRead = 0;
static QDateTime * _qdate_lastModified = 0;
static QString * _qstring_group = 0;
static QString * _qstring_owner = 0;
static QString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QUrlInfoJBridge((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (int) permissions, (QString&) * (QString *) QtSupport::toQString(env, owner, &_qstring_owner), (QString&) * (QString *) QtSupport::toQString(env, group, &_qstring_group), (uint) size, (QDateTime&) * (QDateTime *) QtSupport::toQDateTime(env, lastModified, &_qdate_lastModified), (QDateTime&) * (QDateTime *) QtSupport::toQDateTime(env, lastRead, &_qdate_lastRead), (bool) isDir, (bool) isFile, (bool) isSymLink, (bool) isWritable, (bool) isReadable, (bool) isExecutable));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_newQUrlInfo__Lorg_kde_qt_QUrlInterface_2ILjava_lang_String_2Ljava_lang_String_2ILjava_util_Calendar_2Ljava_util_Calendar_2ZZZZZZ(JNIEnv *env, jobject obj, jobject url, jint permissions, jstring owner, jstring group, jint size, jobject lastModified, jobject lastRead, jboolean isDir, jboolean isFile, jboolean isSymLink, jboolean isWritable, jboolean isReadable, jboolean isExecutable)
{
static QDateTime * _qdate_lastRead = 0;
static QDateTime * _qdate_lastModified = 0;
static QString * _qstring_group = 0;
static QString * _qstring_owner = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QUrlInfoJBridge((QUrl&) *(QUrl *) QtSupport::getQt(env, url), (int) permissions, (QString&) * (QString *) QtSupport::toQString(env, owner, &_qstring_owner), (QString&) * (QString *) QtSupport::toQString(env, group, &_qstring_group), (uint) size, (QDateTime&) * (QDateTime *) QtSupport::toQDateTime(env, lastModified, &_qdate_lastModified), (QDateTime&) * (QDateTime *) QtSupport::toQDateTime(env, lastRead, &_qdate_lastRead), (bool) isDir, (bool) isFile, (bool) isSymLink, (bool) isWritable, (bool) isReadable, (bool) isExecutable));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setName(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setName((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setDir(JNIEnv *env, jobject obj, jboolean b)
{
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setDir((bool) b);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setFile(JNIEnv *env, jobject obj, jboolean b)
{
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setFile((bool) b);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setSymLink(JNIEnv *env, jobject obj, jboolean b)
{
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setSymLink((bool) b);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setOwner(JNIEnv *env, jobject obj, jstring s)
{
static QString * _qstring_s = 0;
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setOwner((QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setGroup(JNIEnv *env, jobject obj, jstring s)
{
static QString * _qstring_s = 0;
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setGroup((QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setSize(JNIEnv *env, jobject obj, jint s)
{
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setSize((uint) s);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setWritable(JNIEnv *env, jobject obj, jboolean b)
{
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setWritable((bool) b);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setReadable(JNIEnv *env, jobject obj, jboolean b)
{
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setReadable((bool) b);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setPermissions(JNIEnv *env, jobject obj, jint p)
{
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setPermissions((int) p);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QUrlInfo_setLastModified(JNIEnv *env, jobject obj, jobject dt)
{
static QDateTime * _qdate_dt = 0;
	((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->setLastModified((QDateTime&) * (QDateTime *) QtSupport::toQDateTime(env, dt, &_qdate_dt));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QUrlInfo_isValid(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->isValid();
}

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QUrlInfo_permissions(JNIEnv *env, jobject obj)
{
	return (jint) ((QUrlInfoJBridge*) QtSupport::getQt(env, obj))->permissions();
}

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

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

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

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

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

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

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

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

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

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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QUrlInfo_greaterThan(JNIEnv *env, jclass obj, jobject i1, jobject i2, jint sortBy)
{
	return (jboolean) QUrlInfoJBridge::greaterThan((QUrlInfo&) *(QUrlInfo *) QtSupport::getQt(env, i1), (QUrlInfo&) *(QUrlInfo *) QtSupport::getQt(env, i2), (int) sortBy);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QUrlInfo_lessThan(JNIEnv *env, jclass obj, jobject i1, jobject i2, jint sortBy)
{
	return (jboolean) QUrlInfoJBridge::lessThan((QUrlInfo&) *(QUrlInfo *) QtSupport::getQt(env, i1), (QUrlInfo&) *(QUrlInfo *) QtSupport::getQt(env, i2), (int) sortBy);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QUrlInfo_equal(JNIEnv *env, jclass obj, jobject i1, jobject i2, jint sortBy)
{
	return (jboolean) QUrlInfoJBridge::equal((QUrlInfo&) *(QUrlInfo *) QtSupport::getQt(env, i1), (QUrlInfo&) *(QUrlInfo *) QtSupport::getQt(env, i2), (int) sortBy);
}

