POI: AGL LifeCycle Management
[apps/agl-service-windowmanager.git] / client / communication.cpp
1 /*
2  * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
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 #include "communication.h"
18
19 #include <QGuiApplication>
20 #include <QDebug>
21
22 communication::communication(QObject *parent) : QObject(parent)
23 {
24     this->quit = false;
25 }
26
27 communication::~communication()
28 {
29 }
30
31 void communication::setWidth(const unsigned int &w)
32 {
33     this->width = w;
34     emit widthChanged();
35 }
36
37 void communication::setHeight(const unsigned int &h)
38 {
39     this->height = h;
40     emit heightChanged();
41 }
42
43 void communication::setColor(const QString &c)
44 {
45     this->color = c;
46     emit colorChanged();
47 }
48
49 void communication::setAppName(const QString &a)
50 {
51     this->appName = a;
52     emit appNameChanged();
53 }
54
55 void communication::setQuit(const bool &q)
56 {
57     this->quit = q;
58     emit quitChanged();
59     if(q)
60         exit(EXIT_SUCCESS);
61 }
62
63 unsigned int communication::getWidth() const
64 {
65     return this->width;
66 }
67
68 unsigned int communication::getHeight() const
69 {
70     return this->height;
71 }
72
73 QString communication::getColor() const
74 {
75     return this->color;
76 }
77
78 QString communication::getAppName() const
79 {
80     return this->appName;
81 }
82
83 bool communication::getQuit() const
84 {
85     return this->quit;
86 }