-Make the SampleNav app yellow.
[staging/HomeScreen.git] / interfaces / src / appframework.cpp
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 #include "include/appframework.hpp"
18
19
20 AppInfo::AppInfo()
21 {
22 }
23
24 AppInfo::~AppInfo()
25 {
26 }
27
28 void AppInfo::read(const QJsonObject &json)
29 {
30     id = json["id"].toString();
31     version = json["id"].toString();
32     width = json["id"].toInt();
33     height = json["id"].toInt();
34     name = json["id"].toString();
35     description = json["id"].toString();
36     shortname = json["id"].toString();
37     author = json["id"].toString();
38     iconPath = json["id"].toString();
39 }
40
41 QDBusArgument &operator <<(QDBusArgument &argument, const AppInfo &mAppInfo)
42 {
43     argument.beginStructure();
44     argument << mAppInfo.id;
45     argument << mAppInfo.version;
46     argument << mAppInfo.width;
47     argument << mAppInfo.height;
48     argument << mAppInfo.name;
49     argument << mAppInfo.description;
50     argument << mAppInfo.shortname;
51     argument << mAppInfo.author;
52     argument << mAppInfo.iconPath;
53     argument.endStructure();
54
55     return argument;
56 }
57
58 const QDBusArgument &operator >>(const QDBusArgument &argument, AppInfo &mAppInfo)
59 {
60     argument.beginStructure();
61     argument >> mAppInfo.id;
62     argument >> mAppInfo.version;
63     argument >> mAppInfo.width;
64     argument >> mAppInfo.height;
65     argument >> mAppInfo.name;
66     argument >> mAppInfo.description;
67     argument >> mAppInfo.shortname;
68     argument >> mAppInfo.author;
69     argument >> mAppInfo.iconPath;
70     argument.endStructure();
71     return argument;
72 }