on 325ade4 help sign in
unity8/plugins/WindowManager/WorkspaceManager.h
58 lines 1.7 kB history raw
1/*
2 * Copyright (C) 2017 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17#ifndef WORKSPACEMANAGER_H
18#define WORKSPACEMANAGER_H
20#include "WorkspaceModel.h"
21#include <QQmlListProperty>
23class Workspace;
24class ScreensProxy;
26class WorkspaceManager : public QObject
28 Q_OBJECT
29 Q_PROPERTY(Workspace* activeWorkspace READ activeWorkspace WRITE setActiveWorkspace2 NOTIFY activeWorkspaceChanged)
30 Q_PROPERTY(QQmlListProperty<Workspace> floatingWorkspaces READ floatingWorkspaces NOTIFY floatingWorkspacesChanged)
32public:
33 static WorkspaceManager* instance();
35 Workspace* activeWorkspace() const;
36 void setActiveWorkspace(Workspace* workspace);
38 Workspace* createWorkspace();
39 void destroyWorkspace(Workspace* workspace);
41 QQmlListProperty<Workspace> floatingWorkspaces();
42 void destroyFloatingWorkspaces();
44Q_SIGNALS:
45 void activeWorkspaceChanged();
46 void floatingWorkspacesChanged();
48private:
49 WorkspaceManager();
51 void setActiveWorkspace2(Workspace* workspace);
53 QSet<Workspace*> m_allWorkspaces;
54 QList<Workspace*> m_floatingWorkspaces;
55 Workspace* m_activeWorkspace;
56};
58#endif // WORKSPACEMANAGER_H