Konsole
Konsole::Pty Class Reference
#include <Pty.h>

Detailed Description
The Pty class is used to start the terminal process, send data to it, receive data from it and manipulate various properties of the pseudo-teletype interface used to communicate with the process.To use this class, construct an instance and connect to the sendData slot and receivedData signal to send data to or receive data from the process.
To start the terminal process, call the start() method with the program name and appropriate arguments.
Definition at line 52 of file Pty.h.
Public Slots | |
void | lockPty (bool lock) |
void | sendData (const char *buffer, int length) |
void | setUtf8Mode (bool on) |
Signals | |
void | receivedData (const char *buffer, int length) |
Public Member Functions | |
char | erase () const |
bool | flowControlEnabled () const |
int | foregroundProcessGroup () const |
Pty (int ptyMasterFd, QObject *parent=0) | |
Pty (QObject *parent=0) | |
void | setErase (char erase) |
void | setFlowControlEnabled (bool on) |
void | setWindowSize (int lines, int cols) |
void | setWriteable (bool writeable) |
int | start (const QString &program, const QStringList &arguments, const QStringList &environment, ulong winid, bool addToUtmp, const QString &dbusService, const QString &dbusSession) |
QSize | windowSize () const |
~Pty () | |
Protected Member Functions | |
void | setupChildProcess () |
Constructor & Destructor Documentation
Pty::Pty | ( | QObject * | parent = 0 |
) | [explicit] |
Constructs a new Pty.
Connect to the sendData() slot and receivedData() signal to prepare for sending and receiving data from the terminal process.
To start the terminal process, call the run() method with the name of the program to start and appropriate arguments.
Pty::Pty | ( | int | ptyMasterFd, | |
QObject * | parent = 0 | |||
) |
Member Function Documentation
bool Pty::flowControlEnabled | ( | ) | const |
int Pty::foregroundProcessGroup | ( | ) | const |
Returns the process id of the teletype's current foreground process.
This is the process which is currently reading input sent to the terminal via. sendData()
If there is a problem reading the foreground process group, 0 will be returned.
void Pty::lockPty | ( | bool | lock | ) | [slot] |
void Konsole::Pty::receivedData | ( | const char * | buffer, | |
int | length | |||
) | [signal] |
Emitted when a new block of data is received from the teletype.
- Parameters:
-
buffer Pointer to the data received. length Length of buffer
void Pty::sendData | ( | const char * | buffer, | |
int | length | |||
) | [slot] |
Sends data to the process currently controlling the teletype ( whose id is returned by foregroundProcessGroup() ).
- Parameters:
-
buffer Pointer to the data to send. length Length of buffer
.
void Pty::setFlowControlEnabled | ( | bool | on | ) |
Enables or disables Xon/Xoff flow control.
The flow control setting may be changed later by a terminal application, so flowControlEnabled() may not equal the value of on
in the previous call to setFlowControlEnabled()
void Pty::setUtf8Mode | ( | bool | on | ) | [slot] |
void Pty::setWindowSize | ( | int | lines, | |
int | cols | |||
) |
void Pty::setWriteable | ( | bool | writeable | ) |
int Pty::start | ( | const QString & | program, | |
const QStringList & | arguments, | |||
const QStringList & | environment, | |||
ulong | winid, | |||
bool | addToUtmp, | |||
const QString & | dbusService, | |||
const QString & | dbusSession | |||
) |
Starts the terminal process.
Returns 0 if the process was started successfully or non-zero otherwise.
- Parameters:
-
program Path to the program to start arguments Arguments to pass to the program being started environment A list of key=value pairs which will be added to the environment for the new process. At the very least this should include an assignment for the TERM environment variable. winid Specifies the value of the WINDOWID environment variable in the process's environment. addToUtmp Specifies whether a utmp entry should be created for the pty used. See K3Process::setUsePty() dbusService Specifies the value of the KONSOLE_DBUS_SERVICE environment variable in the process's environment. dbusSession Specifies the value of the KONSOLE_DBUS_SESSION environment variable in the process's environment.
QSize Pty::windowSize | ( | ) | const |
Returns the size of the window used by this teletype.
See setWindowSize()
The documentation for this class was generated from the following files: