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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KFilterBase_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj) && ((KFilterBase*)QtSupport::getQt(env, obj))->parent() == (QObject *) 0) {
		delete (KFilterBase*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFilterBase_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KFilterBase_finalize(env, obj);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFilterBase_isDisposed(JNIEnv *env, jobject obj)
{
	return (QtSupport::getQt(env, obj) == 0);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFilterBase_setDevice__Lorg_kde_qt_QIODeviceInterface_2Z(JNIEnv *env, jobject obj, jobject dev, jboolean autodelete)
{
	((KFilterBase*) QtSupport::getQt(env, obj))->setDevice((QIODevice*) QtSupport::getQt(env, dev), (bool) autodelete);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFilterBase_setDevice__Lorg_kde_qt_QIODeviceInterface_2(JNIEnv *env, jobject obj, jobject dev)
{
	((KFilterBase*) QtSupport::getQt(env, obj))->setDevice((QIODevice*) QtSupport::getQt(env, dev), false);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KFilterBase_device(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KFilterBase*) QtSupport::getQt(env, obj))->device(), "org.kde.qt.QIODeviceInterface");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFilterBase_init(JNIEnv *env, jobject obj, jint mode)
{
	((KFilterBase*) QtSupport::getQt(env, obj))->init((int) mode);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KFilterBase_mode(JNIEnv *env, jobject obj)
{
	return (jint) ((KFilterBase*) QtSupport::getQt(env, obj))->mode();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFilterBase_terminate(JNIEnv *env, jobject obj)
{
	((KFilterBase*) QtSupport::getQt(env, obj))->terminate();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFilterBase_reset(JNIEnv *env, jobject obj)
{
	((KFilterBase*) QtSupport::getQt(env, obj))->reset();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFilterBase_readHeader(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KFilterBase*) QtSupport::getQt(env, obj))->readHeader();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFilterBase_writeHeader(JNIEnv *env, jobject obj, jstring filename)
{
static QCString * _qcstring_filename = 0;
	return (jboolean) ((KFilterBase*) QtSupport::getQt(env, obj))->writeHeader((QCString&) * (QCString *) QtSupport::toQCString(env, filename, &_qcstring_filename));
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFilterBase_setOutBuffer(JNIEnv *env, jobject obj, jstring data, jint maxlen)
{
static QCString * _qstring_data = 0;
	((KFilterBase*) QtSupport::getQt(env, obj))->setOutBuffer((char*) QtSupport::toCharString(env, data, &_qstring_data), (uint) maxlen);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KFilterBase_setInBuffer(JNIEnv *env, jobject obj, jstring data, jint size)
{
static QCString * _qstring_data = 0;
	((KFilterBase*) QtSupport::getQt(env, obj))->setInBuffer((char*) QtSupport::toCharString(env, data, &_qstring_data), (uint) size);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFilterBase_inBufferEmpty(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KFilterBase*) QtSupport::getQt(env, obj))->inBufferEmpty();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KFilterBase_inBufferAvailable(JNIEnv *env, jobject obj)
{
	return (jint) ((KFilterBase*) QtSupport::getQt(env, obj))->inBufferAvailable();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KFilterBase_outBufferFull(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KFilterBase*) QtSupport::getQt(env, obj))->outBufferFull();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KFilterBase_outBufferAvailable(JNIEnv *env, jobject obj)
{
	return (jint) ((KFilterBase*) QtSupport::getQt(env, obj))->outBufferAvailable();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KFilterBase_uncompress(JNIEnv *env, jobject obj)
{
	return (jint) ((KFilterBase*) QtSupport::getQt(env, obj))->uncompress();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KFilterBase_compress(JNIEnv *env, jobject obj, jboolean finish)
{
	return (jint) ((KFilterBase*) QtSupport::getQt(env, obj))->compress((bool) finish);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KFilterBase_findFilterByFileName(JNIEnv *env, jclass obj, jstring fileName)
{
static QString * _qstring_fileName = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)KFilterBase::findFilterByFileName((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName)), "org.kde.koala.KFilterBase");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KFilterBase_findFilterByMimeType(JNIEnv *env, jclass obj, jstring mimeType)
{
static QString * _qstring_mimeType = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)KFilterBase::findFilterByMimeType((QString&) * (QString *) QtSupport::toQString(env, mimeType, &_qstring_mimeType)), "org.kde.koala.KFilterBase");
}

