Konsole
Pty.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PTY_H
00024 #define PTY_H
00025
00026
00027 #include <QtCore/QStringList>
00028 #include <QtCore/QVector>
00029 #include <QtCore/QList>
00030 #include <QtCore/QSize>
00031
00032
00033 #include <KPtyProcess>
00034 #include <kdemacros.h>
00035
00036 namespace Konsole
00037 {
00038
00052 class KDE_EXPORT Pty: public KPtyProcess
00053 {
00054 Q_OBJECT
00055
00056 public:
00057
00067 explicit Pty(QObject* parent = 0);
00068
00073 explicit Pty(int ptyMasterFd, QObject* parent = 0);
00074
00075 ~Pty();
00076
00097 int start( const QString& program,
00098 const QStringList& arguments,
00099 const QStringList& environment,
00100 ulong winid,
00101 bool addToUtmp,
00102 const QString& dbusService,
00103 const QString& dbusSession
00104 );
00105
00107 void setWriteable(bool writeable);
00108
00114 void setFlowControlEnabled(bool on);
00115
00117 bool flowControlEnabled() const;
00118
00123 void setWindowSize(int lines, int cols);
00124
00126 QSize windowSize() const;
00127
00129 void setErase(char erase);
00130
00132 char erase() const;
00133
00142 int foregroundProcessGroup() const;
00143
00144 public slots:
00145
00149 void setUtf8Mode(bool on);
00150
00160 void lockPty(bool lock);
00161
00169 void sendData(const char* buffer, int length);
00170
00171 signals:
00172
00180 void receivedData(const char* buffer, int length);
00181
00182 protected:
00183 void setupChildProcess();
00184
00185 private slots:
00186
00187 void dataReceived();
00188
00189 private:
00190 void init();
00191
00192
00193
00194 void addEnvironmentVariables(const QStringList& environment);
00195
00196 int _windowColumns;
00197 int _windowLines;
00198 char _eraseChar;
00199 bool _xonXoff;
00200 bool _utf8;
00201 };
00202
00203 }
00204
00205 #endif // PTY_H