digiKam
showfotodelegate_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 : 2013-08-01
7  * Description : Qt model view for Showfoto item - the delegate Private
8  *
9  * Copyright (C) 2013 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
10  * Copyright (C) 2013-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 SHOW_FOTO_DELEGATE_P_H
26 #define SHOW_FOTO_DELEGATE_P_H
27 
28 #include "showfotodelegate.h"
29 
30 // Qt includes
31 
32 #include <QPainter>
33 #include <QApplication>
34 #include <QRect>
35 #include <QCache>
36 
37 // KDE includes
38 
39 #include <ksharedconfig.h>
40 #include <kconfiggroup.h>
41 
42 // Local includes
43 
44 #include "showfotoitemmodel.h"
45 #include "showfotofiltermodel.h"
46 #include "showfotothumbnailbar.h"
47 #include "showfotoiteminfo.h"
48 #include "showfotothumbnailmodel.h"
49 #include "showfotosettings.h"
51 
52 namespace ShowFoto
53 {
54 
56 {
57 public:
58 
60  : contentWidth (0),
61  drawImageFormat (true),
62  drawFocusFrame (true),
63  drawMouseOverFrame (true),
64  currentView (nullptr),
65  currentModel (nullptr)
66  {
67  actualPixmapRectCache.setMaxCost(250);
68  }
69 
71 
72  QRect dateRect;
73  QRect pixmapRect;
74  QRect nameRect;
76  QRect sizeRect;
78  QRect groupRect;
80 
84 
85  QCache<int, QRect> actualPixmapRectCache;
86 
88  QAbstractItemModel* currentModel;
89 
90 public:
91 
92  void clearRects() override;
93 };
94 
95 // --- ShowfotoThumbnailDelegate ----------------------------------------------------
96 
98 {
99 public:
100 
102  : flow (QListView::LeftToRight)
103  {
104  // switch off drawing of frames
105 
106  drawMouseOverFrame = false;
107  drawFocusFrame = false;
108  }
109 
110  void init(ShowfotoThumbnailDelegate* const q);
111 
112 public:
113 
114  QListView::Flow flow;
115  QRect viewSize;
116 };
117 
118 // --- ShowfotoNormalDelegate ----------------------------------------------------
119 
121 {
122 public:
123 
125  {
126  }
127 
128  void init(ShowfotoNormalDelegate* const q, ShowfotoThumbnailBar* const parent);
129 };
130 
131 } // namespace Showfoto
132 
133 #endif // SHOW_FOTO_DELEGATE_P_H
Definition: showfotodelegate_p.h:56
bool drawMouseOverFrame
Definition: showfotodelegate_p.h:83
QRect dateRect
Definition: showfotodelegate_p.h:72
QRect sizeRect
Definition: showfotodelegate_p.h:76
QCache< int, QRect > actualPixmapRectCache
Definition: showfotodelegate_p.h:85
QRect pixmapRect
Definition: showfotodelegate_p.h:73
QAbstractItemModel * currentModel
Definition: showfotodelegate_p.h:88
QRect resolutionRect
Definition: showfotodelegate_p.h:75
int contentWidth
Definition: showfotodelegate_p.h:70
ShowfotoDelegatePrivate()
Definition: showfotodelegate_p.h:59
ShowfotoThumbnailBar * currentView
Definition: showfotodelegate_p.h:87
bool drawFocusFrame
Definition: showfotodelegate_p.h:82
QRect groupRect
Definition: showfotodelegate_p.h:78
QRect imageInformationRect
Definition: showfotodelegate_p.h:77
QRect coordinatesRect
Definition: showfotodelegate_p.h:79
QRect nameRect
Definition: showfotodelegate_p.h:74
bool drawImageFormat
Definition: showfotodelegate_p.h:81
Definition: showfotodelegate.h:46
Definition: showfotoitemviewdelegate_p.h:58
Definition: showfotodelegate_p.h:121
ShowfotoNormalDelegatePrivate()
Definition: showfotodelegate_p.h:124
Definition: showfotodelegate.h:176
Definition: showfotothumbnailbar.h:38
Definition: showfotodelegate_p.h:98
QRect viewSize
Definition: showfotodelegate_p.h:115
ShowfotoThumbnailDelegatePrivate()
Definition: showfotodelegate_p.h:101
QListView::Flow flow
Definition: showfotodelegate_p.h:114
Definition: showfotodelegate.h:134
Definition: showfotofolderviewbar.cpp:52