X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=interfaces%2Finclude%2Fappframework.hpp;h=98ec3174b1c6cc8af70cbe30adc449c609e6d315;hb=09f2f0036f122e49aa49e6c446d723850192a725;hp=d95cd9deaeecfa39fb63edd006a25e6bb9153f31;hpb=0a468d9b5ae7b3e5ba106facf17698d89b1ce200;p=staging%2FHomeScreen.git diff --git a/interfaces/include/appframework.hpp b/interfaces/include/appframework.hpp index d95cd9d..98ec317 100644 --- a/interfaces/include/appframework.hpp +++ b/interfaces/include/appframework.hpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,38 +17,50 @@ #ifndef APPFRAMEWORK_HPP #define APPFRAMEWORK_HPP -#include -#include -#include +#include +#include -class AppInfo : public QObject +class AppInfo { - Q_OBJECT + Q_GADGET + Q_PROPERTY(QString id READ id) + Q_PROPERTY(QString version READ version) + Q_PROPERTY(int width READ width) + Q_PROPERTY(int height READ height) + Q_PROPERTY(QString name READ name) + Q_PROPERTY(QString description READ description) + Q_PROPERTY(QString shortname READ shortname) + Q_PROPERTY(QString author READ author) + Q_PROPERTY(QString iconPath READ iconPath) public: - explicit AppInfo(QObject *parent = 0); + AppInfo(); AppInfo(const AppInfo &other); - AppInfo& operator=(const AppInfo &other); - ~AppInfo(); + virtual ~AppInfo(); + AppInfo &operator =(const AppInfo &other); + void swap(AppInfo &other) { qSwap(d, other.d); } - //register Message with the Qt type system - static void registerMetaType(); + QString id() const; + QString version() const; + int width() const; + int height() const; + QString name() const; + QString description() const; + QString shortname() const; + QString author() const; + QString iconPath() const; - friend QDBusArgument &operator<<(QDBusArgument &argument, const AppInfo &appInfo); - friend const QDBusArgument &operator>>(const QDBusArgument &argument, AppInfo &appInfo); + void read(const QJsonObject &json); - void setName(const QString name) {this->name = name;} - QString getName() const {return name;} - void setIconPath(const QString iconPath) {this->iconPath = iconPath;} - QString getIconPath() const {return iconPath;} - void setDescription(const QString description) {this->description = description;} - QString getDescription() const {return description;} + friend QDBusArgument &operator <<(QDBusArgument &argument, const AppInfo &appInfo); + friend const QDBusArgument &operator >>(const QDBusArgument &argument, AppInfo &appInfo); private: - QString name; - QString iconPath; - QString description; + class Private; + QSharedDataPointer d; }; +Q_DECLARE_SHARED(AppInfo) Q_DECLARE_METATYPE(AppInfo) +Q_DECLARE_METATYPE(QList) #endif // APPFRAMEWORK_HPP