Using the Tizen application manager to receive information about installed apps and...
[staging/HomeScreen.git] / interfaces / src / appframework.cpp
1 #include "include/appframework.hpp"
2
3 AppInfo::AppInfo(QObject *parent) :
4     QObject(parent)
5 {
6 }
7
8 AppInfo::AppInfo(const AppInfo &other) :
9     QObject(other.parent()),
10     name(other.getName()),
11     iconPath(other.getIconPath()),
12     description(other.getDescription())
13 {
14 }
15
16 AppInfo& AppInfo::operator=(const AppInfo &other)
17 {
18     setParent(other.parent());
19     name = other.getName();
20     iconPath = other.getIconPath();
21     description = other.getDescription();
22
23     return *this;
24 }
25
26 AppInfo::~AppInfo()
27 {
28 }
29
30 void AppInfo::registerMetaType()
31 {
32     qRegisterMetaType<AppInfo>("AppInfo");
33     qDBusRegisterMetaType<AppInfo>();
34 }
35
36
37 // Marshall the MyStructure data into a D-Bus argument
38 QDBusArgument &operator<<(QDBusArgument &argument, const AppInfo &appInfo)
39 {
40     argument.beginStructure();
41     argument << appInfo.name << appInfo.iconPath << appInfo.description;
42     argument.endStructure();
43     qDebug("appInfo.name:<< %s", appInfo.name.toStdString().c_str());
44     return argument;
45 }
46
47 // Retrieve the MyStructure data from the D-Bus argument
48 const QDBusArgument &operator>>(const QDBusArgument &argument, AppInfo &appInfo)
49 {
50     argument.beginStructure();
51     argument >> appInfo.name >> appInfo.iconPath >> appInfo.description;
52     argument.endStructure();
53     qDebug("appInfo.name:>> %s", appInfo.name.toStdString().c_str());
54     return argument;
55 }