on d55286b help sign in
unity8/plugins/WindowManager/WorkspaceManager.h
68 lines 2.0 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;
25namespace unity {
26 namespace shell {
27 namespace application {
28 class MirSurfaceInterface;
29 class SurfaceManagerInterface;
30 }
31 }
34class WorkspaceManager : public QObject
36 Q_OBJECT
37 Q_PROPERTY(Workspace* activeWorkspace READ activeWorkspace WRITE setActiveWorkspace2 NOTIFY activeWorkspaceChanged)
39public:
40 static WorkspaceManager* instance();
42 Workspace* activeWorkspace() const;
43 void setActiveWorkspace(Workspace* workspace);
45 Workspace* createWorkspace();
46 void destroyWorkspace(Workspace* workspace);
48 void destroyFloatingWorkspaces();
50 Q_INVOKABLE void moveSurfaceToWorkspace(unity::shell::application::MirSurfaceInterface* surface,
51 Workspace* workspace);
53 Q_INVOKABLE void moveWorkspaceContentToWorkspace(Workspace* to, Workspace* from);
55Q_SIGNALS:
56 void activeWorkspaceChanged(Workspace*);
58private:
59 WorkspaceManager();
61 void setActiveWorkspace2(Workspace* workspace);
63 QSet<Workspace*> m_allWorkspaces;
64 Workspace* m_activeWorkspace;
65 unity::shell::application::SurfaceManagerInterface* m_surfaceManager;
66};
68#endif // WORKSPACEMANAGER_H