2 * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
3 * Copyright (C) 2016 The Qt Company Ltd.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 #include <QtCore/QSharedDataPointer>
22 #include <QtDBus/QDBusArgument>
27 Q_PROPERTY(QString id READ id)
28 Q_PROPERTY(QString version READ version)
29 Q_PROPERTY(int width READ width)
30 Q_PROPERTY(int height READ height)
31 Q_PROPERTY(QString name READ name)
32 Q_PROPERTY(QString description READ description)
33 Q_PROPERTY(QString shortname READ shortname)
34 Q_PROPERTY(QString author READ author)
35 Q_PROPERTY(QString iconPath READ iconPath)
38 AppInfo(const QString &icon, const QString &name, const QString &id);
39 AppInfo(const AppInfo &other);
41 AppInfo &operator =(const AppInfo &other);
42 void swap(AppInfo &other) { qSwap(d, other.d); }
45 QString version() const;
49 QString description() const;
50 QString shortname() const;
51 QString author() const;
52 QString iconPath() const;
54 void read(const QJsonObject &json);
56 friend QDBusArgument &operator <<(QDBusArgument &argument, const AppInfo &appInfo);
57 friend const QDBusArgument &operator >>(const QDBusArgument &argument, AppInfo &appInfo);
61 QSharedDataPointer<Private> d;
64 Q_DECLARE_SHARED(AppInfo)
65 Q_DECLARE_METATYPE(AppInfo)
66 Q_DECLARE_METATYPE(QList<AppInfo>)