Warning, file /plasma/plasma-mobile/containments/homescreens/halcyon/applicationlistmodel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // SPDX-FileCopyrightText: 2014 Antonis Tsiapaliokas <antonis.tsiapaliokas@kde.org>
0002 // SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
0003 // SPDX-License-Identifier: GPL-2.0-or-later
0004 
0005 #pragma once
0006 
0007 #include "application.h"
0008 
0009 #include <QAbstractListModel>
0010 #include <QList>
0011 #include <QObject>
0012 #include <QQuickItem>
0013 #include <QSet>
0014 
0015 /**
0016  * @short The base application list, used directly by the full app list page.
0017  */
0018 class ApplicationListModel : public QAbstractListModel
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     enum Roles { ApplicationRole = Qt::UserRole + 1 };
0024 
0025     ApplicationListModel(QObject *parent = nullptr);
0026     ~ApplicationListModel() override;
0027 
0028     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0029     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0030     QHash<int, QByteArray> roleNames() const override;
0031 
0032     Q_INVOKABLE void loadApplications();
0033 
0034 public Q_SLOTS:
0035     void sycocaDbChanged();
0036 
0037 Q_SIGNALS:
0038     void launchError(const QString &msg);
0039 
0040 protected:
0041     QList<Application *> m_applicationList;
0042 };