KSession

Search for usage in LXR

#include <ksession.h>

Inheritance diagram for KSession:

Properties

QString currentDir
 
QString foregroundProcessName
 
bool hasActiveProcess
 
QString history
 
int historySize
 
QString initialWorkingDirectory
 
QString kbScheme
 
bool monitorSilence
 
QString shellProgram
 
QStringList shellProgramArgs
 
QString title
 
- Properties inherited from QObject
 objectName
 

Signals

void argsChanged ()
 
void bellRequest (QString message)
 
void changedKeyBindings (QString kb)
 
void copyAvailable (bool)
 
void currentDirChanged ()
 
void finished ()
 
void foregroundProcessNameChanged ()
 
void hasActiveProcessChanged ()
 
void historySizeChanged ()
 
void initialWorkingDirectoryChanged ()
 
void matchFound (int startColumn, int startLine, int endColumn, int endLine)
 
void monitorSilenceChanged ()
 
void noMatchFound ()
 
void processHasSilent (bool value)
 
void shellProgramChanged ()
 
void started ()
 
void termGetFocus ()
 
void termKeyPressed (QKeyEvent *, bool)
 
void termLostFocus ()
 
void titleChanged ()
 

Public Slots

QStringList args () const
 
void changeDir (const QString &dir)
 
void clearScreen ()
 
int getShellPID ()
 
void search (const QString &regexp, int startLine=0, int startColumn=0, bool forwards=true)
 
void selectionChanged (bool textSelected)
 
void sendKey (int rep, int key, int mod) const
 
bool sendSignal (int signal)
 
void sendText (QString text)
 
void setArgs (const QStringList &args)
 
void setKeyBindings (const QString &kb)
 
void setShellProgram (const QString &progname)
 
void setTitle (QString name)
 
QString shellProgram () const
 
void startShellProgram ()
 

Public Member Functions

 KSession (QObject *parent=nullptr)
 
void addView (TerminalDisplay *display)
 
QString currentDir ()
 
bool flowControlEnabled (void)
 
QString foregroundProcessName ()
 
QString getHistory () const
 
QString getInitialWorkingDirectory ()
 
QString getKeyBindings ()
 
int getRandomSeed ()
 
QString getTitle ()
 
bool hasActiveProcess () const
 
int historySize () const
 
QString keyBindings ()
 
bool monitorSilence () const
 
void removeView (TerminalDisplay *display)
 
void setEnvironment (const QStringList &environment)
 
void setFlowControlEnabled (bool enabled)
 
void setHistorySize (int lines)
 
void setInitialWorkingDirectory (const QString &dir)
 
void setMonitorSilence (bool value)
 
void setTextCodec (QTextCodec *codec)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static QStringList availableKeyBindings ()
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 

Protected Slots

void sessionFinished ()
 

Additional Inherited Members

- Public Types inherited from QObject
typedef  QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

The KSession class Creates and controls the terminal session.

This class is exposed to the QML engine as Session.

Note
This class is not part of any public API and it is only part of the Terminal QML control implementation

Definition at line 37 of file ksession.h.

Property Documentation

◆ currentDir

QString KSession::currentDir
read

The current directory of the session.

Definition at line 84 of file ksession.h.

◆ foregroundProcessName

QString KSession::foregroundProcessName
read

The name of the current process running.

Definition at line 79 of file ksession.h.

◆ hasActiveProcess

bool KSession::hasActiveProcess
read

Whether the session has an active process running.

Definition at line 74 of file ksession.h.

◆ history

QString KSession::history
read

The commands history.

Definition at line 69 of file ksession.h.

◆ historySize

int KSession::historySize
readwrite

Allows to set the amount of lines to store in the history.

Definition at line 89 of file ksession.h.

◆ initialWorkingDirectory

QString KSession::initialWorkingDirectory
readwrite

Set the initial working directory from a local path.

Definition at line 49 of file ksession.h.

◆ kbScheme

QString KSession::kbScheme
readwrite

Allows to select the preferred key binding, by default there is one pre-defined.

Definition at line 44 of file ksession.h.

◆ monitorSilence

bool KSession::monitorSilence
readwrite

Whether to monitor when the session has gone silent.

Definition at line 94 of file ksession.h.

◆ shellProgram

QString KSession::shellProgram
readwrite

