File indexing completed on 2024-04-21 05:45:39

0001 /*
0002  * SPDX-FileCopyrightText: 2010 Peter Penz <peter.penz19@gmail.com>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef DOLPHIN_DOCK_WIDGET_H
0008 #define DOLPHIN_DOCK_WIDGET_H
0009 
0010 #include <QDockWidget>
0011 
0012 /**
0013  * @brief Extends QDockWidget to be able to get locked.
0014  */
0015 class DolphinDockWidget : public QDockWidget
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     explicit DolphinDockWidget(const QString &title = QString(), QWidget *parent = nullptr, Qt::WindowFlags flags = {});
0021     ~DolphinDockWidget() override;
0022 
0023     /**
0024      * @param lock If \a lock is true, the title bar of the dock-widget will get hidden so
0025      *             that it is not possible for the user anymore to move or undock the dock-widget.
0026      */
0027     void setLocked(bool lock);
0028     bool isLocked() const;
0029 
0030 private:
0031     bool m_locked;
0032     QWidget *m_dockTitleBar;
0033 };
0034 
0035 #endif