2011-11-12 06:59:50 +00:00
|
|
|
#ifndef UNIXCLIENT_H
|
|
|
|
#define UNIXCLIENT_H
|
2011-11-11 10:20:32 +00:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <termios.h>
|
|
|
|
|
|
|
|
class QSocketNotifier;
|
|
|
|
class QTcpSocket;
|
|
|
|
|
|
|
|
class UnixClient : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit UnixClient(QTcpSocket *socket, QObject *parent = 0);
|
|
|
|
virtual ~UnixClient();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static termios setRawTerminalMode();
|
|
|
|
static void restoreTerminalMode(termios original);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
private slots:
|
2011-11-13 02:21:11 +00:00
|
|
|
void terminalResized();
|
2011-11-12 09:44:06 +00:00
|
|
|
void socketDisconnected();
|
2011-11-11 10:20:32 +00:00
|
|
|
void terminalReadActivated();
|
|
|
|
void socketBytesWritten();
|
|
|
|
void socketReadyRead();
|
|
|
|
void terminalWriteActivated();
|
|
|
|
void doServerToClient();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
private:
|
|
|
|
termios savedTermios;
|
|
|
|
QSocketNotifier *terminalReadNotifier;
|
|
|
|
QSocketNotifier *terminalWriteNotifier;
|
|
|
|
QTcpSocket *socket;
|
|
|
|
QByteArray terminalWriteBuffer;
|
|
|
|
};
|
|
|
|
|
2011-11-12 06:59:50 +00:00
|
|
|
#endif // UNIXCLIENT_H
|