Add gitlab issue/merge request templates
[apps/launcher.git] / launcher / src / applicationmodel.h
1 // SPDX-License-Identifier: Apache-2.0
2 /*
3  * Copyright (C) 2016 The Qt Company Ltd.
4  * Copyright (c) 2018,2019 TOYOTA MOTOR CORPORATION
5  * Copyright (C) 2022 Konsulko Group
6  */
7
8 #ifndef APPLICATIONMODEL_H
9 #define APPLICATIONMODEL_H
10
11 #include <QAbstractListModel>
12
13 class ApplicationModel : public QAbstractListModel
14 {
15     Q_OBJECT
16
17 public:
18     explicit ApplicationModel(QObject *parent = nullptr);
19     ~ApplicationModel();
20
21     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
22
23     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
24     QHash<int, QByteArray> roleNames() const override;
25     Q_INVOKABLE QString appid(int index) const;
26     Q_INVOKABLE QString id(int index) const;
27     Q_INVOKABLE QString name(int index) const;
28     Q_INVOKABLE void move(int from, int to);
29     Q_INVOKABLE void initAppList(QList<QMap<QString, QString>> &apps);
30     Q_INVOKABLE void updateApplist(QStringList info);
31
32 private:
33     class Private;
34     Private *d;
35 };
36
37 #endif // APPLICATIONMODEL_H