File indexing completed on 2025-01-19 03:59:32
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2006-30-08 0007 * Description : batch thumbnails generator 0008 * 0009 * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_THUMBS_GENERATOR_H 0016 #define DIGIKAM_THUMBS_GENERATOR_H 0017 0018 // Qt includes 0019 0020 #include <QObject> 0021 #include <QImage> 0022 0023 // Local includes 0024 0025 #include "album.h" 0026 #include "maintenancetool.h" 0027 0028 namespace Digikam 0029 { 0030 0031 class ThumbsGenerator : public MaintenanceTool 0032 { 0033 Q_OBJECT 0034 0035 public: 0036 0037 /** Constructor using Album Id as argument. If Id = -1, whole Albums collection is processed. 0038 */ 0039 explicit ThumbsGenerator(const bool rebuildAll, int albumId, ProgressItem* const parent = nullptr); 0040 0041 /** Constructor using AlbumList as argument. If list is empty, whole Albums collection is processed. 0042 */ 0043 ThumbsGenerator(const bool rebuildAll, const AlbumList& list, ProgressItem* const parent = nullptr); 0044 ~ThumbsGenerator() override; 0045 0046 void setUseMultiCoreCPU(bool b) override; 0047 0048 private: 0049 0050 void init(const bool rebuildAll); 0051 0052 private Q_SLOTS: 0053 0054 void slotStart() override; 0055 void slotCancel() override; 0056 void slotAdvance(const QImage&); 0057 0058 private: 0059 0060 class Private; 0061 Private* const d; 0062 }; 0063 0064 } // namespace Digikam 0065 0066 #endif // DIGIKAM_THUMBS_GENERATOR_H