digiKam
importdelegate_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 : 2012-07-08
7  * Description : Qt item view to import items - the delegate (private container)
8  *
9  * Copyright (C) 2012 by Islam Wazery <wazery at ubuntu dot com>
10  * Copyright (C) 2012-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_IMPORT_DELEGATE_P_H
26 #define DIGIKAM_IMPORT_DELEGATE_P_H
27 
28 #include "importdelegate.h"
29 
30 // Qt includes
31 
32 #include <QRect>
33 #include <QCache>
34 
35 // Local includes
36 
37 #include "importcategorizedview.h"
39 
40 namespace Digikam
41 {
42 
43 class ImportCategoryDrawer;
44 
46 {
47 public:
48 
50  : contentWidth (0),
51  drawImageFormat (false),
52  drawCoordinates (false),
53  drawFocusFrame (true),
54  drawMouseOverFrame (true),
55  ratingOverThumbnail (false),
56  categoryDrawer (nullptr),
57  currentView (nullptr),
58  currentModel (nullptr)
59  {
60  actualPixmapRectCache.setMaxCost(250);
61  }
62 
64 
65  QRect dateRect;
66  QRect pixmapRect;
67  QRect nameRect;
68 /*
69  QRect titleRect;
70  QRect commentsRect;
71 */
73  QRect sizeRect;
74  QRect downloadRect;
75  QRect lockRect;
77  QRect tagRect;
80  QRect groupRect;
81 
87 
88  QCache<int, QRect> actualPixmapRectCache;
90 
92  QAbstractItemModel* currentModel;
93 
94 public:
95 
96  void clearRects() override;
97 };
98 
99 // --- ImportThumbnailDelegate ----------------------------------------------------
100 
102 {
103 public:
104 
106  : flow(QListView::LeftToRight)
107  {
108  drawFocusFrame = false; // switch off drawing of frames
109  drawMouseOverFrame = false;
110  ratingOverThumbnail = true; // switch off composing rating over background
111  }
112 
113  void init(ImportThumbnailDelegate* const q);
114 
115 public:
116 
117  QListView::Flow flow;
118  QRect viewSize;
119 };
120 
121 // --- ImportNormalDelegate ----------------------------------------------------
122 
124 {
125 public:
126 
128  ~ImportNormalDelegatePrivate() override;
129 
130  void init(ImportNormalDelegate* const q, ImportCategorizedView* const parent);
131 };
132 
133 } // namespace Digikam
134 
135 #endif // DIGIKAM_IMPORT_DELEGATE_P_H
Definition: importcategorizedview.h:44
Definition: importcategorydrawer.h:41
Definition: importdelegate_p.h:46
QRect pixmapRect
Definition: importdelegate_p.h:66
QRect coordinatesRect
Definition: importdelegate_p.h:76
QRect sizeRect
Definition: importdelegate_p.h:73
bool ratingOverThumbnail
Definition: importdelegate_p.h:86
ImportDelegatePrivate()
Definition: importdelegate_p.h:49
QRect pickLabelRect
Definition: importdelegate_p.h:79
bool drawImageFormat
Definition: importdelegate_p.h:82
QRect downloadRect
Definition: importdelegate_p.h:74
ImportCategorizedView * currentView
Definition: importdelegate_p.h:91
ImportCategoryDrawer * categoryDrawer
Definition: importdelegate_p.h:89
bool drawFocusFrame
Definition: importdelegate_p.h:84
QRect nameRect
Definition: importdelegate_p.h:67
QRect lockRect
Definition: importdelegate_p.h:75
bool drawCoordinates
Definition: importdelegate_p.h:83
bool drawMouseOverFrame
Definition: importdelegate_p.h:85
QRect imageInformationRect
Definition: importdelegate_p.h:78
QRect groupRect
Definition: importdelegate_p.h:80
QRect tagRect
Definition: importdelegate_p.h:77
QRect dateRect
Definition: importdelegate_p.h:65
QAbstractItemModel * currentModel
Definition: importdelegate_p.h:92
QRect resolutionRect
Definition: importdelegate_p.h:72
int contentWidth
Definition: importdelegate_p.h:63
QCache< int, QRect > actualPixmapRectCache
Definition: importdelegate_p.h:88
Definition: importdelegate.h:45
Definition: importdelegate_p.h:124
ImportNormalDelegatePrivate()
Definition: importdelegate_p.h:127
Definition: importdelegate.h:176
Definition: importdelegate_p.h:102
QRect viewSize
Definition: importdelegate_p.h:118
QListView::Flow flow
Definition: importdelegate_p.h:117
ImportThumbnailDelegatePrivate()
Definition: importdelegate_p.h:105
Definition: importdelegate.h:141
Definition: itemviewimportdelegate_p.h:49
Definition: datefolderview.cpp:43