File indexing completed on 2024-05-19 04:39:34

0001 /*
0002     SPDX-FileCopyrightText: 2010 Milian Wolff <mail@milianw.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVPLATFORM_CLOSEDWORKINGSETSWIDGET_H
0008 #define KDEVPLATFORM_CLOSEDWORKINGSETSWIDGET_H
0009 
0010 #include <QWidget>
0011 #include <QMap>
0012 #include <QPointer>
0013 
0014 namespace Sublime
0015 {
0016 class Area;
0017 }
0018 
0019 namespace KDevelop {
0020 
0021 class MainWindow;
0022 class WorkingSet;
0023 class WorkingSetController;
0024 class WorkingSetToolButton;
0025 
0026 /**
0027  * This widget shows all working sets that are not open in any area.
0028  *
0029  * It's put next to the area switcher tabs.
0030  */
0031 class ClosedWorkingSetsWidget : public QWidget
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036     explicit ClosedWorkingSetsWidget(MainWindow* window);
0037 
0038 private Q_SLOTS:
0039     void areaChanged(Sublime::Area* area);
0040     void changedWorkingSet(Sublime::Area *area, Sublime::Area*, const QString &from, const QString &to);
0041     void addWorkingSet(WorkingSet* set);
0042     void removeWorkingSet( WorkingSet* );
0043 
0044 private:
0045     MainWindow* const m_mainWindow;
0046     QPointer<Sublime::Area> m_connectedArea;
0047     QMap<WorkingSet*, WorkingSetToolButton*> m_buttons;
0048 };
0049 
0050 }
0051 
0052 #endif // KDEVPLATFORM_CLOSEDWORKINGSETSWIDGET_H