/***************************************************************************
                            qt_QSocketDevice.cpp -  description
                             -------------------
    begin                : Tue Nov 20 20:51:20 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Tue Nov 20 20:51:20 2001, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

extern "C" {
#include "qt_QSocketDevice.h"
}

#include <qsocketdevice.h>

class QSocketDeviceBridge : public QSocketDevice
{
public:
	QSocketDeviceBridge(Type type) : QSocketDevice(type) {}
	QSocketDeviceBridge(int socket, Type type) : QSocketDevice(socket, type) {}
	~QSocketDeviceBridge() {}
	void protected_setError(Error err) {
		QSocketDevice::setError(err);
		return;
	}
};

qt_QSocketDevice * qt_new_QSocketDevice(int type){
	return (qt_QSocketDevice *) new QSocketDeviceBridge((QSocketDevice::Type)type);
}
qt_QSocketDevice * qt_new_QSocketDevice1(int socket, int type){
	return (qt_QSocketDevice *) new QSocketDeviceBridge((int)socket, (QSocketDevice::Type)type);
}
void qt_del_QSocketDevice( qt_QSocketDevice* p ){
	delete (QSocketDeviceBridge*) p;
}
int qt_QSocketDevice_isValid( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->isValid();
}
int qt_QSocketDevice_type( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->type();
}
int qt_QSocketDevice_socket( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->socket();
}
void qt_QSocketDevice_setSocket( qt_QSocketDevice* instPointer,int socket, int type){
	((QSocketDeviceBridge*)instPointer)->setSocket((int)socket, (QSocketDevice::Type)type);
	return;
}
int qt_QSocketDevice_open( qt_QSocketDevice* instPointer,int mode){
	return (int) ((QSocketDeviceBridge*)instPointer)->open((int)mode);
}
void qt_QSocketDevice_close( qt_QSocketDevice* instPointer){
	((QSocketDeviceBridge*)instPointer)->close();
	return;
}
void qt_QSocketDevice_flush( qt_QSocketDevice* instPointer){
	((QSocketDeviceBridge*)instPointer)->flush();
	return;
}
int qt_QSocketDevice_size( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->size();
}
int qt_QSocketDevice_at( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->at();
}
int qt_QSocketDevice_at1( qt_QSocketDevice* instPointer,int arg1){
	return (int) ((QSocketDeviceBridge*)instPointer)->at((QSocketDevice::Offset)arg1);
}
int qt_QSocketDevice_atEnd( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->atEnd();
}
int qt_QSocketDevice_blocking( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->blocking();
}
void qt_QSocketDevice_setBlocking( qt_QSocketDevice* instPointer,int arg1){
	((QSocketDeviceBridge*)instPointer)->setBlocking((bool)arg1);
	return;
}
int qt_QSocketDevice_addressReusable( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->addressReusable();
}
void qt_QSocketDevice_setAddressReusable( qt_QSocketDevice* instPointer,int arg1){
	((QSocketDeviceBridge*)instPointer)->setAddressReusable((bool)arg1);
	return;
}
int qt_QSocketDevice_receiveBufferSize( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->receiveBufferSize();
}
void qt_QSocketDevice_setReceiveBufferSize( qt_QSocketDevice* instPointer,unsigned int arg1){
	((QSocketDeviceBridge*)instPointer)->setReceiveBufferSize((uint)arg1);
	return;
}
int qt_QSocketDevice_sendBufferSize( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->sendBufferSize();
}
void qt_QSocketDevice_setSendBufferSize( qt_QSocketDevice* instPointer,unsigned int arg1){
	((QSocketDeviceBridge*)instPointer)->setSendBufferSize((uint)arg1);
	return;
}
int qt_QSocketDevice_connect( qt_QSocketDevice* instPointer,qt_QHostAddress* arg1, unsigned short arg2){
	return (int) ((QSocketDeviceBridge*)instPointer)->connect((QHostAddress&)* (QHostAddress*)arg1, (Q_UINT16)arg2);
}
int qt_QSocketDevice_bind( qt_QSocketDevice* instPointer,qt_QHostAddress* arg1, unsigned short arg2){
	return (int) ((QSocketDeviceBridge*)instPointer)->bind((QHostAddress&)* (QHostAddress*)arg1, (Q_UINT16)arg2);
}
int qt_QSocketDevice_listen( qt_QSocketDevice* instPointer,int backlog){
	return (int) ((QSocketDeviceBridge*)instPointer)->listen((int)backlog);
}
int qt_QSocketDevice_accept( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->accept();
}
long qt_QSocketDevice_bytesAvailable( qt_QSocketDevice* instPointer){
	return (long) ((QSocketDeviceBridge*)instPointer)->bytesAvailable();
}
long qt_QSocketDevice_waitForMore( qt_QSocketDevice* instPointer,int msecs, int* timeout){
	return (long) ((QSocketDeviceBridge*)instPointer)->waitForMore((int)msecs, (bool*)timeout);
}
long qt_QSocketDevice_readBlock( qt_QSocketDevice* instPointer,char* data, long maxlen){
	return (long) ((QSocketDeviceBridge*)instPointer)->readBlock((char*)data, (Q_ULONG)maxlen);
}
long qt_QSocketDevice_writeBlock( qt_QSocketDevice* instPointer,char* data, long len){
	return (long) ((QSocketDeviceBridge*)instPointer)->writeBlock((char*)data, (Q_ULONG)len);
}
long qt_QSocketDevice_writeBlock1( qt_QSocketDevice* instPointer,char* data, long len, qt_QHostAddress* host, unsigned short port){
	return (long) ((QSocketDeviceBridge*)instPointer)->writeBlock((char*)data, (Q_ULONG)len, (QHostAddress&)* (QHostAddress*)host, (Q_UINT16)port);
}
int qt_QSocketDevice_getch( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->getch();
}
int qt_QSocketDevice_putch( qt_QSocketDevice* instPointer,int arg1){
	return (int) ((QSocketDeviceBridge*)instPointer)->putch((int)arg1);
}
int qt_QSocketDevice_ungetch( qt_QSocketDevice* instPointer,int arg1){
	return (int) ((QSocketDeviceBridge*)instPointer)->ungetch((int)arg1);
}
unsigned short qt_QSocketDevice_port( qt_QSocketDevice* instPointer){
	return (unsigned short) ((QSocketDeviceBridge*)instPointer)->port();
}
unsigned short qt_QSocketDevice_peerPort( qt_QSocketDevice* instPointer){
	return (unsigned short) ((QSocketDeviceBridge*)instPointer)->peerPort();
}
qt_QHostAddress* qt_QSocketDevice_address( qt_QSocketDevice* instPointer){
	return (qt_QHostAddress*)new QHostAddress(((QSocketDeviceBridge*)instPointer)->address());
}
qt_QHostAddress* qt_QSocketDevice_peerAddress( qt_QSocketDevice* instPointer){
	return (qt_QHostAddress*)new QHostAddress(((QSocketDeviceBridge*)instPointer)->peerAddress());
}
int qt_QSocketDevice_error( qt_QSocketDevice* instPointer){
	return (int) ((QSocketDeviceBridge*)instPointer)->error();
}
void qt_QSocketDevice_setError( qt_QSocketDevice* instPointer,int err){
	((QSocketDeviceBridge*)instPointer)->protected_setError((QSocketDevice::Error)err);
	return;
}
