File indexing completed on 2024-09-22 05:16:04

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2010 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef KASTEN_TERMINALVIEW_HPP
0010 #define KASTEN_TERMINALVIEW_HPP
0011 
0012 // Qt
0013 #include <QWidget>
0014 
0015 class TerminalInterface;
0016 namespace KParts {
0017 class ReadOnlyPart;
0018 }
0019 class QUrl;
0020 
0021 namespace Kasten {
0022 
0023 class TerminalTool;
0024 
0025 class TerminalView : public QWidget
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     explicit TerminalView(TerminalTool* tool, QWidget* parent = nullptr);
0031     ~TerminalView() override;
0032 
0033 public:
0034     TerminalTool* tool() const;
0035 
0036 private Q_SLOTS:
0037     void createTerminalPart();
0038 
0039     void onCurrentUrlChanged(const QUrl& currentUrl);
0040 
0041     void onTerminalPartDestroyed();
0042 
0043 private:
0044     TerminalTool* const mTool;
0045 
0046     KParts::ReadOnlyPart* mTerminalPart = nullptr;
0047     TerminalInterface* mTerminalInterface = nullptr;
0048 };
0049 
0050 inline TerminalTool* TerminalView::tool() const { return mTool; }
0051 
0052 }
0053 
0054 #endif