File indexing completed on 2024-04-28 15:39:43

0001 /* SPDX-FileCopyrightText: 2014 Jesper K. Pedersen <blackie@kde.org>
0002 
0003    SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef REMOTECONTROL_THUMBNAILMODEL_H
0007 #define REMOTECONTROL_THUMBNAILMODEL_H
0008 
0009 #include <QAbstractListModel>
0010 
0011 namespace RemoteControl
0012 {
0013 
0014 using RoleMap = QHash<int, QByteArray>;
0015 class ThumbnailModel : public QAbstractListModel
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit ThumbnailModel(QObject *parent = 0);
0020     enum { ImageIdRole };
0021     int rowCount(const QModelIndex &parent) const override;
0022     QVariant data(const QModelIndex &index, int role) const override;
0023     RoleMap roleNames() const override;
0024     virtual void setImages(const QList<int> &image);
0025     int indexOf(int imageId);
0026 
0027 protected:
0028     QList<int> m_images;
0029 };
0030 
0031 } // namespace RemoteControl
0032 
0033 Q_DECLARE_METATYPE(RemoteControl::ThumbnailModel *);
0034 
0035 #endif // REMOTECONTROL_THUMBNAILMODEL_H