28 #include <QtCore/QStringList>
29 #include <QtCore/QHash>
31 #include <QtCore/QUuid>
32 #include <QtCore/QSize>
33 #include <QtCore/QProcess>
52 class TerminalDisplay;
70 Q_CLASSINFO(
"D-Bus Interface",
"org.kde.konsole.Session")
73 Q_PROPERTY(QString name READ nameTitle)
74 Q_PROPERTY(
int processId READ processId)
75 Q_PROPERTY(QString keyBindings READ keyBindings WRITE setKeyBindings)
76 Q_PROPERTY(QSize size READ size WRITE setSize)
102 void openTeletype(
int masterFd);
108 bool isRunning() const;
142 int sessionId() const;
173 void setTabTitleFormat(TabTitleContext context ,
const QString& format);
175 QString tabTitleFormat(TabTitleContext context)
const;
178 QStringList arguments()
const;
180 QString program()
const;
186 void setArguments(
const QStringList& arguments);
188 void setProgram(
const QString& program);
192 return _initialWorkingDir;
199 void setInitialWorkingDirectory(
const QString& dir);
204 QString currentWorkingDirectory();
233 void setKeyBindings(
const QString& name);
235 QString keyBindings()
const;
251 QString userTitle()
const;
258 QString getDynamicTitle();
261 void setIconName(
const QString& iconName);
263 QString iconName()
const;
269 void setIconText(
const QString& iconText);
271 QString iconText()
const;
274 void setTitle(TitleRole role ,
const QString& title);
277 QString title(TitleRole role)
const;
283 void setAddToUtmp(
bool);
289 void setAutoClose(
bool close);
292 bool autoClose()
const;
295 bool isForegroundProcessActive();
298 QString foregroundProcessName();
308 void setSize(
const QSize& size);
310 QSize preferredSize()
const;
312 void setPreferredSize(
const QSize & size);
322 void setDarkBackground(
bool darkBackground);
331 void startZModem(
const QString& rz,
const QString& dir,
const QStringList& list);
342 IconNameAndWindowTitle = 0,
346 BackgroundColor = 11,
353 void setCodec(QTextCodec* codec);
356 void saveSession(KConfigGroup& group);
359 void sendSignal(
int signal);
374 Q_SCRIPTABLE QStringList environment()
const;
381 Q_SCRIPTABLE
void setEnvironment(
const QStringList& environment);
387 void addEnvironmentEntry(
const QString& entry);
405 bool closeInNormalWay();
412 bool closeInForceWay();
422 void setUserTitle(
int what ,
const QString& caption);
430 Q_SCRIPTABLE
void setMonitorActivity(
bool);
433 Q_SCRIPTABLE
bool isMonitorActivity()
const;
442 Q_SCRIPTABLE
void setMonitorSilence(
bool);
448 Q_SCRIPTABLE
bool isMonitorSilence()
const;
451 Q_SCRIPTABLE
void setMonitorSilenceSeconds(
int seconds);
457 Q_SCRIPTABLE
void setFlowControlEnabled(
bool enabled);
460 Q_SCRIPTABLE
bool flowControlEnabled()
const;
465 Q_SCRIPTABLE
void sendText(
const QString& text)
const;
470 Q_SCRIPTABLE
void runCommand(
const QString& command)
const;
477 Q_SCRIPTABLE
void sendMouseEvent(
int buttons,
int column,
int line,
int eventType);
483 Q_SCRIPTABLE
int processId()
const;
490 Q_SCRIPTABLE
int foregroundProcessId();
496 Q_SCRIPTABLE
bool setCodec(QByteArray codec);
501 Q_SCRIPTABLE QByteArray codec();
508 Q_SCRIPTABLE
void setTitle(
int role,
const QString& title);
515 Q_SCRIPTABLE QString title(
int role)
const;
522 Q_SCRIPTABLE QString shellSessionId()
const;
529 Q_SCRIPTABLE
void setTabTitleFormat(
int context,
const QString& format);
536 Q_SCRIPTABLE QString tabTitleFormat(
int context)
const;
548 Q_SCRIPTABLE
void setHistorySize(
int lines);
553 Q_SCRIPTABLE
int historySize()
const;
574 void stateChanged(
int state);
581 void currentDirectoryChanged(
const QString& dir);
584 void bellRequest(
const QString& message);
592 void changeTabTextColorRequest(
int);
598 void changeBackgroundColorRequest(
const QColor&);
603 void changeForegroundColorRequest(
const QColor&);
606 void openUrlRequest(
const QString& url);
612 void zmodemDetected();
620 void resizeRequest(
const QSize& size);
628 void profileChangeCommandReceived(
const QString& text);
635 void flowControlEnabledChanged(
bool enabled);
644 void primaryScreenInUse(
bool use);
652 void selectionChanged(
const QString& text);
655 void done(
int, QProcess::ExitStatus);
657 void fireZModemDetected();
659 void onReceiveBlock(
const char* buffer,
int len);
660 void silenceTimerDone();
661 void activityTimerDone();
663 void onViewSizeChange(
int height,
int width);
665 void activityStateSet(
int);
668 void viewDestroyed(
QObject* view);
670 void zmodemReadStatus();
671 void zmodemReadAndSendBlock();
672 void zmodemReceiveBlock(
const char* data,
int len);
673 void zmodemFinished();
675 void updateFlowControlState(
bool suspended);
676 void updateWindowSize(
int lines,
int columns);
679 void onPrimaryScreenInUse(
bool use);
684 static QString checkProgram(
const QString& program);
686 void updateTerminalSize();
687 WId windowId()
const;
688 bool kill(
int signal);
692 void terminalWarning(
const QString& message);
694 void updateSessionProcessInfo();
695 bool updateForegroundProcessInfo();
698 QUuid _uniqueIdentifier;
706 bool _monitorActivity;
707 bool _monitorSilence;
708 bool _notifiedActivity;
710 QTimer* _silenceTimer;
711 QTimer* _activityTimer;
714 bool _closePerUserRequest;
717 QString _displayTitle;
720 QString _localTabTitleFormat;
721 QString _remoteTabTitleFormat;
726 bool _flowControlEnabled;
729 QStringList _arguments;
731 QStringList _environment;
734 QString _initialWorkingDir;
735 QString _currentWorkingDir;
743 KProcess* _zmodemProc;
746 bool _hasDarkBackground;
748 QSize _preferredSize;
750 static int lastSessionId;
815 void sessionFinished();
816 void forwardData(
const char* data,
int size);
822 QHash<Session*, bool> _sessions;
void restoreSession(Application &app)
Represents a terminal session consisting of a pseudo-teletype and a terminal emulation.
QList< Session * > sessions() const
Returns the list of sessions currently in the group.
bool masterStatus(Session *session) const
Returns the master status of a session.
TitleRole
This enum describes the available title roles.
The Pty class is used to start the terminal process, send data to it, receive data from it and manipu...
int masterMode() const
Returns a bitwise OR of the active MasterMode flags for this group.
UserTitleChange
Possible values of the what parameter for setUserTitle() See "Operating System Controls" section on h...
Provides a group of sessions which is divided into master and slave sessions.
Takes a snapshot of the state of a process and provides access to information such as the process nam...
void setMasterStatus(Session *session, bool master)
Sets whether a particular session is a master within the group.
Base class for terminal emulation back-ends.
MasterMode
This enum describes the options for propagating certain activity or changes in the group's master ses...
QString nameTitle() const
Convenience method used to read the name property.
void setMasterMode(int mode)
Specifies which activity in the group's master sessions is propagated to all sessions in the group...
void removeSession(Session *session)
Removes a session from the group.
SessionGroup(QObject *parent)
Constructs an empty session group.
~SessionGroup()
Destroys the session group and removes all connections between master and slave sessions.
Default tab title format.
void addSession(Session *session)
Adds a session to the group.
#define KONSOLEPRIVATE_EXPORT
QString initialWorkingDirectory()
Returns the session's current working directory.
Any input key presses in the master sessions are sent to all sessions in the group.
TabTitleContext
This enum describes the contexts for which separate tab title formats may be specified.
A widget which displays output from a terminal emulation and sends input keypresses and mouse activit...