| 1 | /* |
| 2 | This file is part of Konsole QML plugin, |
| 3 | which is a terminal emulator from KDE. |
| 4 | |
| 5 | Copyright 2013 by Dmitry Zagnoyko <[email protected]> |
| 6 | |
| 7 | This program is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation; either version 2 of the License, or |
| 10 | (at your option) any later version. |
| 11 | |
| 12 | This program is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with this program; if not, write to the Free Software |
| 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 20 | 02110-1301 USA. |
| 21 | */ |
| 22 | |
| 23 | #ifndef KSESSION_H |
| 24 | #define KSESSION_Hcxx . . $ `src/ksession.h:24:9`! |
| 25 | |
| 26 | #include <QObject> |
| 27 | |
| 28 | // Konsole |
| 29 | #include "Session.h"cxx . . $ `<file>/lib/Session.h`/ |
| 30 | //#include "TerminalDisplay.h" |
| 31 | |
| 32 | using namespace Konsole; |
| 33 | |
| 34 | class KSessioncxx . . $ KSession# : public QObjectcxx . . $ QObject# |
| 35 | { |
| 36 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 37 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QString kbScheme READ getKeyBindings WRITE setKeyBindings NOTIFY changedKeyBindings) |
| 38 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QString initialWorkingDirectory READ getInitialWorkingDirectory WRITE setInitialWorkingDirectory NOTIFY initialWorkingDirectoryChanged) |
| 39 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QString title READ getTitle WRITE setTitle NOTIFY titleChanged) |
| 40 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QString shellProgram WRITE setShellProgram) |
| 41 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QStringList shellProgramArgs WRITE setArgs) |
| 42 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QString history READ getHistory) |
| 43 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(bool hasActiveProcess READ hasActiveProcess) |
| 44 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QString foregroundProcessName READ foregroundProcessName) |
| 45 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QString currentDir READ currentDir) |
| 46 | |
| 47 | public: |
| 48 | KSessioncxx . . $ KSession#KSession(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent = 0); |
| 49 | ~cxx . . $ KSession#`~KSession`(ced63f7c635d850d).KSessioncxx . . $ KSession#(); |
| 50 | |
| 51 | public: |
| 52 | //bool setup(); |
| 53 | void addViewcxx . . $ KSession#addView(d1be2bc5a38bdd21).(TerminalDisplaycxx . . $ Konsole/TerminalDisplay# *display); |
| 54 | void removeViewcxx . . $ KSession#removeView(d1be2bc5a38bdd21).(TerminalDisplaycxx . . $ Konsole/TerminalDisplay# *display); |
| 55 | |
| 56 | int getRandomSeedcxx . . $ KSession#getRandomSeed(b126dc7c1de90089).(); |
| 57 | QStringcxx . . $ QString# getKeyBindingscxx . . $ KSession#getKeyBindings(4365c3963150523e).(); |
| 58 | |
| 59 | //look-n-feel, if you don`t like defaults |
| 60 | |
| 61 | //environment |
| 62 | void setEnvironmentcxx . . $ KSession#setEnvironment(631c0101495f0328).(const QStringListcxx . . $ QStringList# & environment); |
| 63 | |
| 64 | //Initial working directory |
| 65 | void setInitialWorkingDirectorycxx . . $ KSession#setInitialWorkingDirectory(3520e46b33348bf6).(const QStringcxx . . $ QString# & dir); |
| 66 | QStringcxx . . $ QString# getInitialWorkingDirectorycxx . . $ KSession#getInitialWorkingDirectory(4365c3963150523e).(); |
| 67 | |
| 68 | //Text codec, default is UTF-8 |
| 69 | void setTextCodeccxx . . $ KSession#setTextCodec(1f30447839ed391).(QTextCodeccxx . . $ QTextCodec# * codec); |
| 70 | |
| 71 | // History size for scrolling |
| 72 | void setHistorySizecxx . . $ KSession#setHistorySize(d4f767463ce0a6b3).(int lines); //infinite if lines < 0 |
| 73 | int historySizecxx . . $ KSession#historySize(455f465bc33b4cdf).() const; |
| 74 | |
| 75 | QStringcxx . . $ QString# getHistorycxx . . $ KSession#getHistory(6ef7b6c27b00b43d).() const; |
| 76 | |
| 77 | // Sets whether flow control is enabled |
| 78 | void setFlowControlEnabledcxx . . $ KSession#setFlowControlEnabled(b45ddcbc8423892c).(bool enabled); |
| 79 | |
| 80 | // Returns whether flow control is enabled |
| 81 | bool flowControlEnabledcxx . . $ KSession#flowControlEnabled(c9857a73d68e59ba).(void); |
| 82 | |
| 83 | /** |
| 84 | * Sets whether the flow control warning box should be shown |
| 85 | * when the flow control stop key (Ctrl+S) is pressed. |
| 86 | */ |
| 87 | //void setFlowControlWarningEnabled(bool enabled); |
| 88 | |
| 89 | /*! Get all available keyboard bindings |
| 90 | */ |
| 91 | static QStringListcxx . . $ QStringList# availableKeyBindingscxx . . $ KSession#availableKeyBindings(669a05bc42dd57cc).(); |
| 92 | |
| 93 | //! Return current key bindings |
| 94 | QStringcxx . . $ QString# keyBindingscxx . . $ KSession#keyBindings(4365c3963150523e).(); |
| 95 | |
| 96 | QStringcxx . . $ QString# getTitlecxx . . $ KSession#getTitle(4365c3963150523e).(); |
| 97 | |
| 98 | /** |
| 99 | * Returns \c true if the session has an active subprocess running in it |
| 100 | * spawned from the initial shell. |
| 101 | */ |
| 102 | bool hasActiveProcesscxx . . $ KSession#hasActiveProcess(50ce9a9e25b4a850).() const; |
| 103 | |
| 104 | /** |
| 105 | * Returns the name of the terminal's foreground process. |
| 106 | */ |
| 107 | QStringcxx . . $ QString# foregroundProcessNamecxx . . $ KSession#foregroundProcessName(4365c3963150523e).(); |
| 108 | |
| 109 | /** |
| 110 | * Returns the current working directory of the process. |
| 111 | */ |
| 112 | QStringcxx . . $ QString# currentDircxx . . $ KSession#currentDir(4365c3963150523e).(); |
| 113 | |
| 114 | signalscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:89:14`!: |
| 115 | void startedcxx . . $ KSession#started(49f6e7a06ebc5aa8).(); |
| 116 | void finishedcxx . . $ KSession#finished(49f6e7a06ebc5aa8).(); |
| 117 | void copyAvailablecxx . . $ KSession#copyAvailable(b45ddcbc8423892c).(bool); |
| 118 | |
| 119 | void termGetFocuscxx . . $ KSession#termGetFocus(49f6e7a06ebc5aa8).(); |
| 120 | void termLostFocuscxx . . $ KSession#termLostFocus(49f6e7a06ebc5aa8).(); |
| 121 | |
| 122 | void termKeyPressedcxx . . $ KSession#termKeyPressed(4ced653b20f45578).(QKeyEventcxx . . $ QKeyEvent# *, bool); |
| 123 | |
| 124 | void changedKeyBindingscxx . . $ KSession#changedKeyBindings(7df51288a9ebd664).(QStringcxx . . $ QString# kb); |
| 125 | |
| 126 | void titleChangedcxx . . $ KSession#titleChanged(49f6e7a06ebc5aa8).(); |
| 127 | |
| 128 | void historySizeChangedcxx . . $ KSession#historySizeChanged(49f6e7a06ebc5aa8).(); |
| 129 | |
| 130 | void initialWorkingDirectoryChangedcxx . . $ KSession#initialWorkingDirectoryChanged(49f6e7a06ebc5aa8).(); |
| 131 | |
| 132 | void matchFoundcxx . . $ KSession#matchFound(748afa4755bc9595).(int startColumn, int startLine, int endColumn, int endLine); |
| 133 | void noMatchFoundcxx . . $ KSession#noMatchFound(49f6e7a06ebc5aa8).(); |
| 134 | |
| 135 | public slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 136 | /*! Set named key binding for given widget |
| 137 | */ |
| 138 | void setKeyBindingscxx . . $ KSession#setKeyBindings(3520e46b33348bf6).(const QStringcxx . . $ QString# & kb); |
| 139 | void setTitlecxx . . $ KSession#setTitle(7df51288a9ebd664).(QStringcxx . . $ QString# name); |
| 140 | |
| 141 | void startShellProgramcxx . . $ KSession#startShellProgram(49f6e7a06ebc5aa8).(); |
| 142 | |
| 143 | bool sendSignalcxx . . $ KSession#sendSignal(83c267b20bac841a).(int signal); |
| 144 | |
| 145 | // Shell program, default is /bin/bash |
| 146 | void setShellProgramcxx . . $ KSession#setShellProgram(3520e46b33348bf6).(const QStringcxx . . $ QString# & progname); |
| 147 | |
| 148 | // Shell program args, default is none |
| 149 | void setArgscxx . . $ KSession#setArgs(631c0101495f0328).(const QStringListcxx . . $ QStringList# &args); |
| 150 | |
| 151 | int getShellPIDcxx . . $ KSession#getShellPID(b126dc7c1de90089).(); |
| 152 | void changeDircxx . . $ KSession#changeDir(3520e46b33348bf6).(const QStringcxx . . $ QString# & dir); |
| 153 | |
| 154 | // Send some text to terminal |
| 155 | void sendTextcxx . . $ KSession#sendText(7df51288a9ebd664).(QStringcxx . . $ QString# text); |
| 156 | // Send some text to terminal |
| 157 | void sendKeycxx . . $ KSession#sendKey(6ad14a2cad9708b7).(int rep, int key, int mod) const; |
| 158 | |
| 159 | void clearScreencxx . . $ KSession#clearScreen(49f6e7a06ebc5aa8).(); |
| 160 | |
| 161 | // Search history |
| 162 | void searchcxx . . $ KSession#search(7ae16150a604556).(const QStringcxx . . $ QString# ®exp, int startLine = 0, int startColumn = 0, bool forwards = true ); |
| 163 | |
| 164 | protected slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 165 | void sessionFinishedcxx . . $ KSession#sessionFinished(49f6e7a06ebc5aa8).(); |
| 166 | void selectionChangedcxx . . $ KSession#selectionChanged(b45ddcbc8423892c).(bool textSelected); |
| 167 | |
| 168 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 169 | Sessioncxx . . $ Konsole/Session#* createSessioncxx . . $ KSession#createSession(867a005158409b9e).(QStringcxx . . $ QString# name); |
| 170 | //Konsole::KTerminalDisplay* createTerminalDisplay(Konsole::Session *session, QQuickItem* parent); |
| 171 | |
| 172 | private: |
| 173 | //Konsole::KTerminalDisplay *m_terminalDisplay; |
| 174 | QStringcxx . . $ QString# _initialWorkingDirectorycxx . . $ KSession#_initialWorkingDirectory.; |
| 175 | Sessioncxx . . $ Konsole/Session# *m_sessioncxx . . $ KSession#m_session.; |
| 176 | |
| 177 | }; |
| 178 | |
| 179 | #endif // KSESSION_H |