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

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_word__Ljava_lang_String_2I(JNIEnv *env, jclass obj, jstring text, jint pos)
{
	QString  _qstring;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::word((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (uint) pos);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_word__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring text, jstring range)
{
	QString  _qstring;
static QCString * _qstring_range = 0;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::word((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (char*) QtSupport::toCharString(env, range, &_qstring_range));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_insword(JNIEnv *env, jclass obj, jstring text, jstring word, jint pos)
{
	QString  _qstring;
static QString * _qstring_word = 0;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::insword((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QString&) * (QString *) QtSupport::toQString(env, word, &_qstring_word), (uint) pos);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_setword(JNIEnv *env, jclass obj, jstring text, jstring word, jint pos)
{
	QString  _qstring;
static QString * _qstring_word = 0;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::setword((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QString&) * (QString *) QtSupport::toQString(env, word, &_qstring_word), (uint) pos);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_remrange(JNIEnv *env, jclass obj, jstring text, jstring range)
{
	QString  _qstring;
static QCString * _qstring_range = 0;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::remrange((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (char*) QtSupport::toCharString(env, range, &_qstring_range));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_remword__Ljava_lang_String_2I(JNIEnv *env, jclass obj, jstring text, jint pos)
{
	QString  _qstring;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::remword((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (uint) pos);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_remword__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring text, jstring word)
{
	QString  _qstring;
static QString * _qstring_word = 0;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::remword((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QString&) * (QString *) QtSupport::toQString(env, word, &_qstring_word));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_capwords__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring text)
{
	QString  _qstring;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::capwords((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KStringHandler_capwords___3Ljava_lang_String_2(JNIEnv *env, jclass obj, jobjectArray list)
{
	QStringList  _qlist;
static QStringList * _qlist_list = 0;
	_qlist = KStringHandler::capwords((QStringList&) * (QStringList *) QtSupport::toQStringList(env, list, &_qlist_list));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_reverse__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring text)
{
	QString  _qstring;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::reverse((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KStringHandler_reverse___3Ljava_lang_String_2(JNIEnv *env, jclass obj, jobjectArray list)
{
	QStringList  _qlist;
static QStringList * _qlist_list = 0;
	_qlist = KStringHandler::reverse((QStringList&) * (QStringList *) QtSupport::toQStringList(env, list, &_qlist_list));
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_ljust(JNIEnv *env, jclass obj, jstring text, jint width)
{
	QString  _qstring;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::ljust((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (uint) width);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_rjust(JNIEnv *env, jclass obj, jstring text, jint width)
{
	QString  _qstring;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::rjust((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (uint) width);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_center(JNIEnv *env, jclass obj, jstring text, jint width)
{
	QString  _qstring;
static QString * _qstring_text = 0;
	_qstring = KStringHandler::center((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (uint) width);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_lsqueeze__Ljava_lang_String_2I(JNIEnv *env, jclass obj, jstring str, jint maxlen)
{
	QString  _qstring;
static QString * _qstring_str = 0;
	_qstring = KStringHandler::lsqueeze((QString&) * (QString *) QtSupport::toQString(env, str, &_qstring_str), (uint) maxlen);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_lsqueeze__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring str)
{
static QString * _qstring_str = 0;
	QString _qstring;
	_qstring = KStringHandler::lsqueeze((QString&) * (QString *) QtSupport::toQString(env, str, &_qstring_str), 40);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_csqueeze__Ljava_lang_String_2I(JNIEnv *env, jclass obj, jstring str, jint maxlen)
{
	QString  _qstring;
static QString * _qstring_str = 0;
	_qstring = KStringHandler::csqueeze((QString&) * (QString *) QtSupport::toQString(env, str, &_qstring_str), (uint) maxlen);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_csqueeze__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring str)
{
static QString * _qstring_str = 0;
	QString _qstring;
	_qstring = KStringHandler::csqueeze((QString&) * (QString *) QtSupport::toQString(env, str, &_qstring_str), 40);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_rsqueeze__Ljava_lang_String_2I(JNIEnv *env, jclass obj, jstring str, jint maxlen)
{
	QString  _qstring;
static QString * _qstring_str = 0;
	_qstring = KStringHandler::rsqueeze((QString&) * (QString *) QtSupport::toQString(env, str, &_qstring_str), (uint) maxlen);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KStringHandler_rsqueeze__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring str)
{
static QString * _qstring_str = 0;
	QString _qstring;
	_qstring = KStringHandler::rsqueeze((QString&) * (QString *) QtSupport::toQString(env, str, &_qstring_str), 40);
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KStringHandler_matchFileName(JNIEnv *env, jclass obj, jstring filename, jstring pattern)
{
static QString * _qstring_pattern = 0;
static QString * _qstring_filename = 0;
	return (jboolean) KStringHandler::matchFileName((QString&) * (QString *) QtSupport::toQString(env, filename, &_qstring_filename), (QString&) * (QString *) QtSupport::toQString(env, pattern, &_qstring_pattern));
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KStringHandler_perlSplit__Ljava_lang_String_2Ljava_lang_String_2I(JNIEnv *env, jclass obj, jstring sep, jstring s, jint max)
{
	QStringList  _qlist;
static QString * _qstring_s = 0;
static QString * _qstring_sep = 0;
	_qlist = KStringHandler::perlSplit((QString&) * (QString *) QtSupport::toQString(env, sep, &_qstring_sep), (QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s), (uint) max);
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KStringHandler_perlSplit__CLjava_lang_String_2I(JNIEnv *env, jclass obj, jchar sep, jstring s, jint max)
{
	QStringList  _qlist;
static QString * _qstring_s = 0;
static QChar * _qchar_sep = 0;
	_qlist = KStringHandler::perlSplit((QChar&) * (QChar *) QtSupport::toQChar(env, sep, &_qchar_sep), (QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s), (uint) max);
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KStringHandler_perlSplit__Lorg_kde_qt_QRegExp_2Ljava_lang_String_2I(JNIEnv *env, jclass obj, jobject sep, jstring s, jint max)
{
	QStringList  _qlist;
static QString * _qstring_s = 0;
	_qlist = KStringHandler::perlSplit((QRegExp&) *(QRegExp *) QtSupport::getQt(env, sep), (QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s), (uint) max);
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

