shift-shell/components/mobilehomescreencomponents/favoritesmodel.h
Marco Martin 690abebfd5 Make components out of the homescreen
Move most of the homescreen pieces in a QML import
that can be reused making it easier to do alternative homescreens
2021-05-05 12:31:08 +02:00

49 lines
902 B
C++

/*
* SPDX-FileCopyrightText: 2021 Marco Martin <mart@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
// Qt
#include <QObject>
#include <QAbstractListModel>
#include <QList>
#include <QSet>
#include "homescreenutils.h"
#include "applicationlistmodel.h"
class QString;
namespace KWayland
{
namespace Client
{
class PlasmaWindowManagement;
class PlasmaWindow;
}
}
class FavoritesModel;
class FavoritesModel : public ApplicationListModel {
Q_OBJECT
public:
FavoritesModel(QObject *parent = nullptr);
~FavoritesModel() override;
QString storageToUniqueId(const QString &storageId) const;
QString uniqueToStorageId(const QString &uniqueId) const;
Q_INVOKABLE void addFavorite(const QString &storageId, int row, LauncherLocation location);
Q_INVOKABLE void removeFavorite(int row);
Q_INVOKABLE void loadApplications() override;
};