digiKam
importthumbnailmodel.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2012-06-13
7  * Description : Qt item model for camera thumbnails entries
8  *
9  * Copyright (C) 2009-2012 by Islam Wazery <wazery at ubuntu dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_IMPORT_THUMBNAIL_MODEL_H
25 #define DIGIKAM_IMPORT_THUMBNAIL_MODEL_H
26 
27 // Local includes
28 
29 #include "importimagemodel.h"
30 #include "thumbnailsize.h"
31 #include "camerathumbsctrl.h"
32 #include "digikam_export.h"
33 
34 namespace Digikam
35 {
36 
37 typedef QPair<CamItemInfo, QPixmap> CachedItem;
38 
39 class DIGIKAM_GUI_EXPORT ImportThumbnailModel : public ImportItemModel
40 {
41  Q_OBJECT
42 
43 public:
44 
50  explicit ImportThumbnailModel(QObject* const parent);
51  ~ImportThumbnailModel() override;
52 
54  void setCameraThumbsController(CameraThumbsCtrl* const thumbsCtrl) override;
55 
57  ThumbnailSize thumbnailSize() const;
58 
64  void setEmitDataChanged(bool emitSignal);
65 
72  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
73 
79  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::DisplayRole) override;
80 
81 Q_SIGNALS:
82 
83  void thumbnailAvailable(const QModelIndex& index, int requestedSize);
84  void thumbnailFailed(const QModelIndex& index, int requestedSize);
85 
86 private Q_SLOTS:
87 
88  void slotThumbInfoReady(const CamItemInfo&);
89 
90 private:
91 
92  // Disable
94  ImportThumbnailModel& operator=(const ImportThumbnailModel&) = delete;
95 
96 private:
97 
98  class Private;
99  Private* const d;
100 };
101 
102 } // namespace Digikam
103 
104 #endif // DIGIKAM_IMPORT_THUMBNAIL_MODEL_H
Definition: camiteminfo.h:48
Definition: camerathumbsctrl.h:48
Definition: importimagemodel.h:43
Definition: importthumbnailmodel.h:40
void thumbnailAvailable(const QModelIndex &index, int requestedSize)
void thumbnailFailed(const QModelIndex &index, int requestedSize)
Definition: thumbnailsize.h:42
qulonglong value
Definition: itemviewutilities.cpp:592
Definition: datefolderview.cpp:43
QPair< CamItemInfo, QPixmap > CachedItem
Definition: camerathumbsctrl.h:43