New layer management in WindowManager. Three layers are created. One for the HomeScre...
[staging/HomeScreen.git] / interfaces / include / windowmanager.hpp
1 /*
2  * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef WINDOWMANAGER_H
18 #define WINDOWMANAGER_H
19
20 #include <QtDBus>
21
22 #define WINDOWMANAGER_NO_ERROR 0
23 #define WINDOWMANAGER_ERROR_ID_ALREADY_DEFINED 1
24 #define WINDOWMANAGER_ERROR_NAME_ALREADY_DEFINED 2
25 #define WINDOWMANAGER_ERROR_ID_NOT_FOUND 3
26 #define WINDOWMANAGER_ERROR_NAME_NOT_FOUND 4
27
28 class SimplePoint
29 {
30 public:
31     SimplePoint();
32     virtual ~SimplePoint();
33
34         int x;
35         int y;
36
37     friend QDBusArgument &operator <<(QDBusArgument &argument, const SimplePoint &mSimplePoint);
38     friend const QDBusArgument &operator >>(const QDBusArgument &argument, SimplePoint &mSimplePoint);
39 };
40
41
42 class LayoutArea
43 {
44 public:
45     LayoutArea();
46     virtual ~LayoutArea();
47
48         int x;
49         int y;
50         int width;
51         int height;
52
53     friend QDBusArgument &operator <<(QDBusArgument &argument, const LayoutArea &mLayoutArea);
54     friend const QDBusArgument &operator >>(const QDBusArgument &argument, LayoutArea &mLayoutArea);
55 };
56
57 class Layout
58 {
59 public:
60     Layout();
61     Layout(int layoutId, const QString &layoutName, const QList<LayoutArea> &surfaceAreas);
62     virtual ~Layout();
63
64     int id;
65     QString name;
66     QList<LayoutArea> layoutAreas;
67
68     friend QDBusArgument &operator <<(QDBusArgument &argument, const Layout &mLayout);
69     friend const QDBusArgument &operator >>(const QDBusArgument &argument, Layout &mLayout);
70 };
71
72 Q_DECLARE_METATYPE(SimplePoint)
73 Q_DECLARE_METATYPE(QList<SimplePoint>)
74
75 Q_DECLARE_METATYPE(LayoutArea)
76 Q_DECLARE_METATYPE(QList<LayoutArea>)
77
78 Q_DECLARE_METATYPE(Layout)
79 Q_DECLARE_METATYPE(QList<Layout>)
80
81 #endif // WINDOWMANAGER_H