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

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2008-05-19
0007  * Description : Find Duplicates tree-view search album.
0008  *
0009  * SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2008-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0011  * SPDX-FileCopyrightText: 2009      by Andi Clemens <andi dot clemens at gmail dot com>
0012  *
0013  * SPDX-License-Identifier: GPL-2.0-or-later
0014  *
0015  * ============================================================ */
0016 
0017 #ifndef DIGIKAM_FIND_DUPLICATES_ALBUM_H
0018 #define DIGIKAM_FIND_DUPLICATES_ALBUM_H
0019 
0020 // Qt includes
0021 
0022 #include <QList>
0023 #include <QWidget>
0024 #include <QPixmap>
0025 #include <QTreeWidget>
0026 
0027 // Local includes
0028 
0029 #include "album.h"
0030 #include "thumbnailloadthread.h"
0031 
0032 namespace Digikam
0033 {
0034 
0035 
0036 /*!
0037  * \brief The FindDuplicatesAlbum class
0038  * Widgets used to show all reference images.
0039  */
0040 class FindDuplicatesAlbum : public QTreeWidget
0041 {
0042     Q_OBJECT
0043 
0044 public:
0045 
0046     explicit FindDuplicatesAlbum(QWidget* const parent = nullptr);
0047     ~FindDuplicatesAlbum()                        override;
0048 
0049     void updateDuplicatesAlbumItems(const QList<SAlbum*>& sAlbumsToRebuild,
0050                                     const QList<qlonglong>& deletedImages);
0051 
0052     void selectFirstItem();
0053     QTreeWidgetItem* firstItem();
0054     void removeDuplicates();
0055 
0056 private:
0057 
0058     void drawRow(QPainter* p,
0059                  const QStyleOptionViewItem& opt,
0060                  const QModelIndex& index) const override;
0061 
0062 private Q_SLOTS:
0063 
0064     void slotThumbnailLoaded(const LoadingDescription&, const QPixmap&);
0065 
0066 private:
0067 
0068     class Private;
0069     Private* const d;
0070 };
0071 
0072 } // namespace Digikam
0073 
0074 #endif // DIGIKAM_FIND_DUPLICATES_ALBUM_H