on 2adba16 help sign in
unity8/plugins/WindowManager/WorkspaceManager.h
69 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 <QQmlListProperty>
22#include "WindowManagerGlobal.h"
23#include "WorkspaceModel.h"
25class Workspace;
27namespace unity {
28 namespace shell {
29 namespace application {
30 class MirSurfaceInterface;
31 class SurfaceManagerInterface;
32 }
33 }
36class WINDOWMANAGERQML_EXPORT WorkspaceManager : public QObject
38 Q_OBJECT
39 Q_PROPERTY(Workspace* activeWorkspace READ activeWorkspace WRITE setActiveWorkspace2 NOTIFY activeWorkspaceChanged)
41public:
42 WorkspaceManager();
43 static WorkspaceManager* instance();
45 Workspace* activeWorkspace() const;
46 void setActiveWorkspace(Workspace* workspace);
48 Workspace* createWorkspace();
49 void destroyWorkspace(Workspace* workspace);
51 void destroyFloatingWorkspaces();
53 Q_INVOKABLE void moveSurfaceToWorkspace(unity::shell::application::MirSurfaceInterface* surface,
54 Workspace* workspace);
56 Q_INVOKABLE void moveWorkspaceContentToWorkspace(Workspace* to, Workspace* from);
58Q_SIGNALS:
59 void activeWorkspaceChanged(Workspace*);
61private:
62 void setActiveWorkspace2(Workspace* workspace);
64 QSet<Workspace*> m_allWorkspaces;
65 Workspace* m_activeWorkspace;
66 unity::shell::application::SurfaceManagerInterface* m_surfaceManager;
67};
69#endif // WORKSPACEMANAGER_H