[64efc22] | 1 | %Module(name=QTermWidget, use_limited_api=True) |
---|
| 2 | |
---|
| 3 | %ModuleHeaderCode |
---|
| 4 | #pragma GCC visibility push(default) |
---|
| 5 | %End |
---|
| 6 | |
---|
| 7 | %Import QtGui/QtGuimod.sip |
---|
| 8 | %Import QtCore/QtCoremod.sip |
---|
| 9 | %Import QtWidgets/QtWidgetsmod.sip |
---|
| 10 | |
---|
| 11 | class QTermWidget : QWidget { |
---|
| 12 | |
---|
| 13 | %TypeHeaderCode |
---|
| 14 | #include <qtermwidget.h> |
---|
| 15 | %End |
---|
| 16 | |
---|
| 17 | public: |
---|
| 18 | enum ScrollBarPosition |
---|
| 19 | { |
---|
| 20 | NoScrollBar=0, |
---|
| 21 | ScrollBarLeft=1, |
---|
| 22 | ScrollBarRight=2 |
---|
| 23 | }; |
---|
| 24 | |
---|
| 25 | enum class KeyboardCursorShape |
---|
| 26 | { |
---|
| 27 | BlockCursor=0, |
---|
| 28 | UnderlineCursor=1, |
---|
| 29 | IBeamCursor=2 |
---|
| 30 | }; |
---|
| 31 | |
---|
| 32 | QTermWidget(int startnow = 1, QWidget *parent = 0); |
---|
| 33 | ~QTermWidget(); |
---|
| 34 | void startTerminalTeletype(); |
---|
| 35 | QSize sizeHint() const; |
---|
| 36 | void setTerminalSizeHint(bool on); |
---|
| 37 | bool terminalSizeHint(); |
---|
| 38 | void startShellProgram(); |
---|
| 39 | int getShellPID(); |
---|
[fedf2a2] | 40 | int getForegroundProcessId(); |
---|
[64efc22] | 41 | void changeDir(const QString & dir); |
---|
| 42 | void setTerminalFont(QFont &font); |
---|
| 43 | QFont getTerminalFont(); |
---|
| 44 | void setTerminalOpacity(qreal level); |
---|
| 45 | void setEnvironment(const QStringList & environment); |
---|
| 46 | void setShellProgram(const QString & progname); |
---|
| 47 | void setWorkingDirectory(const QString & dir); |
---|
| 48 | QString workingDirectory(); |
---|
| 49 | void setArgs(QStringList & args); |
---|
| 50 | void setTextCodec(QTextCodec *codec); |
---|
| 51 | void setColorScheme(const QString & name); |
---|
| 52 | QStringList getAvailableColorSchemes(); |
---|
| 53 | static QStringList availableColorSchemes(); |
---|
| 54 | static void addCustomColorSchemeDir(const QString& custom_dir); |
---|
| 55 | void setHistorySize(int lines); |
---|
| 56 | void setScrollBarPosition(ScrollBarPosition); |
---|
| 57 | void scrollToEnd(); |
---|
| 58 | void sendText(QString &text); |
---|
| 59 | void setFlowControlEnabled(bool enabled); |
---|
| 60 | bool flowControlEnabled(); |
---|
| 61 | void setFlowControlWarningEnabled(bool enabled); |
---|
| 62 | static QStringList availableKeyBindings(); |
---|
| 63 | QString keyBindings(); |
---|
| 64 | void setMotionAfterPasting(int); |
---|
| 65 | int historyLinesCount(); |
---|
| 66 | int screenColumnsCount(); |
---|
| 67 | void setSelectionStart(int row, int column); |
---|
| 68 | void setSelectionEnd(int row, int column); |
---|
| 69 | void getSelectionStart(int& row, int& column); |
---|
| 70 | void getSelectionEnd(int& row, int& column); |
---|
| 71 | QString selectedText(bool preserveLineBreaks = true); |
---|
| 72 | void setMonitorActivity(bool); |
---|
| 73 | void setMonitorSilence(bool); |
---|
| 74 | void setSilenceTimeout(int seconds); |
---|
| 75 | int getPtySlaveFd() const; |
---|
| 76 | void setKeyboardCursorShape(KeyboardCursorShape shape); |
---|
| 77 | void setAutoClose(bool); |
---|
| 78 | QString title() const; |
---|
| 79 | QString icon() const; |
---|
| 80 | signals: |
---|
| 81 | void finished(); |
---|
| 82 | void copyAvailable(bool); |
---|
| 83 | void termGetFocus(); |
---|
| 84 | void termLostFocus(); |
---|
| 85 | void termKeyPressed(QKeyEvent *); |
---|
| 86 | void urlActivated(const QUrl&, bool fromContextMenu); |
---|
| 87 | void bell(const QString& message); |
---|
| 88 | void activity(); |
---|
| 89 | void silence(); |
---|
| 90 | void sendData(const char *,int); |
---|
| 91 | void titleChanged(); |
---|
| 92 | void receivedData(const QString &text); |
---|
| 93 | void profileChanged(const QString & profile); |
---|
| 94 | public slots: |
---|
| 95 | void copyClipboard(); |
---|
| 96 | void pasteClipboard(); |
---|
| 97 | void pasteSelection(); |
---|
| 98 | void zoomIn(); |
---|
| 99 | void zoomOut(); |
---|
| 100 | void setSize(const QSize &); |
---|
| 101 | void setKeyBindings(const QString & kb); |
---|
| 102 | void clear(); |
---|
| 103 | void toggleShowSearchBar(); |
---|
| 104 | protected: |
---|
| 105 | virtual void resizeEvent(QResizeEvent *); |
---|
| 106 | protected slots: |
---|
| 107 | void sessionFinished(); |
---|
| 108 | void selectionChanged(bool textSelected); |
---|
| 109 | private: |
---|
| 110 | void search(bool forwards, bool next); |
---|
| 111 | void setZoom(int step); |
---|
| 112 | void init(int startnow); |
---|
| 113 | private slots: |
---|
| 114 | void find(); |
---|
| 115 | void findNext(); |
---|
| 116 | void findPrevious(); |
---|
| 117 | void matchFound(int startColumn, int startLine, int endColumn, int endLine); |
---|
| 118 | void noMatchFound(); |
---|
| 119 | }; |
---|