My Project
SurfaceManagerInterface.h
1 /*
2  * Copyright (C) 2016 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  */
16 
17 #ifndef UNITY_SHELL_APPLICATION_SURFACEMANAGERINTERFACE_H
18 #define UNITY_SHELL_APPLICATION_SURFACEMANAGERINTERFACE_H
19 
20 #include "Mir.h"
21 
22 #include <QObject>
23 #include <QVector>
24 
25 #include <memory>
26 
27 namespace miral {
28 class Window;
29 class Workspace;
30 }
31 
32 namespace unity {
33 namespace shell {
34 namespace application {
35 
36 class MirSurfaceInterface;
37 
38 class SurfaceManagerInterface : public QObject
39 {
40  Q_OBJECT
41 
42 public:
43  virtual ~SurfaceManagerInterface() {}
44 
45  virtual void raise(MirSurfaceInterface *surface) = 0;
46  virtual void activate(MirSurfaceInterface *surface) = 0;
47 
48  virtual void forEachSurfaceInWorkspace(const std::shared_ptr<miral::Workspace> &workspace,
49  const std::function<void(unity::shell::application::MirSurfaceInterface*)> &callback) = 0;
50  virtual void moveSurfaceToWorkspace(unity::shell::application::MirSurfaceInterface* surface,
51  const std::shared_ptr<miral::Workspace> &workspace) = 0;
52  virtual void moveWorkspaceContentToWorkspace(const std::shared_ptr<miral::Workspace> &to,
53  const std::shared_ptr<miral::Workspace> &from) = 0;
54 
55 Q_SIGNALS:
56  void surfaceCreated(unity::shell::application::MirSurfaceInterface *surface);
57  void surfaceRemoved(unity::shell::application::MirSurfaceInterface *surface);
58  void surfaceReady(unity::shell::application::MirSurfaceInterface *surface);
59  void surfaceMoved(unity::shell::application::MirSurfaceInterface *surface, const QPoint &topLeft);
60  void surfaceResized(unity::shell::application::MirSurfaceInterface *surface, const QSize &size);
61  void surfaceStateChanged(unity::shell::application::MirSurfaceInterface *surface, Mir::State state);
62  void surfaceFocusChanged(unity::shell::application::MirSurfaceInterface *surface, bool focused);
63  void surfacesRaised(const QVector<unity::shell::application::MirSurfaceInterface*> &surfaces);
64  void surfaceRequestedRaise(unity::shell::application::MirSurfaceInterface *surface);
65  void surfacesAddedToWorkspace(const std::shared_ptr<miral::Workspace> &workspace,
66  const QVector<unity::shell::application::MirSurfaceInterface*> &surfaces);
67  void surfacesAboutToBeRemovedFromWorkspace(const std::shared_ptr<miral::Workspace> &workspace,
68  const QVector<unity::shell::application::MirSurfaceInterface*> &surfaces);
69  void modificationsStarted();
70  void modificationsEnded();
71 };
72 
73 } // namespace application
74 } // namespace shell
75 } // namespace unity
76 
77 #endif // UNITY_SHELL_APPLICATION_SURFACEMANAGERINTERFACE_H
Definition: SurfaceManagerInterface.h:38
State
Surface state.
Definition: Mir.h:64
Top-level namespace for all things Unity-related.
Definition: Version.h:37
Definition: SurfaceManagerInterface.h:27
Holds a Mir surface. Pretty much an opaque class.
Definition: MirSurfaceInterface.h:41