• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Konsole

Konsole::Pty

Konsole::Pty Class Reference

#include <Pty.h>

Inheritance diagram for Konsole::Pty:

Inheritance graph
[legend]

List of all members.


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 51 of file Pty.h.


Public Slots

void setUtf8Mode (bool on)
void lockPty (bool lock)
void sendData (const char *buffer, int length)

Signals

void done (int exitCode)
void receivedData (const char *buffer, int length)
void bufferEmpty ()

Public Member Functions

 Pty ()
 ~Pty ()
int start (const QString &program, const QStringList &arguments, const QStringList &environment, ulong winid, bool addToUtmp, const QString &dbusService, const QString &dbusSession)
void setWriteable (bool writeable)
void setXonXoff (bool on)
void setWindowSize (int lines, int cols)
QSize windowSize () const
void setErase (char erase)
char erase () const
int foregroundProcessGroup () const
bool bufferFull () const

Constructor & Destructor Documentation

Pty::Pty (  ) 

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.

Definition at line 228 of file Pty.cpp.

Pty::~Pty (  ) 

Definition at line 246 of file Pty.cpp.


Member Function Documentation

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.

Definition at line 146 of file Pty.cpp.

void Pty::setWriteable ( bool  writeable  ) 

TODO: Document me.

Definition at line 218 of file Pty.cpp.

void Pty::setXonXoff ( bool  on  ) 

Enables or disables Xon/Xoff flow control.

Definition at line 60 of file Pty.cpp.

void Pty::setWindowSize ( int  lines,
int  cols 
)

Sets the size of the window (in lines and columns of characters) used by this teletype.

Definition at line 47 of file Pty.cpp.

QSize Pty::windowSize (  )  const

Returns the size of the window used by this teletype.

See setWindowSize()

Definition at line 55 of file Pty.cpp.

void Pty::setErase ( char  erase  ) 

TODO Document me.

Definition at line 96 of file Pty.cpp.

char Pty::erase (  )  const

Definition at line 110 of file Pty.cpp.

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.

Definition at line 300 of file Pty.cpp.

bool Konsole::Pty::bufferFull (  )  const [inline]

Returns whether the buffer used to send data to the terminal process is full.

Definition at line 135 of file Pty.h.

void Pty::setUtf8Mode ( bool  on  )  [slot]

Put the pty into UTF-8 mode on systems which support it.

Definition at line 77 of file Pty.cpp.

void Pty::lockPty ( bool  lock  )  [slot]

Suspend or resume processing of data from the standard output of the terminal process.

See K3Process::suspend() and K3Process::resume()

Parameters:
lock If true, processing of output is suspended, otherwise processing is resumed.

Definition at line 292 of file Pty.cpp.

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.

Definition at line 280 of file Pty.cpp.

void Konsole::Pty::done ( int  exitCode  )  [signal]

Emitted when the terminal process terminates.

Parameters:
exitCode The status code which the process exited with.

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 Konsole::Pty::bufferEmpty (  )  [signal]

Emitted when the buffer used to send data to the terminal process becomes empty, i.e.

all data has been sent.


The documentation for this class was generated from the following files:
  • Pty.h
  • Pty.cpp

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • Konsole
  • Libraries
  •   libkonq
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal