From dadca6f0b1e4660876cccb51702998d378a5dc03 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 30 Nov 2014 21:32:13 +0100 Subject: convert appinfo into a Q_GADGET with properties --- daemon/appinfo.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 daemon/appinfo.h (limited to 'daemon/appinfo.h') diff --git a/daemon/appinfo.h b/daemon/appinfo.h new file mode 100644 index 0000000..da71dfc --- /dev/null +++ b/daemon/appinfo.h @@ -0,0 +1,66 @@ +#ifndef APPINFO_H +#define APPINFO_H + +#include +#include +#include +#include + +class AppInfoData; + +class AppInfo +{ + Q_GADGET + + Q_PROPERTY(QUuid uuid READ uuid WRITE setUuid) + Q_PROPERTY(QString shortName READ shortName WRITE setShortName) + Q_PROPERTY(QString longName READ longName WRITE setLongName) + Q_PROPERTY(QString companyName READ companyName WRITE setCompanyName) + Q_PROPERTY(int versionCode READ versionCode WRITE setVersionCode) + Q_PROPERTY(QString versionLabel READ versionLabel WRITE setVersionLabel) + Q_PROPERTY(bool watchface READ isWatchface WRITE setWatchface) + Q_PROPERTY(bool jskit READ isJSKit WRITE setJSKit) + Q_PROPERTY(QString path READ path WRITE setPath) + +public: + AppInfo(); + AppInfo(const AppInfo &); + AppInfo &operator=(const AppInfo &); + ~AppInfo(); + + QUuid uuid() const; + void setUuid(const QUuid &uuid); + + QString shortName() const; + void setShortName(const QString &string); + + QString longName() const; + void setLongName(const QString &string); + + QString companyName() const; + void setCompanyName(const QString &string); + + int versionCode() const; + void setVersionCode(int code); + + QString versionLabel() const; + void setVersionLabel(const QString &string); + + bool isWatchface() const; + void setWatchface(bool b); + + bool isJSKit() const; + void setJSKit(bool b); + + QHash appKeys() const; + void setAppKeys(const QHash &string); + void addAppKey(const QString &key, int value); + + QString path() const; + void setPath(const QString &string); + +private: + QSharedDataPointer d; +}; + +#endif // APPINFO_H -- cgit v1.2.3