Allows to change the default shell program, by default bash is used.

Definition at line 59 of file ksession.h.

◆ shellProgramArgs

QStringList KSession::shellProgramArgs
readwrite

Allows to set the arguments to the default shell program.

Definition at line 64 of file ksession.h.

◆ title

QString KSession::title
readwrite

The session title.

Definition at line 54 of file ksession.h.

Constructor & Destructor Documentation

◆ KSession()

KSession::KSession ( QObject * parent = nullptr)

Definition at line 38 of file ksession.cpp.

◆ ~KSession()

KSession::~KSession ( )

Definition at line 98 of file ksession.cpp.

Member Function Documentation

◆ addView()

void KSession::addView ( TerminalDisplay * display)

addView

Parameters
display

Definition at line 175 of file ksession.cpp.

◆ args

QStringList KSession::args ( ) const
slot

args

Returns

Definition at line 427 of file ksession.cpp.

◆ argsChanged

void KSession::argsChanged ( )
signal

argsChanged

◆ availableKeyBindings()

QStringList KSession::availableKeyBindings ( )
static

Sets whether the flow control warning box should be shown when the flow control stop key (Ctrl+S) is pressed.

Get all available keyboard bindings

Returns

Definition at line 388 of file ksession.cpp.

◆ bellRequest

void KSession::bellRequest ( QString message)
signal

bellRequest

Parameters
message

◆ changeDir

void KSession::changeDir ( const QString & dir)
slot

changeDir

Parameters
dir

Definition at line 220 of file ksession.cpp.

◆ changedKeyBindings

void KSession::changedKeyBindings ( QString kb)
signal

changedKeyBindings

Parameters
kb

◆ clearScreen

void KSession::clearScreen ( )
slot

clearScreen

Definition at line 354 of file ksession.cpp.

◆ copyAvailable

void KSession::copyAvailable ( bool )
signal

copyAvailable

◆ currentDir()

QString KSession::currentDir ( )

Returns the current working directory of the process.

◆ currentDirChanged

void KSession::currentDirChanged ( )
signal

currentDirChanged

◆ finished

void KSession::finished ( )
signal

finished

◆ flowControlEnabled()

bool KSession::flowControlEnabled ( void )

Returns whether flow control is enabled.

Returns

Definition at line 372 of file ksession.cpp.

◆ foregroundProcessName()

QString KSession::foregroundProcessName ( )

Returns the name of the terminal's foreground process.

◆ foregroundProcessNameChanged

void KSession::foregroundProcessNameChanged ( )
signal

foregroundProcessNameChanged

◆ getHistory()

QString KSession::getHistory ( ) const

Definition at line 319 of file ksession.cpp.

◆ getInitialWorkingDirectory()

QString KSession::getInitialWorkingDirectory ( )

Definition at line 277 of file ksession.cpp.

◆ getKeyBindings()

QString KSession::getKeyBindings ( )

Definition at line 383 of file ksession.cpp.

◆ getRandomSeed()

int KSession::getRandomSeed ( )

Definition at line 170 of file ksession.cpp.

◆ getShellPID

int KSession::getShellPID ( )
slot

getShellPID

Returns

Definition at line 215 of file ksession.cpp.

◆ getTitle()

QString KSession::getTitle ( )

Definition at line 398 of file ksession.cpp.

◆ hasActiveProcess()

bool KSession::hasActiveProcess ( ) const

Returns true if the session has an active subprocess running in it spawned from the initial shell.

Definition at line 412 of file ksession.cpp.

◆ hasActiveProcessChanged

void KSession::hasActiveProcessChanged ( )
signal

hasActiveProcessChanged

◆ historySize()

int KSession::historySize ( ) const

Definition at line 309 of file ksession.cpp.

◆ historySizeChanged

void KSession::historySizeChanged ( )
signal

historySizeChanged

◆ initialWorkingDirectoryChanged

void KSession::initialWorkingDirectoryChanged ( )
signal

initialWorkingDirectoryChanged

◆ keyBindings()

QString KSession::keyBindings ( )

Return current key bindings.

Returns

Definition at line 393 of file ksession.cpp.

◆ matchFound

void KSession::matchFound ( int startColumn,
int startLine,
int endColumn,
int endLine )
signal

matchFound

Parameters
startColumn
startLine
endColumn
endLine

