digiKam
dimgitems_p.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 : 2010-04-30
7  * Description : Graphics View item for DImg - Private containers
8  *
9  * Copyright (C) 2010-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
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_DIMG_ITEMS_P_H
25 #define DIGIKAM_DIMG_ITEMS_P_H
26 
27 // Qt includes
28 
29 #include <QPixmapCache>
30 #include <QQueue>
31 #include <QString>
32 
33 // Local includes
34 
35 #include "digikam_export.h"
36 #include "dimg.h"
37 #include "dimgpreviewitem.h"
38 #include "imagezoomsettings.h"
39 #include "previewsettings.h"
40 
41 namespace Digikam
42 {
43 
45 {
46 public:
47 
48  QRect region;
49  QPixmapCache::Key key;
50 };
51 
52 // -------------------------------------------------------------------------------
53 
55 {
56 public:
57 
58  explicit CachedPixmaps(int maxCount = 2);
60 
61  void setMaxCount(int);
62  void clear();
63  bool find(const QRect& region, QPixmap* const pix, QRect* const source);
64  void insert(const QRect& region, const QPixmap& pixmap);
65 
66 protected:
67 
68  int maxCount;
69  QQueue<CachedPixmapKey> keys;
70 };
71 
72 // -------------------------------------------------------------------------------
73 
74 class DIGIKAM_EXPORT GraphicsDImgItem::GraphicsDImgItemPrivate
75 {
76 public:
77 
79  {
80  }
81 
82  void init(GraphicsDImgItem* const q);
83 
84 public:
85 
89 };
90 
91 // -------------------------------------------------------------------------------
92 
93 class PreviewLoadThread;
94 class DImgPreviewItem;
95 
96 class DIGIKAM_EXPORT DImgPreviewItem::DImgPreviewItemPrivate : public GraphicsDImgItem::GraphicsDImgItemPrivate
97 {
98 public:
99 
101  void init(DImgPreviewItem* const q);
102 
103 public:
104 
108 
109  QString path;
113  QStringList pathsToPreload;
114 };
115 
116 } // namespace Digikam
117 
118 #endif // DIGIKAM_DIMG_ITEMS_P_H
Definition: dimgitems_p.h:45
QRect region
Definition: dimgitems_p.h:48
QPixmapCache::Key key
Definition: dimgitems_p.h:49
Definition: dimgitems_p.h:55
~CachedPixmaps()
Definition: graphicsdimgitem.cpp:49
QQueue< CachedPixmapKey > keys
Definition: dimgitems_p.h:69
void clear()
Definition: graphicsdimgitem.cpp:59
void setMaxCount(int)
Definition: graphicsdimgitem.cpp:54
CachedPixmaps(int maxCount=2)
Definition: graphicsdimgitem.cpp:44
void insert(const QRect &region, const QPixmap &pixmap)
Definition: graphicsdimgitem.cpp:103
bool find(const QRect &region, QPixmap *const pix, QRect *const source)
Definition: graphicsdimgitem.cpp:69
int maxCount
Definition: dimgitems_p.h:68
Definition: dimgitems_p.h:97
QString path
Definition: dimgitems_p.h:109
State
Definition: dimgpreviewitem.h:52
bool exifRotate
Definition: dimgitems_p.h:106
int previewSize
Definition: dimgitems_p.h:107
QStringList pathsToPreload
Definition: dimgitems_p.h:113
PreviewLoadThread * previewThread
Definition: dimgitems_p.h:111
PreviewLoadThread * preloadThread
Definition: dimgitems_p.h:112
PreviewSettings previewSettings
Definition: dimgitems_p.h:110
void init(DImgPreviewItem *const q)
DImgPreviewItem::State state
Definition: dimgitems_p.h:105
Definition: dimg.h:62
Definition: dimgitems_p.h:75
DImg image
Definition: dimgitems_p.h:86
GraphicsDImgItemPrivate()
Definition: dimgitems_p.h:78
CachedPixmaps cachedPixmaps
Definition: dimgitems_p.h:88
void init(GraphicsDImgItem *const q)
ImageZoomSettings zoomSettings
Definition: dimgitems_p.h:87
Definition: imagezoomsettings.h:41
Definition: previewloadthread.h:36
Definition: previewsettings.h:35
Definition: datefolderview.cpp:43