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