◆ monitorSilence()

bool KSession::monitorSilence ( ) const

monitorSilence

Returns

Definition at line 116 of file ksession.cpp.

◆ monitorSilenceChanged

void KSession::monitorSilenceChanged ( )
signal

monitorSilenceChanged

◆ noMatchFound

void KSession::noMatchFound ( )
signal

noMatchFound

◆ processHasSilent

void KSession::processHasSilent ( bool value)
signal

processHasSilent

Parameters
value

◆ removeView()

void KSession::removeView ( TerminalDisplay * display)

removeView

Parameters
display

Definition at line 180 of file ksession.cpp.

◆ search

void KSession::search ( const QString & regexp,
int startLine = 0,
int startColumn = 0,
bool forwards = true )
slot

Search history.

Parameters
regexp
startLine
startColumn
forwards

Definition at line 359 of file ksession.cpp.

◆ selectionChanged

void KSession::selectionChanged ( bool textSelected)
slot

Definition at line 190 of file ksession.cpp.

◆ sendKey

void KSession::sendKey ( int rep,
int key,
int mod ) const
slot

Emulate a key press.

Parameters
rep
key
mod

Definition at line 337 of file ksession.cpp.

◆ sendSignal

bool KSession::sendSignal ( int signal)
slot

sendSignal

Parameters
signal
Returns

Definition at line 205 of file ksession.cpp.

◆ sendText

void KSession::sendText ( QString text)
slot

Send some text to terminal.

Parameters
text

Definition at line 332 of file ksession.cpp.

◆ sessionFinished

void KSession::sessionFinished ( )
protectedslot

Definition at line 185 of file ksession.cpp.

◆ setArgs

void KSession::setArgs ( const QStringList & args)
slot

Shell program args, default is none.

Parameters
args

Definition at line 282 of file ksession.cpp.

◆ setEnvironment()

void KSession::setEnvironment ( const QStringList & environment)

Set the custom enviroment variables.

Parameters
environment

Definition at line 247 of file ksession.cpp.

◆ setFlowControlEnabled()

void KSession::setFlowControlEnabled ( bool enabled)

Sets whether flow control is enabled.

Parameters
enabled

Definition at line 367 of file ksession.cpp.

◆ setHistorySize()

void KSession::setHistorySize ( int lines)

History size for scrolling.

Parameters
lines

Definition at line 296 of file ksession.cpp.

◆ setInitialWorkingDirectory()

void KSession::setInitialWorkingDirectory ( const QString & dir)

Initial working directory.

Parameters
dir

Definition at line 266 of file ksession.cpp.

◆ setKeyBindings

void KSession::setKeyBindings ( const QString & kb)
slot

Set named key binding for the session.

Definition at line 377 of file ksession.cpp.

◆ setMonitorSilence()

void KSession::setMonitorSilence ( bool value)

setMonitorSilence

Parameters
value

Definition at line 107 of file ksession.cpp.

◆ setShellProgram

void KSession::setShellProgram ( const QString & progname)
slot

Shell program, default is /bin/bash

Parameters
progname

Definition at line 252 of file ksession.cpp.

◆ setTextCodec()

void KSession::setTextCodec ( QTextCodec * codec)

Text codec, default is UTF-8.

Parameters
codec

Definition at line 291 of file ksession.cpp.

◆ setTitle

void KSession::setTitle ( QString name)
slot

setTitle

Parameters
name

Definition at line 121 of file ksession.cpp.

◆ shellProgram

QString KSession::shellProgram ( ) const
slot

shellProgram

Returns

Definition at line 261 of file ksession.cpp.

◆ shellProgramChanged

void KSession::shellProgramChanged ( )
signal

shellProgramChanged

◆ started

void KSession::started ( )
signal

started

◆ startShellProgram

void KSession::startShellProgram ( )
slot

startShellProgram

Definition at line 195 of file ksession.cpp.

◆ termGetFocus

void KSession::termGetFocus ( )
signal

termGetFocus

◆ termKeyPressed

void KSession::termKeyPressed ( QKeyEvent * ,
bool  )
signal

termKeyPressed

◆ termLostFocus

void KSession::termLostFocus ( )
signal

termLostFocus

◆ titleChanged

void KSession::titleChanged ( )
signal

titleChanged


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.