/***************************************************************************
                            QSocketDevice.java -  description
                             -------------------
    begin                : Wed Nov 21 17:05:56 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 17:05:56 2001, using kalyptus 0.9.
 ***************************************************************************/

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

package org.kde.qt;

import java.util.*;
import java.lang.Error;

public class QSocketDevice extends QIODevice  {
	protected QSocketDevice(Class dummy){super((Class) null);}

	private native void newQSocketDevice( int type);
	public QSocketDevice( int type) {
		super((Class) null);
		newQSocketDevice( type);
	}
	private native void newQSocketDevice();
	public QSocketDevice() {
		super((Class) null);
		newQSocketDevice();
	}
	private native void newQSocketDevice( int socket, int type);
	public QSocketDevice( int socket, int type) {
		super((Class) null);
		newQSocketDevice( socket, type);
	}
	protected native void finalize() throws InternalError;
	public native boolean isValid();
	public native int type();
	public native int socket();
	public native void setSocket( int socket, int type);
	public native boolean open( int mode);
	public native void close();
	public native void flush();
	public native int size();
	public native int at();
	public native boolean at( int arg1);
	public native boolean atEnd();
	public native boolean blocking();
	public native void setBlocking( boolean arg1);
	public native boolean addressReusable();
	public native void setAddressReusable( boolean arg1);
	public native int receiveBufferSize();
	public native void setReceiveBufferSize( int arg1);
	public native int sendBufferSize();
	public native void setSendBufferSize( int arg1);
	public native boolean connect( QHostAddress arg1, short arg2);
	public native boolean bind( QHostAddress arg1, short arg2);
	public native boolean listen( int backlog);
	public native int accept();
	public native long bytesAvailable();
	public native long waitForMore( int msecs, int[] timeout);
	public native long waitForMore( int msecs);
	public native long readBlock( StringBuffer data, long maxlen);
	public native long writeBlock( String data, long len);
	public native long writeBlock( String data, long len, QHostAddress host, short port);
	public native int getch();
	public native int putch( int arg1);
	public native int ungetch( int arg1);
	public native short port();
	public native short peerPort();
	public native QHostAddress address();
	public native QHostAddress peerAddress();
	public native int error();
	protected native void setError( int err);
	public static final int Stream = 0;
	public static final int Datagram = 1;
	public static final int NoError = 0;
	public static final int AlreadyBound = 1;
	public static final int Inaccessible = 2;
	public static final int NoResources = 3;
	public static final int Bug = 4;
	public static final int Impossible = 5;
	public static final int NoFiles = 6;
	public static final int ConnectionRefused = 7;
	public static final int NetworkFailure = 8;
	public static final int UnknownError = 9;
}
