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

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

class QFontJBridge : public QFont
{
public:
	QFontJBridge() : QFont() {}
	QFontJBridge(const QString& family, int pointSize, int weight, bool italic) : QFont(family, pointSize, weight, italic) {}
	QFontJBridge(const QFont& arg1) : QFont(arg1) {}
	~QFontJBridge() {QtSupport::qtKeyDeleted(this);}
//	bool  protected_dirty() {
//		return (bool ) QFont::dirty();
//	}
	int  protected_deciPointSize() {
		return (int ) QFont::deciPointSize();
	}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_newQFont__Ljava_lang_String_2IIZ(JNIEnv *env, jobject obj, jstring family, jint pointSize, jint weight, jboolean italic)
{
static QString * _qstring_family = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QFontJBridge((QString&) * (QString *) QtSupport::toQString(env, family, &_qstring_family), (int) pointSize, (int) weight, (bool) italic));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_newQFont__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring family)
{
static QString * _qstring_family = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QFontJBridge((QString&) * (QString *) QtSupport::toQString(env, family, &_qstring_family), 12, QFont::Normal, FALSE));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setFamily(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	((QFontJBridge*) QtSupport::getQt(env, obj))->setFamily((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFont_pointSize(JNIEnv *env, jobject obj)
{
	return (jint) ((QFontJBridge*) QtSupport::getQt(env, obj))->pointSize();
}

JNIEXPORT jfloat JNICALL
Java_org_kde_qt_QFont_pointSizeFloat(JNIEnv *env, jobject obj)
{
	return (jfloat) ((QFontJBridge*) QtSupport::getQt(env, obj))->pointSizeFloat();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setPointSize(JNIEnv *env, jobject obj, jint arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setPointSize((int) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setPointSizeFloat(JNIEnv *env, jobject obj, jfloat arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setPointSizeFloat((float) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFont_pixelSize(JNIEnv *env, jobject obj)
{
	return (jint) ((QFontJBridge*) QtSupport::getQt(env, obj))->pixelSize();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setPixelSize(JNIEnv *env, jobject obj, jint arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setPixelSize((int) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setPixelSizeFloat(JNIEnv *env, jobject obj, jfloat arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setPixelSizeFloat((float) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFont_weight(JNIEnv *env, jobject obj)
{
	return (jint) ((QFontJBridge*) QtSupport::getQt(env, obj))->weight();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setWeight(JNIEnv *env, jobject obj, jint arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setWeight((int) arg1);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFont_bold(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFontJBridge*) QtSupport::getQt(env, obj))->bold();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setBold(JNIEnv *env, jobject obj, jboolean arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setBold((bool) arg1);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFont_italic(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFontJBridge*) QtSupport::getQt(env, obj))->italic();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setItalic(JNIEnv *env, jobject obj, jboolean arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setItalic((bool) arg1);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFont_underline(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFontJBridge*) QtSupport::getQt(env, obj))->underline();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setUnderline(JNIEnv *env, jobject obj, jboolean arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setUnderline((bool) arg1);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFont_strikeOut(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFontJBridge*) QtSupport::getQt(env, obj))->strikeOut();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setStrikeOut(JNIEnv *env, jobject obj, jboolean arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setStrikeOut((bool) arg1);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFont_fixedPitch(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFontJBridge*) QtSupport::getQt(env, obj))->fixedPitch();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setFixedPitch(JNIEnv *env, jobject obj, jboolean arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setFixedPitch((bool) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFont_styleHint(JNIEnv *env, jobject obj)
{
	return (jint) ((QFontJBridge*) QtSupport::getQt(env, obj))->styleHint();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFont_styleStrategy(JNIEnv *env, jobject obj)
{
	return (jint) ((QFontJBridge*) QtSupport::getQt(env, obj))->styleStrategy();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setQStyle__II(JNIEnv *env, jobject obj, jint arg1, jint arg2)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setStyleHint((QFont::StyleHint) arg1, (QFont::StyleStrategy) arg2);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setStyleHint__I(JNIEnv *env, jobject obj, jint arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setStyleHint((QFont::StyleHint) arg1, QFont::PreferDefault);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setStyleStrategy(JNIEnv *env, jobject obj, jint s)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setStyleStrategy((QFont::StyleStrategy) s);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFont_rawMode(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFontJBridge*) QtSupport::getQt(env, obj))->rawMode();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setRawMode(JNIEnv *env, jobject obj, jboolean arg1)
{
	((QFontJBridge*) QtSupport::getQt(env, obj))->setRawMode((bool) arg1);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFont_exactMatch(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QFontJBridge*) QtSupport::getQt(env, obj))->exactMatch();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFont_isCopyOf(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((QFontJBridge*) QtSupport::getQt(env, obj))->isCopyOf((QFont&) *(QFont *) QtSupport::getQt(env, arg1));
}

//JNIEXPORT jint JNICALL
//Java_org_kde_qt_QFont_handle__(JNIEnv *env, jobject obj)
//{
//	return (jint) ((QFontJBridge*) QtSupport::getQt(env, obj))->handle();
//}

//JNIEXPORT  JNICALL
//Java_org_kde_qt_QFont_handle__(JNIEnv *env, jobject obj)
//{
//	return () ((QFontJBridge*) QtSupport::getQt(env, obj))->handle();
//}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setRawName(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	((QFontJBridge*) QtSupport::getQt(env, obj))->setRawName((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

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

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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFont_fromString(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	return (jboolean) ((QFontJBridge*) QtSupport::getQt(env, obj))->fromString((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QFont_qwsRenderToDisk__Z(JNIEnv *env, jobject obj, jboolean all)
//{
//	((QFontJBridge*) QtSupport::getQt(env, obj))->qwsRenderToDisk((bool) all);
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QFont_qwsRenderToDisk__(JNIEnv *env, jobject obj)
//{
//	((QFontJBridge*) QtSupport::getQt(env, obj))->qwsRenderToDisk(TRUE);
//	return;
//}

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

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

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

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QFont_substitute(JNIEnv *env, jclass obj, jstring arg1)
{
	QString  _qstring;
static QString * _qstring_arg1 = 0;
	_qstring = QFontJBridge::substitute((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QFont_substitutes(JNIEnv *env, jclass obj, jstring arg1)
{
	QStringList  _qlist;
static QString * _qstring_arg1 = 0;
	_qlist = QFontJBridge::substitutes((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QFont_substitutions(JNIEnv *env, jclass obj)
{
	QStringList  _qlist;
	_qlist = QFontJBridge::substitutions();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_insertSubstitution(JNIEnv *env, jclass obj, jstring arg1, jstring arg2)
{
static QString * _qstring_arg2 = 0;
static QString * _qstring_arg1 = 0;
	QFontJBridge::insertSubstitution((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (QString&) * (QString *) QtSupport::toQString(env, arg2, &_qstring_arg2));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_insertSubstitutions(JNIEnv *env, jclass obj, jstring arg1, jobjectArray arg2)
{
static QStringList * _qlist_arg2 = 0;
static QString * _qstring_arg1 = 0;
	QFontJBridge::insertSubstitutions((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, arg2, &_qlist_arg2));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_removeSubstitution(JNIEnv *env, jclass obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	QFontJBridge::removeSubstitution((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_initialize(JNIEnv *env, jclass obj)
{
	QFontJBridge::initialize();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_cleanup(JNIEnv *env, jclass obj)
{
	QFontJBridge::cleanup();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_cacheStatistics(JNIEnv *env, jclass obj)
{
	QFontJBridge::cacheStatistics();
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QFont_defaultFont(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QFont (QFontJBridge::defaultFont()), "org.kde.qt.QFont", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFont_setDefaultFont(JNIEnv *env, jclass obj, jobject arg1)
{
	QFontJBridge::setDefaultFont((QFont&) *(QFont *) QtSupport::getQt(env, arg1));
	return;
}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QFont_dirty(JNIEnv *env, jobject obj)
//{
//	return (jboolean) ((QFontJBridge*) QtSupport::getQt(env, obj))->protected_dirty();
//}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFont_deciPointSize(JNIEnv *env, jobject obj)
{
	return (jint) ((QFontJBridge*) QtSupport::getQt(env, obj))->protected_deciPointSize();
}

