File indexing completed on 2025-01-19 03:57:35

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2013-08-01
0007  * Description : Qt model view for Showfoto item - the delegate
0008  *
0009  * SPDX-FileCopyrightText: 2013 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef SHOW_FOTO_ITEM_VIEW_DELEGATE_P_H
0016 #define SHOW_FOTO_ITEM_VIEW_DELEGATE_P_H
0017 
0018 #include "showfotoitemviewdelegate.h"
0019 
0020 // Qt includes
0021 
0022 #include <QPainter>
0023 #include <QApplication>
0024 #include <QFont>
0025 #include <QModelIndex>
0026 
0027 // KDE includes
0028 
0029 #include <klocalizedstring.h>
0030 
0031 // Local includes
0032 
0033 #include "thememanager.h"
0034 #include "itempropertiestab.h"
0035 #include "showfotoiteminfo.h"
0036 #include "colorlabelwidget.h"
0037 #include "digikam_debug.h"
0038 #include "thumbnailsize.h"
0039 #include "itemdelegateoverlay.h"
0040 
0041 using namespace Digikam;
0042 
0043 namespace ShowFoto
0044 {
0045 
0046 class ShowfotoItemViewDelegate;
0047 
0048 class Q_DECL_HIDDEN ShowfotoItemViewDelegatePrivate
0049 {
0050 public:
0051 
0052     ShowfotoItemViewDelegatePrivate();
0053     virtual ~ShowfotoItemViewDelegatePrivate() = default;
0054 
0055     void init(ShowfotoItemViewDelegate* const _q, QWidget* const _widget);
0056 
0057     /// Resets cached rects. Remember to reimplement in subclass for added rects.
0058     virtual void clearRects();
0059 
0060 public:
0061 
0062     int                       spacing;
0063     QSize                     gridSize;
0064 
0065     QRect                     rect;
0066 
0067     QPixmap                   regPixmap;
0068     QPixmap                   selPixmap;
0069     QVector<QPixmap>          ratingPixmaps;
0070 
0071     QFont                     font;
0072     QFont                     fontReg;
0073     QFont                     fontCom;
0074     QFont                     fontXtra;
0075 
0076     ThumbnailSize             thumbSize;
0077 
0078     ShowfotoItemViewDelegate* q;
0079 
0080     QWidget*                  displayWidget;
0081 
0082     QRect                     oneRowRegRect;
0083     QRect                     oneRowComRect;
0084     QRect                     oneRowXtraRect;
0085 
0086     /// constant values for drawing
0087     int                       radius;
0088     int                       margin;
0089 
0090 private:
0091 
0092     Q_DISABLE_COPY(ShowfotoItemViewDelegatePrivate)
0093 };
0094 
0095 } // namespace ShowFoto
0096 
0097 #endif // SHOW_FOTO_ITEM_VIEW_DELEGATE_P_H