/***************************************************************************
                            KWordWrap.cpp -  description
                             -------------------
    begin                : Sun Jan 27 16:22:17 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Jan 27 16:22:17 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 <kwordwrap.h>
#include <qstring.h>
#include <qcstring.h>

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KWordWrap_boundingRect(JNIEnv *env, jobject obj)
{
	QRect _r= ((KWordWrap*) QtSupport::getQt(env, obj))->boundingRect();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QRect(_r.left(),_r.top(),_r.width(),_r.height()), "org.kde.qt.QRect", TRUE);
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KWordWrap_truncatedString__Z(JNIEnv *env, jobject obj, jboolean dots)
{
	QString  _qstring;
	_qstring = ((KWordWrap*) QtSupport::getQt(env, obj))->truncatedString((bool) dots);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KWordWrap_truncatedString__(JNIEnv *env, jobject obj)
{
	QString _qstring;
	_qstring = ((KWordWrap*) QtSupport::getQt(env, obj))->truncatedString(true);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KWordWrap_drawText__Lorg_kde_qt_QPainter_2III(JNIEnv *env, jobject obj, jobject painter, jint x, jint y, jint flags)
{
	((KWordWrap*) QtSupport::getQt(env, obj))->drawText((QPainter*) QtSupport::getQt(env, painter), (int) x, (int) y, (int) flags);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KWordWrap_drawText__Lorg_kde_qt_QPainter_2II(JNIEnv *env, jobject obj, jobject painter, jint x, jint y)
{
	((KWordWrap*) QtSupport::getQt(env, obj))->drawText((QPainter*) QtSupport::getQt(env, painter), (int) x, (int) y, Qt::AlignAuto);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KWordWrap_formatText__Lorg_kde_qt_QFontMetrics_2Lorg_kde_qt_QRect_2ILjava_lang_String_2I(JNIEnv *env, jclass obj, jobject fm, jobject r, jint flags, jstring str, jint len)
{
static QString * _qstring_str = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)KWordWrap::formatText((QFontMetrics&) *(QFontMetrics *) QtSupport::getQt(env, fm), (QRect&) *(QRect *) QtSupport::getQt(env, r), (int) flags, (QString&) * (QString *) QtSupport::toQString(env, str, &_qstring_str), (int) len), "org.kde.koala.KWordWrap");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KWordWrap_formatText__Lorg_kde_qt_QFontMetrics_2Lorg_kde_qt_QRect_2ILjava_lang_String_2(JNIEnv *env, jclass obj, jobject fm, jobject r, jint flags, jstring str)
{
static QString * _qstring_str = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)KWordWrap::formatText((QFontMetrics&) *(QFontMetrics *) QtSupport::getQt(env, fm), (QRect&) *(QRect *) QtSupport::getQt(env, r), (int) flags, (QString&) * (QString *) QtSupport::toQString(env, str, &_qstring_str), -1), "org.kde.koala.KWordWrap");
}

