summaryrefslogtreecommitdiff
path: root/src/libs/advanceddockingsystem/workspaceview.h
blob: cb507794dbbcf532cc636304cfed7b75ce96f09d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later

#pragma once

#include "workspacemodel.h"

#include <utils/itemviews.h>

#include <QAbstractTableModel>

namespace ADS {

class DockManager;
class WorkspaceDialog;

class WorkspaceView : public Utils::TreeView
{
    Q_OBJECT

public:
    explicit WorkspaceView(DockManager *manager, QWidget *parent = nullptr);

    void createNewWorkspace();
    void deleteSelectedWorkspaces();
    void cloneCurrentWorkspace();
    void renameCurrentWorkspace();
    void resetCurrentWorkspace();
    void switchToCurrentWorkspace();

    void importWorkspace();
    void exportCurrentWorkspace();

    QString currentWorkspace();
    WorkspaceModel *workspaceModel();
    void selectActiveWorkspace();
    void selectWorkspace(const QString &workspaceName);

    QStringList selectedWorkspaces() const;

signals:
    void workspaceActivated(const QString &workspace);
    void workspacesSelected(const QStringList &workspaces);
    void workspaceSwitched();

private:
    void showEvent(QShowEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;

    void deleteWorkspaces(const QStringList &workspaces);

    DockManager *m_manager;
    WorkspaceModel m_workspaceModel;
};

} // namespace ADS