00001 /*************************************************************************** 00002 * Copyright (C) 2002 by Yann Hodique * 00003 * Yann.Hodique@lifl.fr * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 ***************************************************************************/ 00010 00011 #ifndef _TELNETMANAGER_H_ 00012 #define _TELNETMANAGER_H_ 00013 00014 #include <qobject.h> 00015 00016 class QSocket; 00017 class QString; 00018 class ChatSession; 00019 class QChar; 00020 00025 class TelnetManager : public QObject { 00026 Q_OBJECT 00027 00028 public: 00029 TelnetManager(QWidget *parent=0, const char *name=0); 00030 ~TelnetManager(); 00031 00032 void setArgs(const QString&, const QString&); 00033 void start(); 00034 void setLogin(const QString& login); 00035 void setPassword(const QString& password); 00036 00037 public slots: 00038 void readStdout(); 00039 void writeStdin(const QString&); 00040 void slotProcessExited(); 00041 void slotError(int); 00042 00043 private: 00044 QSocket * socket; 00045 ChatSession * mtp; 00046 QString suspended; 00047 QString host; 00048 int port; 00049 00050 QChar IAC; 00051 QString login; 00052 QString password; 00053 00054 signals: 00055 void processExited(); 00056 }; 00057 00058 #endif