File indexing completed on 2025-01-05 03:51:10

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2009-04-19
0007  * Description : Qt model-view for face item - the delegate
0008  *
0009  * SPDX-FileCopyrightText: 2009-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_ITEM_FACE_DELEGATE_H
0016 #define DIGIKAM_ITEM_FACE_DELEGATE_H
0017 
0018 // Local includes
0019 
0020 #include "digikamitemdelegate.h"
0021 
0022 namespace Digikam
0023 {
0024 
0025 class ItemCategoryDrawer;
0026 class FaceTagsIface;
0027 class ItemFaceDelegatePrivate;
0028 
0029 class ItemFaceDelegate : public DigikamItemDelegate
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034 
0035     explicit ItemFaceDelegate(ItemCategorizedView* const parent);
0036     ~ItemFaceDelegate()                                       override;
0037 
0038     QRect faceRect(const QModelIndex& index)            const;
0039     QRect largerFaceRect(const QModelIndex& index)      const;
0040 
0041     static FaceTagsIface face(const QModelIndex& index);
0042 
0043 protected:
0044 
0045     QPixmap thumbnailPixmap(const QModelIndex& index)   const override;
0046     void updateRects()                                        override;
0047     void clearModelDataCaches()                               override;
0048 
0049 private:
0050 
0051     // Disable
0052     ItemFaceDelegate(QObject*) = delete;
0053 
0054 private:
0055 
0056     Q_DECLARE_PRIVATE(ItemFaceDelegate)
0057 };
0058 
0059 } // namespace Digikam
0060 
0061 #endif // DIGIKAM_ITEM_FACE_DELEGATE_H