File indexing completed on 2025-02-09 07:11:34

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2009 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_VIEWAREABOX_HPP
0010 #define KASTEN_VIEWAREABOX_HPP
0011 
0012 // Qt
0013 #include <QWidget>
0014 
0015 class QShortcut;
0016 
0017 namespace Kasten {
0018 
0019 class ToolInlineViewWidget;
0020 
0021 class ViewAreaBox : public QWidget
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     enum Area
0027     {
0028         TopArea,
0029         BottomArea
0030     };
0031 
0032 public:
0033     /// does not take ownership of @p centralWidget, can be 0.
0034     explicit ViewAreaBox(QWidget* centralWidget, QWidget* parent = nullptr);
0035     ~ViewAreaBox() override;
0036 
0037 public:
0038     QWidget* centralWidget() const;
0039     QWidget* bottomToolWidget() const;
0040 
0041 public:
0042     /// does not take ownership of @p centralWidget, can be 0.
0043     void setCentralWidget(QWidget* centralWidget);
0044     /// does not take ownership of @p bottomToolWidget. Can be nullptr.
0045     void setBottomToolWidget(QWidget* bottomToolWidget);
0046 
0047     void showBottomToolWidget();
0048 
0049 private Q_SLOTS:
0050     void onDone();
0051 
0052 private:
0053     QWidget* mCentralWidget;
0054 
0055     QWidget* mBottomToolWidget = nullptr;
0056     ToolInlineViewWidget* mToolInlineViewWidget = nullptr;
0057     QShortcut* mEscapeShortcut;
0058 };
0059 
0060 }
0061 
0062 #endif