2020-08-09 20:00:57 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2020 Aniket Kumar <anikketkumar786@gmail.com>
|
2020-08-09 20:00:57 +01:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2020-08-09 20:00:57 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef THUMBNAILSPROVIDER_H
|
|
|
|
#define THUMBNAILSPROVIDER_H
|
|
|
|
|
|
|
|
#include <QQuickImageProvider>
|
|
|
|
|
|
|
|
class ThumbnailsProvider : public QQuickImageProvider
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ThumbnailsProvider();
|
|
|
|
|
|
|
|
QImage requestImage(const QString& id, QSize* size, const QSize& requestedSize) override;
|
|
|
|
|
|
|
|
void addImage(const QString& id, const QImage& image);
|
|
|
|
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QHash<QString, QImage> m_thumbnails;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // THUMBNAILSPROVIDER_H
|