Add gitlab issue/merge request templates
[apps/launcher.git] / launcher / src / appinfo.h
1 // SPDX-License-Identifier: Apache-2.0
2 /*
3  * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
4  * Copyright (C) 2016 The Qt Company Ltd.
5  * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
6  */
7
8 #ifndef APPINFO_H
9 #define APPINFO_H
10
11 #include <QObject>
12 #include <QtCore/QSharedDataPointer>
13
14 class AppInfo
15 {
16     Q_GADGET
17     Q_PROPERTY(QString id READ id)
18     Q_PROPERTY(QString name READ name)
19     Q_PROPERTY(QString iconPath READ iconPath)
20 public:
21     AppInfo();
22     AppInfo(const QString &icon, const QString &name, const QString &id);
23     AppInfo(const AppInfo &other);
24     virtual ~AppInfo();
25     AppInfo &operator =(const AppInfo &other);
26     void swap(AppInfo &other) { qSwap(d, other.d); }
27
28     QString id() const;
29     QString name() const;
30     QString iconPath() const;
31
32     void read(const QJsonObject &json);
33
34 private:
35     class Private;
36     QSharedDataPointer<Private> d;
37 };
38
39 Q_DECLARE_SHARED(AppInfo)
40 Q_DECLARE_METATYPE(AppInfo)
41 Q_DECLARE_METATYPE(QList<AppInfo>)
42
43 #endif // APPINFO_H