| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
|---|---|
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #ifndef APPOUTPUTPANE_H |
| 6 | #define APPOUTPUTPANE_H |
| 7 | |
| 8 | #include "base/abstractoutputpane.h" |
| 9 | #include "debuggerglobals.h" |
| 10 | |
| 11 | #include <QPlainTextEdit> |
| 12 | |
| 13 | class OutputWindowPrivate; |
| 14 | class AppOutputPane : public QPlainTextEdit |
| 15 | { |
| 16 | Q_OBJECT |
| 17 | public: |
| 18 | AppOutputPane(); |
| 19 | ~AppOutputPane() override; |
| 20 | |
| 21 | void clearContents(); |
| 22 | |
| 23 | bool isScrollbarAtBottom() const; |
| 24 | QString doNewlineEnforcement(const QString &out); |
| 25 | void scrollToBottom(); |
| 26 | |
| 27 | protected: |
| 28 | void contextMenuEvent(QContextMenuEvent * event) override; |
| 29 | |
| 30 | public slots: |
| 31 | void appendText(const QString &text, OutputPane::OutputFormat format); |
| 32 | |
| 33 | private: |
| 34 | void appendText(const QString &text, const QTextCharFormat &format = QTextCharFormat()); |
| 35 | QList<QAction*> actionFactory(); |
| 36 | OutputWindowPrivate *d = nullptr; |
| 37 | }; |
| 38 | |
| 39 | #endif // APPOUTPUTPANE_H |
| 40 |