//
// C++ Interface: client
//
// Description: 
//
//
// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2006
//
// Copyright: See COPYING file that comes with this distribution
//
//

#include <QMainWindow>

class QTcpSocket;
class QTextEdit;
class QLineEdit;

class CClient:public QMainWindow
{
	Q_OBJECT
	public:
		CClient(QString host,int port,QWidget*p=0);
		~CClient();
	private slots:
		//socket has been connected
		void connSock();
		//socket has been disconnected (or error)
		void dconSock();
		//socket is readable
		void readSock();
		
		//enforce disconnect
		void doDisconnect();
		//save buffer to a file
		void dumpFile();
		//clear display/buffer
		void clearDisplay();
		//send some text
		void sendStuff();
	private:
		//the socket
		QTcpSocket*sock;
		//stores current text display
		QString buf;
		//text display widget
		QTextEdit*text;
		//line to enter data in
		QLineEdit*line;
};
