/***************************************************************************
                            qt_QSocket.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_QSocket.h"
}

#include <qsocket.h>

class QSocketBridge : public QSocket
{
public:
	QSocketBridge(QObject* parent, const char* name) : QSocket(parent, name) {}
	~QSocketBridge() {}
	void protected_sn_read(bool force) {
		QSocket::sn_read(force);
		return;
	}
	void protected_sn_write() {
		QSocket::sn_write();
		return;
	}
	void childEvent(QChildEvent* arg1) {
		if (Qt_EventDelegate == 0L || !(*Qt_EventDelegate)(this, "childEvent", arg1, "QChildEvent")) {
			QObject::childEvent(arg1);
		}
		return;
	}
	void customEvent(QCustomEvent* arg1) {
		if (Qt_EventDelegate == 0L || !(*Qt_EventDelegate)(this, "customEvent", arg1, "QCustomEvent")) {
			QObject::customEvent(arg1);
		}
		return;
	}
	void timerEvent(QTimerEvent* arg1) {
		if (Qt_EventDelegate == 0L || !(*Qt_EventDelegate)(this, "timerEvent", arg1, "QTimerEvent")) {
			QObject::timerEvent(arg1);
		}
		return;
	}
};

qt_QSocket * qt_new_QSocket(qt_QObject * parent, char* name){
	return (qt_QSocket *) new QSocketBridge((QObject*)parent, (char*)name);
}
void qt_del_QSocket( qt_QSocket* p ){
	delete (QSocketBridge*) p;
}
int qt_QSocket_state( qt_QSocket* instPointer){
	return (int) ((QSocketBridge*)instPointer)->state();
}
int qt_QSocket_socket( qt_QSocket* instPointer){
	return (int) ((QSocketBridge*)instPointer)->socket();
}
void qt_QSocket_setSocket( qt_QSocket* instPointer,int arg1){
	((QSocketBridge*)instPointer)->setSocket((int)arg1);
	return;
}
qt_QSocketDevice* qt_QSocket_socketDevice( qt_QSocket* instPointer){
	return (qt_QSocketDevice*) ((QSocketBridge*)instPointer)->socketDevice();
}
void qt_QSocket_setSocketDevice( qt_QSocket* instPointer,qt_QSocketDevice* arg1){
	((QSocketBridge*)instPointer)->setSocketDevice((QSocketDevice*)arg1);
	return;
}
void qt_QSocket_connectToHost( qt_QSocket* instPointer,qt_QString * host, unsigned short port){
	((QSocketBridge*)instPointer)->connectToHost((QString&)* (QString*)host, (Q_UINT16)port);
	return;
}
qt_QString * qt_QSocket_peerName( qt_QSocket* instPointer){
	return (qt_QString *)new QString(((QSocketBridge*)instPointer)->peerName());
}
int qt_QSocket_open( qt_QSocket* instPointer,int mode){
	return (int) ((QSocketBridge*)instPointer)->open((int)mode);
}
void qt_QSocket_close( qt_QSocket* instPointer){
	((QSocketBridge*)instPointer)->close();
	return;
}
void qt_QSocket_flush( qt_QSocket* instPointer){
	((QSocketBridge*)instPointer)->flush();
	return;
}
int qt_QSocket_size( qt_QSocket* instPointer){
	return (int) ((QSocketBridge*)instPointer)->size();
}
int qt_QSocket_at( qt_QSocket* instPointer){
	return (int) ((QSocketBridge*)instPointer)->at();
}
int qt_QSocket_at1( qt_QSocket* instPointer,int arg1){
	return (int) ((QSocketBridge*)instPointer)->at((QSocket::Offset)arg1);
}
int qt_QSocket_atEnd( qt_QSocket* instPointer){
	return (int) ((QSocketBridge*)instPointer)->atEnd();
}
long qt_QSocket_bytesAvailable( qt_QSocket* instPointer){
	return (long) ((QSocketBridge*)instPointer)->bytesAvailable();
}
long qt_QSocket_waitForMore( qt_QSocket* instPointer,int msecs){
	return (long) ((QSocketBridge*)instPointer)->waitForMore((int)msecs);
}
long qt_QSocket_bytesToWrite( qt_QSocket* instPointer){
	return (long) ((QSocketBridge*)instPointer)->bytesToWrite();
}
long qt_QSocket_readBlock( qt_QSocket* instPointer,char* data, long maxlen){
	return (long) ((QSocketBridge*)instPointer)->readBlock((char*)data, (Q_ULONG)maxlen);
}
long qt_QSocket_writeBlock( qt_QSocket* instPointer,char* data, long len){
	return (long) ((QSocketBridge*)instPointer)->writeBlock((char*)data, (Q_ULONG)len);
}
long qt_QSocket_readLine( qt_QSocket* instPointer,char* data, long maxlen){
	return (long) ((QSocketBridge*)instPointer)->readLine((char*)data, (Q_ULONG)maxlen);
}
int qt_QSocket_getch( qt_QSocket* instPointer){
	return (int) ((QSocketBridge*)instPointer)->getch();
}
int qt_QSocket_putch( qt_QSocket* instPointer,int arg1){
	return (int) ((QSocketBridge*)instPointer)->putch((int)arg1);
}
int qt_QSocket_ungetch( qt_QSocket* instPointer,int arg1){
	return (int) ((QSocketBridge*)instPointer)->ungetch((int)arg1);
}
int qt_QSocket_canReadLine( qt_QSocket* instPointer){
	return (int) ((QSocketBridge*)instPointer)->canReadLine();
}
qt_QString * qt_QSocket_readLine1( qt_QSocket* instPointer){
	return (qt_QString *)new QString(((QSocketBridge*)instPointer)->readLine());
}
unsigned short qt_QSocket_port( qt_QSocket* instPointer){
	return (unsigned short) ((QSocketBridge*)instPointer)->port();
}
unsigned short qt_QSocket_peerPort( qt_QSocket* instPointer){
	return (unsigned short) ((QSocketBridge*)instPointer)->peerPort();
}
qt_QHostAddress* qt_QSocket_address( qt_QSocket* instPointer){
	return (qt_QHostAddress*)new QHostAddress(((QSocketBridge*)instPointer)->address());
}
qt_QHostAddress* qt_QSocket_peerAddress( qt_QSocket* instPointer){
	return (qt_QHostAddress*)new QHostAddress(((QSocketBridge*)instPointer)->peerAddress());
}
void qt_QSocket_sn_read( qt_QSocket* instPointer,int force){
	((QSocketBridge*)instPointer)->protected_sn_read((bool)force);
	return;
}
void qt_QSocket_sn_write( qt_QSocket* instPointer){
	((QSocketBridge*)instPointer)->protected_sn_write();
	return;
}
qt_QIODevice * qt_QSocket_QIODevice(qt_QSocket* instPointer){
	return (qt_QIODevice *) (QIODevice *) (QSocket *) instPointer;
}
qt_QObject * qt_QSocket_QObject(qt_QSocket* instPointer){
	return (qt_QObject *) (QObject *) (QSocket *) instPointer;
}
