//Auto-generated by kalyptus. DO NOT EDIT.
#include <tqglobal.h>
#include <tqbuffer.h>
#include <tqiodevice.h>
#include <tqcstring.h>

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

class TQBufferJBridge : public TQBuffer
{
public:
	TQBufferJBridge() : TQBuffer() {};
	TQBufferJBridge(TQByteArray arg1) : TQBuffer(arg1) {};
	~TQBufferJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jlong JNICALL
Java_org_trinitydesktop_qt_QBuffer_at__(JNIEnv* env, jobject obj)
{
	jlong xret = (jlong) ((TQBuffer*) QtSupport::getQt(env, obj))->at();
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_trinitydesktop_qt_QBuffer_at__J(JNIEnv* env, jobject obj, jlong arg1)
{
	jboolean xret = (jboolean) ((TQBuffer*) QtSupport::getQt(env, obj))->at((TQIODevice::Offset) arg1);
	return xret;
}

JNIEXPORT jbyteArray JNICALL
Java_org_trinitydesktop_qt_QBuffer_buffer(JNIEnv* env, jobject obj)
{
	TQByteArray _qbyteArray;
	_qbyteArray = ((TQBuffer*) QtSupport::getQt(env, obj))->buffer();
	return QtSupport::fromTQByteArray(env, &_qbyteArray);
}

JNIEXPORT void JNICALL
Java_org_trinitydesktop_qt_QBuffer_close(JNIEnv* env, jobject obj)
{
	((TQBuffer*) QtSupport::getQt(env, obj))->close();
	return;
}

JNIEXPORT void JNICALL
Java_org_trinitydesktop_qt_QBuffer_dispose(JNIEnv* env, jobject obj)
{
	Java_org_trinitydesktop_qt_QBuffer_finalize(env, obj);
	return;
}

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

JNIEXPORT void JNICALL
Java_org_trinitydesktop_qt_QBuffer_flush(JNIEnv* env, jobject obj)
{
	((TQBuffer*) QtSupport::getQt(env, obj))->flush();
	return;
}

JNIEXPORT jint JNICALL
Java_org_trinitydesktop_qt_QBuffer_getch(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((TQBuffer*) QtSupport::getQt(env, obj))->getch();
	return xret;
}

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

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

JNIEXPORT void JNICALL
Java_org_trinitydesktop_qt_QBuffer_newTQBuffer___3B(JNIEnv* env, jobject obj, jbyteArray arg1)
{
static TQByteArray* _qbyteArray_arg1 = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new TQBufferJBridge((TQByteArray)*(TQByteArray*) QtSupport::toTQByteArray(env, arg1, &_qbyteArray_arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_trinitydesktop_qt_QBuffer_open(JNIEnv* env, jobject obj, jint arg1)
{
	jboolean xret = (jboolean) ((TQBuffer*) QtSupport::getQt(env, obj))->open((int) arg1);
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_trinitydesktop_qt_QBuffer_putch(JNIEnv* env, jobject obj, jint arg1)
{
	jint xret = (jint) ((TQBuffer*) QtSupport::getQt(env, obj))->putch((int) arg1);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_trinitydesktop_qt_QBuffer_readBlock(JNIEnv* env, jobject obj, jobject p, jlong arg2)
{
static TQCString* _qstring_p = 0;
	if (_qstring_p == 0) { _qstring_p = new TQCString(); }
	_qstring_p->resize((uint) arg2);
	jlong xret = (jlong) ((TQBuffer*) QtSupport::getQt(env, obj))->readBlock((char*) _qstring_p->data(), (TQ_ULONG) arg2);
	QtSupport::fromTQCStringToStringBuffer(env, _qstring_p, p);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_trinitydesktop_qt_QBuffer_readLine(JNIEnv* env, jobject obj, jstring p, jlong arg2)
{
static TQCString* _qstring_p = 0;
	jlong xret = (jlong) ((TQBuffer*) QtSupport::getQt(env, obj))->readLine((char*) QtSupport::toCharString(env, p, &_qstring_p), (TQ_ULONG) arg2);
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_trinitydesktop_qt_QBuffer_setBuffer(JNIEnv* env, jobject obj, jbyteArray arg1)
{
static TQByteArray* _qbyteArray_arg1 = 0;
	jboolean xret = (jboolean) ((TQBuffer*) QtSupport::getQt(env, obj))->setBuffer((TQByteArray)*(TQByteArray*) QtSupport::toTQByteArray(env, arg1, &_qbyteArray_arg1));
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_trinitydesktop_qt_QBuffer_size(JNIEnv* env, jobject obj)
{
	jlong xret = (jlong) ((TQBuffer*) QtSupport::getQt(env, obj))->size();
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_trinitydesktop_qt_QBuffer_ungetch(JNIEnv* env, jobject obj, jint arg1)
{
	jint xret = (jint) ((TQBuffer*) QtSupport::getQt(env, obj))->ungetch((int) arg1);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_trinitydesktop_qt_QBuffer_writeBlock__Ljava_lang_String_2J(JNIEnv* env, jobject obj, jstring p, jlong arg2)
{
static TQCString* _qstring_p = 0;
	jlong xret = (jlong) ((TQBuffer*) QtSupport::getQt(env, obj))->writeBlock((const char*) QtSupport::toCharString(env, p, &_qstring_p), (TQ_ULONG) arg2);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_trinitydesktop_qt_QBuffer_writeBlock___3B(JNIEnv* env, jobject obj, jbyteArray data)
{
static TQByteArray* _qbyteArray_data = 0;
	jlong xret = (jlong) ((TQBuffer*) QtSupport::getQt(env, obj))->writeBlock((const TQByteArray&)*(TQByteArray*) QtSupport::toTQByteArray(env, data, &_qbyteArray_data));
	return xret;
}

