//Auto-generated by kalyptus. DO NOT EDIT.
#include <qglobal.h>
#include <qiodevice.h>
#include <qsocketdevice.h>
#include <qhostaddress.h>

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

class QSocketDeviceJBridge : public QSocketDevice
{
public:
	QSocketDeviceJBridge(QSocketDevice::Type arg1) : QSocketDevice(arg1) {};
	QSocketDeviceJBridge() : QSocketDevice() {};
	QSocketDeviceJBridge(QSocketDevice::Type arg1,QSocketDevice::Protocol arg2,int arg3) : QSocketDevice(arg1,arg2,arg3) {};
	QSocketDeviceJBridge(int arg1,QSocketDevice::Type arg2) : QSocketDevice(arg1,arg2) {};
	void protected_setError(QSocketDevice::Error arg1) {
		QSocketDevice::setError(arg1);
		return;
	}
	~QSocketDeviceJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSocketDevice_accept(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QSocketDevice*) QtSupport::getQt(env, obj))->accept();
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSocketDevice_addressReusable(JNIEnv* env, jobject obj)
{
	jboolean xret = (jboolean) ((QSocketDevice*) QtSupport::getQt(env, obj))->addressReusable();
	return xret;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSocketDevice_address(JNIEnv* env, jobject obj)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)new QHostAddress(((QSocketDevice*) QtSupport::getQt(env, obj))->address()), "org.kde.qt.QHostAddress", TRUE);
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSocketDevice_atEnd(JNIEnv* env, jobject obj)
{
	jboolean xret = (jboolean) ((QSocketDevice*) QtSupport::getQt(env, obj))->atEnd();
	return xret;
}

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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSocketDevice_bind(JNIEnv* env, jobject obj, jobject arg1, jshort arg2)
{
	jboolean xret = (jboolean) ((QSocketDevice*) QtSupport::getQt(env, obj))->bind((const QHostAddress&)*(const QHostAddress*) QtSupport::getQt(env, arg1), (Q_UINT16) arg2);
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSocketDevice_blocking(JNIEnv* env, jobject obj)
{
	jboolean xret = (jboolean) ((QSocketDevice*) QtSupport::getQt(env, obj))->blocking();
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QSocketDevice_bytesAvailable(JNIEnv* env, jobject obj)
{
	jlong xret = (jlong) ((QSocketDevice*) QtSupport::getQt(env, obj))->bytesAvailable();
	return xret;
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSocketDevice_connect(JNIEnv* env, jobject obj, jobject arg1, jshort arg2)
{
	jboolean xret = (jboolean) ((QSocketDevice*) QtSupport::getQt(env, obj))->connect((const QHostAddress&)*(const QHostAddress*) QtSupport::getQt(env, arg1), (Q_UINT16) arg2);
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSocketDevice_dispose(JNIEnv* env, jobject obj)
{
	Java_org_kde_qt_QSocketDevice_finalize(env, obj);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSocketDevice_error(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QSocketDevice*) QtSupport::getQt(env, obj))->error();
	return xret;
}

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

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

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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSocketDevice_isValid(JNIEnv* env, jobject obj)
{
	jboolean xret = (jboolean) ((QSocketDevice*) QtSupport::getQt(env, obj))->isValid();
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSocketDevice_listen(JNIEnv* env, jobject obj, jint backlog)
{
	jboolean xret = (jboolean) ((QSocketDevice*) QtSupport::getQt(env, obj))->listen((int) backlog);
	return xret;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QSocketDevice_newQSocketDevice__I(JNIEnv* env, jobject obj, jint type)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSocketDeviceJBridge((QSocketDevice::Type) type));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSocketDevice_newQSocketDevice__II(JNIEnv* env, jobject obj, jint socket, jint type)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSocketDeviceJBridge((int) socket, (QSocketDevice::Type) type));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSocketDevice_newQSocketDevice__III(JNIEnv* env, jobject obj, jint type, jint protocol, jint dummy)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSocketDeviceJBridge((QSocketDevice::Type) type, (QSocketDevice::Protocol) protocol, (int) dummy));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSocketDevice_peerAddress(JNIEnv* env, jobject obj)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)new QHostAddress(((QSocketDevice*) QtSupport::getQt(env, obj))->peerAddress()), "org.kde.qt.QHostAddress", TRUE);
	return xret;
}

JNIEXPORT jshort JNICALL
Java_org_kde_qt_QSocketDevice_peerPort(JNIEnv* env, jobject obj)
{
	jshort xret = (jshort) ((QSocketDevice*) QtSupport::getQt(env, obj))->peerPort();
	return xret;
}

