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

#ifndef QT_QSOCKET
#define QT_QSOCKET

#include <qtc/qtc_types.h>

#define QSOCKET_ErrConnectionRefused	0
#define QSOCKET_ErrHostNotFound	1
#define QSOCKET_ErrSocketRead	2
#define QSOCKET_Idle	0
#define QSOCKET_HostLookup	1
#define QSOCKET_Connecting	2
#define QSOCKET_Connected	3
#define QSOCKET_Closing	4
#define QSOCKET_Connection	QSOCKET_Connected
qt_QSocket * qt_new_QSocket(qt_QObject * parent, char* name);
void qt_del_QSocket( qt_QSocket* p );
int qt_QSocket_state(qt_QSocket* instPointer);
int qt_QSocket_socket(qt_QSocket* instPointer);
void qt_QSocket_setSocket(qt_QSocket* instPointer,int arg1);
qt_QSocketDevice* qt_QSocket_socketDevice(qt_QSocket* instPointer);
void qt_QSocket_setSocketDevice(qt_QSocket* instPointer,qt_QSocketDevice* arg1);
void qt_QSocket_connectToHost(qt_QSocket* instPointer,qt_QString * host, unsigned short port);
qt_QString * qt_QSocket_peerName(qt_QSocket* instPointer);
int qt_QSocket_open(qt_QSocket* instPointer,int mode);
void qt_QSocket_close(qt_QSocket* instPointer);
void qt_QSocket_flush(qt_QSocket* instPointer);
int qt_QSocket_size(qt_QSocket* instPointer);
int qt_QSocket_at(qt_QSocket* instPointer);
int qt_QSocket_at1(qt_QSocket* instPointer,int arg1);
int qt_QSocket_atEnd(qt_QSocket* instPointer);
long qt_QSocket_bytesAvailable(qt_QSocket* instPointer);
long qt_QSocket_waitForMore(qt_QSocket* instPointer,int msecs);
long qt_QSocket_bytesToWrite(qt_QSocket* instPointer);
long qt_QSocket_readBlock(qt_QSocket* instPointer,char* data, long maxlen);
long qt_QSocket_writeBlock(qt_QSocket* instPointer,char* data, long len);
long qt_QSocket_readLine(qt_QSocket* instPointer,char* data, long maxlen);
int qt_QSocket_getch(qt_QSocket* instPointer);
int qt_QSocket_putch(qt_QSocket* instPointer,int arg1);
int qt_QSocket_ungetch(qt_QSocket* instPointer,int arg1);
int qt_QSocket_canReadLine(qt_QSocket* instPointer);
qt_QString * qt_QSocket_readLine1(qt_QSocket* instPointer);
unsigned short qt_QSocket_port(qt_QSocket* instPointer);
unsigned short qt_QSocket_peerPort(qt_QSocket* instPointer);
qt_QHostAddress* qt_QSocket_address(qt_QSocket* instPointer);
qt_QHostAddress* qt_QSocket_peerAddress(qt_QSocket* instPointer);
void qt_QSocket_sn_read(qt_QSocket* instPointer,int force);
void qt_QSocket_sn_write(qt_QSocket* instPointer);

/** Casts a 'qt_QSocket *' to a 'qt_QIODevice *' */
qt_QIODevice * qt_QSocket_QIODevice(qt_QSocket* instPointer);

/** Casts a 'qt_QSocket *' to a 'qt_QObject *' */
qt_QObject * qt_QSocket_QObject(qt_QSocket* instPointer);

#endif
