Add 2017 to copyright
[staging/HomeScreen.git] / HomeScreen / src / layouthandler.h
1 /*
2  * Copyright (C) 2016, 2017 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 LAYOUTHANDLER_H
18 #define LAYOUTHANDLER_H
19
20 #include <QObject>
21 #include "windowmanager_proxy.h"
22 #include "popup_proxy.h"
23
24 class LayoutHandler : public QObject
25 {
26     Q_OBJECT
27 public:
28     explicit LayoutHandler(QObject *parent = 0);
29     ~LayoutHandler();
30
31 signals:
32
33 public slots:
34     void showAppLayer(int pid);
35     void hideAppLayer();
36     void makeMeVisible(int pid);
37 private:
38     void checkToDoQueue();
39 public slots:
40     int requestGetSurfaceStatus(int surfaceId);
41     void requestRenderSurfaceToArea(int surfaceId, int layoutArea);
42     bool requestRenderSurfaceToAreaAllowed(int surfaceId, int layoutArea);
43     void requestSurfaceIdToFullScreen(int surfaceId);
44     void setLayoutByName(QString layoutName);
45
46     // this will receive the surfaceVisibilityChanged signal of the windowmanager
47     void requestSurfaceVisibilityChanged(int surfaceId, bool visible);
48
49 Q_SIGNALS: // SIGNALS
50     void surfaceVisibilityChanged(int surfaceId, bool visible);
51
52 protected:
53     void timerEvent(QTimerEvent *e);
54 private:
55     int m_secondsTimerId;
56     org::agl::windowmanager *mp_dBusWindowManagerProxy;
57     org::agl::popup *mp_dBusPopupProxy;
58
59     QList<int> m_requestsToBeVisiblePids;
60     QList<int> m_visibleSurfaces;
61     QList<int> m_invisibleSurfaces;
62     QList<int> m_requestsToBeVisibleSurfaces;
63 };
64
65 #endif // LAYOUTHANDLER_H