JNIEXPORT jshort JNICALL
Java_org_kde_qt_QSocketDevice_port(JNIEnv* env, jobject obj)
{
	jshort xret = (jshort) ((QSocketDevice*) QtSupport::getQt(env, obj))->port();
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSocketDevice_protocol(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QSocketDevice*) QtSupport::getQt(env, obj))->protocol();
	return xret;
}

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

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QSocketDevice_readBlock(JNIEnv* env, jobject obj, jobject data, jlong maxlen)
{
static QCString* _qstring_data = 0;
	if (_qstring_data == 0) { _qstring_data = new QCString(); }
	_qstring_data->resize((uint) maxlen);
	jlong xret = (jlong) ((QSocketDevice*) QtSupport::getQt(env, obj))->readBlock((char*) _qstring_data->data(), (Q_ULONG) maxlen);
	QtSupport::fromQCStringToStringBuffer(env, _qstring_data, data);
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSocketDevice_receiveBufferSize(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QSocketDevice*) QtSupport::getQt(env, obj))->receiveBufferSize();
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSocketDevice_sendBufferSize(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QSocketDevice*) QtSupport::getQt(env, obj))->sendBufferSize();
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSocketDevice_setAddressReusable(JNIEnv* env, jobject obj, jboolean arg1)
{
	((QSocketDevice*) QtSupport::getQt(env, obj))->setAddressReusable((bool) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSocketDevice_setBlocking(JNIEnv* env, jobject obj, jboolean arg1)
{
	((QSocketDevice*) QtSupport::getQt(env, obj))->setBlocking((bool) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSocketDevice_setError(JNIEnv* env, jobject obj, jint err)
{
	((QSocketDeviceJBridge*) QtSupport::getQt(env, obj))->protected_setError((QSocketDevice::Error) err);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSocketDevice_setReceiveBufferSize(JNIEnv* env, jobject obj, jint arg1)
{
	((QSocketDevice*) QtSupport::getQt(env, obj))->setReceiveBufferSize((uint) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSocketDevice_setSendBufferSize(JNIEnv* env, jobject obj, jint arg1)
{
	((QSocketDevice*) QtSupport::getQt(env, obj))->setSendBufferSize((uint) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSocketDevice_setSocket(JNIEnv* env, jobject obj, jint socket, jint type)
{
	((QSocketDevice*) QtSupport::getQt(env, obj))->setSocket((int) socket, (QSocketDevice::Type) type);
	return;
}

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSocketDevice_socket(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QSocketDevice*) QtSupport::getQt(env, obj))->socket();
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSocketDevice_type(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QSocketDevice*) QtSupport::getQt(env, obj))->type();
	return xret;
}

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

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QSocketDevice_waitForMore__I(JNIEnv* env, jobject obj, jint msecs)
{
	jlong xret = (jlong) ((QSocketDevice*) QtSupport::getQt(env, obj))->waitForMore((int) msecs);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QSocketDevice_waitForMore__I_3Z(JNIEnv* env, jobject obj, jint msecs, jbooleanArray timeout)
{
	bool* _bool_timeout = QtSupport::toBooleanPtr(env, timeout);
	jlong xret = (jlong) ((QSocketDevice*) QtSupport::getQt(env, obj))->waitForMore((int) msecs,  (bool*) _bool_timeout);
	env->SetBooleanArrayRegion(timeout, 0, 1, (jboolean*) _bool_timeout);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QSocketDevice_writeBlock__Ljava_lang_String_2J(JNIEnv* env, jobject obj, jstring data, jlong len)
{
static QCString* _qstring_data = 0;
	jlong xret = (jlong) ((QSocketDevice*) QtSupport::getQt(env, obj))->writeBlock((const char*) QtSupport::toCharString(env, data, &_qstring_data), (Q_ULONG) len);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QSocketDevice_writeBlock__Ljava_lang_String_2JLorg_kde_qt_QHostAddress_2S(JNIEnv* env, jobject obj, jstring data, jlong len, jobject host, jshort port)
{
static QCString* _qstring_data = 0;
	jlong xret = (jlong) ((QSocketDevice*) QtSupport::getQt(env, obj))->writeBlock((const char*) QtSupport::toCharString(env, data, &_qstring_data), (Q_ULONG) len, (const QHostAddress&)*(const QHostAddress*) QtSupport::getQt(env, host), (Q_UINT16) port);
	return xret;
}

