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

class x_QSocketDevice : public QSocketDevice {
public:
    static void x_0(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::Stream;
    }
    static void x_1(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::Datagram;
    }
    static void x_2(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::NoError;
    }
    static void x_3(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::AlreadyBound;
    }
    static void x_4(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::Inaccessible;
    }
    static void x_5(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::NoResources;
    }
    static void x_6(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::InternalError;
    }
    static void x_7(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::Bug;
    }
    static void x_8(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::Impossible;
    }
    static void x_9(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::NoFiles;
    }
    static void x_10(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::ConnectionRefused;
    }
    static void x_11(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::NetworkFailure;
    }
    static void x_12(Smoke::Stack x) {
	x[0].s_enum = (long)QSocketDevice::UnknownError;
    }
    static void x_13(Smoke::Stack x) {
	// QSocketDevice(QSocketDevice::Type)
	x_QSocketDevice* xret = new x_QSocketDevice((QSocketDevice::Type)x[1].s_enum);
	x[0].s_class = (void*)xret;
    }
    x_QSocketDevice(QSocketDevice::Type x1) : QSocketDevice(x1) {
    }
    static void x_14(Smoke::Stack x) {
	// QSocketDevice()
	x_QSocketDevice* xret = new x_QSocketDevice();
	x[0].s_class = (void*)xret;
    }
    x_QSocketDevice() : QSocketDevice() {
    }
    static void x_15(Smoke::Stack x) {
	// QSocketDevice(int, QSocketDevice::Type)
	x_QSocketDevice* xret = new x_QSocketDevice((int)x[1].s_int,(QSocketDevice::Type)x[2].s_enum);
	x[0].s_class = (void*)xret;
    }
    x_QSocketDevice(int x1, QSocketDevice::Type x2) : QSocketDevice(x1, x2) {
    }
    void x_16(Smoke::Stack x) const {
	// isValid()
	bool xret = this->QSocketDevice::isValid();
	x[0].s_bool = xret;
    }
    void x_17(Smoke::Stack x) const {
	// type()
	QSocketDevice::Type xret = this->QSocketDevice::type();
	x[0].s_enum = xret;
    }
    void x_18(Smoke::Stack x) const {
	// socket()
	int xret = this->QSocketDevice::socket();
	x[0].s_int = xret;
    }
    void x_19(Smoke::Stack x) {
	// setSocket(int, QSocketDevice::Type)
	this->QSocketDevice::setSocket((int)x[1].s_int,(QSocketDevice::Type)x[2].s_enum);
	(void)x; // noop (for compiler warning)
    }
    void x_20(Smoke::Stack x) {
	// open(int)
	bool xret = this->QSocketDevice::open((int)x[1].s_int);
	x[0].s_bool = xret;
    }
    void x_21(Smoke::Stack x) {
	// close()
	this->QSocketDevice::close();
	(void)x; // noop (for compiler warning)
    }
    void x_22(Smoke::Stack x) {
	// flush()
	this->QSocketDevice::flush();
	(void)x; // noop (for compiler warning)
    }
    void x_23(Smoke::Stack x) const {
	// size()
	QIODevice::Offset xret = this->QSocketDevice::size();
	x[0].s_ulong = xret;
    }
    void x_24(Smoke::Stack x) const {
	// at()
	QIODevice::Offset xret = this->QSocketDevice::at();
	x[0].s_ulong = xret;
    }
    void x_25(Smoke::Stack x) {
	// at(QIODevice::Offset)
	bool xret = this->QSocketDevice::at((QIODevice::Offset)x[1].s_ulong);
	x[0].s_bool = xret;
    }
    void x_26(Smoke::Stack x) const {
	// atEnd()
	bool xret = this->QSocketDevice::atEnd();
	x[0].s_bool = xret;
    }
    void x_27(Smoke::Stack x) const {
	// blocking()
	bool xret = this->QSocketDevice::blocking();
	x[0].s_bool = xret;
    }
    void x_28(Smoke::Stack x) {
	// setBlocking(bool)
	this->QSocketDevice::setBlocking((bool)x[1].s_bool);
	(void)x; // noop (for compiler warning)
    }
    void x_29(Smoke::Stack x) const {
	// addressReusable()
	bool xret = this->QSocketDevice::addressReusable();
	x[0].s_bool = xret;
    }
    void x_30(Smoke::Stack x) {
	// setAddressReusable(bool)
	this->QSocketDevice::setAddressReusable((bool)x[1].s_bool);
	(void)x; // noop (for compiler warning)
    }
    void x_31(Smoke::Stack x) const {
	// receiveBufferSize()
	int xret = this->QSocketDevice::receiveBufferSize();
	x[0].s_int = xret;
    }
    void x_32(Smoke::Stack x) {
	// setReceiveBufferSize(uint)
	this->QSocketDevice::setReceiveBufferSize((uint)x[1].s_uint);
	(void)x; // noop (for compiler warning)
    }
    void x_33(Smoke::Stack x) const {
	// sendBufferSize()
	int xret = this->QSocketDevice::sendBufferSize();
	x[0].s_int = xret;
    }
    void x_34(Smoke::Stack x) {
	// setSendBufferSize(uint)
	this->QSocketDevice::setSendBufferSize((uint)x[1].s_uint);
	(void)x; // noop (for compiler warning)
    }
    void x_35(Smoke::Stack x) {
	// connect(const QHostAddress&, Q_UINT16)
	bool xret = this->QSocketDevice::connect(*(const QHostAddress *)x[1].s_class,(Q_UINT16)x[2].s_ushort);
	x[0].s_bool = xret;
    }
    void x_36(Smoke::Stack x) {
	// bind(const QHostAddress&, Q_UINT16)
	bool xret = this->QSocketDevice::bind(*(const QHostAddress *)x[1].s_class,(Q_UINT16)x[2].s_ushort);
	x[0].s_bool = xret;
    }
    void x_37(Smoke::Stack x) {
	// listen(int)
	bool xret = this->QSocketDevice::listen((int)x[1].s_int);
	x[0].s_bool = xret;
    }
    void x_38(Smoke::Stack x) {
	// accept()
	int xret = this->QSocketDevice::accept();
	x[0].s_int = xret;
    }
    void x_39(Smoke::Stack x) const {
	// bytesAvailable()
	Q_LONG xret = this->QSocketDevice::bytesAvailable();
	x[0].s_long = xret;
    }
    void x_40(Smoke::Stack x) const {
	// waitForMore(int, bool*)
	Q_LONG xret = this->QSocketDevice::waitForMore((int)x[1].s_int,(bool*)x[2].s_voidp);
	x[0].s_long = xret;
    }
    void x_41(Smoke::Stack x) const {
	// waitForMore(int)
	Q_LONG xret = this->QSocketDevice::waitForMore((int)x[1].s_int);
	x[0].s_long = xret;
    }
    void x_42(Smoke::Stack x) {
	// readBlock(char*, Q_ULONG)
	Q_LONG xret = this->QSocketDevice::readBlock((char*)x[1].s_voidp,(Q_ULONG)x[2].s_long);
	x[0].s_long = xret;
    }
    void x_43(Smoke::Stack x) {
	// writeBlock(const char*, Q_ULONG)
	Q_LONG xret = this->QSocketDevice::writeBlock((const char*)x[1].s_voidp,(Q_ULONG)x[2].s_long);
	x[0].s_long = xret;
    }
    void x_44(Smoke::Stack x) {
	// writeBlock(const char*, Q_ULONG, const QHostAddress&, Q_UINT16)
	Q_LONG xret = this->QSocketDevice::writeBlock((const char*)x[1].s_voidp,(Q_ULONG)x[2].s_long,*(const QHostAddress *)x[3].s_class,(Q_UINT16)x[4].s_ushort);
	x[0].s_long = xret;
    }
    void x_45(Smoke::Stack x) {
	// getch()
	int xret = this->QSocketDevice::getch();
	x[0].s_int = xret;
    }
    void x_46(Smoke::Stack x) {
	// putch(int)
	int xret = this->QSocketDevice::putch((int)x[1].s_int);
	x[0].s_int = xret;
    }
    void x_47(Smoke::Stack x) {
	// ungetch(int)
	int xret = this->QSocketDevice::ungetch((int)x[1].s_int);
	x[0].s_int = xret;
    }
    void x_48(Smoke::Stack x) const {
	// port()
	Q_UINT16 xret = this->QSocketDevice::port();
	x[0].s_ushort = xret;
    }
    void x_49(Smoke::Stack x) const {
	// peerPort()
	Q_UINT16 xret = this->QSocketDevice::peerPort();
	x[0].s_ushort = xret;
    }
    void x_50(Smoke::Stack x) const {
	// address()
	QHostAddress xret = this->QSocketDevice::address();
	x[0].s_class = (void*)new QHostAddress(xret);
    }
    void x_51(Smoke::Stack x) const {
	// peerAddress()
	QHostAddress xret = this->QSocketDevice::peerAddress();
	x[0].s_class = (void*)new QHostAddress(xret);
    }
    void x_52(Smoke::Stack x) const {
	// error()
	QSocketDevice::Error xret = this->QSocketDevice::error();
	x[0].s_enum = xret;
    }
    void x_53(Smoke::Stack x) {
	// setError(QSocketDevice::Error)
	this->QSocketDevice::setError((QSocketDevice::Error)x[1].s_enum);
	(void)x; // noop (for compiler warning)
    }
    virtual int accept() {
	Smoke::StackItem x[1];
	if(qt_Smoke->binding->callMethod(8615, (void*)this, x)) return (int)x[0].s_int;
	return this->QSocketDevice::accept();
    }
    virtual QIODevice::Offset at() const {
	Smoke::StackItem x[1];
	if(qt_Smoke->binding->callMethod(8601, (void*)this, x)) {
	    QIODevice::Offset *xptr = (QIODevice::Offset *)x[0].s_class;
	    QIODevice::Offset xret(*xptr);
	    delete xptr;
	    return xret;
	}
	return this->QSocketDevice::at();
    }
    virtual bool at(QIODevice::Offset x1) {
	Smoke::StackItem x[2];
	x[1].s_ulong = x1;
	if(qt_Smoke->binding->callMethod(8602, (void*)this, x)) return (bool)x[0].s_bool;
	return this->QSocketDevice::at(x1);
    }
    virtual bool atEnd() const {
	Smoke::StackItem x[1];
	if(qt_Smoke->binding->callMethod(8603, (void*)this, x)) return (bool)x[0].s_bool;
	return this->QSocketDevice::atEnd();
    }
    virtual bool bind(const QHostAddress& x1, Q_UINT16 x2) {
	Smoke::StackItem x[3];
	x[1].s_class = (void*)&x1;
	x[2].s_ushort = x2;
	if(qt_Smoke->binding->callMethod(8613, (void*)this, x)) return (bool)x[0].s_bool;
	return this->QSocketDevice::bind(x1, x2);
    }
    virtual void close() {
	Smoke::StackItem x[1];
	if(qt_Smoke->binding->callMethod(8598, (void*)this, x)) return;
	this->QSocketDevice::close();
    }
    virtual bool connect(const QHostAddress& x1, Q_UINT16 x2) {
	Smoke::StackItem x[3];
	x[1].s_class = (void*)&x1;
	x[2].s_ushort = x2;
	if(qt_Smoke->binding->callMethod(8612, (void*)this, x)) return (bool)x[0].s_bool;
	return this->QSocketDevice::connect(x1, x2);
    }
    virtual void flush() {
	Smoke::StackItem x[1];
	if(qt_Smoke->binding->callMethod(8599, (void*)this, x)) return;
	this->QSocketDevice::flush();
    }
    virtual int getch() {
	Smoke::StackItem x[1];
	if(qt_Smoke->binding->callMethod(8622, (void*)this, x)) return (int)x[0].s_int;
	return this->QSocketDevice::getch();
    }
    virtual bool listen(int x1) {
	Smoke::StackItem x[2];
	x[1].s_int = x1;
	if(qt_Smoke->binding->callMethod(8614, (void*)this, x)) return (bool)x[0].s_bool;
	return this->QSocketDevice::listen(x1);
    }
    virtual bool open(int x1) {
	Smoke::StackItem x[2];
	x[1].s_int = x1;
	if(qt_Smoke->binding->callMethod(8597, (void*)this, x)) return (bool)x[0].s_bool;
	return this->QSocketDevice::open(x1);
    }
    virtual int putch(int x1) {
	Smoke::StackItem x[2];
	x[1].s_int = x1;
	if(qt_Smoke->binding->callMethod(8623, (void*)this, x)) return (int)x[0].s_int;
	return this->QSocketDevice::putch(x1);
    }
    virtual QByteArray readAll() {
	Smoke::StackItem x[1];
	if(qt_Smoke->binding->callMethod(4366, (void*)this, x)) {
	    QByteArray *xptr = (QByteArray *)x[0].s_class;
	    QByteArray xret(*xptr);
	    delete xptr;
	    return xret;
	}
	return this->QIODevice::readAll();
    }
    virtual Q_LONG readBlock(char* x1, Q_ULONG x2) {
	Smoke::StackItem x[3];
	x[1].s_voidp = (void*)x1;
	x[2].s_long = x2;
	if(qt_Smoke->binding->callMethod(8619, (void*)this, x)) {
	    Q_LONG *xptr = (Q_LONG *)x[0].s_class;
	    Q_LONG xret(*xptr);
	    delete xptr;
	    return xret;
	}
	return this->QSocketDevice::readBlock(x1, x2);
    }
    virtual Q_LONG readLine(char* x1, Q_ULONG x2) {
	Smoke::StackItem x[3];
	x[1].s_voidp = (void*)x1;
	x[2].s_long = x2;
	if(qt_Smoke->binding->callMethod(4364, (void*)this, x)) {
	    Q_LONG *xptr = (Q_LONG *)x[0].s_class;
	    Q_LONG xret(*xptr);
	    delete xptr;
	    return xret;
	}
	return this->QIODevice::readLine(x1, x2);
    }
    virtual void setAddressReusable(bool x1) {
	Smoke::StackItem x[2];
	x[1].s_bool = x1;
	if(qt_Smoke->binding->callMethod(8607, (void*)this, x)) return;
	this->QSocketDevice::setAddressReusable(x1);
    }
    virtual void setBlocking(bool x1) {
	Smoke::StackItem x[2];
	x[1].s_bool = x1;
	if(qt_Smoke->binding->callMethod(8605, (void*)this, x)) return;
	this->QSocketDevice::setBlocking(x1);
    }
    virtual void setReceiveBufferSize(uint x1) {
	Smoke::StackItem x[2];
	x[1].s_uint = x1;
	if(qt_Smoke->binding->callMethod(8609, (void*)this, x)) return;
	this->QSocketDevice::setReceiveBufferSize(x1);
    }
    virtual void setSendBufferSize(uint x1) {
	Smoke::StackItem x[2];
	x[1].s_uint = x1;
	if(qt_Smoke->binding->callMethod(8611, (void*)this, x)) return;
	this->QSocketDevice::setSendBufferSize(x1);
    }
    virtual void setSocket(int x1, QSocketDevice::Type x2) {
	Smoke::StackItem x[3];
	x[1].s_int = x1;
	x[2].s_enum = x2;
	if(qt_Smoke->binding->callMethod(8596, (void*)this, x)) return;
	this->QSocketDevice::setSocket(x1, x2);
    }
    virtual QIODevice::Offset size() const {
	Smoke::StackItem x[1];
	if(qt_Smoke->binding->callMethod(8600, (void*)this, x)) {
	    QIODevice::Offset *xptr = (QIODevice::Offset *)x[0].s_class;
	    QIODevice::Offset xret(*xptr);
	    delete xptr;
	    return xret;
	}
	return this->QSocketDevice::size();
    }
    virtual int ungetch(int x1) {
	Smoke::StackItem x[2];
	x[1].s_int = x1;
	if(qt_Smoke->binding->callMethod(8624, (void*)this, x)) return (int)x[0].s_int;
	return this->QSocketDevice::ungetch(x1);
    }
    virtual Q_LONG writeBlock(const char* x1, Q_ULONG x2) {
	Smoke::StackItem x[3];
	x[1].s_voidp = (void*)x1;
	x[2].s_long = x2;
	if(qt_Smoke->binding->callMethod(8620, (void*)this, x)) {
	    Q_LONG *xptr = (Q_LONG *)x[0].s_class;
	    Q_LONG xret(*xptr);
	    delete xptr;
	    return xret;
	}
	return this->QSocketDevice::writeBlock(x1, x2);
    }
    virtual Q_LONG writeBlock(const char* x1, Q_ULONG x2, const QHostAddress& x3, Q_UINT16 x4) {
	Smoke::StackItem x[5];
	x[1].s_voidp = (void*)x1;
	x[2].s_long = x2;
	x[3].s_class = (void*)&x3;
	x[4].s_ushort = x4;
	if(qt_Smoke->binding->callMethod(8621, (void*)this, x)) {
	    Q_LONG *xptr = (Q_LONG *)x[0].s_class;
	    Q_LONG xret(*xptr);
	    delete xptr;
	    return xret;
	}
	return this->QSocketDevice::writeBlock(x1, x2, x3, x4);
    }
    static void xenum_operation(Smoke::EnumOperation xop, Smoke::Index xtype, void *&xdata, long &xvalue) {
	switch(xtype) {
	  case 536: //QSocketDevice::Type
	    switch(xop) {
	      case Smoke::EnumNew:
		xdata = (void*)new QSocketDevice::Type;
		break;
	      case Smoke::EnumDelete:
		delete (QSocketDevice::Type*)xdata;
		break;
	      case Smoke::EnumFromLong:
		*(QSocketDevice::Type*)xdata = (QSocketDevice::Type)xvalue;
		break;
	      case Smoke::EnumToLong:
		xvalue = (long)*(QSocketDevice::Type*)xdata;
		break;
	    }
	    break;
	  case 534: //QSocketDevice::Error
	    switch(xop) {
	      case Smoke::EnumNew:
		xdata = (void*)new QSocketDevice::Error;
		break;
	      case Smoke::EnumDelete:
		delete (QSocketDevice::Error*)xdata;
		break;
	      case Smoke::EnumFromLong:
		*(QSocketDevice::Error*)xdata = (QSocketDevice::Error)xvalue;
		break;
	      case Smoke::EnumToLong:
		xvalue = (long)*(QSocketDevice::Error*)xdata;
		break;
	    }
	    break;
	}
    }
    ~x_QSocketDevice() { qt_Smoke->binding->deleted(270, (void*)this); }
};
void xenum_QSocketDevice(Smoke::EnumOperation xop, Smoke::Index xtype, void *&xdata, long &xvalue) {
    x_QSocketDevice::xenum_operation(xop, xtype, xdata, xvalue);
}
void xcall_QSocketDevice(Smoke::Index xi, void *obj, Smoke::Stack args) {
    x_QSocketDevice *xself = (x_QSocketDevice*)obj;
    switch(xi) {
	case 0: x_QSocketDevice::x_0(args);	break;
	case 1: x_QSocketDevice::x_1(args);	break;
	case 2: x_QSocketDevice::x_2(args);	break;
	case 3: x_QSocketDevice::x_3(args);	break;
	case 4: x_QSocketDevice::x_4(args);	break;
	case 5: x_QSocketDevice::x_5(args);	break;
	case 6: x_QSocketDevice::x_6(args);	break;
	case 7: x_QSocketDevice::x_7(args);	break;
	case 8: x_QSocketDevice::x_8(args);	break;
	case 9: x_QSocketDevice::x_9(args);	break;
	case 10: x_QSocketDevice::x_10(args);	break;
	case 11: x_QSocketDevice::x_11(args);	break;
	case 12: x_QSocketDevice::x_12(args);	break;
	case 13: x_QSocketDevice::x_13(args);	break;
	case 14: x_QSocketDevice::x_14(args);	break;
	case 15: x_QSocketDevice::x_15(args);	break;
	case 16: xself->x_16(args);	break;
	case 17: xself->x_17(args);	break;
	case 18: xself->x_18(args);	break;
	case 19: xself->x_19(args);	break;
	case 20: xself->x_20(args);	break;
	case 21: xself->x_21(args);	break;
	case 22: xself->x_22(args);	break;
	case 23: xself->x_23(args);	break;
	case 24: xself->x_24(args);	break;
	case 25: xself->x_25(args);	break;
	case 26: xself->x_26(args);	break;
	case 27: xself->x_27(args);	break;
	case 28: xself->x_28(args);	break;
	case 29: xself->x_29(args);	break;
	case 30: xself->x_30(args);	break;
	case 31: xself->x_31(args);	break;
	case 32: xself->x_32(args);	break;
	case 33: xself->x_33(args);	break;
	case 34: xself->x_34(args);	break;
	case 35: xself->x_35(args);	break;
	case 36: xself->x_36(args);	break;
	case 37: xself->x_37(args);	break;
	case 38: xself->x_38(args);	break;
	case 39: xself->x_39(args);	break;
	case 40: xself->x_40(args);	break;
	case 41: xself->x_41(args);	break;
	case 42: xself->x_42(args);	break;
	case 43: xself->x_43(args);	break;
	case 44: xself->x_44(args);	break;
	case 45: xself->x_45(args);	break;
	case 46: xself->x_46(args);	break;
	case 47: xself->x_47(args);	break;
	case 48: xself->x_48(args);	break;
	case 49: xself->x_49(args);	break;
	case 50: xself->x_50(args);	break;
	case 51: xself->x_51(args);	break;
	case 52: xself->x_52(args);	break;
	case 53: xself->x_53(args);	break;
	case 54: delete (QSocketDevice*)xself;	break;
    }
}
