~artmello/gallery-app/gallery-app-start_on_event

« back to all changes in this revision

Viewing changes to src/medialoader/gallery-thumbnail-image-provider.h

  • Committer: CI bot
  • Author(s): Arthur Mello, Bill Filler, Ugo Riboni
  • Date: 2014-03-19 20:19:57 UTC
  • mfrom: (912.3.20 multiple-bug-fixes)
  • Revision ID: ps-jenkins@lists.canonical.com-20140319201957-32sglr01gx1xx9e0
multiple gallery-app bug fixes Bug #907870: [desktop] Gallery does not display photos in sub folders, Bug #1221968: use libthumbnailer for gallery thumbnails, Bug #1268748: videos are not displayed when running on desktop, Bug #1271327: disable switching between camera and gallery on desktop, Bug #1287272: Black flash at the end of the zoom animation" Fixes: 907870, 1221968, 1268748, 1271327, 1287272

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2012 Canonical Ltd
3
 
 *
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.
7
 
 *
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.
12
 
 *
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/>.
15
 
 *
16
 
 * Authors:
17
 
 * Guenter Schwann <guenter.schwann@canonical.com>
18
 
*/
19
 
 
20
 
#ifndef GALLERYTHUMBNAILIMAGEPROVIDER_H
21
 
#define GALLERYTHUMBNAILIMAGEPROVIDER_H
22
 
 
23
 
#include <QFileInfo>
24
 
#include <QQuickImageProvider>
25
 
#include <QSize>
26
 
#include <QString>
27
 
 
28
 
class PreviewManager;
29
 
 
30
 
/*!
31
 
 * @brief The GalleryThumbailImageProvider class is used to load the small square thumbnails
32
 
 *
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.
36
 
 */
37
 
class GalleryThumbnailImageProvider : public QQuickImageProvider
38
 
{
39
 
public:
40
 
    static const char* PROVIDER_ID;
41
 
    static const char* PROVIDER_ID_SCHEME;
42
 
    static const char* REVISION_PARAM_NAME;
43
 
 
44
 
    GalleryThumbnailImageProvider();
45
 
 
46
 
    static QUrl toURL(const QFileInfo& file);
47
 
 
48
 
    virtual QImage requestImage(const QString& id, QSize* size,
49
 
                                const QSize& requestedSize);
50
 
 
51
 
    void setPreviewManager(PreviewManager* previewManager);
52
 
    void setLogging(bool enableLogging);
53
 
 
54
 
private:
55
 
    PreviewManager* m_previewManager;
56
 
    bool m_logImageLoading;
57
 
};
58
 
 
59
 
#endif // GALLERYTHUMBNAILIMAGEPROVIDER_H