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

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

class QFontInfoJBridge : public QFontInfo
{
public:
	QFontInfoJBridge(const QFont& arg1) : QFontInfo(arg1) {}
	QFontInfoJBridge(const QFontInfo& arg1) : QFontInfo(arg1) {}
	~QFontInfoJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

