2
* Copyright (C) 2012 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Guenter Schwann <guenter.schwann@canonical.com>
20
#ifndef GALLERYTHUMBNAILIMAGEPROVIDER_H
21
#define GALLERYTHUMBNAILIMAGEPROVIDER_H
24
#include <QQuickImageProvider>
31
* @brief The GalleryThumbailImageProvider class is used to load the small square thumbnails
33
* An extra image provider is used, so the image can be updated by adding parameters to the URL,
34
* to update the image. As for local URL, no parameters are used (internally).
35
* In future it might be used for more functionality, like custom caching of images.
37
class GalleryThumbnailImageProvider : public QQuickImageProvider
40
static const char* PROVIDER_ID;
41
static const char* PROVIDER_ID_SCHEME;
42
static const char* REVISION_PARAM_NAME;
44
GalleryThumbnailImageProvider();
46
static QUrl toURL(const QFileInfo& file);
48
virtual QImage requestImage(const QString& id, QSize* size,
49
const QSize& requestedSize);
51
void setPreviewManager(PreviewManager* previewManager);
52
void setLogging(bool enableLogging);
55
PreviewManager* m_previewManager;
56
bool m_logImageLoading;
59
#endif // GALLERYTHUMBNAILIMAGEPROVIDER_H